MyGUI_LayerManager.h
Go to the documentation of this file.
/*
* This source file is part of MyGUI. For the latest info, see http://mygui.info/
* Distributed under the MIT License
* (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
*/
#ifndef MYGUI_LAYER_MANAGER_H_
#define MYGUI_LAYER_MANAGER_H_
#include "MyGUI_Prerequest.h"
#include "MyGUI_Singleton.h"
#include "MyGUI_Enumerator.h"
#include "MyGUI_XmlDocument.h"
#include "MyGUI_IUnlinkWidget.h"
#include "MyGUI_ResourceManager.h"
#include "MyGUI_ILayer.h"
#include "MyGUI_BackwardCompatibility.h"
namespace MyGUI
{
class MYGUI_EXPORT LayerManager : public IUnlinkWidget, public MemberObsolete<LayerManager>
{
MYGUI_SINGLETON_DECLARATION(LayerManager);
public:
using VectorLayer = std::vector<ILayer*>;
using EnumeratorLayer = Enumerator<VectorLayer>;
public:
LayerManager();
void initialise();
void shutdown();
void attachToLayerNode(std::string_view _name, Widget* _item);
void detachFromLayer(Widget* _item);
void upLayerItem(Widget* _item);
bool isExist(std::string_view _name) const;
EnumeratorLayer getEnumerator() const;
ILayer* createLayerAt(std::string_view _name, std::string_view _type, size_t _index);
ILayer* getByName(std::string_view _name, bool _throw = true) const;
size_t getLayerCount() const;
ILayer* getLayer(size_t _index) const;
Widget* getWidgetFromPoint(int _left, int _top) const;
void renderToTarget(IRenderTarget* _target, bool _update);
void resizeView(const IntSize& _viewSize);
const std::string& getCategoryName() const;
private:
void _load(xml::ElementPtr _node, std::string_view _file, Version _version);
void _unlinkWidget(Widget* _widget) override;
ILayer* _createLayerObject(std::string_view _type);
void clear();
void merge(VectorLayer& _layers);
void destroy(ILayer* _layer);
private:
VectorLayer mLayerNodes;
bool mIsInitialise{false};
std::string mCategoryName;
};
} // namespace MyGUI
#endif // MYGUI_LAYER_MANAGER_H_
MyGUI_BackwardCompatibility.h
MyGUI_Enumerator.h
MyGUI_ILayer.h
MyGUI_IUnlinkWidget.h
MYGUI_EXPORT
#define MYGUI_EXPORT
Definition MyGUI_Platform.h:77
MyGUI_Prerequest.h
MyGUI_ResourceManager.h
MyGUI_Singleton.h
MYGUI_SINGLETON_DECLARATION
#define MYGUI_SINGLETON_DECLARATION(ClassName)
Definition MyGUI_Singleton.h:112
MyGUI_XmlDocument.h
MyGUI::Enumerator
Definition MyGUI_Enumerator.h:49
MyGUI::ILayer
Definition MyGUI_ILayer.h:22
MyGUI::IRenderTarget
Definition MyGUI_IRenderTarget.h:21
MyGUI::IUnlinkWidget
Definition MyGUI_IUnlinkWidget.h:17
MyGUI::LayerManager::detachFromLayer
void detachFromLayer(Widget *_item)
Definition MyGUI_LayerManager.cpp:145
MyGUI::LayerManager::upLayerItem
void upLayerItem(Widget *_item)
Definition MyGUI_LayerManager.cpp:151
MyGUI::LayerManager::getLayer
ILayer * getLayer(size_t _index) const
Definition MyGUI_LayerManager.cpp:259
MyGUI::LayerManager::getCategoryName
const std::string & getCategoryName() const
Definition MyGUI_LayerManager.cpp:265
MyGUI::LayerManager::LayerManager
LayerManager(const LayerManager &)=delete
MyGUI::LayerManager::getEnumerator
EnumeratorLayer getEnumerator() const
Definition MyGUI_LayerManager.cpp:243
MyGUI::LayerManager::getLayerCount
size_t getLayerCount() const
Definition MyGUI_LayerManager.cpp:254
MyGUI::LayerManager::createLayerAt
ILayer * createLayerAt(std::string_view _name, std::string_view _type, size_t _index)
Definition MyGUI_LayerManager.cpp:193
MyGUI::LayerManager::renderToTarget
void renderToTarget(IRenderTarget *_target, bool _update)
Definition MyGUI_LayerManager.cpp:224
MyGUI::LayerManager::shutdown
void shutdown()
Definition MyGUI_LayerManager.cpp:44
MyGUI::LayerManager::VectorLayer
std::vector< ILayer * > VectorLayer
Definition MyGUI_LayerManager.h:27
MyGUI::LayerManager::getByName
ILayer * getByName(std::string_view _name, bool _throw=true) const
Definition MyGUI_LayerManager.cpp:232
MyGUI::LayerManager::resizeView
void resizeView(const IntSize &_viewSize)
Definition MyGUI_LayerManager.cpp:248
MyGUI::LayerManager::attachToLayerNode
void attachToLayerNode(std::string_view _name, Widget *_item)
Definition MyGUI_LayerManager.cpp:122
MyGUI::LayerManager::getWidgetFromPoint
Widget * getWidgetFromPoint(int _left, int _top) const
Definition MyGUI_LayerManager.cpp:211
MyGUI::LayerManager::initialise
void initialise()
Definition MyGUI_LayerManager.cpp:29
MyGUI::LayerManager::EnumeratorLayer
Enumerator< VectorLayer > EnumeratorLayer
Definition MyGUI_LayerManager.h:28
MyGUI::LayerManager::isExist
bool isExist(std::string_view _name) const
Definition MyGUI_LayerManager.cpp:157
MyGUI::MemberObsolete
Definition MyGUI_DeprecatedTypes.h:14
MyGUI::Version
Definition MyGUI_Version.h:18
MyGUI::Widget
widget description should be here.
Definition MyGUI_Widget.h:40
MyGUI::xml::ElementPtr
Element * ElementPtr
Definition MyGUI_XmlDocument.h:112
MyGUI
Definition MyGUI_ActionController.h:15
MyGUI::IntSize
types::TSize< int > IntSize
Definition MyGUI_Types.h:30