MyGUI: MyGUI_WidgetManager.h Source File

MyGUI 3.4.3

MyGUI_WidgetManager.h
Go to the documentation of this file.
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_WIDGET_MANAGER_H_
8#define MYGUI_WIDGET_MANAGER_H_
9
10#include "MyGUI_Prerequest.h"
11#include "MyGUI_Singleton.h"
12#include "MyGUI_IUnlinkWidget.h"
13#include "MyGUI_ICroppedRectangle.h"
14#include "MyGUI_Widget.h"
15#include <set>
16#include "MyGUI_BackwardCompatibility.h"
17
18namespace MyGUI
19{
20 class MYGUI_EXPORT WidgetManager : public MemberObsolete<WidgetManager>
21 {
22 MYGUI_SINGLETON_DECLARATION(WidgetManager);
23
24 public:
25 WidgetManager();
26
27 void initialise();
28 void shutdown();
29
30 Widget* createWidget(
31 WidgetStyle _style,
32 std::string_view _type,
33 std::string_view _skin,
34 const IntCoord& _coord,
35 Widget* _parent,
36 ICroppedRectangle* _cropeedParent,
37 std::string_view _name);
38
40 void destroyWidget(Widget* _widget);
42 void destroyWidgets(const VectorWidgetPtr& _widgets);
44 void destroyWidgets(EnumeratorWidgetPtr _widgets);
45
47 void registerUnlinker(IUnlinkWidget* _unlink);
49 void unregisterUnlinker(IUnlinkWidget* _unlink);
51 void unlinkFromUnlinkers(Widget* _widget);
52
54 bool isFactoryExist(std::string_view _type);
55
56 /*internal:*/
57 void _deleteWidget(Widget* _widget);
58 void _deleteDelayWidgets();
59
60 const std::string& getCategoryName() const;
61
62 private:
63 void notifyEventFrameStart(float _time);
64
65 private:
66 bool mIsInitialise{false};
67 std::string mCategoryName;
68
69 // список менеджеров для отписки при удалении
70 VectorIUnlinkWidget mVectorIUnlinkWidget;
71
72 // список виджетов для удаления
73 VectorWidgetPtr mDestroyWidgets;
74 };
75
76} // namespace MyGUI
77
78#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