MyGUI
3.2.0
|
00001 00006 /* 00007 This file is part of MyGUI. 00008 00009 MyGUI is free software: you can redistribute it and/or modify 00010 it under the terms of the GNU Lesser General Public License as published by 00011 the Free Software Foundation, either version 3 of the License, or 00012 (at your option) any later version. 00013 00014 MyGUI is distributed in the hope that it will be useful, 00015 but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 GNU Lesser General Public License for more details. 00018 00019 You should have received a copy of the GNU Lesser General Public License 00020 along with MyGUI. If not, see <http://www.gnu.org/licenses/>. 00021 */ 00022 #ifndef __MYGUI_I_SUB_WIDGET_H__ 00023 #define __MYGUI_I_SUB_WIDGET_H__ 00024 00025 #include "MyGUI_Prerequest.h" 00026 #include "MyGUI_ICroppedRectangle.h" 00027 #include "MyGUI_ILayerNode.h" 00028 #include "MyGUI_Types.h" 00029 #include "MyGUI_IRenderTarget.h" 00030 #include "MyGUI_IStateInfo.h" 00031 #include "MyGUI_IObject.h" 00032 00033 namespace MyGUI 00034 { 00035 00036 class ISubWidget; 00037 typedef std::vector<ISubWidget*> VectorSubWidget; 00038 00039 class MYGUI_EXPORT ISubWidget : 00040 public ICroppedRectangle, 00041 public IObject 00042 { 00043 MYGUI_RTTI_DERIVED( ISubWidget ) 00044 00045 public: 00046 ISubWidget() : mVisible(true) { } 00047 virtual ~ISubWidget() { } 00048 00049 virtual void createDrawItem(ITexture* _texture, ILayerNode* _node) = 0; 00050 virtual void destroyDrawItem() = 0; 00051 00052 virtual void setAlpha(float _alpha) { } 00053 00054 virtual void setStateData(IStateInfo* _data) { } 00055 00056 virtual void doRender() = 0; 00057 00058 virtual void setAlign(Align _value) 00059 { 00060 mAlign = _value; 00061 } 00062 virtual void setVisible(bool _value) 00063 { 00064 mVisible = _value; 00065 } 00066 00067 virtual void _updateView() { } 00068 virtual void _correctView() { } 00069 00070 virtual void _setAlign(const IntSize& _oldsize) { } 00071 00072 virtual void doManualRender(IVertexBuffer* _buffer, ITexture* _texture, size_t _count) { } 00073 00074 protected: 00075 Align mAlign; 00076 bool mVisible; 00077 }; 00078 00079 } // namespace MyGUI 00080 00081 #endif // __MYGUI_I_SUB_WIDGET_H__