MyGUI  3.2.0
MyGUI_LayerManager.h
Go to the documentation of this file.
1 
6 /*
7  This file is part of MyGUI.
8 
9  MyGUI is free software: you can redistribute it and/or modify
10  it under the terms of the GNU Lesser General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  (at your option) any later version.
13 
14  MyGUI is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU Lesser General Public License for more details.
18 
19  You should have received a copy of the GNU Lesser General Public License
20  along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
21 */
22 #ifndef __MYGUI_LAYER_MANAGER_H__
23 #define __MYGUI_LAYER_MANAGER_H__
24 
25 #include "MyGUI_Prerequest.h"
26 #include "MyGUI_Singleton.h"
27 #include "MyGUI_Enumerator.h"
28 #include "MyGUI_XmlDocument.h"
29 #include "MyGUI_IUnlinkWidget.h"
30 #include "MyGUI_ResourceManager.h"
31 #include "MyGUI_ILayer.h"
33 
34 namespace MyGUI
35 {
36 
38  public Singleton<LayerManager>,
39  public IUnlinkWidget,
40  public MemberObsolete<LayerManager>
41  {
42  public:
43  typedef std::vector<ILayer*> VectorLayer;
45 
46  public:
47  LayerManager();
48 
49  void initialise();
50  void shutdown();
51 
56  void attachToLayerNode(const std::string& _name, Widget* _item);
60  void detachFromLayer(Widget* _item);
61 
65  void upLayerItem(Widget* _item);
66 
68  bool isExist(const std::string& _name) const;
70  EnumeratorLayer getEnumerator() const;
71 
73  ILayer* getByName(const std::string& _name, bool _throw = true) const;
74 
76  Widget* getWidgetFromPoint(int _left, int _top);
77 
79  void renderToTarget(IRenderTarget* _target, bool _update);
80 
81  void resizeView(const IntSize& _viewSize);
82 
83  private:
84  void _load(xml::ElementPtr _node, const std::string& _file, Version _version);
85  void _unlinkWidget(Widget* _widget);
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;
96  };
97 
98 } // namespace MyGUI
99 
100 #endif // __MYGUI_LAYER_MANAGER_H__
std::vector< ILayer * > VectorLayer
Enumerator< VectorLayer > EnumeratorLayer
#define MYGUI_EXPORT