MyGUI 3.4.3
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 {
24
25 public:
26 ~ResourceSkin() override;
27
28 void deserialization(xml::ElementPtr _node, Version _version) override;
29
30 const IntSize& getSize() const;
31 const std::string& getTextureName() const;
32 const VectorSubWidgetInfo& getBasisInfo() const;
33 const MapWidgetStateInfo& getStateInfo() const;
34 const MapString& getProperties() const;
35 const VectorChildSkinInfo& getChild() const;
36 const std::string& getSkinName() const;
37
38 private:
39 void setInfo(const IntSize& _size, std::string_view _texture);
40 void addInfo(const SubWidgetBinding& _bind);
41 void addProperty(std::string_view _key, std::string_view _value);
42 void addChild(const ChildSkinInfo& _child);
43 void clear();
44
45 void checkState(const MapStateInfo& _states);
46 void checkState(std::string_view _name);
47 void checkBasis();
48 void fillState(const MapStateInfo& _states, size_t _index);
49
50 private:
51 IntSize mSize;
52 std::string mTexture;
54 MapWidgetStateInfo mStates;
55 // дополнительные параметры скина
56 MapString mProperties;
57 // дети скина
58 VectorChildSkinInfo mChilds;
59 std::string mSkinName;
60 };
61
62} // namespace MyGUI
63
64#endif // MYGUI_RESOURCE_SKIN_H_
#define MYGUI_EXPORT
#define MYGUI_RTTI_DERIVED(DerivedType)
Definition MyGUI_RTTI.h:69
IResource(IResource const &)=delete
const MapWidgetStateInfo & getStateInfo() const
const std::string & getSkinName() const
const IntSize & getSize() const
const MapString & getProperties() const
const VectorSubWidgetInfo & getBasisInfo() const
void deserialization(xml::ElementPtr _node, Version _version) override
const std::string & getTextureName() const
const VectorChildSkinInfo & getChild() const
Element * ElementPtr
std::map< std::string, VectorStateInfo, std::less<> > MapWidgetStateInfo
std::map< std::string, std::string, std::less<> > MapString
Definition MyGUI_Types.h:40
std::vector< SubWidgetInfo > VectorSubWidgetInfo
types::TSize< int > IntSize
Definition MyGUI_Types.h:30
std::map< std::string, IStateInfo *, std::less<> > MapStateInfo
std::vector< ChildSkinInfo > VectorChildSkinInfo