MyGUI_WidgetManager.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_WIDGET_MANAGER_H_
#define MYGUI_WIDGET_MANAGER_H_
#include "MyGUI_Prerequest.h"
#include "MyGUI_Singleton.h"
#include "MyGUI_IUnlinkWidget.h"
#include "MyGUI_ICroppedRectangle.h"
#include "MyGUI_Widget.h"
#include <set>
#include "MyGUI_BackwardCompatibility.h"
namespace MyGUI
{
class MYGUI_EXPORT WidgetManager : public MemberObsolete<WidgetManager>
{
MYGUI_SINGLETON_DECLARATION(WidgetManager);
public:
WidgetManager();
void initialise();
void shutdown();
Widget* createWidget(
WidgetStyle _style,
std::string_view _type,
std::string_view _skin,
const IntCoord& _coord,
Widget* _parent,
ICroppedRectangle* _cropeedParent,
std::string_view _name);
void destroyWidget(Widget* _widget);
void destroyWidgets(const VectorWidgetPtr& _widgets);
void destroyWidgets(EnumeratorWidgetPtr _widgets);
void registerUnlinker(IUnlinkWidget* _unlink);
void unregisterUnlinker(IUnlinkWidget* _unlink);
void unlinkFromUnlinkers(Widget* _widget);
bool isFactoryExist(std::string_view _type);
/*internal:*/
void _deleteWidget(Widget* _widget);
void _deleteDelayWidgets();
const std::string& getCategoryName() const;
private:
void notifyEventFrameStart(float _time);
private:
bool mIsInitialise{false};
std::string mCategoryName;
// список менеджеров для отписки при удалении
VectorIUnlinkWidget mVectorIUnlinkWidget;
// список виджетов для удаления
VectorWidgetPtr mDestroyWidgets;
};
} // namespace MyGUI
#endif // MYGUI_WIDGET_MANAGER_H_
MyGUI_BackwardCompatibility.h
MyGUI_ICroppedRectangle.h
MyGUI_IUnlinkWidget.h
MYGUI_EXPORT
#define MYGUI_EXPORT
Definition MyGUI_Platform.h:77
MyGUI_Prerequest.h
MyGUI_Singleton.h
MYGUI_SINGLETON_DECLARATION
#define MYGUI_SINGLETON_DECLARATION(ClassName)
Definition MyGUI_Singleton.h:112
MyGUI_Widget.h
MyGUI::ICroppedRectangle
Definition MyGUI_ICroppedRectangle.h:17
MyGUI::IUnlinkWidget
Definition MyGUI_IUnlinkWidget.h:17
MyGUI::MemberObsolete
Definition MyGUI_DeprecatedTypes.h:14
MyGUI::Widget
widget description should be here.
Definition MyGUI_Widget.h:40
MyGUI::WidgetManager::unregisterUnlinker
void unregisterUnlinker(IUnlinkWidget *_unlink)
Definition MyGUI_WidgetManager.cpp:144
MyGUI::WidgetManager::getCategoryName
const std::string & getCategoryName() const
Definition MyGUI_WidgetManager.cpp:194
MyGUI::WidgetManager::WidgetManager
WidgetManager(const WidgetManager &)=delete
MyGUI::WidgetManager::createWidget
Widget * createWidget(WidgetStyle _style, std::string_view _type, std::string_view _skin, const IntCoord &_coord, Widget *_parent, ICroppedRectangle *_cropeedParent, std::string_view _name)
Definition MyGUI_WidgetManager.cpp:102
MyGUI::WidgetManager::shutdown
void shutdown()
Definition MyGUI_WidgetManager.cpp:86
MyGUI::WidgetManager::initialise
void initialise()
Definition MyGUI_WidgetManager.cpp:48
MyGUI::WidgetManager::isFactoryExist
bool isFactoryExist(std::string_view _type)
Definition MyGUI_WidgetManager.cpp:160
MyGUI::WidgetManager::destroyWidgets
void destroyWidgets(const VectorWidgetPtr &_widgets)
Definition MyGUI_WidgetManager.cpp:128
MyGUI::WidgetManager::_deleteWidget
void _deleteWidget(Widget *_widget)
Definition MyGUI_WidgetManager.cpp:170
MyGUI::WidgetManager::_deleteDelayWidgets
void _deleteDelayWidgets()
Definition MyGUI_WidgetManager.cpp:184
MyGUI::WidgetManager::unlinkFromUnlinkers
void unlinkFromUnlinkers(Widget *_widget)
Definition MyGUI_WidgetManager.cpp:152
MyGUI::WidgetManager::registerUnlinker
void registerUnlinker(IUnlinkWidget *_unlink)
Definition MyGUI_WidgetManager.cpp:138
MyGUI::WidgetManager::destroyWidget
void destroyWidget(Widget *_widget)
Definition MyGUI_WidgetManager.cpp:123
MyGUI
Definition MyGUI_ActionController.h:15
MyGUI::EnumeratorWidgetPtr
Enumerator< VectorWidgetPtr > EnumeratorWidgetPtr
Definition MyGUI_WidgetDefines.h:22
MyGUI::VectorIUnlinkWidget
std::vector< IUnlinkWidget * > VectorIUnlinkWidget
Definition MyGUI_IUnlinkWidget.h:23
MyGUI::IntCoord
types::TCoord< int > IntCoord
Definition MyGUI_Types.h:36
MyGUI::VectorWidgetPtr
std::vector< Widget * > VectorWidgetPtr
Definition MyGUI_WidgetDefines.h:20
MyGUI::WidgetStyle
Definition MyGUI_WidgetStyle.h:19