~ubuntu-branches/ubuntu/vivid/mygui/vivid

« back to all changes in this revision

Viewing changes to MyGUIEngine/include/MyGUI_LayerNode.h

  • Committer: Package Import Robot
  • Author(s): Scott Howard, Bret Curtis, Scott Howard
  • Date: 2014-09-18 17:57:48 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20140918175748-dd8va78mvpw1jbes
Tags: 3.2.1-1
[ Bret Curtis ]
* Updated license for majority of files from LGPL to Expat (MIT)

[ Scott Howard ]
* New upstream release
* Updated patch to add build option for system GLEW libraries
* All patches accepted upstream except shared_libraries.patch
* Bumped SONAME due to dropped symbols, updated *.symbols and package
  names
* Updated license of debian/* to Expat with permission of all authors
* Don't install Doxygen autogenerated md5 and map files (thanks
  lintian)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*!
2
 
        @file
3
 
        @author         Albert Semenov
4
 
        @date           02/2008
5
 
*/
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_NODE_H__
23
 
#define __MYGUI_LAYER_NODE_H__
24
 
 
25
 
#include "MyGUI_Prerequest.h"
26
 
#include "MyGUI_ILayer.h"
27
 
#include "MyGUI_ILayerNode.h"
28
 
#include "MyGUI_RenderItem.h"
29
 
 
30
 
namespace MyGUI
31
 
{
32
 
 
33
 
        class LayerItem;
34
 
        typedef std::vector<RenderItem*> VectorRenderItem;
35
 
        typedef std::vector<ILayerItem*> VectorLayerItem;
36
 
 
37
 
        class MYGUI_EXPORT LayerNode :
38
 
                public ILayerNode
39
 
        {
40
 
                MYGUI_RTTI_DERIVED( LayerNode )
41
 
 
42
 
        public:
43
 
                explicit LayerNode(ILayer* _layer, ILayerNode* _parent = nullptr);
44
 
                virtual ~LayerNode();
45
 
 
46
 
                // леер, которому мы принадлежим
47
 
                virtual ILayer* getLayer() const;
48
 
 
49
 
                // возвращает отца или nullptr
50
 
                virtual ILayerNode* getParent() const;
51
 
 
52
 
                // создаем дочерний нод
53
 
                virtual ILayerNode* createChildItemNode();
54
 
                // удаляем дочерний нод
55
 
                virtual void destroyChildItemNode(ILayerNode* _node);
56
 
 
57
 
                // поднимаем дочерний нод
58
 
                virtual void upChildItemNode(ILayerNode* _node);
59
 
 
60
 
                // список детей
61
 
                virtual EnumeratorILayerNode getEnumerator() const;
62
 
 
63
 
                // добавляем айтем к ноду
64
 
                virtual void attachLayerItem(ILayerItem* _item);
65
 
                // удаляем айтем из нода
66
 
                virtual void detachLayerItem(ILayerItem* _item);
67
 
 
68
 
                // добавляет саб айтем и возвращает рендер айтем
69
 
                virtual RenderItem* addToRenderItem(ITexture* _texture, bool _firstQueue, bool _manualRender);
70
 
                // необходимо обновление нода
71
 
                virtual void outOfDate(RenderItem* _item);
72
 
 
73
 
                // возвращает виджет по позиции
74
 
                virtual ILayerItem* getLayerItemByPoint(int _left, int _top) const;
75
 
 
76
 
                // рисует леер
77
 
                virtual void renderToTarget(IRenderTarget* _target, bool _update);
78
 
 
79
 
                virtual void resizeView(const IntSize& _viewSize);
80
 
 
81
 
                bool isOutOfDate() const;
82
 
 
83
 
        protected:
84
 
                void updateCompression();
85
 
 
86
 
        protected:
87
 
                // список двух очередей отрисовки, для сабскинов и текста
88
 
                VectorRenderItem mFirstRenderItems;
89
 
                VectorRenderItem mSecondRenderItems;
90
 
 
91
 
                // список всех рутовых виджетов
92
 
                // у перекрывающегося слоя здесь только один
93
 
                VectorLayerItem mLayerItems;
94
 
 
95
 
                // список такиж как мы, для построения дерева
96
 
                VectorILayerNode mChildItems;
97
 
 
98
 
                ILayerNode* mParent;
99
 
                ILayer* mLayer;
100
 
                bool mOutOfDate;
101
 
        };
102
 
 
103
 
} // namespace MyGUI
104
 
 
105
 
#endif // __MYGUI_LAYER_NODE_H__
 
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_NODE_H__
 
8
#define __MYGUI_LAYER_NODE_H__
 
9
 
 
10
#include "MyGUI_Prerequest.h"
 
11
#include "MyGUI_ILayer.h"
 
12
#include "MyGUI_ILayerNode.h"
 
13
#include "MyGUI_RenderItem.h"
 
14
 
 
15
namespace MyGUI
 
16
{
 
17
 
 
18
        class LayerItem;
 
19
        typedef std::vector<RenderItem*> VectorRenderItem;
 
20
        typedef std::vector<ILayerItem*> VectorLayerItem;
 
21
 
 
22
        class MYGUI_EXPORT LayerNode :
 
23
                public ILayerNode
 
24
        {
 
25
                MYGUI_RTTI_DERIVED( LayerNode )
 
26
 
 
27
        public:
 
28
                explicit LayerNode(ILayer* _layer, ILayerNode* _parent = nullptr);
 
29
                virtual ~LayerNode();
 
30
 
 
31
                // леер, которому мы принадлежим
 
32
                virtual ILayer* getLayer() const;
 
33
 
 
34
                // возвращает отца или nullptr
 
35
                virtual ILayerNode* getParent() const;
 
36
 
 
37
                // создаем дочерний нод
 
38
                virtual ILayerNode* createChildItemNode();
 
39
                // удаляем дочерний нод
 
40
                virtual void destroyChildItemNode(ILayerNode* _node);
 
41
 
 
42
                // поднимаем дочерний нод
 
43
                virtual void upChildItemNode(ILayerNode* _node);
 
44
 
 
45
                // список детей
 
46
                virtual EnumeratorILayerNode getEnumerator() const;
 
47
 
 
48
                virtual size_t getLayerNodeCount() const;
 
49
 
 
50
                virtual ILayerNode* getLayerNodeAt(size_t _index) const;
 
51
 
 
52
                // добавляем айтем к ноду
 
53
                virtual void attachLayerItem(ILayerItem* _item);
 
54
                // удаляем айтем из нода
 
55
                virtual void detachLayerItem(ILayerItem* _item);
 
56
 
 
57
                // добавляет саб айтем и возвращает рендер айтем
 
58
                virtual RenderItem* addToRenderItem(ITexture* _texture, bool _firstQueue, bool _manualRender);
 
59
                // необходимо обновление нода
 
60
                virtual void outOfDate(RenderItem* _item);
 
61
 
 
62
                // возвращает виджет по позиции
 
63
                virtual ILayerItem* getLayerItemByPoint(int _left, int _top) const;
 
64
 
 
65
                // рисует леер
 
66
                virtual void renderToTarget(IRenderTarget* _target, bool _update);
 
67
 
 
68
                virtual void resizeView(const IntSize& _viewSize);
 
69
 
 
70
                virtual float getNodeDepth();
 
71
 
 
72
                bool isOutOfDate() const;
 
73
 
 
74
        protected:
 
75
                void updateCompression();
 
76
 
 
77
        protected:
 
78
                // список двух очередей отрисовки, для сабскинов и текста
 
79
                VectorRenderItem mFirstRenderItems;
 
80
                VectorRenderItem mSecondRenderItems;
 
81
 
 
82
                // список всех рутовых виджетов
 
83
                // у перекрывающегося слоя здесь только один
 
84
                VectorLayerItem mLayerItems;
 
85
 
 
86
                // список такиж как мы, для построения дерева
 
87
                VectorILayerNode mChildItems;
 
88
 
 
89
                ILayerNode* mParent;
 
90
                ILayer* mLayer;
 
91
                bool mOutOfDate;
 
92
                float mDepth;
 
93
        };
 
94
 
 
95
} // namespace MyGUI
 
96
 
 
97
#endif // __MYGUI_LAYER_NODE_H__