MyGUI 3.4.1
MyGUI_ResourceSkin.h
Go to the documentation of this file.
1/*
2 * This source file is part of MyGUI. For the latest info, see http://mygui.info/
3 * Distributed under the MIT License
4 * (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
5 */
6
7#ifndef MYGUI_RESOURCE_SKIN_H_
8#define MYGUI_RESOURCE_SKIN_H_
9
10#include "MyGUI_Prerequest.h"
12#include "MyGUI_ChildSkinInfo.h"
13#include "MyGUI_MaskPickInfo.h"
14#include "MyGUI_IResource.h"
15#include "MyGUI_SubWidgetInfo.h"
16
17namespace MyGUI
18{
19
20 // вспомогательный класс для инициализации одного скина
22 public IResource
23 {
25
26 public:
28 ~ResourceSkin() override;
29
30 void deserialization(xml::ElementPtr _node, Version _version) override;
31
32 const IntSize& getSize() const;
33 const std::string& getTextureName() const;
34 const VectorSubWidgetInfo& getBasisInfo() const;
35 const MapWidgetStateInfo& getStateInfo() const;
36 const MapString& getProperties() const;
37 const VectorChildSkinInfo& getChild() const;
38 const std::string& getSkinName() const;
39
40 private:
41 void setInfo(const IntSize& _size, const std::string& _texture);
42 void addInfo(const SubWidgetBinding& _bind);
43 void addProperty(const std::string& _key, const std::string& _value);
44 void addChild(const ChildSkinInfo& _child);
45 void clear();
46
47 void checkState(const MapStateInfo& _states);
48 void checkState(const std::string& _name);
49 void checkBasis();
50 void fillState(const MapStateInfo& _states, size_t _index);
51
52 private:
53 IntSize mSize;
54 std::string mTexture;
56 MapWidgetStateInfo mStates;
57 // дополнительные параметры скина
58 MapString mProperties;
59 // дети скина
60 VectorChildSkinInfo mChilds;
61 std::string mSkinName;
62 };
63
64} // namespace MyGUI
65
66#endif // MYGUI_RESOURCE_SKIN_H_
#define MYGUI_EXPORT
#define MYGUI_RTTI_DERIVED(DerivedType)
Definition: MyGUI_RTTI.h:48
std::map< std::string, VectorStateInfo > MapWidgetStateInfo
std::map< std::string, std::string > MapString
Definition: MyGUI_Types.h:39
std::vector< SubWidgetInfo > VectorSubWidgetInfo
std::vector< ChildSkinInfo > VectorChildSkinInfo
std::map< std::string, IStateInfo * > MapStateInfo