1
0

wasabicfg.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491
  1. #ifndef __WASABI_CFG_H
  2. #define __WASABI_CFG_H
  3. #define GEN_FF
  4. #define WA5
  5. //#define _WASABIRUNTIME
  6. // Uncomment this to have an old-style global api pointer
  7. //#define WA3COMPATIBILITY
  8. #ifndef _WASABIRUNTIME
  9. #ifndef WA3COMPATIBILITY
  10. #define WASABINOMAINAPI
  11. #endif
  12. /*
  13. Comment or uncomment the following directives according to the needs of your application :
  14. */
  15. /* note to the team:
  16. the WANT_WASABI_API_* directives will go away once we're done splitting the api, their only purpose
  17. is to split the api one bit at a time while the rest remains working. when it's done, all that will remain
  18. will be the WASABI_COMPILE_* directives
  19. */
  20. // This allows component (external plugins)
  21. //#define WASABI_COMPILE_COMPONENTS
  22. // This enables the layered UI
  23. #define WASABI_COMPILE_WND
  24. // This enables multiplexed timers
  25. #define WASABI_COMPILE_TIMERS
  26. // This enables xml group loading within the window api
  27. #define WASABI_COMPILE_SKIN
  28. #define WASABI_SCRIPT_SYSTEMOBJECT_WA3COMPATIBLE
  29. // This enables internationalizaiton
  30. // #define WASABI_COMPILE_UTF
  31. // This enables action handling in UI objects (clicks and keypresses)
  32. //#define WASABI_COMPILE_ACTIONS // CUT!!!
  33. // This enables UI scripting
  34. #define WASABI_COMPILE_SCRIPT
  35. // This enables keyboard locales in UI
  36. #define WASABI_COMPILE_LOCALES
  37. // This enables bitmap and truetype font rendering
  38. #define WASABI_COMPILE_FONTS
  39. //#define WASABI_FONT_RENDERER_USE_WIN32
  40. #define WASABI_FONT_RENDERER_USE_FREETYPE
  41. // This sets the static font renderer. If you are compiling with api_config, the attribute to set is { 0x280876cf, 0x48c0, 0x40bc, { 0x8e, 0x86, 0x73, 0xce, 0x6b, 0xb4, 0x62, 0xe5 } }, "Font Renderer"
  42. #if defined(WASABI_FONT_RENDERER_USE_WIN32)
  43. #define WASABI_FONT_RENDERER L"" // "" is Win32
  44. #elif defined(WASABI_FONT_RENDERER_USE_FREETYPE)
  45. #define WASABI_FONT_RENDERER L"Freetype" // Freetype lib
  46. #else
  47. #define WASABI_FONT_RENDERER L"" // "" default for OS
  48. #endif
  49. // This lets you override all bitmapfonts using TTF fonts (for internationalization). define to a function call or a global value to change this value dynamically.
  50. // If you are compiling with api_config, the attribute to set is { 0x280876cf, 0x48c0, 0x40bc, { 0x8e, 0x86, 0x73, 0xce, 0x6b, 0xb4, 0x62, 0xe5 } }, "Use bitmap fonts (no international support)"
  51. #define WASABI_FONT_TTFOVERRIDE 0 // 1 does all rendering with TTF
  52. #define WASABI_WNDMGR_ANIMATEDRECTS 0 // if api_config is compiled, the item controlling this is {280876CF-48C0-40bc-8E86-73CE6BB462E5};"Animated rects"
  53. #define WASABI_WNDMGR_FINDOPENRECT 0 // if api_config is compiled, the item controlling this is {280876CF-48C0-40bc-8E86-73CE6BB462E5};"Find open rect"
  54. #define WASABI_WNDMGR_LINKLAYOUTSCALES 0 // if api_config is compiled, the item controlling this is {9149C445-3C30-4e04-8433-5A518ED0FDDE};"Link layouts scale"
  55. #define WASABI_WNDMGR_LINKLAYOUTSALPHA 0 // if api_config is compiled, the item controlling this is {9149C445-3C30-4e04-8433-5A518ED0FDDE};"Link layouts alpha"
  56. #define WASABI_WNDMGR_DESKTOPALPHA 1 // if api_config is compiled, the item controlling this is {9149C445-3C30-4e04-8433-5A518ED0FDDE};"Enable desktop alpha"
  57. // This enables loading for pngs, jpgs (you need to add the necessary image loader services)
  58. #define WASABI_COMPILE_IMGLDR
  59. #define WASABI_COMPILE_IMGLDR_PNGREAD
  60. #define WASABI_COMPILE_IMGLDR_JPGREAD
  61. // This enables metadb support
  62. //#define WASABI_COMPILE_METADB
  63. // This enables config file support
  64. #define WASABI_COMPILE_CONFIG
  65. // This enables the filereader pipeline
  66. #define WASABI_COMPILE_FILEREADER
  67. // This enables the zip filereader
  68. //#define WASABI_COMPILE_ZIPREADER
  69. // This enables the xml parser for config and group loading
  70. #define WASABI_COMPILE_XMLPARSER
  71. // This enables system callback management
  72. #define WASABI_COMPILE_SYSCB
  73. // This enables centralized memory allocation/deallocation
  74. #define WASABI_COMPILE_MEMMGR
  75. #define WASABI_DIRS_FROMEXEPATH // otherwise, if the lib is running from a dll in another path, undefining that means the path are relative to the DLL path
  76. #define WASABI_SKINS_SUBDIRECTORY L"skins"
  77. #define WASABI_RESOURCES_SUBDIRECTORY L"plugins\\freeform"
  78. #define WASABI_COMPILE_MEDIACORE
  79. #define WASABI_COMPILE_WNDMGR
  80. #define WASABI_COMPILE_PAINTSETS
  81. #define WASABI_COMPILE_MAKIDEBUG
  82. #define WASABI_CUSTOMIMPL_MEDIACORE
  83. #define WASABI_WIDGETS_MEDIASLIDERS
  84. #define WASABI_CUSTOM_CONTEXTMENUS
  85. #define WASABI_CUSTOM_QUIT
  86. #define WASABI_CUSTOM_QUITFN { extern void appQuit(); appQuit(); }
  87. #define WASABI_CUSTOM_ONTOP
  88. #else // not _WASABIRUNTIME
  89. // this section should define the entire set of wasabi parts since this is a full runtime build
  90. #define WASABI_COMPILE_COMPONENTS
  91. #define WASABI_COMPILE_SKIN
  92. #define WASABI_COMPILE_ACTIONS
  93. #define WASABI_COMPILE_SCRIPT
  94. #define WASABI_COMPILE_FONTS
  95. #define WASABI_COMPILE_LOCALES
  96. #define WASABI_COMPILE_IMGLDR
  97. #define WASABI_COMPILE_IMGLDR_PNGREAD
  98. #define WASABI_COMPILE_IMGLDR_JPGREAD
  99. #define WASABI_COMPILE_METADB
  100. #define WASABI_COMPILE_CONFIG
  101. #define WASABI_COMPILE_FILEREADER
  102. #define WASABI_COMPILE_XMLPARSER
  103. #define WASABI_COMPILE_SYSCB
  104. #define WASABI_COMPILE_MEMMGR
  105. #define WASABI_COMPILE_SKIN_WA2
  106. #define WASABI_COMPILE_PAINTSETS
  107. #define WASABI_COMPILE_WNDMGR
  108. #define WASABI_COMPILE_MEDIACORE
  109. #define WASABI_COMPILE_TIMERS
  110. #define WASABI_COMPILE_WND
  111. #define WASABI_COMPILE_UTF
  112. #define WASABI_SKINS_SUBDIRECTORY "skins"
  113. #define WASABI_FONT_RENDERER "" // "" is Win32
  114. #define WASABI_WNDMGR_ANIMATEDRECTS 0 // if api_config is compiled, the item controlling this is {280876CF-48C0-40bc-8E86-73CE6BB462E5};"Animated rects"
  115. #define WASABI_WNDMGR_FINDOPENRECT 0 // if api_config is compiled, the item controlling this is {280876CF-48C0-40bc-8E86-73CE6BB462E5};"Find open rect"
  116. #define WASABI_COMPILE_MAKIDEBUG
  117. #endif // not _WASABIRUNTIME
  118. #ifdef _WASABIRUNTIME
  119. #define WASABI_API_SYSTEM api
  120. #define WASABI_API_APP api
  121. #define WASABI_API_COMPONENT api
  122. #define WASABI_API_SVC api
  123. #define WASABI_API_SYSCB api
  124. #define WASABI_API_MAKI api
  125. #define WASABI_API_UTF api
  126. #define WASABI_API_WND api
  127. #define WASABI_API_IMGLDR api
  128. #define WASABI_API_FILE api
  129. #define WASABI_API_TIMER api
  130. #define WASABI_API_WNDMGR api
  131. #define WASABI_API_SKIN api
  132. #define WASABI_API_METADB api
  133. #define WASABI_API_LOCALE api
  134. #define WASABI_API_CONFIG api
  135. #define WASABI_API_FONT api
  136. #define WASABI_API_MEMMGR api
  137. #define WASABI_API_XML api
  138. #define WASABI_API_MEDIACORE api
  139. #define WASABI_API_MAKIDEBUG debugApi
  140. #else // _WASABIRUNTIME
  141. #define WASABI_API_SYSTEM systemApi
  142. #define WASABI_API_APP applicationApi
  143. #define WASABI_API_SVC serviceApi
  144. #define WASABI_API_SYSCB sysCallbackApi
  145. #ifdef WASABI_COMPILE_COMPONENTS
  146. #define WASABI_API_COMPONENT componentApi
  147. #endif
  148. #ifdef WASABI_COMPILE_SCRIPT
  149. #define WASABI_API_MAKI makiApi
  150. #endif
  151. #ifdef WASABI_COMPILE_UTF
  152. #define WASABI_API_UTF utfApi
  153. #endif
  154. #ifdef WASABI_COMPILE_WND
  155. #define WASABI_API_WND wndApi
  156. #endif
  157. #ifdef WASABI_COMPILE_IMGLDR
  158. #define WASABI_API_IMGLDR imgLoaderApi
  159. #endif
  160. #ifdef WASABI_COMPILE_FILEREADER
  161. #define WASABI_API_FILE fileApi
  162. #endif
  163. #ifdef WASABI_COMPILE_TIMERS
  164. #define WASABI_API_TIMER timerApi
  165. #endif
  166. #ifdef WASABI_COMPILE_WNDMGR
  167. #define WASABI_API_WNDMGR wndManagerApi
  168. #endif
  169. #ifdef WASABI_COMPILE_SKIN
  170. #define WASABI_API_SKIN skinApi
  171. #endif
  172. #ifdef WASABI_COMPILE_METADB
  173. #define WASABI_API_METADB metadbApi
  174. #endif
  175. #ifdef WASABI_COMPILE_LOCALES
  176. #define WASABI_API_LOCALE localesApi
  177. #endif
  178. #ifdef WASABI_COMPILE_CONFIG
  179. #define WASABI_API_CONFIG configApi
  180. #endif
  181. #ifdef WASABI_COMPILE_FONTS
  182. #define WASABI_API_FONT fontApi
  183. #endif
  184. #ifdef WASABI_COMPILE_MEMMGR
  185. #define WASABI_API_MEMMGR memmgrApi
  186. #endif
  187. #ifdef WASABI_COMPILE_XMLPARSER
  188. #define WASABI_API_XML xmlApi
  189. #endif
  190. #ifdef WASABI_COMPILE_MEDIACORE
  191. #define WASABI_API_MEDIACORE coreApi
  192. #endif
  193. #ifdef WASABI_COMPILE_MAKIDEBUG
  194. #define WASABI_API_MAKIDEBUG debugApi
  195. #endif
  196. #endif // _WASABIRUNTIME
  197. // #define WASABI_EXTERNAL_GUIOBJECTS
  198. #define WASABI_WIDGETS_GUIOBJECT
  199. #define WASABI_WIDGETS_LAYER
  200. #define WASABI_WIDGETS_TEXT
  201. #define WASABI_WIDGETS_BUTTON
  202. #define WASABI_WIDGETS_TGBUTTON
  203. #define WASABI_WIDGETS_ANIMLAYER
  204. #define WASABI_WIDGETS_GROUPLIST
  205. #define WASABI_WIDGETS_MOUSEREDIR
  206. #define WASABI_WIDGETS_SLIDER
  207. #define WASABI_WIDGETS_MEDIAVIS
  208. #define WASABI_WIDGETS_MEDIAEQCURVE
  209. #define WASABI_WIDGETS_MEDIASTATUS
  210. //#define WASABI_WIDGETS_SVCWND
  211. #define WASABI_WIDGETS_EDIT
  212. #define WASABI_WIDGETS_TITLEBAR
  213. #define WASABI_WIDGETS_COMPBUCK
  214. #define WASABI_WIDGETS_BROWSER
  215. #define WASABI_WIDGETS_FRAME
  216. #define WASABI_WIDGETS_GRID
  217. //#define WASABI_WIDGETS_QUERYDRAG
  218. //#define WASABI_WIDGETS_QUERYLIST
  219. //#define WASABI_WIDGETS_FILTERLIST
  220. //#define WASABI_WIDGETS_QUERYLINE
  221. #define WASABI_WIDGETS_TABSHEET
  222. #define WASABI_WIDGETS_CHECKBOX
  223. #define WASABI_WIDGETS_TITLEBOX
  224. #define WASABI_WIDGETS_CUSTOMOBJECT
  225. #define WASABI_WIDGETS_OSWNDHOST
  226. #define WASABI_WIDGETS_RADIOGROUP
  227. #define WASABI_WIDGETS_LIST
  228. #define WASABI_WIDGETS_TREE
  229. #define WASABI_WIDGETS_DROPDOWNLIST
  230. #define WASABI_WIDGETS_COMBOBOX
  231. #define WASABI_WIDGETS_HISTORYEDITBOX
  232. #define WASABI_WIDGETS_OBJECTDIRECTORY
  233. #define WASABI_WIDGETS_RECTANGLE
  234. #define WASABI_WIDGETS_PATHPICKER
  235. #define WASABI_WIDGETS_GRADIENT
  236. #define WASABI_WIDGETS_MENUBUTTON
  237. #define WASABI_WIDGETS_MENU
  238. #define WASABI_WIDGETS_WNDHOLDER
  239. #define WASABI_WIDGETS_LAYOUTSTATUS
  240. #define WASABI_WIDGETS_TOOLTIPS
  241. #include "../Winamp/buildType.h"
  242. #if defined(_DEBUG) || defined(WASABI_DEBUG)// || defined(INTERNAL) || defined(BETA) || defined(NIGHT)
  243. #define WASABI_COMPILE_STATSWND
  244. #endif
  245. #if defined(_DEBUG)
  246. #ifndef WASABI_DEBUG
  247. #define WASABI_DEBUG
  248. #endif
  249. #endif
  250. #define WASABI_TOOLOBJECT_HIDEOBJECT
  251. #define WASABI_TOOLOBJECT_SENDPARAMS
  252. #define WASABI_TOOLOBJECT_ADDPARAMS
  253. // #endif // WASABI_EXTERNAL_GUIOBJECTS
  254. #define WASABI_COMPILE_COLORTHEMES
  255. #define WASABI_SCRIPTOBJECTS_POPUP
  256. #define WASABI_SCRIPTOBJECTS_LIST
  257. #define WASABI_SCRIPTOBJECTS_BITLIST
  258. #define WASABI_SCRIPTOBJECTS_REGION
  259. #define WASABI_SCRIPTOBJECTS_TIMER
  260. #define WASABI_SCRIPTOBJECTS_MAP
  261. #define WASABI_SCRIPTOBJECTS_EMBEDDEDXUI // needed by 3rd+ level objects
  262. #ifndef WASABI_EXTERNAL_GUIOBJECTS
  263. #define WASABI_SCRIPTOBJECTS_WAC
  264. #endif // WASABI_EXTERNAL_GUIOBJECTS
  265. // lone is super dirty but wants to get stuff working. we need to clean that up
  266. #ifdef WASABI_CUSTOMIMPL_MEDIACORE
  267. class api_core;
  268. extern api_core *createCustomCoreApi();
  269. extern void destroyCustomCoreApi(api_core *core);
  270. #endif
  271. #define WASABI_WNDMGR_ALLCONTAINERSDYNAMIC 0
  272. #define WASABI_WNDMGR_NORESPAWN
  273. #define WASABI_WNDMGR_OSMSGBOX
  274. #define WASABI_STATICVARMGR
  275. #define WASABI_CUSTOM_MODULE_SVCMGR
  276. #define ON_LAYOUT_CHANGED { extern void onLayoutChanged(); onLayoutChanged(); }
  277. #define ON_FATAL_SKIN_ERROR { extern void onFatalSkinError(); onFatalSkinError(); }
  278. #define ON_CREATE_EXTERNAL_WINDOW_GUID(x, y) { extern int onCreateExternalWindowGuid(GUID g); y = onCreateExternalWindowGuid(x); }
  279. #define ON_TOGGLE_DESKTOPALPHA(v) { extern void onToggleDesktopAlpha(int v); onToggleDesktopAlpha(v); }
  280. #define ON_TWEAK_CONTAINER_NAMEW(x) { extern const wchar_t *onTweakContainerNameW(const wchar_t *name); x = onTweakContainerNameW(x); }
  281. #define ON_TWEAK_RENDER_RATIO(x) { extern double onTweakRenderRatio(double v); x = onTweakRenderRatio(x); }
  282. #define ON_CUSTOM_ALTF4 { extern void onCustomAltF4(); onCustomAltF4(); }
  283. #define WASABI_DEFAULT_STDCONTAINER L"resizable_status"
  284. #define SWITCH_SKIN(x) { extern void switchSkin(const wchar_t *name); switchSkin(x); }
  285. #define IS_SKIN_STILL_LOADING(x) { extern int isSkinStillLoading(); x = isSkinStillLoading(); }
  286. #define ON_LOAD_EXTRA_COLORTHEMES() { extern void loadExtraColorThemes(); loadExtraColorThemes(); }
  287. #define LOCALES_CUSTOM_LOAD(x) { extern const wchar_t *localesCustomGetFile(); x = localesCustomGetFile(); }
  288. #define DEFAULT_CROSSFADE_ENABLED FALSE
  289. #define CUSTOM_VARS(x, y) { extern const wchar_t *getCustomVar(const wchar_t *var); y = getCustomVar(x); }
  290. #define WASABI_NO_RELEASEMODE_DEBUGSTRINGS
  291. #define WASABI_CUSTOM_MINIDB(field, buf, len) { extern void getCustomMetaData(const wchar_t *f, wchar_t *b, int l); getCustomMetaData(field, buf, len); }
  292. #define GET_SONG_INFO_TEXT(ret) { extern const wchar_t *getSongInfoText(); ret = getSongInfoText(); }
  293. #define GET_SONG_INFO_TEXT_TRANSLATED(ret) { extern const wchar_t *getSongInfoTextTranslated(); ret = getSongInfoTextTranslated(); }
  294. #define GET_KBDFORWARD_WND(g, wnd) { extern OSWINDOWHANDLE getKeyboardForwardWnd(GUID g); wnd = getKeyboardForwardWnd(g); }
  295. #define WASABI_EDITWND_LISTCOLORS // editwnds use list foreground & background rather than their own colors
  296. #define WASABI_APPBAR_ONDOCKCHANGED(wnd) { extern void onAppBarDockChanged(ifc_window *w); onAppBarDockChanged(wnd); }
  297. #define WASABI_GET_VERSION(cs, n) { extern const char *getVersion(); STRNCPY(cs, getVersion(), n); cs[n] = 0; }
  298. #define WASABI_ON_MAIN_MOVE(hwnd) { extern void onMainLayoutMove(HWND w); onMainLayoutMove(hwnd); }
  299. #define WASABI_ON_REPARENT(hwnd) { extern void onReParent(HWND w); onReParent(hwnd); }
  300. #define WASABI_ON_REINIT(hwnd) { extern void onReInit(HWND w); onReInit(hwnd); }
  301. #define WASABI_GET_TEMPDISABLE_AOT(x) { extern int getAOTTempDisable(); x = getAOTTempDisable(); }
  302. #define WASABI_CHECK_CAN_EXIT(x) { extern int canExitWinamp(); x = canExitWinamp(); }
  303. #define WASABI_CHECK_OFFSCREENCHECK_DISABLE(x) { extern int fsMonitorIsFS(); x = fsMonitorIsFS(); }
  304. #define WASABI_MODAL_PUSH { extern void modalPush(); modalPush(); }
  305. #define WASABI_MODAL_POP { extern void modalPop(); modalPop(); }
  306. // config defaults
  307. #define DEFAULT_DESKTOPALPHA TRUE
  308. #define DEFAULT_LINKLAYOUTSCALE TRUE
  309. #define DEFAULT_LINKLAYOUTSALPHA FALSE
  310. #define DEFAULT_LINKALLALPHA TRUE
  311. #define DEFAULT_LINKALLRATIO FALSE
  312. #define DEFAULT_LINKEDALPHA 255
  313. #define DEFAULT_AUTOOPACITYTIME 2000
  314. #define DEFAULT_AUTOOPACITYFADEIN 250
  315. #define DEFAULT_AUTOOPACITYFADEOUT 1000
  316. #define DEFAULT_AUTOOPACITYTYPE 0
  317. #define DEFAULT_EXTENDAUTOOPACITY 25
  318. #define DEFAULT_USERATIOLOCKS FALSE
  319. #define DEFAULT_TIMERRESOLUTION 33
  320. #define DEFAULT_TOOLTIPS TRUE
  321. #define DEFAULT_TEXTSPEED 1.0f/3.0f
  322. #define DEFAULT_TEXTINCREMENT 1
  323. #define DEFAULT_APPBARHIDETIME 500
  324. #define DEFAULT_APPBARSHOWTIME 500
  325. #define UTF8 0
  326. #define WANT_UTF8_WARNINGS
  327. //#define DROP_BITMAP_ON_IDLE
  328. //#include "../../bfc/api/api_system.h"
  329. #include <api/application/api_application.h>
  330. #include <api/service/api_service.h>
  331. #include <api/syscb/api_syscbi.h>
  332. #ifdef WASABI_COMPILE_MEMMGR
  333. # include <api/memmgr/api_memmgr.h>
  334. #endif
  335. #ifdef WASABI_COMPILE_SCRIPT
  336. # include <api/script/api_maki.h>
  337. #endif
  338. #ifdef WASABI_COMPILE_FONTS
  339. # include <api/font/api_font.h>
  340. #endif
  341. #ifdef WASABI_COMPILE_WND
  342. # include <api/wnd/api_wnd.h>
  343. #endif
  344. #ifdef WASABI_COMPILE_IMGLDR
  345. # include <api/imgldr/api_imgldr.h>
  346. #endif
  347. #ifdef WASABI_COMPILE_FILEREADER
  348. # include <api/filereader/api_filereader.h>
  349. #endif
  350. #ifdef WASABI_COMPILE_TIMERS
  351. # include <api/timer/api_timer.h>
  352. #endif
  353. #ifdef WASABI_COMPILE_WNDMGR
  354. # include <api/wndmgr/api_wndmgr.h>
  355. #endif
  356. #ifdef WASABI_COMPILE_LOCALES
  357. # include <api/locales/api_locales.h>
  358. #endif
  359. #ifdef WASABI_COMPILE_CONFIG
  360. # include <api/config/api_config.h>
  361. #endif
  362. # include "../xml/obj_xml.h"
  363. #ifdef WASABI_COMPILE_SKIN
  364. # include <api/skin/api_skin.h>
  365. #endif
  366. #ifdef WASABI_COMPILE_MAKIDEBUG
  367. # include <api/script/debugger/api_makidebug.h>
  368. #endif
  369. #endif