MyGUI 3.4.3
MyGUI_LayerManager.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_MANAGER_H_
8#define MYGUI_LAYER_MANAGER_H_
9
10#include "MyGUI_Prerequest.h"
11#include "MyGUI_Singleton.h"
12#include "MyGUI_Enumerator.h"
13#include "MyGUI_XmlDocument.h"
14#include "MyGUI_IUnlinkWidget.h"
16#include "MyGUI_ILayer.h"
18
19namespace MyGUI
20{
21
22 class MYGUI_EXPORT LayerManager : public IUnlinkWidget, public MemberObsolete<LayerManager>
23 {
25
26 public:
27 using VectorLayer = std::vector<ILayer*>;
29
30 public:
32
33 void initialise();
34 void shutdown();
35
40 void attachToLayerNode(std::string_view _name, Widget* _item);
44 void detachFromLayer(Widget* _item);
45
49 void upLayerItem(Widget* _item);
50
52 bool isExist(std::string_view _name) const;
54 EnumeratorLayer getEnumerator() const;
55
61 ILayer* createLayerAt(std::string_view _name, std::string_view _type, size_t _index);
62
64 ILayer* getByName(std::string_view _name, bool _throw = true) const;
65
66 size_t getLayerCount() const;
67
68 ILayer* getLayer(size_t _index) const;
69
71 Widget* getWidgetFromPoint(int _left, int _top) const;
72
74 void renderToTarget(IRenderTarget* _target, bool _update);
75
76 void resizeView(const IntSize& _viewSize);
77
78 const std::string& getCategoryName() const;
79
80 private:
81 void _load(xml::ElementPtr _node, std::string_view _file, Version _version);
82 void _unlinkWidget(Widget* _widget) override;
83
84 ILayer* _createLayerObject(std::string_view _type);
85
86 void clear();
87
88 void merge(VectorLayer& _layers);
89 void destroy(ILayer* _layer);
90
91 private:
92 VectorLayer mLayerNodes;
93
94 bool mIsInitialise{false};
95 std::string mCategoryName;
96 };
97
98} // namespace MyGUI
99
100#endif // MYGUI_LAYER_MANAGER_H_
#define MYGUI_EXPORT
#define MYGUI_SINGLETON_DECLARATION(ClassName)
std::vector< ILayer * > VectorLayer
widget description should be here.