MyGUI 3.2.0

- Main Page
- Related Pages
- Namespaces
- Data Structures
- Files
- Examples

- File List
- Globals

MyGUI_ResourceSkin.h
Go to the documentation of this file.
1
6 /*
7 This file is part of MyGUI.
8
9 MyGUI is free software: you can redistribute it and/or modify
10 it under the terms of the GNU Lesser General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13
14 MyGUI is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU Lesser General Public License for more details.
18
19 You should have received a copy of the GNU Lesser General Public License
20 along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
21 */
22 #ifndef __MYGUI_RESOURCE_SKIN_H__
23 #define __MYGUI_RESOURCE_SKIN_H__
24
25 #include "MyGUI_Prerequest.h"
26 #include "MyGUI_SubWidgetBinding.h"
27 #include "MyGUI_ChildSkinInfo.h"
28 #include "MyGUI_MaskPickInfo.h"
29 #include "MyGUI_IResource.h"
30 #include "MyGUI_SubWidgetInfo.h"
31
32 namespace MyGUI
33 {
34
35 // вспомогательный класс для инициализации одного скина
36 class MYGUI_EXPORT ResourceSkin :
37 public IResource
38 {
39 MYGUI_RTTI_DERIVED( ResourceSkin )
40
41 public:
42 ResourceSkin();
43 virtual ~ResourceSkin();
44
45 virtual void deserialization(xml::ElementPtr _node, Version _version);
46
47 const IntSize& getSize() const;
48 const std::string& getTextureName() const;
49 const VectorSubWidgetInfo& getBasisInfo() const;
50 const MapWidgetStateInfo& getStateInfo() const;
51 const MapString& getProperties() const;
52 const VectorChildSkinInfo& getChild() const;
53 const std::string& getSkinName() const;
54
55 private:
56 void setInfo(const IntSize& _size, const std::string& _texture);
57 void addInfo(const SubWidgetBinding& _bind);
58 void addProperty(const std::string& _key, const std::string& _value);
59 void addChild(const ChildSkinInfo& _child);
60 void clear();
61
62 void checkState(const MapStateInfo& _states);
63 void checkState(const std::string& _name);
64 void checkBasis();
65 void fillState(const MapStateInfo& _states, size_t _index);
66
67 private:
68 IntSize mSize;
69 std::string mTexture;
70 VectorSubWidgetInfo mBasis;
71 MapWidgetStateInfo mStates;
72 // дополнительные параметры скина
73 MapString mProperties;
74 // дети скина
75 VectorChildSkinInfo mChilds;
76 std::string mSkinName;
77 };
78
79 } // namespace MyGUI
80
81 #endif // __MYGUI_RESOURCE_SKIN_H__
MyGUI::MapWidgetStateInfo
std::map< std::string, VectorStateInfo > MapWidgetStateInfo
Definition: MyGUI_IStateInfo.h:42
MyGUI::ResourceSkin
Definition: MyGUI_ResourceSkin.h:36
MyGUI_Prerequest.h
MyGUI::types::TSize< int >
MyGUI::xml::ElementPtr
Element * ElementPtr
Definition: MyGUI_XmlDocument.h:114
MyGUI_SubWidgetInfo.h
MyGUI::ChildSkinInfo
Definition: MyGUI_ChildSkinInfo.h:31
MYGUI_RTTI_DERIVED
#define MYGUI_RTTI_DERIVED(DerivedType)
Definition: MyGUI_RTTI.h:88
MYGUI_EXPORT
#define MYGUI_EXPORT
Definition: MyGUI_Platform.h:120
MyGUI_ChildSkinInfo.h
MyGUI_MaskPickInfo.h
MyGUI::MapStateInfo
std::map< std::string, IStateInfo * > MapStateInfo
Definition: MyGUI_IStateInfo.h:41
MyGUI::MapString
std::map< std::string, std::string > MapString
Definition: MyGUI_Types.h:53
MyGUI::VectorSubWidgetInfo
std::vector< SubWidgetInfo > VectorSubWidgetInfo
Definition: MyGUI_SubWidgetInfo.h:47
MyGUI_IResource.h
MyGUI::Version
Definition: MyGUI_Version.h:32
MyGUI_SubWidgetBinding.h
MyGUI::IResource
Definition: MyGUI_IResource.h:38
MyGUI::VectorChildSkinInfo
std::vector< ChildSkinInfo > VectorChildSkinInfo
Definition: MyGUI_ChildSkinInfo.h:47
MyGUI::SubWidgetBinding
Definition: MyGUI_SubWidgetBinding.h:32