1 /***********************************************************************
2     created:    Mon Jun 13 2005
3     author:     Paul D Turner <paul@cegui.org.uk>
4                 edited by Lukas E Meindl in Jul 2014
5 *************************************************************************/
6 /***************************************************************************
7  *   Copyright (C) 2004 - 2010 Paul D Turner & The CEGUI Development Team
8  *
9  *   Permission is hereby granted, free of charge, to any person obtaining
10  *   a copy of this software and associated documentation files (the
11  *   "Software"), to deal in the Software without restriction, including
12  *   without limitation the rights to use, copy, modify, merge, publish,
13  *   distribute, sublicense, and/or sell copies of the Software, and to
14  *   permit persons to whom the Software is furnished to do so, subject to
15  *   the following conditions:
16  *
17  *   The above copyright notice and this permission notice shall be
18  *   included in all copies or substantial portions of the Software.
19  *
20  *   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21  *   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22  *   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23  *   IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
24  *   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
25  *   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
26  *   OTHER DEALINGS IN THE SOFTWARE.
27  ***************************************************************************/
28 #ifndef _CEGUIFalWidgetLookFeel_h_
29 #define _CEGUIFalWidgetLookFeel_h_
30 
31 #include "./StateImagery.h"
32 #include "./WidgetComponent.h"
33 #include "./ImagerySection.h"
34 #include "./PropertyInitialiser.h"
35 #include "./PropertyDefinition.h"
36 #include "./PropertyLinkDefinition.h"
37 #include "./EventLinkDefinition.h"
38 #include "./NamedArea.h"
39 #include "./NamedDefinitionCollator.h"
40 #include <map>
41 
42 #if defined(_MSC_VER)
43 #   pragma warning(push)
44 #   pragma warning(disable : 4251)
45 #endif
46 
47 
48 namespace CEGUI
49 {
50 /*!
51 \brief
52     Class that encapsulates Look N' Feel information for a widget.
53 */
54 class CEGUIEXPORT WidgetLookFeel :
55     public AllocatedObject<WidgetLookFeel>
56 {
57 public:
58     WidgetLookFeel(const String& name, const String& inherits);
WidgetLookFeel()59     WidgetLookFeel() {}
60     WidgetLookFeel(const WidgetLookFeel& other);
61     WidgetLookFeel& operator=(const WidgetLookFeel& other);
62 
63     virtual ~WidgetLookFeel();
64     /*!
65     \brief
66         Return a const reference to the StateImagery object for the specified
67         state.
68 
69     \return
70         StateImagery object for the requested state.
71     */
72     const StateImagery& getStateImagery(const CEGUI::String& state) const;
73 
74     /*!
75     \brief
76         Return a const reference to the ImagerySection object with the
77         specified name.
78 
79     \return
80         ImagerySection object with the specified name.
81     */
82     const ImagerySection& getImagerySection(const CEGUI::String& section) const;
83 
84     /*!
85     \brief
86         Return the name of the widget look.
87 
88     \return
89         String object holding the name of the WidgetLookFeel.
90     */
91     const String& getName() const;
92 
93     /*!
94     \brief
95         Add an ImagerySection to the WidgetLookFeel.
96 
97     \param section
98         ImagerySection object to be added.
99 
100     \return
101         Nothing.
102     */
103     void addImagerySection(const ImagerySection& section);
104 
105     //! \deprecated This function is to be replaced by a new renameImagerySection function in the new version, which considers inheritance and accepts more appropriate parameters.
106     void renameImagerySection(const String& oldName, const String& newName);
107 
108     /*!
109     \brief
110         Add a WidgetComponent to the WidgetLookFeel.
111 
112     \param widget
113         WidgetComponent object to be added.
114 
115     \return
116         Nothing.
117     */
118     void addWidgetComponent(const WidgetComponent& widget);
119 
120     /*!
121     \brief
122         Add a state specification (StateImagery object) to the WidgetLookFeel.
123 
124     \param section
125         StateImagery object to be added.
126 
127     \return
128         Nothing.
129     */
130     void addStateSpecification(const StateImagery& state);
131 
132     /*!
133     \brief
134         Add a property initialiser to the WidgetLookFeel.
135 
136     \param initialiser
137         PropertyInitialiser object to be added.
138 
139     \return
140         Nothing.
141     */
142     void addPropertyInitialiser(const PropertyInitialiser& initialiser);
143 
144     /*!
145     \brief
146         Clear all ImagerySections from the WidgetLookFeel.
147 
148     \return
149         Nothing.
150     */
151     void clearImagerySections();
152 
153     /*!
154     \brief
155         Clear all WidgetComponents from the WidgetLookFeel.
156 
157     \return
158         Nothing.
159     */
160     void clearWidgetComponents();
161 
162     /*!
163     \brief
164         Clear all StateImagery objects from the WidgetLookFeel.
165 
166     \return
167         Nothing.
168     */
169     void clearStateSpecifications();
170 
171     /*!
172     \brief
173         Clear all PropertyInitialiser objects from the WidgetLookFeel.
174 
175     \return
176         Nothing.
177     */
178     void clearPropertyInitialisers();
179 
180     /*!
181     \brief
182         Initialise the given window using PropertyInitialsers and component
183         widgets specified for this WidgetLookFeel.
184 
185     \param widget
186         Window based object to be initialised.
187 
188     \return
189         Nothing.
190     */
191     void initialiseWidget(Window& widget) const;
192 
193     /*!
194     \brief
195         Clean up the given window from all properties and component widgets
196         created by this WidgetLookFeel
197 
198     \param widget
199         Window based object to be cleaned up.
200 
201     \return
202         Nothing.
203     */
204     void cleanUpWidget(Window& widget) const;
205 
206     /*!
207     \brief
208         Return whether imagery is defined for the given state.
209 
210     \param state
211         String object containing name of state to look for.
212 
213     \return
214         - true if imagery exists for the specified state,
215         - false if no imagery exists for the specified state.
216 
217     \deprecated This function is deprecated because it does not consider WidgetLook inheritance. It will be replaced by a
218                 new isStateImageryPresent function in the next major version.
219     */
220     bool isStateImageryPresent(const String& state) const;
221 
222     /*!
223     \brief
224         Adds a named area to the WidgetLookFeel.
225 
226     \param area
227         NamedArea to be added.
228 
229     \return
230         Nothing.
231     */
232     void addNamedArea(const NamedArea& area);
233 
234     /*!
235     \brief
236         Clear all defined named areas from the WidgetLookFeel
237 
238     \return
239         Nothing.
240     */
241     void clearNamedAreas();
242 
243     /*!
244     \brief
245         Return the NamedArea with the specified name.
246 
247     \param name
248         String object holding the name of the NamedArea to be returned.
249 
250     \return
251         The requested NamedArea object.
252     */
253     const NamedArea& getNamedArea(const String& name) const;
254 
255     //! \deprecated This function is to be replaced by a new renameNamedArea function in the new version, which considers inheritance and accepts more appropriate parameters.
256     void renameNamedArea(const String& oldName, const String& newName);
257 
258     /*!
259     \brief
260         return whether a NamedArea object with the specified name exists for
261         this WidgetLookFeel.
262 
263     \param name
264         String holding the name of the NamedArea to check for.
265 
266     \return
267         - true if a named area with the requested name is defined for this
268           WidgetLookFeel.
269         - false if no such named area is defined for this WidgetLookFeel.
270 
271     \deprecated This function is deprecated because it does not consider WidgetLook inheritance. It will be changed to isNamedAreaPresent() in the next major version.
272     */
273     bool isNamedAreaDefined(const String& name) const;
274 
275     /*!
276     \brief
277         Layout the child widgets defined for this WidgetLookFeel which are
278         attached to the given window.
279 
280     \param owner
281         Window object that has the child widgets that require laying out.
282 
283     \return
284         Nothing.
285     */
286     void layoutChildWidgets(const Window& owner) const;
287 
288     /*!
289     \brief
290         Adds a property definition to the WidgetLookFeel.
291 
292     \param propdef
293         PropertyDefinition object to be added.
294 
295     \return
296         Nothing.
297     */
298     void addPropertyDefinition(PropertyDefinitionBase* propdef);
299 
300     /*!
301     \brief
302         Adds a property link definition to the WidgetLookFeel.
303 
304     \param propdef
305         PropertyLinkDefinition object to be added.
306 
307     \return
308         Nothing.
309     */
310     void addPropertyLinkDefinition(PropertyDefinitionBase* propdef);
311 
312     /*!
313     \brief
314         Clear all defined property definitions from the WidgetLookFeel
315 
316     \return
317         Nothing.
318     */
319     void clearPropertyDefinitions();
320 
321     /*!
322     \brief
323         Clear all defined property link definitions from the WidgetLookFeel
324 
325     \return
326         Nothing.
327     */
328     void clearPropertyLinkDefinitions();
329 
330     /*!
331     \brief
332         Add the name of an animation that is associated with the
333         WidgetLookFeel.
334 
335     \param anim_name
336         Reference to a String object that contains the name of the animation
337         to be associated with this WidgetLookFeel.
338     */
339     void addAnimationName(const String& anim_name);
340 
341     //! adds an event link definition to the WidgetLookFeel.
342     void addEventLinkDefinition(const EventLinkDefinition& evtdef);
343 
344     //! clear all defined event link definitions from the WidgetLookFeel.
345     void clearEventLinkDefinitions();
346 
347     /*!
348     \brief
349         Writes an xml representation of this WidgetLookFeel to \a out_stream.
350 
351     \param xml_stream
352         Stream where xml data should be output.
353 
354     \return
355         Nothing.
356     */
357     void writeXMLToStream(XMLSerializer& xml_stream) const;
358 
359     /*!
360     \brief
361         Takes the name of a property and returns a pointer to the last
362         PropertyInitialiser for this property or 0 if the is no
363         PropertyInitialiser for this property in the WidgetLookFeel
364 
365     \param propertyName
366         The name of the property to look for.
367     */
368     const PropertyInitialiser* findPropertyInitialiser(const String& propertyName) const;
369 
370     /*!
371     \brief
372         Takes the name for a WidgetComponent and returns a pointer to
373         it if it exists or a null pointer if it doesn't.
374 
375     \param name
376         The name of the Child component to look for.
377 
378     \deprecated
379         This function will be replaced by getWidgetComponent in the next version.
380     */
381     const WidgetComponent* findWidgetComponent(const String& name) const;
382 
383 
384     /*!
385     \brief
386         Takes the name for a WidgetComponent and returns a pointer to
387         it if it exists or null pointer if it doesn't.
388 
389     \param name
390         The name of the WidgetComponent to look for.
391 
392     \param includeInheritedElements
393         If set to true, this function will try to also include elements from the inherited WidgetLookFeel.
394 
395     \return
396         A pointer to the WidgetComponent.
397 
398     \deprecated
399         This function will be replaced by getWidgetComponent in the next version.
400     */
401     WidgetComponent* retrieveWidgetComponentFromList(const String& name, bool includeInheritedElements = false);
402 
403     /*!
404     \brief
405         Takes the name for a Property (PropertyInitialiser) and returns a pointer to
406         it if it exists or 0 if it doesn't.
407 
408     \param name
409         The name of the Property (PropertyInitialiser) to look for.
410 
411     \param includeInheritedElements
412         If set to true, this function will try to also include elements from the inherited WidgetLookFeel.
413 
414     \return
415         A pointer to the Property (PropertyInitialiser).
416 
417     \deprecated
418         This function will be replaced by getPropertyInitialiser in the next version.
419     */
420     PropertyInitialiser* retrievePropertyInitialiserFromList(const String& name, bool includeInheritedElements = false);
421 
422     /*!
423     \brief
424         Takes the name for a PropertyDefinition and returns a pointer to
425         it if it exists or 0 if it doesn't.
426 
427     \param name
428         The name of the PropertyDefinition (PropertyDefinitionBase) to look for.
429 
430     \param includeInheritedElements
431         If set to true, this function will try to also include elements from the inherited WidgetLookFeel.
432 
433     \return
434         A pointer to the PropertyDefinition (PropertyDefinitionBase).
435 
436     \deprecated
437         This function will be replaced by getPropertyDefinition in the next version.
438     */
439     PropertyDefinitionBase* retrievePropertyDefinitionFromList(const String& name, bool includeInheritedElements = false);
440 
441     /*!
442     \brief
443         Takes the name for a PropertyLinkDefinition and returns a pointer to
444         it if it exists or 0 if it doesn't.
445 
446     \param name
447         The name of the PropertyLinkDefinition (PropertyDefinitionBase) to look for.
448 
449     \param includeInheritedElements
450         If set to true, this function will try to also include elements from the inherited WidgetLookFeel.
451 
452     \return
453         A pointer to the PropertyLinkDefinition (PropertyDefinitionBase).
454 
455     \deprecated
456         This function will be replaced by getPropertyLinkDefinition in the next version.
457     */
458     PropertyDefinitionBase* retrievePropertyLinkDefinitionFromList(const String& name, bool includeInheritedElements = false);
459 
460     /*!
461     \brief
462         Takes the name for a EventLinkDefinition and returns a pointer to
463         it if it exists or 0 if it doesn't.
464 
465     \param name
466         The name of the EventLinkDefinition to look for.
467 
468     \param includeInheritedElements
469         If set to true, this function will try to also include elements from the inherited WidgetLookFeel.
470 
471     \return
472         A pointer to the EventLinkDefinition.
473 
474     \deprecated
475         This function will be replaced by getEventLinkDefinition in the next version.
476     */
477     EventLinkDefinition* retrieveEventLinkDefinitionFromList(const String& name, bool includeInheritedElements = false);
478 
479 
480     typedef std::set<String, StringFastLessCompare
481         CEGUI_SET_ALLOC(String)> StringSet;
482 
483     /** Typedefs for maps of Falagard elements this WidgetLookFeel owns. */
484     //! Map of Strings to StateImagery pointers
485     typedef std::map<String, StateImagery*, StringFastLessCompare
486         CEGUI_MAP_ALLOC(String, StateImagery*)> StateImageryPointerMap;
487     //! Map of Strings to ImagerySection pointers
488     typedef std::map<String, ImagerySection*, StringFastLessCompare
489         CEGUI_MAP_ALLOC(String, ImagerySection*)> ImagerySectionPointerMap;
490     //! Map of Strings to NamedArea pointers
491     typedef std::map<String, NamedArea*, StringFastLessCompare
492         CEGUI_MAP_ALLOC(String, NamedArea*)> NamedAreaPointerMap;
493     //! Map of Strings to WidgetComponent pointers
494     typedef std::map<String, WidgetComponent*, StringFastLessCompare
495         CEGUI_MAP_ALLOC(String, WidgetComponent*)> WidgetComponentPointerMap;
496     //! Map of Strings to AnimationInstance pointers
497     typedef std::map<String, AnimationInstance*, StringFastLessCompare
498         CEGUI_MAP_ALLOC(String, AnimationInstance*)> AnimationInstancePointerMap;
499     //! Map of Strings to EventLinkDefinition pointers
500     typedef std::map<String, EventLinkDefinition*, StringFastLessCompare
501         CEGUI_MAP_ALLOC(String, EventLinkDefinition*)> EventLinkDefinitionPointerMap;
502 
503     /** Typedefs for maps of property related elements this WidgetLookFeel owns. */
504     //! Map of Strings to PropertyInitialiser pointers
505     typedef std::map<String, PropertyInitialiser*, StringFastLessCompare
506         CEGUI_MAP_ALLOC(String, PropertyInitialiser*)> PropertyInitialiserPointerMap;
507     //! Map of Strings to PropertyDefinitionBase pointers
508     typedef std::map<String, PropertyDefinitionBase*, StringFastLessCompare
509         CEGUI_MAP_ALLOC(String, PropertyDefinitionBase*)> PropertyDefinitionBasePointerMap;
510 
511 
512 
513     /** Typedefs for property related lists. */
514     //! \deprecated This type is deprecated because it will be moved into the private section and changed into a map in the next version.
515     typedef std::vector<PropertyInitialiser
516         CEGUI_VECTOR_ALLOC(PropertyInitialiser)> PropertyList;
517     //! \deprecated This type is deprecated because it will be moved into the private section and changed into a map in the next version.
518     typedef std::vector<PropertyDefinitionBase*
519         CEGUI_VECTOR_ALLOC(PropertyDefinitionBase*)> PropertyDefinitionList;
520     //! \deprecated This type is deprecated because it will be moved into the private section and changed into a map in the next version.
521     typedef std::vector<PropertyDefinitionBase*
522         CEGUI_VECTOR_ALLOC(PropertyDefinitionBase*)> PropertyLinkDefinitionList;
523 
524 
525 
526     /** Obtains list of properties definitions.
527      * @access public
528      * @return CEGUI::WidgetLookFeel::PropertyDefinitionList List of properties
529      * definitions
530      */
531     /*!
532         \deprecated
533             This function is deprecated because the return type is to be replaced by a map, a bool parameter for WLF-inheritance added.
534             The function will be replaced by getPropertyDefinitionMap in the next version.
535     */
getPropertyDefinitions()536     const PropertyDefinitionList& getPropertyDefinitions() const
537     {
538         return d_propertyDefinitions;
539     }
540 
541     /** Obtains list of properties link definitions.
542      * @access public
543      * @return CEGUI::WidgetLookFeel::PropertyLinkDefinitionList List of
544      * properties link definitions
545      */
546     /*!
547         \deprecated
548             This function is deprecated because the return type is to be replaced by a map, a bool parameter for WLF-inheritance added.
549             The function will be replaced by getPropertyLinkDefinitionMap in the next version.
550     */
getPropertyLinkDefinitions()551     const PropertyLinkDefinitionList& getPropertyLinkDefinitions() const
552     {
553         return d_propertyLinkDefinitions;
554     }
555 
556     /** Obtains list of properties.
557      * @access public
558      * @return CEGUI::WidgetLookFeel::PropertyList List of properties
559      */
560     /*!
561         \deprecated
562             This function is deprecated because the return type is to be replaced by a map, a bool parameter for WLF-inheritance added.
563             The function will be replaced by getPropertyMap in the next version.
564     */
getProperties()565     const PropertyList& getProperties() const
566     {
567         return d_properties;
568     }
569 
570     //! perform any processing required due to the given font having changed.
571     bool handleFontRenderSizeChange(Window& window, const Font* font) const;
572 
573 
574 
575     /*!
576     \brief
577         Returns a map of names to pointers for all StateImagery elements this WidgetLookFeel owns. If the list of
578         StateImageries of this or an inherited WidgetLookFeel is modified in any way (by clearing it, adding or
579         removing elements), then the pointers in this map are not valid anymore. The function should then be called
580         again to retrieve valid pointers.
581 
582     \param includeInheritedElements
583         If set to true, this function will try to also include elements from the inherited WidgetLookFeel.
584 
585     \return
586         A map of names to StateImagery pointers.
587     */
588     StateImageryPointerMap getStateImageryMap(bool includeInheritedElements = false);
589 
590     /*!
591     \brief
592         Returns a map of names to pointers for all ImagerySection elements this WidgetLookFeel owns. If the list of
593         ImagerySections of this or an inherited WidgetLookFeel is modified in any way (by clearing it, adding or
594         removing elements), then the pointers in this map are not valid anymore. The function should then be called
595         again to retrieve valid pointers.
596 
597     \param includeInheritedElements
598         If set to true, this function will try to also include elements from the inherited WidgetLookFeel.
599 
600     \return
601         A map of names to ImagerySection pointers.
602     */
603     ImagerySectionPointerMap getImagerySectionMap(bool includeInheritedElements = false);
604 
605     /*!
606     \brief
607         Returns a map of names to pointers for all NamedArea elements this WidgetLookFeel owns. If the list of
608         NamedAreas of this or an inherited WidgetLookFeel is modified in any way (by clearing it, adding or
609         removing elements), then the pointers in this map are not valid anymore. The function should then be called
610         again to retrieve valid pointers.
611 
612     \param includeInheritedElements
613         If set to true, this function will try to also include elements from the inherited WidgetLookFeel.
614 
615     \return
616         A map of names to NamedArea pointers.
617     */
618     NamedAreaPointerMap getNamedAreaMap(bool includeInheritedElements = false);
619 
620     /*!
621     \brief
622         Returns a map of names to pointers for all WidgetComponent elements this WidgetLookFeel owns. If the list of
623         WidgetComponents of this or an inherited WidgetLookFeel is modified in any way (by clearing it, adding or
624         removing elements), then the pointers in this map are not valid anymore. The function should then be called
625         again to retrieve valid pointers.
626 
627     \param includeInheritedElements
628         If set to true, this function will try to also include elements from the inherited WidgetLookFeel.
629 
630     \return
631         A map of names to WidgetComponent pointers.
632     */
633     WidgetComponentPointerMap getWidgetComponentMap(bool includeInheritedElements = false);
634 
635     /*!
636     \brief
637         Returns a map of names to pointers for all PropertyInitialiser elements this WidgetLookFeel owns. If the list of
638         PropertyInitialisers of this or an inherited WidgetLookFeel is modified in any way (by clearing it, adding or
639         removing elements), then the pointers in this map are not valid anymore. The function should then be called
640         again to retrieve valid pointers.
641 
642     \param includeInheritedElements
643         If set to true, this function will try to also include elements from the inherited WidgetLookFeel.
644 
645     \return
646         A map of names to PropertyInitialiser pointers.
647     */
648     PropertyInitialiserPointerMap getPropertyInitialiserMap(bool includeInheritedElements = false);
649 
650     /*!
651     \brief
652         Returns a map of names to pointers for all PropertyDefinition elements this WidgetLookFeel owns. If the list of
653         PropertyDefinitions of this or an inherited WidgetLookFeel is modified in any way (by clearing it, adding or
654         removing elements), then the pointers in this map are not valid anymore. The function should then be called
655         again to retrieve valid pointers.
656 
657     \param includeInheritedElements
658         If set to true, this function will try to also include elements from the inherited WidgetLookFeel.
659 
660     \return
661         A map of names to PropertyDefinition pointers.
662     */
663     PropertyDefinitionBasePointerMap getPropertyDefinitionMap(bool includeInheritedElements = false);
664 
665     /*!
666     \brief
667         Returns a map of names to pointers for all PropertyLinkDefinition elements this WidgetLookFeel owns. If the list of
668         PropertyLinkDefinitions of this or an inherited WidgetLookFeel is modified in any way (by clearing it, adding or
669         removing elements), then the pointers in this map are not valid anymore. The function should then be called
670         again to retrieve valid pointers.
671 
672     \param includeInheritedElements
673         If set to true, this function will try to also include elements from the inherited WidgetLookFeel.
674 
675     \return
676         A map of names to PropertyLinkDefinition pointers.
677     */
678     PropertyDefinitionBasePointerMap getPropertyLinkDefinitionMap(bool includeInheritedElements = false);
679 
680     /*!
681     \brief
682         Returns a map of names to pointers for all EventLinkDefinition elements this WidgetLookFeel owns. If the list of
683         EventLinkDefinitions of this or an inherited WidgetLookFeel is modified in any way (by clearing it, adding or
684         removing elements), then the pointers in this map are not valid anymore. The function should then be called
685         again to retrieve valid pointers.
686 
687     \param includeInheritedElements
688         If set to true, this function will try to also include elements from the inherited WidgetLookFeel.
689 
690     \return
691         A map of names to EventLinkDefinition pointers.
692     */
693     EventLinkDefinitionPointerMap getEventLinkDefinitionMap(bool includeInheritedElements = false);
694 
695     /*!
696     \brief
697         Returns a String containing the name of the inherited WidgetLookFeel.
698 
699     \return
700         A String containing the name of the inherited WidgetLookFeel.
701     */
702     const CEGUI::String& getInheritedWidgetLookName() const;
703 
704     StringSet getStateImageryNames(bool inherits = false) const;
705     //! \deprecated This function has been renamed to getStateImageryNames to conform the general way of naming functions, and will be replaced in the next version
706     StringSet getStateNames(bool inherits = false) const;
707     StringSet getImagerySectionNames(bool inherits = false) const;
708     //! \deprecated This function has been renamed to getImagerySectionNames to conform the general way of naming functions, and will be replaced in the next version
709     StringSet getImageryNames(bool inherits = false) const;
710     StringSet getNamedAreaNames(bool inherits = false) const;
711     StringSet getWidgetComponentNames(bool inherits = false) const;
712     //! \deprecated This function has been renamed to getWidgetComponentNames to conform the general way of naming functions, and will be replaced in the next version
713     StringSet getWidgetNames(bool inherits = false) const;
714     StringSet getPropertyInitialiserNames(bool inherits = false) const;
715     StringSet getPropertyDefinitionNames(bool inherits = false) const;
716     StringSet getPropertyLinkDefinitionNames(bool inherits = false) const;
717     StringSet getEventLinkDefinitionNames(bool inherits = false) const;
718     StringSet getAnimationNames(bool inherits = false) const;
719 
720 private:
721 
722     /*!
723     \brief
724         Returns a pointer to the inherited WidgetLookFeel. If this WidgetLookFeel does not inherit from another, the function returns 0.
725 
726     \return
727         A pointer to the inherited WidgetLookFeel.
728     */
729     WidgetLookFeel* getInheritedWidgetLookFeel();
730 
731 
732     typedef std::map<String, StateImagery, StringFastLessCompare
733         CEGUI_MAP_ALLOC(String, StateImagery)> StateList;
734     typedef std::map<String, ImagerySection, StringFastLessCompare
735         CEGUI_MAP_ALLOC(String, ImagerySection)> ImageryList;
736     typedef std::map<String, NamedArea, StringFastLessCompare
737         CEGUI_MAP_ALLOC(String, NamedArea)> NamedAreaList;
738 
739     //! \deprecated The type is deprecated, as it will be changed to a map in the next CEGUI version, in accordance with the existing StateImagery/ImagerySection/NamedArea container types
740     typedef std::vector<WidgetComponent
741         CEGUI_VECTOR_ALLOC(WidgetComponent)> WidgetList;
742 
743     typedef std::vector<String
744         CEGUI_VECTOR_ALLOC(String)> AnimationList;
745     //! The type is deprecated, as it will be changed to have the correct CEGUI allocator used starting in the next version
746     typedef std::multimap<Window*, AnimationInstance*
747         /*CEGUI_MULTIMAP_ALLOC(Window*, AnimationInstance*)*/> AnimationInstanceMap;
748 
749     //! \deprecated The type is deprecated, as it will be changed to a map in the next CEGUI version, in accordance with the existing StateImagery/ImagerySection/NamedArea container types
750     typedef std::vector<EventLinkDefinition
751         CEGUI_VECTOR_ALLOC(EventLinkDefinition)> EventLinkDefinitionList;
752 
753     //! Name of this WidgetLookFeel.
754     CEGUI::String d_lookName;
755     //! Name of a WidgetLookFeel inherited by this WidgetLookFeel.
756     CEGUI::String d_inheritedLookName;
757     //! Collection of ImagerySection objects.
758     ImageryList d_imagerySections;
759     //! Collection of WidgetComponent objects.
760     WidgetList d_childWidgets;
761     //! Collection of StateImagery objects.
762     StateList d_stateImagery;
763     //! Collection of PropertyInitialser objects.
764     PropertyList d_properties;
765     //! Collection of NamedArea objects.
766     NamedAreaList d_namedAreas;
767     //! Collection of PropertyDefinition objects.
768     mutable PropertyDefinitionList  d_propertyDefinitions;
769     //! Collection of PropertyLinkDefinition objects.
770     mutable PropertyLinkDefinitionList d_propertyLinkDefinitions;
771     //! Collection of animation names associated with this WidgetLookFeel.
772     AnimationList d_animations;
773     //! map of windows and their associated animation instances
774     mutable AnimationInstanceMap d_animationInstances;
775     //! Collection of EventLinkDefinition objects.
776     EventLinkDefinitionList d_eventLinkDefinitions;
777 
778     // these are container types used when composing final collections of
779     // objects that come via inheritence.
780     typedef NamedDefinitionCollator<String, const WidgetComponent*> WidgetComponentCollator;
781     typedef NamedDefinitionCollator<String, PropertyDefinitionBase*> PropertyDefinitionCollator;
782     typedef NamedDefinitionCollator<String, PropertyDefinitionBase*> PropertyLinkDefinitionCollator;
783     typedef NamedDefinitionCollator<String, const PropertyInitialiser*> PropertyInitialiserCollator;
784     typedef NamedDefinitionCollator<String, const EventLinkDefinition*> EventLinkDefinitionCollator;
785     typedef std::set<String, StringFastLessCompare
786         CEGUI_SET_ALLOC(String)> AnimationNameSet;
787 
788     // functions to populate containers with collections of objects that we
789     // gain through inheritence.
790     void appendChildWidgetComponents(WidgetComponentCollator& col, bool inherits = true) const;
791     void appendPropertyDefinitions(PropertyDefinitionCollator& col, bool inherits = true) const;
792     void appendPropertyLinkDefinitions(PropertyLinkDefinitionCollator& col, bool inherits = true) const;
793     void appendPropertyInitialisers(PropertyInitialiserCollator& col, bool inherits = true) const;
794     void appendEventLinkDefinitions(EventLinkDefinitionCollator& col, bool inherits = true) const;
795     void appendAnimationNames(AnimationNameSet& set, bool inherits = true) const;
796 
797     void swap(WidgetLookFeel& other);
798 
799 public:
800     /*************************************************************************
801         Iterator stuff
802     *************************************************************************/
803 
804     //! \deprecated This typedef is deprecated because all iterator getter functions will be removed. Please use the getStateImageryMap function instead to access the container.
805     typedef ConstMapIterator<StateList> StateIterator;
806     //! \deprecated This typedef is deprecated because all iterator getter functions will be removed. Please use the getImagerySectionMap function instead to access the container.
807     typedef ConstMapIterator<ImageryList> ImageryIterator;
808     //! \deprecated This typedef is deprecated because all iterator getter functions will be removed. Please use the getNamedAreaMap function instead to access the container.
809     typedef ConstMapIterator<NamedAreaList> NamedAreaIterator;
810 
811     //! \deprecated This typedef is deprecated because all iterator getter functions will be removed. Please use the getWidgetComponentMap function instead to access the container.
812     typedef ConstVectorIterator<WidgetComponentCollator> WidgetComponentIterator;
813     //! \deprecated This typedef is deprecated because all iterator getter functions will be removed. Please use the getPropertyDefinitionMap function instead to access the container.
814     typedef ConstVectorIterator<PropertyDefinitionCollator> PropertyDefinitionIterator;
815     //! \deprecated This typedef is deprecated because all iterator getter functions will be removed. Please use the getPropertyLinkDefinitionMap function instead to access the container.
816     typedef ConstVectorIterator<PropertyLinkDefinitionCollator> PropertyLinkDefinitionIterator;
817     //! \deprecated This typedef is deprecated because all iterator getter functions will be removed. Please use the getPropertyInitialiserMap function instead to access the container.
818     typedef ConstVectorIterator<PropertyInitialiserCollator> PropertyInitialiserIterator;
819     //! \deprecated This typedef is deprecated because all iterator getter functions will be removed. Please use the getEventLinkDefinitionMap function instead to access the container.
820     typedef ConstVectorIterator<EventLinkDefinitionCollator> EventLinkDefinitionIterator;
821     //! \deprecated This typedef is deprecated because all iterator getter functions will be removed. Please use the getAnimationNames function instead to access the container.
822     typedef ConstVectorIterator<AnimationNameSet> AnimationNameIterator;
823 
824     /*!
825     \brief
826         Returns an iterator for the StateImageries of this WidgetLookFeel.
827 
828     \deprecated
829         This function is deprecated because all iterator getter functions will be removed. Please use the getStateImageryMap function instead to access the container.
830     */
831     StateIterator getStateIterator(bool inherits = false) const;
832     /*!
833     \brief
834         Returns an iterator for the ImagerySections of this WidgetLookFeel.
835 
836     \deprecated
837         This function is deprecated because all iterator getter functions will be removed. Please use the getImagerySectionMap function instead to access the container.
838     */
839     ImageryIterator getImageryIterator(bool inherits = false) const;
840 
841     /*!
842     \brief
843         Returns an iterator for the NamedAreas of this WidgetLookFeel.
844 
845     \deprecated
846         This function is deprecated because all iterator getter functions will be removed. Please use the getNamedAreaMap function instead to access the container.
847     */
848     NamedAreaIterator getNamedAreaIterator(bool inherits = false) const;
849 
850     /*!
851     \brief
852         Returns an iterator for the WidgetComponents of this WidgetLookFeel.
853 
854     \deprecated
855         This function is deprecated because all iterator getter functions will be removed. Please use the getWidgetComponentMap function instead to access the container.
856     */
857     WidgetComponentIterator getWidgetComponentIterator(bool inherits = false) const;
858 
859     /*!
860     \brief
861         Returns an iterator for the PropertyDefinitions of this WidgetLookFeel.
862 
863     \deprecated
864         This function is deprecated because all iterator getter functions will be removed. Please use the getPropertyDefinitionMap function instead to access the container.
865     */
866     PropertyDefinitionIterator getPropertyDefinitionIterator(bool inherits = false) const;
867 
868     /*!
869     \brief
870         Returns an iterator for the PropertyLinkDefinitions of this WidgetLookFeel.
871 
872     \deprecated
873         This function is deprecated because all iterator getter functions will be removed. Please use the getPropertyLinkDefinitionMap function instead to access the container.
874     */
875     PropertyLinkDefinitionIterator getPropertyLinkDefinitionIterator(bool inherits = false) const;
876 
877     /*!
878     \brief
879         Returns an iterator for the PropertyInitialisers of this WidgetLookFeel.
880 
881     \deprecated
882         This function is deprecated because all iterator getter functions will be removed. Please use the getPropertyInitialiserMap function instead to access the container.
883     */
884     PropertyInitialiserIterator getPropertyInitialiserIterator(bool inherits = false) const;
885 
886     /*!
887     \brief
888         Returns an iterator for the EventLinkDefinitions of this WidgetLookFeel.
889 
890     \deprecated
891         This function is deprecated because all iterator getter functions will be removed. Please use the getEventLinkDefinitionMap function instead to access the container.
892     */
893     EventLinkDefinitionIterator getEventLinkDefinitionIterator(bool inherits = false) const;
894 
895     /*!
896     \brief
897         Returns an iterator for the AnimationNames of this WidgetLookFeel.
898 
899     \deprecated
900         This function is deprecated because all iterator getter functions will be removed. Please use the getAnimationNames function instead to access the container.
901     */
902     AnimationNameIterator getAnimationNameIterator(bool inherits = false) const;
903 };
904 
905 }
906 
907 
908 #if defined(_MSC_VER)
909 #   pragma warning(pop)
910 #endif
911 
912 #endif
913 
914