123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451 |
- #include <precomp.h>
- #include <api/skin/widgets.h>
- #include <api/skin/widgets/group.h>
- #ifdef WASABI_WIDGETS_LAYER
- #include <api/skin/widgets/layer.h>
- #endif
- #ifdef WASABI_WIDGETS_ANIMLAYER
- #include <api/skin/widgets/animlayer.h>
- #endif
- #ifdef WASABI_WIDGETS_BUTTON
- #include <api/skin/widgets/button.h>
- #endif
- #ifdef WASABI_WIDGETS_TGBUTTON
- #include <api/skin/widgets/tgbutton.h>
- #endif
- #ifdef WASABI_WIDGETS_GUIOBJECT
- #include <api/script/objects/guiobj.h>
- #endif
- #ifdef WASABI_WIDGETS_GROUPLIST
- #include <api/skin/widgets/grouplist.h>
- #endif
- #ifdef WASABI_WIDGETS_MOUSEREDIR
- #include <api/skin/widgets/mouseredir.h>
- #endif
- #ifdef WASABI_WIDGETS_SLIDER
- #include <api/skin/widgets/pslider.h>
- #endif
- #ifdef WASABI_WIDGETS_MEDIASLIDERS
- #include <api/skin/widgets/seqband.h>
- #include <api/skin/widgets/seqpreamp.h>
- #include <api/skin/widgets/svolbar.h>
- #include <api/skin/widgets/sseeker.h>
- #include <api/skin/widgets/spanbar.h>
- #endif
- #ifdef WASABI_WIDGETS_MEDIAVIS
- #include <api/skin/widgets/sa.h>
- #endif
- #ifdef WASABI_WIDGETS_MEDIAEQCURVE
- #include <api/skin/widgets/seqvis.h>
- #endif
- #ifdef WASABI_WIDGETS_MEDIASTATUS
- #include <api/skin/widgets/sstatus.h>
- #endif
- #ifdef _WIN32
- #include <api/skin/widgets/wa2/xuiwa2slider.h>
- #endif
- #ifdef WASABI_WIDGETS_SVCWND
- #include <api/skin/widgets/script/svcwnd.h>
- #endif
- #ifdef WASABI_WIDGETS_TEXT
- #include <api/skin/widgets/text.h>
- #endif
- #ifdef WASABI_WIDGETS_EDIT
- #include <api/skin/widgets/edit.h>
- #endif
- #ifdef WASABI_WIDGETS_TITLEBAR
- #include <api/skin/widgets/title.h>
- #endif
- #ifdef WASABI_WIDGETS_COMPBUCK
- #include <api/skin/widgets/compbuck2.h>
- #endif
- #ifdef WASABI_WIDGETS_BROWSER
- #include <api/skin/widgets/mb/xuibrowser.h>
- #ifdef WASABI_WIDGETS_BROWSERSVC
- #include <api/skin/widgets/mb/iebrowser.h>
- #include <api/skin/widgets/mb/mbsvc.h>
- #endif
- #endif
- #ifdef WASABI_WIDGETS_FRAME
- #include <api/skin/widgets/xuiframe.h>
- #endif
- #ifdef WASABI_WIDGETS_GRID
- #include <api/skin/widgets/xuigrid.h>
- #endif
- #ifdef WASABI_WIDGETS_QUERYDRAG
- #include <api/skin/widgets/xuiquerydrag.h>
- #endif
- #ifdef WASABI_WIDGETS_QUERYLIST
- #include <api/skin/widgets/db/xuiquerylist.h>
- #endif
- #ifdef WASABI_WIDGETS_FILTERLIST
- #include <api/skin/widgets/db/xuifilterlist.h>
- #endif
- #ifdef WASABI_WIDGETS_QUERYLINE
- #include <api/skin/widgets/db/xuiqueryline.h>
- #endif
- #ifdef WASABI_WIDGETS_WNDHOLDER
- #include <api/skin/widgets/xuiwndholder.h>
- #endif
- #ifdef WASABI_COMPILE_WNDMGR
- #ifdef WASABI_WIDGETS_LAYOUTSTATUS
- #include <api/skin/widgets/xuistatus.h>
- #endif
- #endif // wndmgr
- #ifdef WASABI_WIDGETS_TABSHEET
- #include <api/skin/widgets/xuitabsheet.h>
- #endif
- #ifdef WASABI_WIDGETS_CHECKBOX
- #include <api/skin/widgets/xuicheckbox.h>
- #endif
- #ifdef WASABI_WIDGETS_TITLEBOX
- #include <api/skin/widgets/xuititlebox.h>
- #endif
- #ifdef WASABI_WIDGETS_CUSTOMOBJECT
- #include <api/skin/widgets/xuicustomobject.h>
- #endif
- #ifdef WASABI_WIDGETS_OSWNDHOST
- #include <api/skin/widgets/xuioswndhost.h>
- #endif
- #ifdef WASABI_WIDGETS_RADIOGROUP
- #include <api/skin/widgets/xuiradiogroup.h>
- #endif
- #ifdef WASABI_TOOLOBJECT_HIDEOBJECT
- #include <api/skin/widgets/xuihideobject.h>
- #endif
- #ifdef WASABI_TOOLOBJECT_SENDPARAMS
- #include <api/skin/widgets/xuisendparams.h>
- #endif
- #ifdef WASABI_TOOLOBJECT_ADDPARAMS
- #include <api/skin/widgets/xuiaddparams.h>
- #endif
- #ifdef WASABI_WIDGETS_LIST
- #include <api/skin/widgets/xuilist.h>
- #endif
- #ifdef WASABI_WIDGETS_TREE
- #include <api/skin/widgets/xuitree.h>
- #endif
- #ifdef WASABI_WIDGETS_DROPDOWNLIST
- #include <api/skin/widgets/xuidropdownlist.h>
- #endif
- #ifdef WASABI_WIDGETS_COMBOBOX
- #include <api/skin/widgets/xuicombobox.h>
- #endif
- #ifdef WASABI_WIDGETS_HISTORYEDITBOX
- #include <api/skin/widgets/xuihistoryedit.h>
- #endif
- #ifdef WASABI_WIDGETS_OBJECTDIRECTORY
- #include <api/skin/widgets/xuiobjdirwnd.h>
- #endif
- #ifdef WASABI_WIDGETS_RECTANGLE
- #include <api/skin/widgets/xuirect.h>
- #endif
- #ifdef WASABI_WIDGETS_PATHPICKER
- #include <api/skin/widgets/xuipathpicker.h>
- #endif
- #ifdef WASABI_WIDGETS_GRADIENT
- #include <api/skin/widgets/xuigradientwnd.h>
- #endif
- #ifdef WASABI_WIDGETS_MENU
- #include <api/skin/widgets/xuimenu.h>
- #endif
- #include <api/skin/widgets/xuidownloadslist.h>
- #ifdef WASABI_COMPILE_STATSWND
- #include <api/skin/widgets/stats/xuistats.h>
- #include <api/skin/widgets/stats/statswnd.h>
- #endif
- extern StringW g_resourcepath;
- Widgets::Widgets() {
- count = 0;
- registerService(new XuiObjectCreator<GuiObjectXuiSvc>);
- #ifdef WASABI_WIDGETS_LAYER
- registerService(new XuiObjectCreator<LayerXuiSvc>);
- #endif
- #ifdef WASABI_WIDGETS_ANIMLAYER
- registerService(new XuiObjectCreator<AnimLayerXuiSvc>);
- #endif
- #ifdef WASABI_WIDGETS_BUTTON
- registerService(new XuiObjectCreator<ButtonXuiSvc>);
- #endif
- #ifdef WASABI_WIDGETS_TGBUTTON
- registerService(new XuiObjectCreator<ToggleButtonXuiSvc>);
- registerService(new XuiObjectCreator<nStatesTgButtonXuiSvc>);
- #endif
- #ifdef WASABI_WIDGETS_GROUPLIST
- registerService(new XuiObjectCreator<GroupListXuiSvc>);
- #endif
- #ifdef WASABI_WIDGETS_MOUSEREDIR
- registerService(new XuiObjectCreator<MouseRedirXuiSvc>);
- #endif
- #ifdef WASABI_WIDGETS_SLIDER
- registerService(new XuiObjectCreator<SliderXuiSvc>);
- #endif
- #ifdef _WIN32
- registerService(new XuiObjectCreator<Wa2SliderXuiSvc>);
- #endif
- #ifdef WASABI_WIDGETS_MEDIASLIDERS
- registerService(new XuiObjectCreator<EqBandXuiSvc>);
- registerService(new XuiObjectCreator<EqPreAmpXuiSvc>);
- registerService(new XuiObjectCreator<VolBarXuiSvc>);
- registerService(new XuiObjectCreator<SeekBarXuiSvc>);
- registerService(new XuiObjectCreator<PanBarXuiSvc>);
- #endif
- #ifdef WASABI_WIDGETS_MEDIAVIS
- registerService(new XuiObjectCreator<VisXuiSvc>);
- #endif
- #ifdef WASABI_WIDGETS_MEDIAEQCURVE
- registerService(new XuiObjectCreator<EqVisXuiSvc>);
- #endif
- #ifdef WASABI_WIDGETS_MEDIASTATUS
- registerService(new XuiObjectCreator<StatusXuiSvc>);
- #endif
- #ifdef WASABI_WIDGETS_SVCWND
- registerService(new XuiObjectCreator<SvcWndXuiSvc>);
- #endif
- #ifdef WASABI_WIDGETS_TEXT
- registerService(new XuiObjectCreator<TextXuiSvc>);
- #endif
- #ifdef WASABI_WIDGETS_EDIT
- registerService(new XuiObjectCreator<EditXuiSvc>);
- #endif
- #ifdef WASABI_WIDGETS_TITLEBAR
- registerService(new XuiObjectCreator<TitleBarXuiSvc>);
- #endif
- #ifdef WASABI_WIDGETS_COMPBUCK
- registerService(new XuiObjectCreator<ComponentBucketXuiSvc>);
- #endif
- #ifdef WASABI_WIDGETS_BROWSER
- registerService(new XuiObjectCreator<BrowserXuiSvc>);
- #ifdef WASABI_WIDGETS_BROWSERSVC
- registerService(new waServiceFactoryT<svc_miniBrowser, MbSvc>);
- #endif
- #endif
- #ifdef WASABI_WIDGETS_FRAME
- registerService(new XuiObjectCreator<FrameXuiSvc>);
- #endif
- #ifdef WASABI_WIDGETS_GRID
- registerService(new XuiObjectCreator<GridXuiSvc>);
- #endif
- #ifdef WASABI_WIDGETS_QUERYDRAG
- registerService(new XuiObjectCreator<QueryDragXuiSvc>);
- #endif
- #ifdef WASABI_COMPILE_METADB
- #ifdef WASABI_WIDGETS_QUERYLIST
- registerService(new XuiObjectCreator<QueryListXuiSvc>);
- #endif
- #ifdef WASABI_WIDGETS_FILTERLIST
- registerService(new XuiObjectCreator<FilterListXuiSvc>);
- #endif
- #ifdef WASABI_WIDGETS_QUERYLINE
- registerService(new XuiObjectCreator<QueryLineXuiSvc>);
- #endif
- #endif // metadb
- #ifdef WASABI_WIDGETS_WNDHOLDER
- registerService(new XuiObjectCreator<WindowHolderXuiSvc>);
- registerService(new XuiObjectCreator<WindowHolderXuiSvc2>);
- #endif // components
- #ifdef WASABI_COMPILE_WNDMGR
- #ifdef WASABI_WIDGETS_LAYOUTSTATUS
- registerService(new XuiObjectCreator<LayoutStatusXuiSvc>);
- #endif
- #endif // wndmgr
- #ifdef WASABI_WIDGETS_TABSHEET
- registerService(new XuiObjectCreator<ScriptTabSheetXuiSvc>);
- #endif
- #ifdef WASABI_WIDGETS_CHECKBOX
- registerService(new XuiObjectCreator<ScriptCheckBoxXuiSvc>);
- #endif
- #ifdef WASABI_WIDGETS_TITLEBOX
- registerService(new XuiObjectCreator<ScriptTitleBoxXuiSvc>);
- #endif
- #ifdef WASABI_WIDGETS_CUSTOMOBJECT
- registerService(new XuiObjectCreator<CustomObjectXuiSvc>);
- #endif
- #ifdef WASABI_WIDGETS_OSWNDHOST
- registerService(new XuiObjectCreator<OSWndHostXuiSvc>);
- #endif
- #ifdef WASABI_WIDGETS_RADIOGROUP
- registerService(new XuiObjectCreator<ScriptRadioGroupXuiSvc>);
- #endif
- #ifdef WASABI_TOOLOBJECT_HIDEOBJECT
- registerService(new XuiObjectCreator<HideObjectXuiSvc>);
- #endif
- #ifdef WASABI_TOOLOBJECT_SENDPARAMS
- registerService(new XuiObjectCreator<SendParamsXuiSvc>);
- #endif
- #ifdef WASABI_TOOLOBJECT_ADDPARAMS
- registerService(new XuiObjectCreator<AddParamsXuiSvc>);
- #endif
- #ifdef WASABI_WIDGETS_LIST
- registerService(new XuiObjectCreator<ScriptListXuiSvc>);
- #endif
- #ifdef WASABI_WIDGETS_TREE
- registerService(new XuiObjectCreator<ScriptTreeXuiSvc>);
- #endif
- #ifdef WASABI_WIDGETS_DROPDOWNLIST
- registerService(new XuiObjectCreator<DropDownListXuiSvc>);
- #endif
- #ifdef WASABI_WIDGETS_COMBOBOX
- registerService(new XuiObjectCreator<ComboBoxXuiSvc>);
- #endif
- #ifdef WASABI_WIDGETS_HISTORYEDITBOX
- registerService(new XuiObjectCreator<HistoryEditXuiSvc>);
- #endif
- #ifdef WASABI_WIDGETS_OBJECTDIRECTORY
- registerService(new XuiObjectCreator<ScriptObjDirWndXuiSvc>);
- #endif
- #ifdef WASABI_WIDGETS_RECTANGLE
- registerService(new XuiObjectCreator<ScriptRectXuiSvc>);
- #endif
- #ifdef WASABI_WIDGETS_PATHPICKER
- registerService(new XuiObjectCreator<PathPickerXuiSvc>);
- #endif
- #ifdef WASABI_WIDGETS_GRADIENT
- registerService(new XuiObjectCreator<GradientWndXuiSvc>);
- #endif
- #ifdef WASABI_WIDGETS_MENU
- registerService(new XuiObjectCreator<MenuXuiSvc>);
- #endif
- //registerService(new XuiObjectCreator<DownloadsListXuiSvc>);
- #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<XuiStatsXuiSvc>);
- statswnd = new StatsWnd();
- #endif
- //loadResources();
- WASABI_API_SYSCB->syscb_registerCallback(static_cast<SysCallbackI *>(this));
- }
- Widgets::~Widgets() {
- #ifdef WASABI_COMPILE_STATSWND
- delete statswnd;
- #endif
- WASABI_API_SYSCB->syscb_deregisterCallback(static_cast<SysCallbackI *>(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"));
- }
|