MyGUI  3.2.1
MyGUI_ResourceSkin.h
Go to the documentation of this file.
00001 /*
00002  * This source file is part of MyGUI. For the latest info, see http://mygui.info/
00003  * Distributed under the MIT License
00004  * (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
00005  */
00006 
00007 #ifndef __MYGUI_RESOURCE_SKIN_H__
00008 #define __MYGUI_RESOURCE_SKIN_H__
00009 
00010 #include "MyGUI_Prerequest.h"
00011 #include "MyGUI_SubWidgetBinding.h"
00012 #include "MyGUI_ChildSkinInfo.h"
00013 #include "MyGUI_MaskPickInfo.h"
00014 #include "MyGUI_IResource.h"
00015 #include "MyGUI_SubWidgetInfo.h"
00016 
00017 namespace MyGUI
00018 {
00019 
00020     // вспомогательный класс для инициализации одного скина
00021     class MYGUI_EXPORT ResourceSkin :
00022         public IResource
00023     {
00024         MYGUI_RTTI_DERIVED( ResourceSkin )
00025 
00026     public:
00027         ResourceSkin();
00028         virtual ~ResourceSkin();
00029 
00030         virtual void deserialization(xml::ElementPtr _node, Version _version);
00031 
00032         const IntSize& getSize() const;
00033         const std::string& getTextureName() const;
00034         const VectorSubWidgetInfo& getBasisInfo() const;
00035         const MapWidgetStateInfo& getStateInfo() const;
00036         const MapString& getProperties() const;
00037         const VectorChildSkinInfo& getChild() const;
00038         const std::string& getSkinName() const;
00039 
00040     private:
00041         void setInfo(const IntSize& _size, const std::string& _texture);
00042         void addInfo(const SubWidgetBinding& _bind);
00043         void addProperty(const std::string& _key, const std::string& _value);
00044         void addChild(const ChildSkinInfo& _child);
00045         void clear();
00046 
00047         void checkState(const MapStateInfo& _states);
00048         void checkState(const std::string& _name);
00049         void checkBasis();
00050         void fillState(const MapStateInfo& _states, size_t _index);
00051 
00052     private:
00053         IntSize mSize;
00054         std::string mTexture;
00055         VectorSubWidgetInfo mBasis;
00056         MapWidgetStateInfo mStates;
00057         // дополнительные параметры скина
00058         MapString mProperties;
00059         // дети скина
00060         VectorChildSkinInfo mChilds;
00061         std::string mSkinName;
00062     };
00063 
00064 } // namespace MyGUI
00065 
00066 #endif // __MYGUI_RESOURCE_SKIN_H__