MyGUI  3.2.0
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  // вспомогательный класс для инициализации одного скина
37  public IResource
38  {
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__