49 setInfo(size, texture);
53 addProperty(
"MaskPick", tmp);
59 if (basis->
getName() ==
"Property")
76 addProperty(key, value);
78 else if (basis->
getName() ==
"Child")
90 while (child_params.
next(
"Property"))
96 else if (basis->
getName() ==
"BasisSkin")
99 std::string basisSkinType;
109 bind.
create(offset, align, basisSkinType);
115 bool new_format =
false;
121 if (state->
getName() ==
"State")
124 if ((name_state ==
"normal_checked") || (state->
findAttribute(
"name") ==
"normal_check"))
137 if (state->
getName() ==
"State")
140 std::string basisStateName;
147 if (basisStateName ==
"disable_check")
148 basisStateName =
"disabled_checked";
149 else if (basisStateName ==
"normal_check")
150 basisStateName =
"normal_checked";
151 else if (basisStateName ==
"active_check")
152 basisStateName =
"highlighted_checked";
153 else if (basisStateName ==
"pressed_check")
154 basisStateName =
"pushed_checked";
155 else if (basisStateName ==
"disable")
156 basisStateName =
"disabled";
157 else if (basisStateName ==
"active")
158 basisStateName =
"highlighted";
159 else if (basisStateName ==
"select")
160 basisStateName =
"pushed";
161 else if (basisStateName ==
"pressed")
164 basisStateName =
"pushed";
166 basisStateName =
"normal_checked";
173 if (
object !=
nullptr)
180 bind.
add(basisStateName, data, name);
190 void ResourceSkin::setInfo(
const IntSize& _size, std::string_view _texture)
196 void ResourceSkin::addInfo(
const SubWidgetBinding& _bind)
198 checkState(_bind.mStates);
199 mBasis.emplace_back(_bind.mType, _bind.mOffset, _bind.mAlign);
201 fillState(_bind.mStates, mBasis.size() - 1);
204 void ResourceSkin::addProperty(std::string_view _key, std::string_view _value)
206 mapSet(mProperties, _key, _value);
211 mChilds.push_back(_child);
214 void ResourceSkin::clear()
216 for (
auto& state : mStates)
218 for (
auto& info : state.second)
223 void ResourceSkin::checkState(
const MapStateInfo& _states)
225 for (
const auto& state : _states)
227 checkState(state.first);
231 void ResourceSkin::checkState(std::string_view _name)
234 MapWidgetStateInfo::const_iterator iter = mStates.find(_name);
235 if (iter == mStates.end())
242 void ResourceSkin::checkBasis()
245 for (
auto& state : mStates)
247 state.second.resize(mBasis.size());
251 void ResourceSkin::fillState(
const MapStateInfo& _states,
size_t _index)
253 for (
const auto& state : _states)
255 mStates[state.first][_index] = state.second;
static FactoryManager & getInstance()
IObject * createObject(std::string_view _category, std::string_view _type)
Type * castType(bool _throw=true)
virtual void deserialization(xml::ElementPtr, Version)
static LanguageManager & getInstance()
UString replaceTags(const UString &_line)
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
bool findAttribute(std::string_view _name, std::string &_value)
ElementEnumerator getElementEnumerator()
const std::string & getName() const
std::map< std::string, VectorStateInfo, std::less<> > MapWidgetStateInfo
void mapSet(Map &map, std::string_view key, const Value &value)
std::map< std::string, std::string, std::less<> > MapString
std::vector< SubWidgetInfo > VectorSubWidgetInfo
std::vector< IStateInfo * > VectorStateInfo
types::TCoord< int > IntCoord
types::TSize< int > IntSize
std::map< std::string, IStateInfo *, std::less<> > MapStateInfo
std::vector< ChildSkinInfo > VectorChildSkinInfo
static Align parse(std::string_view _value)
void addParam(std::string_view _key, std::string_view _value)
static TCoord< int > parse(std::string_view _value)
static TSize< int > parse(std::string_view _value)