MyGUI 3.2.0

- Main Page
- Related Pages
- Namespaces
- Data Structures
- Files
- Examples

- File List
- Globals

MyGUI_SubWidgetManager.cpp
Go to the documentation of this file.
1
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 #include "MyGUI_Precompiled.h"
23 #include "MyGUI_SubWidgetManager.h"
24 #include "MyGUI_FactoryManager.h"
25 #include "MyGUI_CommonStateInfo.h"
26
27 #include "MyGUI_SubSkin.h"
28 #include "MyGUI_MainSkin.h"
29 #include "MyGUI_PolygonalSkin.h"
30 #include "MyGUI_RotatingSkin.h"
31 #include "MyGUI_SimpleText.h"
32 #include "MyGUI_EditText.h"
33 #include "MyGUI_TileRect.h"
34
35 namespace MyGUI
36 {
37
38 template <> SubWidgetManager* Singleton<SubWidgetManager>::msInstance = nullptr;
39 template <> const char* Singleton<SubWidgetManager>::mClassTypeName("SubWidgetManager");
40
41 SubWidgetManager::SubWidgetManager() :
42 mIsInitialise(false)
43 {
44 }
45
46 void SubWidgetManager::initialise()
47 {
48 MYGUI_ASSERT(!mIsInitialise, getClassTypeName() << " initialised twice");
49 MYGUI_LOG(Info, "* Initialise: " << getClassTypeName());
50
51 FactoryManager& factory = FactoryManager::getInstance();
52
53 factory.registerFactory<SubSkinStateInfo>("BasisSkin/State", "SubSkin");
54 factory.registerFactory<SubSkinStateInfo>("BasisSkin/State", "MainSkin");
55 factory.registerFactory<SubSkinStateInfo>("BasisSkin/State", "PolygonalSkin");
56 factory.registerFactory<SubSkinStateInfo>("BasisSkin/State", "RotatingSkin");
57 factory.registerFactory<TileRectStateInfo>("BasisSkin/State", "TileRect");
58 factory.registerFactory<EditTextStateInfo>("BasisSkin/State", "EditText");
59 factory.registerFactory<EditTextStateInfo>("BasisSkin/State", "SimpleText");
60
61 factory.registerFactory<SubSkin>("BasisSkin");
62 factory.registerFactory<MainSkin>("BasisSkin");
63 factory.registerFactory<PolygonalSkin>("BasisSkin");
64 factory.registerFactory<RotatingSkin>("BasisSkin");
65 factory.registerFactory<TileRect>("BasisSkin");
66 factory.registerFactory<EditText>("BasisSkin");
67 factory.registerFactory<SimpleText>("BasisSkin");
68
69 MYGUI_LOG(Info, getClassTypeName() << " successfully initialized");
70 mIsInitialise = true;
71 }
72
73 void SubWidgetManager::shutdown()
74 {
75 MYGUI_ASSERT(mIsInitialise, getClassTypeName() << " is not initialised");
76 MYGUI_LOG(Info, "* Shutdown: " << getClassTypeName());
77
78 FactoryManager& factory = FactoryManager::getInstance();
79
80 factory.unregisterFactory("BasisSkin/State", "SubSkin");
81 factory.unregisterFactory("BasisSkin/State", "MainSkin");
82 factory.unregisterFactory("BasisSkin/State", "PolygonalSkin");
83 factory.unregisterFactory("BasisSkin/State", "RotatingSkin");
84 factory.unregisterFactory("BasisSkin/State", "TileRect");
85 factory.unregisterFactory("BasisSkin/State", "EditText");
86 factory.unregisterFactory("BasisSkin/State", "SimpleText");
87
88 factory.unregisterFactory<SubSkin>("BasisSkin");
89 factory.unregisterFactory<MainSkin>("BasisSkin");
90 factory.unregisterFactory<PolygonalSkin>("BasisSkin");
91 factory.unregisterFactory<RotatingSkin>("BasisSkin");
92 factory.unregisterFactory<TileRect>("BasisSkin");
93 factory.unregisterFactory<EditText>("BasisSkin");
94 factory.unregisterFactory<SimpleText>("BasisSkin");
95
96 MYGUI_LOG(Info, getClassTypeName() << " successfully shutdown");
97 mIsInitialise = false;
98 }
99
100 } // namespace MyGUI
MyGUI::RotatingSkin
Definition: MyGUI_RotatingSkin.h:33
MyGUI_FactoryManager.h
MyGUI::SimpleText
Definition: MyGUI_SimpleText.h:34
MyGUI::SubSkin
Definition: MyGUI_SubSkin.h:38
MyGUI_Precompiled.h
MyGUI_SimpleText.h
MyGUI::Singleton< FactoryManager >::getInstance
static FactoryManager & getInstance()
Definition: MyGUI_Singleton.h:53
MyGUI::SubWidgetManager::shutdown
void shutdown()
Definition: MyGUI_SubWidgetManager.cpp:73
MyGUI::Singleton< SubWidgetManager >::getClassTypeName
static const char * getClassTypeName()
Definition: MyGUI_Singleton.h:64
MyGUI_MainSkin.h
MyGUI_TileRect.h
MyGUI_SubWidgetManager.h
MyGUI::SubWidgetManager::SubWidgetManager
SubWidgetManager()
Definition: MyGUI_SubWidgetManager.cpp:41
MyGUI::FactoryManager
Definition: MyGUI_FactoryManager.h:33
MYGUI_LOG
#define MYGUI_LOG(level, text)
Definition: MyGUI_Diagnostic.h:38
MyGUI::MainSkin
Definition: MyGUI_MainSkin.h:31
MyGUI_PolygonalSkin.h
MyGUI::EditTextStateInfo
Definition: MyGUI_CommonStateInfo.h:134
MyGUI_CommonStateInfo.h
MYGUI_ASSERT
#define MYGUI_ASSERT(exp, dest)
Definition: MyGUI_Diagnostic.h:58
MyGUI::PolygonalSkin
Definition: MyGUI_PolygonalSkin.h:33
MyGUI::TileRect
Definition: MyGUI_TileRect.h:37
MyGUI::TileRectStateInfo
Definition: MyGUI_CommonStateInfo.h:67
MyGUI::SubSkinStateInfo
Definition: MyGUI_CommonStateInfo.h:34
MyGUI::FactoryManager::unregisterFactory
void unregisterFactory(const std::string &_category, const std::string &_type)
Definition: MyGUI_FactoryManager.cpp:61
MyGUI::FactoryManager::registerFactory
void registerFactory(const std::string &_category, const std::string &_type, Delegate::IDelegate *_delegate)
Definition: MyGUI_FactoryManager.cpp:55
MyGUI_EditText.h
MyGUI::SubWidgetManager::initialise
void initialise()
Definition: MyGUI_SubWidgetManager.cpp:46
MyGUI::Singleton::mClassTypeName
static const char * mClassTypeName
Definition: MyGUI_Singleton.h:73
MyGUI_SubSkin.h
MyGUI::EditText
Definition: MyGUI_EditText.h:40
MyGUI_RotatingSkin.h