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_SHARED_LAYER_H_
8 #define MYGUI_SHARED_LAYER_H_
9 
10 #include "MyGUI_Prerequest.h"
11 #include "MyGUI_Types.h"
12 #include "MyGUI_ILayer.h"
13 #include "MyGUI_SharedLayerNode.h"
14 
15 namespace MyGUI
16 {
17 
18 	class MYGUI_EXPORT SharedLayer :
19 		public ILayer
20 	{
21 		MYGUI_RTTI_DERIVED( SharedLayer )
22 
23 	public:
24 		SharedLayer();
25 		~SharedLayer() override;
26 
27 		void deserialization(xml::ElementPtr _node, Version _version) override;
28 
29 		void setPick(bool _pick);
30 
31 		ILayerNode* createChildItemNode() override;
32 		void destroyChildItemNode(ILayerNode* _node) override;
33 
34 		// up child item (make it draw and pick above other)
35 		void upChildItemNode(ILayerNode* _node) override;
36 
37 		// child items list
38 		EnumeratorILayerNode getEnumerator() const override;
39 
40 		size_t getLayerNodeCount() const override;
41 
42 		ILayerNode* getLayerNodeAt(size_t _index) const override;
43 
44 		// return widget at position
45 		ILayerItem* getLayerItemByPoint(int _left, int _top) const override;
46 
47 		// return position in layer coordinates
48 		IntPoint getPosition(int _left, int _top) const override;
49 
50 		// return layer size
51 		const IntSize& getSize() const override;
52 
53 		// render layer
54 		void renderToTarget(IRenderTarget* _target, bool _update) override;
55 
56 		void resizeView(const IntSize& _viewSize) override;
57 
58 		bool isOutOfDate() const;
59 
60 	protected:
61 		bool mIsPick;
62 		SharedLayerNode* mChildItem;
63 		bool mOutOfDate;
64 		IntSize mViewSize;
65 	};
66 
67 } // namespace MyGUI
68 
69 #endif // MYGUI_SHARED_LAYER_H_
70