25 mCategoryName(
"Controller"),
26 mSingletonHolder(this)
60 mIsInitialise =
false;
63 void ControllerManager::clear()
65 for (ListControllerItem::iterator iter = mListItem.begin(); iter != mListItem.end(); ++iter)
67 delete (*iter).second;
83 for (ListControllerItem::iterator iter = mListItem.begin(); iter != mListItem.end(); ++iter)
86 if ((*iter).first == _widget)
88 if ((*iter).second->getTypeName() == _item->
getTypeName())
90 delete (*iter).second;
91 (*iter).second = _item;
98 if (mListItem.empty())
102 mListItem.push_back(PairControllerItem(_widget, _item));
108 for (ListControllerItem::iterator iter = mListItem.begin(); iter != mListItem.end(); ++iter)
110 if ((*iter).first == _widget) (*iter).first =
nullptr;
114 void ControllerManager::_unlinkWidget(
Widget* _widget)
119 void ControllerManager::frameEntered(
float _time)
121 for (ListControllerItem::iterator iter = mListItem.begin(); iter != mListItem.end(); )
123 if (
nullptr == (*iter).first)
125 delete (*iter).second;
127 iter = mListItem.erase(iter);
131 if ((*iter).second->addTime((*iter).first, _time))
138 (*iter).first =
nullptr;
141 if (mListItem.empty())
147 return mCategoryName;
#define MYGUI_ASSERT(exp, dest)
#define MYGUI_LOG(level, text)
virtual const std::string & getTypeName() const override
virtual void prepareItem(Widget *_widget)=0
ControllerItem * createItem(const std::string &_type)
const std::string & getCategoryName() const
void removeItem(Widget *_widget)
static const char * getClassTypeName()
void addItem(Widget *_widget, ControllerItem *_item)
void unregisterFactory(const std::string &_category, const std::string &_type)
static FactoryManager & getInstance()
void registerFactory(const std::string &_category, const std::string &_type, Delegate::IDelegate *_delegate)
IObject * createObject(const std::string &_category, const std::string &_type)
static Gui & getInstance()
EventHandle_FrameEventDelegate eventFrameStart
Type * castType(bool _throw=true)
delegates::DelegateFunction< Args... > * newDelegate(void(*_func)(Args... args))
MYGUI_SINGLETON_DEFINITION(ClipboardManager)