MyGUI_ResourceSkin.h
Go to the documentation of this file.
/*
* This source file is part of MyGUI. For the latest info, see http://mygui.info/
* Distributed under the MIT License
* (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
*/
#ifndef MYGUI_RESOURCE_SKIN_H_
#define MYGUI_RESOURCE_SKIN_H_
#include "MyGUI_Prerequest.h"
#include "MyGUI_SubWidgetBinding.h"
#include "MyGUI_ChildSkinInfo.h"
#include "MyGUI_MaskPickInfo.h"
#include "MyGUI_IResource.h"
#include "MyGUI_SubWidgetInfo.h"
namespace MyGUI
{
// вспомогательный класс для инициализации одного скина
class MYGUI_EXPORT ResourceSkin : public IResource
{
MYGUI_RTTI_DERIVED(ResourceSkin)
public:
~ResourceSkin() override;
void deserialization(xml::ElementPtr _node, Version _version) override;
const IntSize& getSize() const;
const std::string& getTextureName() const;
const VectorSubWidgetInfo& getBasisInfo() const;
const MapWidgetStateInfo& getStateInfo() const;
const MapString& getProperties() const;
const VectorChildSkinInfo& getChild() const;
const std::string& getSkinName() const;
private:
void setInfo(const IntSize& _size, std::string_view _texture);
void addInfo(const SubWidgetBinding& _bind);
void addProperty(std::string_view _key, std::string_view _value);
void addChild(const ChildSkinInfo& _child);
void clear();
void checkState(const MapStateInfo& _states);
void checkState(std::string_view _name);
void checkBasis();
void fillState(const MapStateInfo& _states, size_t _index);
private:
IntSize mSize;
std::string mTexture;
VectorSubWidgetInfo mBasis;
MapWidgetStateInfo mStates;
// дополнительные параметры скина
MapString mProperties;
// дети скина
VectorChildSkinInfo mChilds;
std::string mSkinName;
};
} // namespace MyGUI
#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