#include #include #include #ifdef WASABI_WIDGETS_LAYER #include #endif #ifdef WASABI_WIDGETS_ANIMLAYER #include #endif #ifdef WASABI_WIDGETS_BUTTON #include #endif #ifdef WASABI_WIDGETS_TGBUTTON #include #endif #ifdef WASABI_WIDGETS_GUIOBJECT #include #endif #ifdef WASABI_WIDGETS_GROUPLIST #include #endif #ifdef WASABI_WIDGETS_MOUSEREDIR #include #endif #ifdef WASABI_WIDGETS_SLIDER #include #endif #ifdef WASABI_WIDGETS_MEDIASLIDERS #include #include #include #include #include #endif #ifdef WASABI_WIDGETS_MEDIAVIS #include #endif #ifdef WASABI_WIDGETS_MEDIAEQCURVE #include #endif #ifdef WASABI_WIDGETS_MEDIASTATUS #include #endif #ifdef _WIN32 #include #endif #ifdef WASABI_WIDGETS_SVCWND #include #endif #ifdef WASABI_WIDGETS_TEXT #include #endif #ifdef WASABI_WIDGETS_EDIT #include #endif #ifdef WASABI_WIDGETS_TITLEBAR #include #endif #ifdef WASABI_WIDGETS_COMPBUCK #include #endif #ifdef WASABI_WIDGETS_BROWSER #include #ifdef WASABI_WIDGETS_BROWSERSVC #include #include #endif #endif #ifdef WASABI_WIDGETS_FRAME #include #endif #ifdef WASABI_WIDGETS_GRID #include #endif #ifdef WASABI_WIDGETS_QUERYDRAG #include #endif #ifdef WASABI_WIDGETS_QUERYLIST #include #endif #ifdef WASABI_WIDGETS_FILTERLIST #include #endif #ifdef WASABI_WIDGETS_QUERYLINE #include #endif #ifdef WASABI_WIDGETS_WNDHOLDER #include #endif #ifdef WASABI_COMPILE_WNDMGR #ifdef WASABI_WIDGETS_LAYOUTSTATUS #include #endif #endif // wndmgr #ifdef WASABI_WIDGETS_TABSHEET #include #endif #ifdef WASABI_WIDGETS_CHECKBOX #include #endif #ifdef WASABI_WIDGETS_TITLEBOX #include #endif #ifdef WASABI_WIDGETS_CUSTOMOBJECT #include #endif #ifdef WASABI_WIDGETS_OSWNDHOST #include #endif #ifdef WASABI_WIDGETS_RADIOGROUP #include #endif #ifdef WASABI_TOOLOBJECT_HIDEOBJECT #include #endif #ifdef WASABI_TOOLOBJECT_SENDPARAMS #include #endif #ifdef WASABI_TOOLOBJECT_ADDPARAMS #include #endif #ifdef WASABI_WIDGETS_LIST #include #endif #ifdef WASABI_WIDGETS_TREE #include #endif #ifdef WASABI_WIDGETS_DROPDOWNLIST #include #endif #ifdef WASABI_WIDGETS_COMBOBOX #include #endif #ifdef WASABI_WIDGETS_HISTORYEDITBOX #include #endif #ifdef WASABI_WIDGETS_OBJECTDIRECTORY #include #endif #ifdef WASABI_WIDGETS_RECTANGLE #include #endif #ifdef WASABI_WIDGETS_PATHPICKER #include #endif #ifdef WASABI_WIDGETS_GRADIENT #include #endif #ifdef WASABI_WIDGETS_MENU #include #endif #include #ifdef WASABI_COMPILE_STATSWND #include #include #endif extern StringW g_resourcepath; Widgets::Widgets() { count = 0; registerService(new XuiObjectCreator); #ifdef WASABI_WIDGETS_LAYER registerService(new XuiObjectCreator); #endif #ifdef WASABI_WIDGETS_ANIMLAYER registerService(new XuiObjectCreator); #endif #ifdef WASABI_WIDGETS_BUTTON registerService(new XuiObjectCreator); #endif #ifdef WASABI_WIDGETS_TGBUTTON registerService(new XuiObjectCreator); registerService(new XuiObjectCreator); #endif #ifdef WASABI_WIDGETS_GROUPLIST registerService(new XuiObjectCreator); #endif #ifdef WASABI_WIDGETS_MOUSEREDIR registerService(new XuiObjectCreator); #endif #ifdef WASABI_WIDGETS_SLIDER registerService(new XuiObjectCreator); #endif #ifdef _WIN32 registerService(new XuiObjectCreator); #endif #ifdef WASABI_WIDGETS_MEDIASLIDERS registerService(new XuiObjectCreator); registerService(new XuiObjectCreator); registerService(new XuiObjectCreator); registerService(new XuiObjectCreator); registerService(new XuiObjectCreator); #endif #ifdef WASABI_WIDGETS_MEDIAVIS registerService(new XuiObjectCreator); #endif #ifdef WASABI_WIDGETS_MEDIAEQCURVE registerService(new XuiObjectCreator); #endif #ifdef WASABI_WIDGETS_MEDIASTATUS registerService(new XuiObjectCreator); #endif #ifdef WASABI_WIDGETS_SVCWND registerService(new XuiObjectCreator); #endif #ifdef WASABI_WIDGETS_TEXT registerService(new XuiObjectCreator); #endif #ifdef WASABI_WIDGETS_EDIT registerService(new XuiObjectCreator); #endif #ifdef WASABI_WIDGETS_TITLEBAR registerService(new XuiObjectCreator); #endif #ifdef WASABI_WIDGETS_COMPBUCK registerService(new XuiObjectCreator); #endif #ifdef WASABI_WIDGETS_BROWSER registerService(new XuiObjectCreator); #ifdef WASABI_WIDGETS_BROWSERSVC registerService(new waServiceFactoryT); #endif #endif #ifdef WASABI_WIDGETS_FRAME registerService(new XuiObjectCreator); #endif #ifdef WASABI_WIDGETS_GRID registerService(new XuiObjectCreator); #endif #ifdef WASABI_WIDGETS_QUERYDRAG registerService(new XuiObjectCreator); #endif #ifdef WASABI_COMPILE_METADB #ifdef WASABI_WIDGETS_QUERYLIST registerService(new XuiObjectCreator); #endif #ifdef WASABI_WIDGETS_FILTERLIST registerService(new XuiObjectCreator); #endif #ifdef WASABI_WIDGETS_QUERYLINE registerService(new XuiObjectCreator); #endif #endif // metadb #ifdef WASABI_WIDGETS_WNDHOLDER registerService(new XuiObjectCreator); registerService(new XuiObjectCreator); #endif // components #ifdef WASABI_COMPILE_WNDMGR #ifdef WASABI_WIDGETS_LAYOUTSTATUS registerService(new XuiObjectCreator); #endif #endif // wndmgr #ifdef WASABI_WIDGETS_TABSHEET registerService(new XuiObjectCreator); #endif #ifdef WASABI_WIDGETS_CHECKBOX registerService(new XuiObjectCreator); #endif #ifdef WASABI_WIDGETS_TITLEBOX registerService(new XuiObjectCreator); #endif #ifdef WASABI_WIDGETS_CUSTOMOBJECT registerService(new XuiObjectCreator); #endif #ifdef WASABI_WIDGETS_OSWNDHOST registerService(new XuiObjectCreator); #endif #ifdef WASABI_WIDGETS_RADIOGROUP registerService(new XuiObjectCreator); #endif #ifdef WASABI_TOOLOBJECT_HIDEOBJECT registerService(new XuiObjectCreator); #endif #ifdef WASABI_TOOLOBJECT_SENDPARAMS registerService(new XuiObjectCreator); #endif #ifdef WASABI_TOOLOBJECT_ADDPARAMS registerService(new XuiObjectCreator); #endif #ifdef WASABI_WIDGETS_LIST registerService(new XuiObjectCreator); #endif #ifdef WASABI_WIDGETS_TREE registerService(new XuiObjectCreator); #endif #ifdef WASABI_WIDGETS_DROPDOWNLIST registerService(new XuiObjectCreator); #endif #ifdef WASABI_WIDGETS_COMBOBOX registerService(new XuiObjectCreator); #endif #ifdef WASABI_WIDGETS_HISTORYEDITBOX registerService(new XuiObjectCreator); #endif #ifdef WASABI_WIDGETS_OBJECTDIRECTORY registerService(new XuiObjectCreator); #endif #ifdef WASABI_WIDGETS_RECTANGLE registerService(new XuiObjectCreator); #endif #ifdef WASABI_WIDGETS_PATHPICKER registerService(new XuiObjectCreator); #endif #ifdef WASABI_WIDGETS_GRADIENT registerService(new XuiObjectCreator); #endif #ifdef WASABI_WIDGETS_MENU registerService(new XuiObjectCreator); #endif //registerService(new XuiObjectCreator); #ifdef WASABI_COMPILE_WNDMGR //registerSkinFile("xml/msgbox/msgbox.xml"); #endif #ifdef WASABI_WIDGETS_TOOLTIPS //registerSkinFile("xml/tooltips/tooltips.xml"); #endif #ifdef WASABI_COMPILE_STATSWND registerService(new XuiObjectCreator); statswnd = new StatsWnd(); #endif //loadResources(); WASABI_API_SYSCB->syscb_registerCallback(static_cast(this)); } Widgets::~Widgets() { #ifdef WASABI_COMPILE_STATSWND delete statswnd; #endif WASABI_API_SYSCB->syscb_deregisterCallback(static_cast(this)); if (WASABI_API_SVC != NULL) { int i=factories.getNumItems(); while (i--) WASABI_API_SVC->service_deregister(factories[i]); } factories.deleteAll(); } void Widgets::registerService(waServiceFactoryI *f) { WASABI_API_SVC->service_register(f); factories.addItem(f); } int Widgets::skincb_onBeforeLoadingElements() { if (count++ > 0) // if 0, we're already loaded so that the lib is usable without 'a skin' loadResources(); return 1; } void Widgets::loadResources() { // TODO: benski> want to put this into gen_ff somewhere, instead. WASABI_API_SKIN->loadSkinFile(StringPathCombine(g_resourcepath,L"xml\\winamp\\cover\\cover.xml")); WASABI_API_SKIN->loadSkinFile(StringPathCombine(g_resourcepath,L"xml\\winamp\\thinger\\thinger.xml")); #ifndef WA3COMPATIBILITY // ifNdef WASABI_API_SKIN->loadSkinFile(StringPathCombine(g_resourcepath,L"xml\\wasabi\\wasabi.xml")); #endif #ifdef WASABI_WIDGETS_PATHPICKER WASABI_API_SKIN->loadSkinFile(StringPathCombine(g_resourcepath,L"xml\\pathpicker\\pathpicker.xml")); #endif #ifdef WASABI_WIDGETS_LAYOUTSTATUS WASABI_API_SKIN->loadSkinFile(StringPathCombine(g_resourcepath,L"xml\\statusbar\\statusbar.xml")); #endif #ifdef WASABI_WIDGETS_TABSHEET WASABI_API_SKIN->loadSkinFile(StringPathCombine(g_resourcepath,L"xml\\tabsheet\\tabsheet.xml")); #endif #ifdef WASABI_WIDGETS_CHECKBOX WASABI_API_SKIN->loadSkinFile(StringPathCombine(g_resourcepath,L"xml\\checkbox\\checkbox.xml")); #endif #ifdef WASABI_WIDGETS_TITLEBOX WASABI_API_SKIN->loadSkinFile(StringPathCombine(g_resourcepath,L"xml\\titlebox\\titlebox.xml")); #endif #ifdef WASABI_WIDGETS_DROPDOWNLIST WASABI_API_SKIN->loadSkinFile(StringPathCombine(g_resourcepath,L"xml\\dropdownlist\\dropdownlist.xml")); #endif #ifdef WASABI_WIDGETS_COMBOBOX WASABI_API_SKIN->loadSkinFile(StringPathCombine(g_resourcepath,L"xml\\combobox\\combobox.xml")); #endif #ifdef WASABI_WIDGETS_HISTORYEDITBOX WASABI_API_SKIN->loadSkinFile(StringPathCombine(g_resourcepath,L"xml\\historyeditbox\\historyeditbox.xml")); #endif #ifdef WASABI_WIDGETS_TOOLTIPS WASABI_API_SKIN->loadSkinFile(StringPathCombine(g_resourcepath,L"xml\\tooltips\\tooltips.xml")); #endif #ifdef WASABI_COMPILE_WNDMGR //WASABI_API_SKIN->loadSkinFile(StringPathCombine(g_resourcepath,"xml\\msgbox\\msgbox.xml")); #endif WASABI_API_SKIN->loadSkinFile(StringPathCombine(g_resourcepath,L"xml\\about\\about.xml")); }