Crazy Eddies GUI System 0.7.6
|
00001 /*********************************************************************** 00002 filename: CEGUIFalWidgetLookFeel.h 00003 created: Mon Jun 13 2005 00004 author: Paul D Turner <paul@cegui.org.uk> 00005 *************************************************************************/ 00006 /*************************************************************************** 00007 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team 00008 * 00009 * Permission is hereby granted, free of charge, to any person obtaining 00010 * a copy of this software and associated documentation files (the 00011 * "Software"), to deal in the Software without restriction, including 00012 * without limitation the rights to use, copy, modify, merge, publish, 00013 * distribute, sublicense, and/or sell copies of the Software, and to 00014 * permit persons to whom the Software is furnished to do so, subject to 00015 * the following conditions: 00016 * 00017 * The above copyright notice and this permission notice shall be 00018 * included in all copies or substantial portions of the Software. 00019 * 00020 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 00021 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00022 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 00023 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 00024 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 00025 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 00026 * OTHER DEALINGS IN THE SOFTWARE. 00027 ***************************************************************************/ 00028 #ifndef _CEGUIFalWidgetLookFeel_h_ 00029 #define _CEGUIFalWidgetLookFeel_h_ 00030 00031 #include "CEGUIFalStateImagery.h" 00032 #include "CEGUIFalWidgetComponent.h" 00033 #include "CEGUIFalImagerySection.h" 00034 #include "CEGUIFalPropertyInitialiser.h" 00035 #include "CEGUIFalPropertyDefinition.h" 00036 #include "CEGUIFalPropertyLinkDefinition.h" 00037 #include "CEGUIFalNamedArea.h" 00038 #include <map> 00039 00040 #if defined(_MSC_VER) 00041 # pragma warning(push) 00042 # pragma warning(disable : 4251) 00043 #endif 00044 00045 00046 // Start of CEGUI namespace section 00047 namespace CEGUI 00048 { 00053 class CEGUIEXPORT WidgetLookFeel 00054 { 00055 public: 00056 WidgetLookFeel(const String& name); 00057 WidgetLookFeel() {} 00058 00066 const StateImagery& getStateImagery(const CEGUI::String& state) const; 00067 00075 const ImagerySection& getImagerySection(const CEGUI::String& section) const; 00076 00084 const String& getName() const; 00085 00095 void addImagerySection(const ImagerySection& section); 00096 00106 void addWidgetComponent(const WidgetComponent& widget); 00107 00117 void addStateSpecification(const StateImagery& state); 00118 00128 void addPropertyInitialiser(const PropertyInitialiser& initialiser); 00129 00137 void clearImagerySections(); 00138 00146 void clearWidgetComponents(); 00147 00155 void clearStateSpecifications(); 00156 00164 void clearPropertyInitialisers(); 00165 00177 void initialiseWidget(Window& widget) const; 00178 00189 void cleanUpWidget(Window& widget) const; 00190 00202 bool isStateImageryPresent(const String& state) const; 00203 00214 void addNamedArea(const NamedArea& area); 00215 00223 void clearNamedAreas(); 00224 00235 const NamedArea& getNamedArea(const String& name) const; 00236 00248 bool isNamedAreaDefined(const String& name) const; 00249 00260 void layoutChildWidgets(const Window& owner) const; 00261 00272 void addPropertyDefinition(const PropertyDefinition& propdef); 00273 00284 void addPropertyLinkDefinition(const PropertyLinkDefinition& propdef); 00285 00293 void clearPropertyDefinitions(); 00294 00302 void clearPropertyLinkDefinitions(); 00303 00313 void addAnimationName(const String& anim_name); 00314 00326 void writeXMLToStream(XMLSerializer& xml_stream) const; 00327 00341 void renameChildren(const Window& widget, const String& newBaseName) const; 00342 00352 const PropertyInitialiser* findPropertyInitialiser(const String& propertyName) const; 00353 00362 const WidgetComponent* findWidgetComponent(const String& nameSuffix) const; 00363 00365 typedef std::vector<PropertyInitialiser> PropertyList; 00366 typedef std::vector<PropertyDefinition> PropertyDefinitionList; 00367 typedef std::vector<PropertyLinkDefinition> PropertyLinkDefinitionList; 00368 00373 const PropertyDefinitionList& getPropertyDefinitions() const { return d_propertyDefinitions; } 00374 00379 const PropertyLinkDefinitionList& getPropertyLinkDefinitions() const { return d_propertyLinkDefinitions; } 00380 00385 const PropertyList& getProperties() const { return d_properties; } 00386 00387 private: 00388 typedef std::map<String, StateImagery, String::FastLessCompare> StateList; 00389 typedef std::map<String, ImagerySection, String::FastLessCompare> ImageryList; 00390 typedef std::map<String, NamedArea, String::FastLessCompare> NamedAreaList; 00391 typedef std::vector<WidgetComponent> WidgetList; 00392 typedef std::vector<String> AnimationList; 00393 typedef std::multimap<Window*, AnimationInstance*> AnimationInstanceMap; 00394 00395 CEGUI::String d_lookName; 00396 ImageryList d_imagerySections; 00397 WidgetList d_childWidgets; 00398 StateList d_stateImagery; 00399 PropertyList d_properties; 00400 NamedAreaList d_namedAreas; 00401 mutable PropertyDefinitionList d_propertyDefinitions; 00402 mutable PropertyLinkDefinitionList d_propertyLinkDefinitions; 00403 00404 AnimationList d_animations; 00406 mutable AnimationInstanceMap d_animationInstances; 00407 }; 00408 00409 00410 } // End of CEGUI namespace section 00411 00412 00413 #if defined(_MSC_VER) 00414 # pragma warning(pop) 00415 #endif 00416 00417 #endif // end of guard _CEGUIFalWidgetLookFeel_h_