18 #define YUILogComponent "ew"
22 #include "YUILoader.h"
23 #include "YUIException.h"
24 #include "YExternalWidgets.h"
25 #include "YExternalWidgetFactory.h"
32 map<string, YExternalWidgets *> YExternalWidgets::_externalWidgets;
38 YUI_THROW(
YUIException(
"UI must be initialized first" ) );
40 yuiMilestone() <<
"Creating Libyui External Widgets object" << endl;
42 std::pair<map<string, YExternalWidgets *>::iterator,
bool> ret;
43 ret = _externalWidgets.insert ( std::pair<string, YExternalWidgets *>(_name,
this));
44 if (ret.second==
false) {
45 string errorString = _name;
46 errorString.append(
" already created");
56 _externalWidgets.erase(_name);
62 map<string, YExternalWidgets *>::iterator it;
65 YUI_THROW(
YUIException(
"UI must be initialized first" ) );
67 it = _externalWidgets.find(name);
68 if (it == _externalWidgets.end())
73 return _externalWidgets[name];
86 YUI_THROW(
YUIException(
"UI must be initialized first" ) );
91 YUI_CHECK_PTR( _factory );
118 map <string, YExternalWidgets* > ew = YExternalWidgets::_externalWidgets;
119 map<string, YExternalWidgets *>::iterator it;
121 for ( it= ew.begin(); it != ew.end(); it++)
123 yuiMilestone() <<
"Shutting down " << it->first <<
" External Widgets" << endl;