22 for (MapWidgetStateInfo::iterator item = mStates.begin(); item != mStates.end(); ++ item)
24 for (VectorStateInfo::iterator info = (*item).second.begin(); info != (*item).second.end(); ++ info)
32 Base::deserialization(_node, _version);
37 std::string name, texture, tmp;
54 setInfo(size, texture);
58 addProperty(
"MaskPick", tmp);
64 if (basis->
getName() ==
"Property")
67 std::string key, value;
80 addProperty(key, value);
82 else if (basis->
getName() ==
"Child")
94 while (child_params.
next(
"Property"))
100 else if (basis->
getName() ==
"BasisSkin")
103 std::string basisSkinType, tmp_str;
112 bind.
create(offset, align, basisSkinType);
118 bool new_format =
false;
124 if (state->
getName() ==
"State")
126 const std::string& name_state = state->
findAttribute(
"name");
127 if ((name_state ==
"normal_checked") || (state->
findAttribute(
"name") ==
"normal_check"))
140 if (state->
getName() ==
"State")
143 std::string basisStateName;
150 if (basisStateName ==
"disable_check")
151 basisStateName =
"disabled_checked";
152 else if (basisStateName ==
"normal_check")
153 basisStateName =
"normal_checked";
154 else if (basisStateName ==
"active_check")
155 basisStateName =
"highlighted_checked";
156 else if (basisStateName ==
"pressed_check")
157 basisStateName =
"pushed_checked";
158 else if (basisStateName ==
"disable")
159 basisStateName =
"disabled";
160 else if (basisStateName ==
"active")
161 basisStateName =
"highlighted";
162 else if (basisStateName ==
"select")
163 basisStateName =
"pushed";
164 else if (basisStateName ==
"pressed")
167 basisStateName =
"pushed";
169 basisStateName =
"normal_checked";
176 if (
object !=
nullptr)
183 bind.
add(basisStateName, data, name);
194 void ResourceSkin::setInfo(
const IntSize& _size,
const std::string& _texture)
200 void ResourceSkin::addInfo(
const SubWidgetBinding& _bind)
202 checkState(_bind.mStates);
203 mBasis.push_back(SubWidgetInfo(_bind.mType, _bind.mOffset, _bind.mAlign));
205 fillState(_bind.mStates, mBasis.size() - 1);
208 void ResourceSkin::addProperty(
const std::string& _key,
const std::string& _value)
210 mProperties[_key] = _value;
213 void ResourceSkin::addChild(
const ChildSkinInfo& _child)
215 mChilds.push_back(_child);
218 void ResourceSkin::clear()
220 for (MapWidgetStateInfo::iterator iter = mStates.begin(); iter != mStates.end(); ++iter)
222 for (VectorStateInfo::iterator iter2 = iter->second.begin(); iter2 != iter->second.end(); ++iter2)
229 void ResourceSkin::checkState(
const MapStateInfo& _states)
231 for (MapStateInfo::const_iterator iter = _states.begin(); iter != _states.end(); ++iter)
233 checkState(iter->first);
237 void ResourceSkin::checkState(
const std::string& _name)
240 MapWidgetStateInfo::const_iterator iter = mStates.find(_name);
241 if (iter == mStates.end())
248 void ResourceSkin::checkBasis()
251 for (MapWidgetStateInfo::iterator iter = mStates.begin(); iter != mStates.end(); ++iter)
253 iter->second.resize(mBasis.size());
257 void ResourceSkin::fillState(
const MapStateInfo& _states,
size_t _index)
259 for (MapStateInfo::const_iterator iter = _states.begin(); iter != _states.end(); ++iter)
261 mStates[iter->first][_index] = iter->second;
static FactoryManager & getInstance()
IObject * createObject(const std::string &_category, const std::string &_type)
Type * castType(bool _throw=true)
virtual void deserialization(xml::ElementPtr _node, Version _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
ElementEnumerator getElementEnumerator()
const std::string & getName() const
bool findAttribute(const std::string &_name, std::string &_value)
std::map< std::string, VectorStateInfo > MapWidgetStateInfo
std::map< std::string, std::string > MapString
std::vector< SubWidgetInfo > VectorSubWidgetInfo
std::vector< IStateInfo * > VectorStateInfo
std::vector< ChildSkinInfo > VectorChildSkinInfo
std::map< std::string, IStateInfo * > MapStateInfo
static Align parse(const std::string &_value)
void addParam(const std::string &_key, const std::string &_value)
static TCoord< int > parse(const std::string &_value)
static TSize< int > parse(const std::string &_value)