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