28 #ifndef _CEGUIFalWidgetLookFeel_h_
29 #define _CEGUIFalWidgetLookFeel_h_
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"
43 # pragma warning(push)
44 # pragma warning(disable : 4251)
54 class CEGUIEXPORT WidgetLookFeel :
55 public AllocatedObject<WidgetLookFeel>
58 WidgetLookFeel(
const String& name,
const String& inherits);
60 WidgetLookFeel(
const WidgetLookFeel& other);
61 WidgetLookFeel& operator=(
const WidgetLookFeel& other);
63 virtual ~WidgetLookFeel();
72 const StateImagery& getStateImagery(
const CEGUI::String& state)
const;
82 const ImagerySection& getImagerySection(
const CEGUI::String& section)
const;
91 const String& getName()
const;
103 void addImagerySection(
const ImagerySection& section);
106 void renameImagerySection(
const String& oldName,
const String& newName);
118 void addWidgetComponent(
const WidgetComponent& widget);
130 void addStateSpecification(
const StateImagery& state);
142 void addPropertyInitialiser(
const PropertyInitialiser& initialiser);
151 void clearImagerySections();
160 void clearWidgetComponents();
169 void clearStateSpecifications();
178 void clearPropertyInitialisers();
191 void initialiseWidget(Window& widget)
const;
204 void cleanUpWidget(Window& widget)
const;
220 bool isStateImageryPresent(
const String& state)
const;
232 void addNamedArea(
const NamedArea& area);
241 void clearNamedAreas();
253 const NamedArea& getNamedArea(
const String& name)
const;
256 void renameNamedArea(
const String& oldName,
const String& newName);
273 bool isNamedAreaDefined(
const String& name)
const;
286 void layoutChildWidgets(
const Window& owner)
const;
298 void addPropertyDefinition(PropertyDefinitionBase* propdef);
310 void addPropertyLinkDefinition(PropertyDefinitionBase* propdef);
319 void clearPropertyDefinitions();
328 void clearPropertyLinkDefinitions();
339 void addAnimationName(
const String& anim_name);
342 void addEventLinkDefinition(
const EventLinkDefinition& evtdef);
345 void clearEventLinkDefinitions();
357 void writeXMLToStream(XMLSerializer& xml_stream)
const;
368 const PropertyInitialiser* findPropertyInitialiser(
const String& propertyName)
const;
381 const WidgetComponent* findWidgetComponent(
const String& name)
const;
401 WidgetComponent* retrieveWidgetComponentFromList(
const String& name,
bool includeInheritedElements =
false);
420 PropertyInitialiser* retrievePropertyInitialiserFromList(
const String& name,
bool includeInheritedElements =
false);
439 PropertyDefinitionBase* retrievePropertyDefinitionFromList(
const String& name,
bool includeInheritedElements =
false);
458 PropertyDefinitionBase* retrievePropertyLinkDefinitionFromList(
const String& name,
bool includeInheritedElements =
false);
477 EventLinkDefinition* retrieveEventLinkDefinitionFromList(
const String& name,
bool includeInheritedElements =
false);
480 typedef std::set<String, StringFastLessCompare
481 CEGUI_SET_ALLOC(String)> StringSet;
484 typedef std::map<String, StateImagery*, StringFastLessCompare
486 CEGUI_MAP_ALLOC(String, StateImagery*)> StateImageryPointerMap;
488 typedef std::map<String, ImagerySection*, StringFastLessCompare
489 CEGUI_MAP_ALLOC(String, ImagerySection*)> ImagerySectionPointerMap;
491 typedef std::map<String, NamedArea*, StringFastLessCompare
492 CEGUI_MAP_ALLOC(String, NamedArea*)> NamedAreaPointerMap;
494 typedef std::map<String, WidgetComponent*, StringFastLessCompare
495 CEGUI_MAP_ALLOC(String, WidgetComponent*)> WidgetComponentPointerMap;
497 typedef std::map<String, AnimationInstance*, StringFastLessCompare
498 CEGUI_MAP_ALLOC(String, AnimationInstance*)> AnimationInstancePointerMap;
500 typedef std::map<String, EventLinkDefinition*, StringFastLessCompare
501 CEGUI_MAP_ALLOC(String, EventLinkDefinition*)> EventLinkDefinitionPointerMap;
504 typedef std::map<String, PropertyInitialiser*, StringFastLessCompare
506 CEGUI_MAP_ALLOC(String, PropertyInitialiser*)> PropertyInitialiserPointerMap;
508 typedef std::map<String, PropertyDefinitionBase*, StringFastLessCompare
509 CEGUI_MAP_ALLOC(String, PropertyDefinitionBase*)> PropertyDefinitionBasePointerMap;
514 typedef std::vector<PropertyInitialiser
516 CEGUI_VECTOR_ALLOC(PropertyInitialiser)> PropertyList;
518 typedef std::vector<PropertyDefinitionBase*
519 CEGUI_VECTOR_ALLOC(PropertyDefinitionBase*)> PropertyDefinitionList;
521 typedef std::vector<PropertyDefinitionBase*
522 CEGUI_VECTOR_ALLOC(PropertyDefinitionBase*)> PropertyLinkDefinitionList;
536 const PropertyDefinitionList& getPropertyDefinitions()
const
538 return d_propertyDefinitions;
551 const PropertyLinkDefinitionList& getPropertyLinkDefinitions()
const
553 return d_propertyLinkDefinitions;
571 bool handleFontRenderSizeChange(
Window& window,
const Font* font)
const;
588 StateImageryPointerMap getStateImageryMap(
bool includeInheritedElements =
false);
603 ImagerySectionPointerMap getImagerySectionMap(
bool includeInheritedElements =
false);
618 NamedAreaPointerMap getNamedAreaMap(
bool includeInheritedElements =
false);
633 WidgetComponentPointerMap getWidgetComponentMap(
bool includeInheritedElements =
false);
648 PropertyInitialiserPointerMap getPropertyInitialiserMap(
bool includeInheritedElements =
false);
663 PropertyDefinitionBasePointerMap getPropertyDefinitionMap(
bool includeInheritedElements =
false);
678 PropertyDefinitionBasePointerMap getPropertyLinkDefinitionMap(
bool includeInheritedElements =
false);
693 EventLinkDefinitionPointerMap getEventLinkDefinitionMap(
bool includeInheritedElements =
false);
704 StringSet getStateImageryNames(
bool inherits =
false)
const;
706 StringSet getStateNames(
bool inherits =
false)
const;
707 StringSet getImagerySectionNames(
bool inherits =
false)
const;
709 StringSet getImageryNames(
bool inherits =
false)
const;
710 StringSet getNamedAreaNames(
bool inherits =
false)
const;
711 StringSet getWidgetComponentNames(
bool inherits =
false)
const;
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;
743 typedef std::vector<
String
744 CEGUI_VECTOR_ALLOC(
String)> AnimationList;
747 > AnimationInstanceMap;
758 ImageryList d_imagerySections;
760 WidgetList d_childWidgets;
762 StateList d_stateImagery;
764 PropertyList d_properties;
766 NamedAreaList d_namedAreas;
768 mutable PropertyDefinitionList d_propertyDefinitions;
770 mutable PropertyLinkDefinitionList d_propertyLinkDefinitions;
772 AnimationList d_animations;
774 mutable AnimationInstanceMap d_animationInstances;
776 EventLinkDefinitionList d_eventLinkDefinitions;
786 CEGUI_SET_ALLOC(
String)> AnimationNameSet;
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;
831 StateIterator getStateIterator(
bool inherits =
false)
const;
839 ImageryIterator getImageryIterator(
bool inherits =
false)
const;
848 NamedAreaIterator getNamedAreaIterator(
bool inherits =
false)
const;
908 #if defined(_MSC_VER)
909 # pragma warning(pop)