MyGUI: MyGUI_LayerItem.h Source File

MyGUI 3.4.3

MyGUI_LayerItem.h
Go to the documentation of this file.
1/*
2 * This source file is part of MyGUI. For the latest info, see http://mygui.info/
3 * Distributed under the MIT License
4 * (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
5 */
6
7#ifndef MYGUI_LAYER_ITEM_H_
8#define MYGUI_LAYER_ITEM_H_
9
10#include "MyGUI_Prerequest.h"
11#include "MyGUI_LayerManager.h"
12#include "MyGUI_ILayer.h"
13#include "MyGUI_ILayerNode.h"
14#include "MyGUI_ILayerItem.h"
15#include "MyGUI_ISubWidget.h"
16
17namespace MyGUI
18{
19
20 class MYGUI_EXPORT LayerItem : public ILayerItem
21 {
22 public:
23 ILayer* getLayer() const;
24 ILayerNode* getLayerNode() const;
25
26 void attachItemToNode(ILayer* _layer, ILayerNode* _node) override;
27 void detachFromLayer() override;
28 void upLayerItem() override;
29
30 void setRenderItemTexture(ITexture* _texture);
31
32 void addChildItem(LayerItem* _item);
33 void removeChildItem(LayerItem* _item);
34
35 void addChildNode(LayerItem* _item);
36 void removeChildNode(LayerItem* _item);
37
38 void addRenderItem(ISubWidget* _item);
39 void removeAllRenderItems();
40
41 void saveLayerItem();
42 void restoreLayerItem();
43
44 protected:
45 void attachToLayerItemNode(ILayerNode* _item, bool _deep);
46 void detachFromLayerItemNode(bool _deep);
47
48 private:
49 // актуально для рутового виджета
50 ILayer* mLayer{nullptr};
51 // конкретный айтем находящийся в слое
52 ILayerNode* mLayerNode{nullptr};
53 ILayerNode* mSaveLayerNode{nullptr};
54
55 using VectorLayerItem = std::vector<LayerItem*>;
56 // список наших детей айтемов
57 VectorLayerItem mLayerItems;
58 // список наших узлов
59 VectorLayerItem mLayerNodes;
60
61 // вектор всех детей сабскинов
62 VectorSubWidget mDrawItems;
63
64 ITexture* mTexture{nullptr};
65 };
66
67} // namespace MyGUI
68
69#endif // MYGUI_LAYER_ITEM_H_
MyGUI_ILayer.h
MyGUI_ILayerItem.h
MyGUI_ILayerNode.h
MyGUI_ISubWidget.h
MyGUI_LayerManager.h
MYGUI_EXPORT
#define MYGUI_EXPORT
Definition MyGUI_Platform.h:77
MyGUI_Prerequest.h
MyGUI::ILayer
Definition MyGUI_ILayer.h:22
MyGUI::ILayerItem
Definition MyGUI_ILayerItem.h:20
MyGUI::ILayerNode
Definition MyGUI_ILayerNode.h:29
MyGUI::ISubWidget
Definition MyGUI_ISubWidget.h:25
MyGUI::ITexture
Definition MyGUI_ITexture.h:28
MyGUI::LayerItem
Definition MyGUI_LayerItem.h:21
MyGUI::LayerItem::removeChildNode
void removeChildNode(LayerItem *_item)
Definition MyGUI_LayerItem.cpp:41
MyGUI::LayerItem::getLayerNode
ILayerNode * getLayerNode() const
Definition MyGUI_LayerItem.cpp:196
MyGUI::LayerItem::attachToLayerItemNode
void attachToLayerItemNode(ILayerNode *_item, bool _deep)
Definition MyGUI_LayerItem.cpp:130
MyGUI::LayerItem::detachFromLayerItemNode
void detachFromLayerItemNode(bool _deep)
Definition MyGUI_LayerItem.cpp:158
MyGUI::LayerItem::addChildItem
void addChildItem(LayerItem *_item)
Definition MyGUI_LayerItem.cpp:14
MyGUI::LayerItem::addChildNode
void addChildNode(LayerItem *_item)
Definition MyGUI_LayerItem.cpp:30
MyGUI::LayerItem::removeChildItem
void removeChildItem(LayerItem *_item)
Definition MyGUI_LayerItem.cpp:23
MyGUI::LayerItem::removeAllRenderItems
void removeAllRenderItems()
Definition MyGUI_LayerItem.cpp:53
MyGUI::LayerItem::getLayer
ILayer * getLayer() const
Definition MyGUI_LayerItem.cpp:191
MyGUI::LayerItem::addRenderItem
void addRenderItem(ISubWidget *_item)
Definition MyGUI_LayerItem.cpp:48
MyGUI::LayerItem::detachFromLayer
void detachFromLayer() override
Definition MyGUI_LayerItem.cpp:96
MyGUI::LayerItem::restoreLayerItem
void restoreLayerItem()
Definition MyGUI_LayerItem.cpp:79
MyGUI::LayerItem::upLayerItem
void upLayerItem() override
Definition MyGUI_LayerItem.cpp:120
MyGUI::LayerItem::saveLayerItem
void saveLayerItem()
Definition MyGUI_LayerItem.cpp:74
MyGUI::LayerItem::attachItemToNode
void attachItemToNode(ILayer *_layer, ILayerNode *_node) override
Definition MyGUI_LayerItem.cpp:88
MyGUI::LayerItem::setRenderItemTexture
void setRenderItemTexture(ITexture *_texture)
Definition MyGUI_LayerItem.cpp:59
MyGUI
Definition MyGUI_ActionController.h:15
MyGUI::VectorSubWidget
std::vector< ISubWidget * > VectorSubWidget
Definition MyGUI_ISubWidget.h:22