00001 00007 /* 00008 This file is part of MyGUI. 00009 00010 MyGUI is free software: you can redistribute it and/or modify 00011 it under the terms of the GNU Lesser General Public License as published by 00012 the Free Software Foundation, either version 3 of the License, or 00013 (at your option) any later version. 00014 00015 MyGUI is distributed in the hope that it will be useful, 00016 but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 GNU Lesser General Public License for more details. 00019 00020 You should have received a copy of the GNU Lesser General Public License 00021 along with MyGUI. If not, see <http://www.gnu.org/licenses/>. 00022 */ 00023 #ifndef __MYGUI_SUB_SKIN_H__ 00024 #define __MYGUI_SUB_SKIN_H__ 00025 00026 #include "MyGUI_Prerequest.h" 00027 #include "MyGUI_XmlDocument.h" 00028 #include "MyGUI_Types.h" 00029 #include "MyGUI_ISubWidgetRect.h" 00030 #include "MyGUI_ResourceSkin.h" 00031 #include "MyGUI_IStateInfo.h" 00032 00033 namespace MyGUI 00034 { 00035 00036 class RenderItem; 00037 00038 class MYGUI_EXPORT SubSkin : 00039 public ISubWidgetRect 00040 { 00041 MYGUI_RTTI_DERIVED( SubSkin ); 00042 00043 public: 00044 SubSkin(); 00045 virtual ~SubSkin(); 00046 00047 void setAlpha(float _alpha); 00048 00049 virtual void setVisible(bool _visible); 00050 00051 virtual void setStateData(IStateInfo* _data); 00052 00053 virtual void createDrawItem(const std::string& _texture, ILayerNode * _node); 00054 virtual void destroyDrawItem(); 00055 00056 // метод для отрисовки себя 00057 virtual void doRender(); 00058 00059 /*internal:*/ 00060 void _updateView(); 00061 void _correctView(); 00062 00063 void _setAlign(const IntSize& _oldsize, bool _update); 00064 void _setAlign(const IntCoord& _oldcoord, bool _update); 00065 00066 virtual void _setUVSet(const FloatRect& _rect); 00067 00068 protected: 00069 FloatRect mRectTexture; 00070 bool mEmptyView; 00071 00072 uint32 mCurrentAlpha; 00073 00074 FloatRect mCurrentTexture; 00075 IntCoord mCurrentCoord; 00076 00077 ILayerNode* mNode; 00078 RenderItem* mRenderItem; 00079 }; 00080 00081 } // namespace MyGUI 00082 00083 #endif // __MYGUI_SUB_SKIN_H__