18 #define YUILogComponent "ew" 22 #include "YUILoader.h" 23 #include "YUIException.h" 24 #include "YExternalWidgets.h" 25 #include "YExternalWidgetFactory.h" 30 std::map<std::string, YExternalWidgets *> YExternalWidgets::_externalWidgets;
35 YUI_THROW(
YUIException(
"UI must be initialized first" ) );
37 yuiMilestone() <<
"Creating Libyui External Widgets object" << std::endl;
39 std::pair<std::map<std::string, YExternalWidgets *>::iterator,
bool> ret;
40 ret = _externalWidgets.insert ( std::pair<std::string, YExternalWidgets *>(_name,
this));
41 if (ret.second==
false) {
42 std::string errorString = _name;
43 errorString.append(
" already created");
52 _externalWidgets.erase(_name);
57 std::map<std::string, YExternalWidgets *>::iterator it;
60 YUI_THROW(
YUIException(
"UI must be initialized first" ) );
62 it = _externalWidgets.find(name);
63 if (it == _externalWidgets.end())
68 return _externalWidgets[name];
79 YUI_THROW(
YUIException(
"UI must be initialized first" ) );
84 YUI_CHECK_PTR( _factory );
111 std::map <std::string, YExternalWidgets* > ew = YExternalWidgets::_externalWidgets;
112 std::map<std::string, YExternalWidgets *>::iterator it;
114 for (it= ew.begin(); it != ew.end(); it++)
116 yuiMilestone() <<
"Shutting down " << it->first <<
" External Widgets" << std::endl;
static void loadExternalWidgets(const std::string &name, const std::string &symbol="_Z21createExternalWidgetsPKc")
Load the given External Widgets plugin followed by its graphical extension implementation in the foll...
static YUI * ui()
Access the global UI.
Base class for UI Exceptions.