MyGUI 3.5.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_XmlDocument.h"
13#include "MyGUI_IUnlinkWidget.h"
15#include "MyGUI_ILayer.h"
17
18namespace MyGUI
19{
20
21 class MYGUI_EXPORT LayerManager : public IUnlinkWidget, public MemberObsolete<LayerManager>
22 {
23 MYGUI_SINGLETON_DECLARATION(LayerManager);
24
25 public:
26 using VectorLayer = std::vector<ILayer*>;
27
28 public:
29 LayerManager();
30
31 void initialise();
32 void shutdown();
33
38 void attachToLayerNode(std::string_view _name, Widget* _item);
42 void detachFromLayer(Widget* _item);
43
47 void upLayerItem(Widget* _item);
48
50 bool isExist(std::string_view _name) const;
52 const VectorLayer& getLayers() const;
53
59 ILayer* createLayerAt(std::string_view _name, std::string_view _type, size_t _index);
60
62 void destroyLayer(std::string_view _name);
63
65 ILayer* getByName(std::string_view _name, bool _throw = true) const;
66
67 size_t getLayerCount() const;
68
69 ILayer* getLayer(size_t _index) const;
70
72 Widget* getWidgetFromPoint(int _left, int _top) const;
73
75 void renderToTarget(IRenderTarget* _target, bool _update);
76
77 void resizeView(const IntSize& _viewSize);
78
79 const std::string& getCategoryName() const;
80
81 private:
82 void _load(xml::ElementPtr _node, std::string_view _file, Version _version);
83 void _unlinkWidget(Widget* _widget) override;
84
85 ILayer* _createLayerObject(std::string_view _type);
86
87 void clear();
88
89 void merge(VectorLayer& _layers);
90 void destroy(ILayer* _layer);
91
92 private:
93 VectorLayer mLayerNodes;
94
95 bool mIsInitialise{false};
96 std::string mCategoryName;
97 };
98
99} // namespace MyGUI
100
101#endif // MYGUI_LAYER_MANAGER_H_
#define MYGUI_EXPORT
#define MYGUI_SINGLETON_DECLARATION(ClassName)