MyGUI  3.2.1
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"
15 #include "MyGUI_ResourceManager.h"
16 #include "MyGUI_ILayer.h"
18 
19 namespace MyGUI
20 {
21 
23  public Singleton<LayerManager>,
24  public IUnlinkWidget,
25  public MemberObsolete<LayerManager>
26  {
27  public:
28  typedef std::vector<ILayer*> VectorLayer;
30 
31  public:
32  LayerManager();
33 
34  void initialise();
35  void shutdown();
36 
41  void attachToLayerNode(const std::string& _name, Widget* _item);
45  void detachFromLayer(Widget* _item);
46 
50  void upLayerItem(Widget* _item);
51 
53  bool isExist(const std::string& _name) const;
55  EnumeratorLayer getEnumerator() const;
56 
58  ILayer* getByName(const std::string& _name, bool _throw = true) const;
59 
60  size_t getLayerCount() const;
61 
62  ILayer* getLayer(size_t _index);
63 
65  Widget* getWidgetFromPoint(int _left, int _top);
66 
68  void renderToTarget(IRenderTarget* _target, bool _update);
69 
70  void resizeView(const IntSize& _viewSize);
71 
72  const std::string& getCategoryName() const;
73 
74  private:
75  void _load(xml::ElementPtr _node, const std::string& _file, Version _version);
76  void _unlinkWidget(Widget* _widget);
77 
78  void clear();
79 
80  void merge(VectorLayer& _layers);
81  void destroy(ILayer* _layer);
82 
83  private:
84  VectorLayer mLayerNodes;
85 
86  bool mIsInitialise;
87  std::string mCategoryName;
88  };
89 
90 } // namespace MyGUI
91 
92 #endif // __MYGUI_LAYER_MANAGER_H__