MyGUI: MyGUI_SubWidgetManager.cpp Source File

MyGUI 3.4.2

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

- File List
- Globals

MyGUI_SubWidgetManager.cpp
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#include "MyGUI_Precompiled.h"
8#include "MyGUI_SubWidgetManager.h"
9#include "MyGUI_FactoryManager.h"
10#include "MyGUI_CommonStateInfo.h"
11
12#include "MyGUI_SubSkin.h"
13#include "MyGUI_MainSkin.h"
14#include "MyGUI_PolygonalSkin.h"
15#include "MyGUI_RotatingSkin.h"
16#include "MyGUI_SimpleText.h"
17#include "MyGUI_EditText.h"
18#include "MyGUI_TileRect.h"
19
20namespace MyGUI
21{
22
23 MYGUI_SINGLETON_DEFINITION(SubWidgetManager);
24
25 SubWidgetManager::SubWidgetManager() :
26 mIsInitialise(false),
27 mCategoryName("BasisSkin"),
28 mStateCategoryName("BasisSkin/State"),
29 mSingletonHolder(this)
30 {
31 }
32
33 void SubWidgetManager::initialise()
34 {
35 MYGUI_ASSERT(!mIsInitialise, getClassTypeName() << " initialised twice");
36 MYGUI_LOG(Info, "* Initialise: " << getClassTypeName());
37
38 FactoryManager& factory = FactoryManager::getInstance();
39
40 factory.registerFactory<SubSkinStateInfo>(mStateCategoryName, "SubSkin");
41 factory.registerFactory<SubSkinStateInfo>(mStateCategoryName, "MainSkin");
42 factory.registerFactory<SubSkinStateInfo>(mStateCategoryName, "PolygonalSkin");
43 factory.registerFactory<RotatingSkinStateInfo>(mStateCategoryName, "RotatingSkin");
44 factory.registerFactory<TileRectStateInfo>(mStateCategoryName, "TileRect");
45 factory.registerFactory<EditTextStateInfo>(mStateCategoryName, "EditText");
46 factory.registerFactory<EditTextStateInfo>(mStateCategoryName, "SimpleText");
47
48 factory.registerFactory<SubSkin>(mCategoryName);
49 factory.registerFactory<MainSkin>(mCategoryName);
50 factory.registerFactory<PolygonalSkin>(mCategoryName);
51 factory.registerFactory<RotatingSkin>(mCategoryName);
52 factory.registerFactory<TileRect>(mCategoryName);
53 factory.registerFactory<EditText>(mCategoryName);
54 factory.registerFactory<SimpleText>(mCategoryName);
55
56 MYGUI_LOG(Info, getClassTypeName() << " successfully initialized");
57 mIsInitialise = true;
58 }
59
60 void SubWidgetManager::shutdown()
61 {
62 MYGUI_ASSERT(mIsInitialise, getClassTypeName() << " is not initialised");
63 MYGUI_LOG(Info, "* Shutdown: " << getClassTypeName());
64
65 FactoryManager& factory = FactoryManager::getInstance();
66
67 factory.unregisterFactory(mStateCategoryName, "SubSkin");
68 factory.unregisterFactory(mStateCategoryName, "MainSkin");
69 factory.unregisterFactory(mStateCategoryName, "PolygonalSkin");
70 factory.unregisterFactory(mStateCategoryName, "RotatingSkin");
71 factory.unregisterFactory(mStateCategoryName, "TileRect");
72 factory.unregisterFactory(mStateCategoryName, "EditText");
73 factory.unregisterFactory(mStateCategoryName, "SimpleText");
74
75 factory.unregisterFactory<SubSkin>(mCategoryName);
76 factory.unregisterFactory<MainSkin>(mCategoryName);
77 factory.unregisterFactory<PolygonalSkin>(mCategoryName);
78 factory.unregisterFactory<RotatingSkin>(mCategoryName);
79 factory.unregisterFactory<TileRect>(mCategoryName);
80 factory.unregisterFactory<EditText>(mCategoryName);
81 factory.unregisterFactory<SimpleText>(mCategoryName);
82
83 MYGUI_LOG(Info, getClassTypeName() << " successfully shutdown");
84 mIsInitialise = false;
85 }
86
87 const std::string& SubWidgetManager::getCategoryName() const
88 {
89 return mCategoryName;
90 }
91
92 const std::string& SubWidgetManager::getStateCategoryName() const
93 {
94 return mStateCategoryName;
95 }
96
97} // namespace MyGUI
MyGUI_CommonStateInfo.h
MYGUI_ASSERT
#define MYGUI_ASSERT(exp, dest)
Definition MyGUI_Diagnostic.h:29
MYGUI_LOG
#define MYGUI_LOG(level, text)
Definition MyGUI_Diagnostic.h:17
MyGUI_EditText.h
MyGUI_FactoryManager.h
MyGUI_MainSkin.h
MyGUI_PolygonalSkin.h
MyGUI_Precompiled.h
MyGUI_RotatingSkin.h
MyGUI_SimpleText.h
MYGUI_SINGLETON_DEFINITION
#define MYGUI_SINGLETON_DEFINITION(ClassName)
Definition MyGUI_Singleton.h:123
MyGUI_SubSkin.h
MyGUI_SubWidgetManager.h
MyGUI_TileRect.h
MyGUI::EditText
Definition MyGUI_EditText.h:27
MyGUI::EditTextStateInfo
Definition MyGUI_CommonStateInfo.h:175
MyGUI::FactoryManager
Definition MyGUI_FactoryManager.h:19
MyGUI::FactoryManager::unregisterFactory
void unregisterFactory(const std::string &_category, const std::string &_type)
Definition MyGUI_FactoryManager.cpp:46
MyGUI::FactoryManager::getInstance
static FactoryManager & getInstance()
MyGUI::FactoryManager::registerFactory
void registerFactory(const std::string &_category, const std::string &_type, Delegate::IDelegate *_delegate)
Definition MyGUI_FactoryManager.cpp:40
MyGUI::MainSkin
Definition MyGUI_MainSkin.h:18
MyGUI::PolygonalSkin
Definition MyGUI_PolygonalSkin.h:20
MyGUI::RotatingSkin
Definition MyGUI_RotatingSkin.h:20
MyGUI::RotatingSkinStateInfo
Definition MyGUI_CommonStateInfo.h:117
MyGUI::SimpleText
Definition MyGUI_SimpleText.h:21
MyGUI::SubSkin
Definition MyGUI_SubSkin.h:25
MyGUI::SubSkinStateInfo
Definition MyGUI_CommonStateInfo.h:21
MyGUI::SubWidgetManager
Definition MyGUI_SubWidgetManager.h:17
MyGUI::SubWidgetManager::getStateCategoryName
const std::string & getStateCategoryName() const
Definition MyGUI_SubWidgetManager.cpp:92
MyGUI::SubWidgetManager::SubWidgetManager
SubWidgetManager()
Definition MyGUI_SubWidgetManager.cpp:25
MyGUI::SubWidgetManager::initialise
void initialise()
Definition MyGUI_SubWidgetManager.cpp:33
MyGUI::SubWidgetManager::getClassTypeName
static const char * getClassTypeName()
MyGUI::SubWidgetManager::shutdown
void shutdown()
Definition MyGUI_SubWidgetManager.cpp:60
MyGUI::SubWidgetManager::getCategoryName
const std::string & getCategoryName() const
Definition MyGUI_SubWidgetManager.cpp:87
MyGUI::TileRect
Definition MyGUI_TileRect.h:24
MyGUI::TileRectStateInfo
Definition MyGUI_CommonStateInfo.h:52
MyGUI
Definition MyGUI_ActionController.h:15