MyGUI: MyGUI_ResourceSkin.h Source File

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"
11#include "MyGUI_SubWidgetBinding.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 // вспомогательный класс для инициализации одного скина
21 class MYGUI_EXPORT ResourceSkin : public IResource
22 {
23 MYGUI_RTTI_DERIVED(ResourceSkin)
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;
53 VectorSubWidgetInfo mBasis;
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_
MyGUI_ChildSkinInfo.h
MyGUI_IResource.h
MyGUI_MaskPickInfo.h
MYGUI_EXPORT
#define MYGUI_EXPORT
Definition MyGUI_Platform.h:77
MyGUI_Prerequest.h
MYGUI_RTTI_DERIVED
#define MYGUI_RTTI_DERIVED(DerivedType)
Definition MyGUI_RTTI.h:69
MyGUI_SubWidgetBinding.h
MyGUI_SubWidgetInfo.h
MyGUI::IResource::IResource
IResource(IResource const &)=delete
MyGUI::ResourceSkin
Definition MyGUI_ResourceSkin.h:22
MyGUI::ResourceSkin::getStateInfo
const MapWidgetStateInfo & getStateInfo() const
Definition MyGUI_ResourceSkin.cpp:274
MyGUI::ResourceSkin::getSkinName
const std::string & getSkinName() const
Definition MyGUI_ResourceSkin.cpp:289
MyGUI::ResourceSkin::getSize
const IntSize & getSize() const
Definition MyGUI_ResourceSkin.cpp:259
MyGUI::ResourceSkin::getProperties
const MapString & getProperties() const
Definition MyGUI_ResourceSkin.cpp:279
MyGUI::ResourceSkin::getBasisInfo
const VectorSubWidgetInfo & getBasisInfo() const
Definition MyGUI_ResourceSkin.cpp:269
MyGUI::ResourceSkin::deserialization
void deserialization(xml::ElementPtr _node, Version _version) override
Definition MyGUI_ResourceSkin.cpp:22
MyGUI::ResourceSkin::getTextureName
const std::string & getTextureName() const
Definition MyGUI_ResourceSkin.cpp:264
MyGUI::ResourceSkin::getChild
const VectorChildSkinInfo & getChild() const
Definition MyGUI_ResourceSkin.cpp:284
MyGUI::SubWidgetBinding
Definition MyGUI_SubWidgetBinding.h:18
MyGUI::Version
Definition MyGUI_Version.h:18
MyGUI::xml::ElementPtr
Element * ElementPtr
Definition MyGUI_XmlDocument.h:112
MyGUI
Definition MyGUI_ActionController.h:15
MyGUI::MapWidgetStateInfo
std::map< std::string, VectorStateInfo, std::less<> > MapWidgetStateInfo
Definition MyGUI_IStateInfo.h:23
MyGUI::MapString
std::map< std::string, std::string, std::less<> > MapString
Definition MyGUI_Types.h:40
MyGUI::VectorSubWidgetInfo
std::vector< SubWidgetInfo > VectorSubWidgetInfo
Definition MyGUI_SubWidgetInfo.h:33
MyGUI::IntSize
types::TSize< int > IntSize
Definition MyGUI_Types.h:30
MyGUI::MapStateInfo
std::map< std::string, IStateInfo *, std::less<> > MapStateInfo
Definition MyGUI_IStateInfo.h:22
MyGUI::VectorChildSkinInfo
std::vector< ChildSkinInfo > VectorChildSkinInfo
Definition MyGUI_ChildSkinInfo.h:40
MyGUI::ChildSkinInfo
Definition MyGUI_ChildSkinInfo.h:18