MyGUI_SubWidgetManager.cpp
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)
*/
#include "MyGUI_Precompiled.h"
#include "MyGUI_SubWidgetManager.h"
#include "MyGUI_FactoryManager.h"
#include "MyGUI_CommonStateInfo.h"
#include "MyGUI_SubSkin.h"
#include "MyGUI_MainSkin.h"
#include "MyGUI_PolygonalSkin.h"
#include "MyGUI_RotatingSkin.h"
#include "MyGUI_SimpleText.h"
#include "MyGUI_EditText.h"
#include "MyGUI_TileRect.h"
namespace MyGUI
{
MYGUI_SINGLETON_DEFINITION(SubWidgetManager);
SubWidgetManager::SubWidgetManager() :
mCategoryName("BasisSkin"),
mStateCategoryName("BasisSkin/State"),
mSingletonHolder(this)
{
}
void SubWidgetManager::initialise()
{
MYGUI_ASSERT(!mIsInitialise, getClassTypeName() << " initialised twice");
MYGUI_LOG(Info, "* Initialise: " << getClassTypeName());
FactoryManager& factory = FactoryManager::getInstance();
factory.registerFactory<SubSkinStateInfo>(mStateCategoryName, "SubSkin");
factory.registerFactory<SubSkinStateInfo>(mStateCategoryName, "MainSkin");
factory.registerFactory<SubSkinStateInfo>(mStateCategoryName, "PolygonalSkin");
factory.registerFactory<RotatingSkinStateInfo>(mStateCategoryName, "RotatingSkin");
factory.registerFactory<TileRectStateInfo>(mStateCategoryName, "TileRect");
factory.registerFactory<EditTextStateInfo>(mStateCategoryName, "EditText");
factory.registerFactory<EditTextStateInfo>(mStateCategoryName, "SimpleText");
factory.registerFactory<SubSkin>(mCategoryName);
factory.registerFactory<MainSkin>(mCategoryName);
factory.registerFactory<PolygonalSkin>(mCategoryName);
factory.registerFactory<RotatingSkin>(mCategoryName);
factory.registerFactory<TileRect>(mCategoryName);
factory.registerFactory<EditText>(mCategoryName);
factory.registerFactory<SimpleText>(mCategoryName);
MYGUI_LOG(Info, getClassTypeName() << " successfully initialized");
mIsInitialise = true;
}
void SubWidgetManager::shutdown()
{
MYGUI_ASSERT(mIsInitialise, getClassTypeName() << " is not initialised");
MYGUI_LOG(Info, "* Shutdown: " << getClassTypeName());
FactoryManager& factory = FactoryManager::getInstance();
factory.unregisterFactory(mStateCategoryName, "SubSkin");
factory.unregisterFactory(mStateCategoryName, "MainSkin");
factory.unregisterFactory(mStateCategoryName, "PolygonalSkin");
factory.unregisterFactory(mStateCategoryName, "RotatingSkin");
factory.unregisterFactory(mStateCategoryName, "TileRect");
factory.unregisterFactory(mStateCategoryName, "EditText");
factory.unregisterFactory(mStateCategoryName, "SimpleText");
factory.unregisterFactory<SubSkin>(mCategoryName);
factory.unregisterFactory<MainSkin>(mCategoryName);
factory.unregisterFactory<PolygonalSkin>(mCategoryName);
factory.unregisterFactory<RotatingSkin>(mCategoryName);
factory.unregisterFactory<TileRect>(mCategoryName);
factory.unregisterFactory<EditText>(mCategoryName);
factory.unregisterFactory<SimpleText>(mCategoryName);
MYGUI_LOG(Info, getClassTypeName() << " successfully shutdown");
mIsInitialise = false;
}
const std::string& SubWidgetManager::getCategoryName() const
{
return mCategoryName;
}
const std::string& SubWidgetManager::getStateCategoryName() const
{
return mStateCategoryName;
}
} // namespace MyGUI
MyGUI_CommonStateInfo.h
MYGUI_ASSERT
#define MYGUI_ASSERT(exp, dest)
Definition MyGUI_Diagnostic.h:31
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:126
MyGUI_SubSkin.h
MyGUI_SubWidgetManager.h
MyGUI_TileRect.h
MyGUI::EditText
Definition MyGUI_EditText.h:26
MyGUI::EditTextStateInfo
Definition MyGUI_CommonStateInfo.h:165
MyGUI::FactoryManager
Definition MyGUI_FactoryManager.h:19
MyGUI::FactoryManager::registerFactory
void registerFactory(std::string_view _category, std::string_view _type, Delegate::IDelegate *_delegate)
Definition MyGUI_FactoryManager.cpp:39
MyGUI::FactoryManager::getInstance
static FactoryManager & getInstance()
MyGUI::FactoryManager::unregisterFactory
void unregisterFactory(std::string_view _category, std::string_view _type)
Definition MyGUI_FactoryManager.cpp:54
MyGUI::MainSkin
Definition MyGUI_MainSkin.h:17
MyGUI::PolygonalSkin
Definition MyGUI_PolygonalSkin.h:20
MyGUI::RotatingSkin
Definition MyGUI_RotatingSkin.h:19
MyGUI::RotatingSkinStateInfo
Definition MyGUI_CommonStateInfo.h:111
MyGUI::SimpleText
Definition MyGUI_SimpleText.h:20
MyGUI::SubSkin
Definition MyGUI_SubSkin.h:24
MyGUI::SubSkinStateInfo
Definition MyGUI_CommonStateInfo.h:20
MyGUI::SubWidgetManager
Definition MyGUI_SubWidgetManager.h:17
MyGUI::SubWidgetManager::getStateCategoryName
const std::string & getStateCategoryName() const
Definition MyGUI_SubWidgetManager.cpp:91
MyGUI::SubWidgetManager::SubWidgetManager
SubWidgetManager()
Definition MyGUI_SubWidgetManager.cpp:25
MyGUI::SubWidgetManager::initialise
void initialise()
Definition MyGUI_SubWidgetManager.cpp:32
MyGUI::SubWidgetManager::getClassTypeName
static std::string_view getClassTypeName()
MyGUI::SubWidgetManager::shutdown
void shutdown()
Definition MyGUI_SubWidgetManager.cpp:59
MyGUI::SubWidgetManager::getCategoryName
const std::string & getCategoryName() const
Definition MyGUI_SubWidgetManager.cpp:86
MyGUI::TileRect
Definition MyGUI_TileRect.h:23
MyGUI::TileRectStateInfo
Definition MyGUI_CommonStateInfo.h:50
MyGUI
Definition MyGUI_ActionController.h:15