Mercurial > mplayer.hg
annotate loader/wine/windef.h @ 35104:053d1129e569
Fix reading language from teletext descriptor when it is not
the first descriptor in the block.
author | reimar |
---|---|
date | Sat, 15 Sep 2012 13:25:56 +0000 |
parents | 77723c0716bb |
children |
rev | line source |
---|---|
1 | 1 /* |
2 * Basic types definitions | |
3 * | |
4 * Copyright 1996 Alexandre Julliard | |
15166
f5537cc95b02
Mark modified imported files as such to comply with GPL ¡ø2a.
diego
parents:
13182
diff
changeset
|
5 * |
18783 | 6 * Modified for use with MPlayer, detailed changelog at |
7 * http://svn.mplayerhq.hu/mplayer/trunk/ | |
15166
f5537cc95b02
Mark modified imported files as such to comply with GPL ¡ø2a.
diego
parents:
13182
diff
changeset
|
8 * |
1 | 9 */ |
10 | |
26045 | 11 #ifndef MPLAYER_WINDEF_H |
12 #define MPLAYER_WINDEF_H | |
1 | 13 |
14 # include "config.h" | |
15 | |
16 /* Misc. constants. */ | |
17 | |
18 #ifdef FALSE | |
19 #undef FALSE | |
20 #endif | |
21 #define FALSE 0 | |
22 | |
23 #ifdef TRUE | |
24 #undef TRUE | |
25 #endif | |
26 #define TRUE 1 | |
27 | |
28 #ifdef NULL | |
29 #undef NULL | |
30 #endif | |
31 #define NULL 0 | |
32 | |
33 /* Macros to map Winelib names to the correct implementation name */ | |
34 /* Note that Winelib is purely Win32. */ | |
35 | |
36 # define WINELIB_NAME_AW(func) \ | |
37 func##_must_be_suffixed_with_W_or_A_in_this_context \ | |
38 func##_must_be_suffixed_with_W_or_A_in_this_context | |
39 | |
40 # define DECL_WINELIB_TYPE_AW(type) /* nothing */ | |
41 | |
42 #ifndef NONAMELESSSTRUCT | |
43 # define NONAMELESSSTRUCT | |
44 #endif /* !defined(NONAMELESSSTRUCT) */ | |
45 | |
46 #ifndef NONAMELESSUNION | |
47 # define NONAMELESSUNION | |
48 #endif /* !defined(NONAMELESSUNION) */ | |
49 | |
50 #ifndef NONAMELESSSTRUCT | |
51 #define DUMMYSTRUCTNAME | |
52 #define DUMMYSTRUCTNAME1 | |
53 #define DUMMYSTRUCTNAME2 | |
54 #define DUMMYSTRUCTNAME3 | |
55 #define DUMMYSTRUCTNAME4 | |
56 #define DUMMYSTRUCTNAME5 | |
57 #else /* !defined(NONAMELESSSTRUCT) */ | |
58 #define DUMMYSTRUCTNAME s | |
59 #define DUMMYSTRUCTNAME1 s1 | |
60 #define DUMMYSTRUCTNAME2 s2 | |
61 #define DUMMYSTRUCTNAME3 s3 | |
62 #define DUMMYSTRUCTNAME4 s4 | |
63 #define DUMMYSTRUCTNAME5 s5 | |
64 #endif /* !defined(NONAMELESSSTRUCT) */ | |
65 | |
66 #ifndef NONAMELESSUNION | |
67 #define DUMMYUNIONNAME | |
68 #define DUMMYUNIONNAME1 | |
69 #define DUMMYUNIONNAME2 | |
70 #define DUMMYUNIONNAME3 | |
71 #define DUMMYUNIONNAME4 | |
72 #define DUMMYUNIONNAME5 | |
73 #else /* !defined(NONAMELESSUNION) */ | |
74 #define DUMMYUNIONNAME u | |
75 #define DUMMYUNIONNAME1 u1 | |
76 #define DUMMYUNIONNAME2 u2 | |
77 #define DUMMYUNIONNAME3 u3 | |
78 #define DUMMYUNIONNAME4 u4 | |
79 #define DUMMYUNIONNAME5 u5 | |
80 #endif /* !defined(NONAMELESSUNION) */ | |
81 | |
82 /* Calling conventions definitions */ | |
83 | |
84 #ifdef __i386__ | |
85 # if defined(__GNUC__) && ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 7))) | |
86 #define __stdcall __attribute__((__stdcall__)) | |
87 #define __cdecl __attribute__((__cdecl__)) | |
27757
b5a46071062a
Replace all occurrences of '__volatile__' and '__volatile' by plain 'volatile'.
diego
parents:
26045
diff
changeset
|
88 # define RESTORE_ES __asm__ volatile("pushl %ds\n\tpopl %es") |
1 | 89 # else |
186 | 90 // # error You need gcc >= 2.7 to build Wine on a 386 |
1 | 91 # endif |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27757
diff
changeset
|
92 #else |
1 | 93 # define __stdcall |
94 # define __cdecl | |
25794
2c8cdb9123b8
Fix a ton of illegal identifiers. Identifiers starting with __ or _ and a
diego
parents:
24422
diff
changeset
|
95 # define RESTORE_ES |
1 | 96 #endif |
97 | |
98 #define CALLBACK __stdcall | |
99 #define WINAPI __stdcall | |
100 #define APIPRIVATE __stdcall | |
101 #define PASCAL __stdcall | |
102 #define pascal __stdcall | |
103 #define _pascal __stdcall | |
9978 | 104 #if !defined(__CYGWIN__) && !defined(__MINGW32__) |
1 | 105 #define _stdcall __stdcall |
106 #define _fastcall __stdcall | |
107 #define __fastcall __stdcall | |
7182
0bfd137f492a
fix some warnings on cygwin, patch by Sylvain Petreolle <spetreolle@yahoo.fr>
atmos4
parents:
6302
diff
changeset
|
108 #endif |
1 | 109 #define __export __stdcall |
110 #define CDECL __cdecl | |
111 #define _CDECL __cdecl | |
112 #define cdecl __cdecl | |
9978 | 113 #if !defined(__CYGWIN__) && !defined(__MINGW32__) |
1 | 114 #define _cdecl __cdecl |
6302
aa9aca7772de
cygwin & darwin fixes by Joey Parrish <joey@yunamusic.com>
arpi
parents:
3548
diff
changeset
|
115 #endif |
1 | 116 #define WINAPIV __cdecl |
117 #define APIENTRY WINAPI | |
118 | |
9978 | 119 #if !defined(__CYGWIN__) && !defined(__MINGW32__) |
1 | 120 #define __declspec(x) |
6302
aa9aca7772de
cygwin & darwin fixes by Joey Parrish <joey@yunamusic.com>
arpi
parents:
3548
diff
changeset
|
121 #endif |
1 | 122 #define dllimport |
123 #define dllexport | |
124 | |
125 #define CONST const | |
126 | |
127 /* Standard data types. These are the same for emulator and library. */ | |
128 | |
129 typedef void VOID; | |
130 typedef int INT; | |
131 typedef unsigned int UINT; | |
132 typedef unsigned short WORD; | |
13182 | 133 typedef unsigned long DWORD; |
134 typedef unsigned long ULONG; | |
1 | 135 typedef unsigned char BYTE; |
136 typedef long LONG; | |
137 typedef short SHORT; | |
138 typedef unsigned short USHORT; | |
139 typedef char CHAR; | |
140 typedef unsigned char UCHAR; | |
141 | |
142 typedef LONG SCODE; | |
143 | |
144 /* Some systems might have wchar_t, but we really need 16 bit characters */ | |
145 typedef unsigned short WCHAR; | |
146 typedef int WIN_BOOL; | |
147 typedef double DATE; | |
148 typedef double DOUBLE; | |
128 | 149 typedef long long LONGLONG; |
150 typedef unsigned long long ULONGLONG; | |
1 | 151 |
152 /* FIXME: Wine does not compile with strict on, therefore strict | |
153 * handles are presently only usable on machines where sizeof(UINT) == | |
154 * sizeof(void*). HANDLEs are supposed to be void* but a large amount | |
155 * of WINE code operates on HANDLES as if they are UINTs. So to WINE | |
156 * they exist as UINTs but to the Winelib user who turns on strict, | |
157 * they exist as void*. If there is a size difference between UINT and | |
158 * void* then things get ugly. */ | |
159 #ifdef STRICT | |
160 typedef VOID* HANDLE; | |
161 #else | |
162 typedef UINT HANDLE; | |
163 #endif | |
164 | |
165 | |
166 typedef HANDLE *LPHANDLE; | |
167 | |
168 /* Integer types. These are the same for emulator and library. */ | |
169 typedef UINT WPARAM; | |
170 typedef LONG LPARAM; | |
171 typedef LONG HRESULT; | |
172 typedef LONG LRESULT; | |
173 typedef WORD ATOM; | |
174 typedef WORD CATCHBUF[9]; | |
175 typedef WORD *LPCATCHBUF; | |
176 typedef HANDLE HHOOK; | |
177 typedef HANDLE HMONITOR; | |
178 typedef DWORD LCID; | |
179 typedef WORD LANGID; | |
180 typedef DWORD LCTYPE; | |
181 typedef float FLOAT; | |
182 | |
183 /* Pointers types. These are the same for emulator and library. */ | |
184 /* winnt types */ | |
185 typedef VOID *PVOID; | |
186 typedef const void *PCVOID; | |
187 typedef CHAR *PCHAR; | |
188 typedef UCHAR *PUCHAR; | |
189 typedef BYTE *PBYTE; | |
190 typedef WORD *PWORD; | |
191 typedef USHORT *PUSHORT; | |
192 typedef SHORT *PSHORT; | |
193 typedef ULONG *PULONG; | |
194 typedef LONG *PLONG; | |
195 typedef DWORD *PDWORD; | |
196 /* common win32 types */ | |
197 typedef CHAR *LPSTR; | |
198 typedef CHAR *PSTR; | |
199 typedef const CHAR *LPCSTR; | |
200 typedef const CHAR *PCSTR; | |
201 typedef WCHAR *LPWSTR; | |
202 typedef WCHAR *PWSTR; | |
203 typedef const WCHAR *LPCWSTR; | |
204 typedef const WCHAR *PCWSTR; | |
205 typedef BYTE *LPBYTE; | |
206 typedef WORD *LPWORD; | |
207 typedef DWORD *LPDWORD; | |
208 typedef LONG *LPLONG; | |
209 typedef VOID *LPVOID; | |
210 typedef const VOID *LPCVOID; | |
211 typedef INT *PINT; | |
212 typedef INT *LPINT; | |
213 typedef UINT *PUINT; | |
214 typedef UINT *LPUINT; | |
215 typedef FLOAT *PFLOAT; | |
216 typedef FLOAT *LPFLOAT; | |
217 typedef WIN_BOOL *PWIN_BOOL; | |
218 typedef WIN_BOOL *LPWIN_BOOL; | |
219 | |
220 /* Special case: a segmented pointer is just a pointer in the user's code. */ | |
221 | |
222 typedef DWORD SEGPTR; | |
223 | |
224 /* Handle types that exist both in Win16 and Win32. */ | |
225 | |
226 #ifdef STRICT | |
227 #define DECLARE_HANDLE(a) \ | |
228 typedef struct a##__ { int unused; } *a; \ | |
229 typedef a *P##a; \ | |
230 typedef a *LP##a | |
231 #else /*STRICT*/ | |
232 #define DECLARE_HANDLE(a) \ | |
233 typedef HANDLE a; \ | |
234 typedef a *P##a; \ | |
235 typedef a *LP##a | |
236 #endif /*STRICT*/ | |
237 | |
238 DECLARE_HANDLE(HACMDRIVERID); | |
239 DECLARE_HANDLE(HACMDRIVER); | |
240 DECLARE_HANDLE(HACMOBJ); | |
241 DECLARE_HANDLE(HACMSTREAM); | |
242 DECLARE_HANDLE(HMETAFILEPICT); | |
243 | |
244 DECLARE_HANDLE(HACCEL); | |
245 DECLARE_HANDLE(HBITMAP); | |
246 DECLARE_HANDLE(HBRUSH); | |
247 DECLARE_HANDLE(HCOLORSPACE); | |
248 DECLARE_HANDLE(HCURSOR); | |
249 DECLARE_HANDLE(HDC); | |
250 DECLARE_HANDLE(HDROP); | |
251 DECLARE_HANDLE(HDRVR); | |
252 DECLARE_HANDLE(HDWP); | |
253 DECLARE_HANDLE(HENHMETAFILE); | |
254 DECLARE_HANDLE(HFILE); | |
255 DECLARE_HANDLE(HFONT); | |
256 DECLARE_HANDLE(HICON); | |
257 DECLARE_HANDLE(HINSTANCE); | |
258 DECLARE_HANDLE(HKEY); | |
259 DECLARE_HANDLE(HMENU); | |
260 DECLARE_HANDLE(HMETAFILE); | |
261 DECLARE_HANDLE(HMIDI); | |
262 DECLARE_HANDLE(HMIDIIN); | |
263 DECLARE_HANDLE(HMIDIOUT); | |
264 DECLARE_HANDLE(HMIDISTRM); | |
265 DECLARE_HANDLE(HMIXER); | |
266 DECLARE_HANDLE(HMIXEROBJ); | |
267 DECLARE_HANDLE(HMMIO); | |
268 DECLARE_HANDLE(HPALETTE); | |
269 DECLARE_HANDLE(HPEN); | |
270 DECLARE_HANDLE(HQUEUE); | |
271 DECLARE_HANDLE(HRGN); | |
272 DECLARE_HANDLE(HRSRC); | |
273 DECLARE_HANDLE(HTASK); | |
274 DECLARE_HANDLE(HWAVE); | |
275 DECLARE_HANDLE(HWAVEIN); | |
276 DECLARE_HANDLE(HWAVEOUT); | |
277 DECLARE_HANDLE(HWINSTA); | |
278 DECLARE_HANDLE(HDESK); | |
279 DECLARE_HANDLE(HWND); | |
280 DECLARE_HANDLE(HKL); | |
281 DECLARE_HANDLE(HIC); | |
282 DECLARE_HANDLE(HRASCONN); | |
283 | |
284 /* Handle types that must remain interchangeable even with strict on */ | |
285 | |
286 typedef HINSTANCE HMODULE; | |
287 typedef HANDLE HGDIOBJ; | |
288 typedef HANDLE HGLOBAL; | |
289 typedef HANDLE HLOCAL; | |
290 typedef HANDLE GLOBALHANDLE; | |
291 typedef HANDLE LOCALHANDLE; | |
292 | |
293 /* Callback function pointers types */ | |
294 //WIN_BOOL CALLBACK DATEFMT_ENUMPROCA(LPSTR); | |
295 | |
296 typedef WIN_BOOL CALLBACK (* DATEFMT_ENUMPROCA)(LPSTR); | |
297 typedef WIN_BOOL CALLBACK (* DATEFMT_ENUMPROCW)(LPWSTR); | |
298 DECL_WINELIB_TYPE_AW(DATEFMT_ENUMPROC) | |
299 typedef WIN_BOOL CALLBACK (*DLGPROC)(HWND,UINT,WPARAM,LPARAM); | |
300 typedef LRESULT CALLBACK (*DRIVERPROC)(DWORD,HDRVR,UINT,LPARAM,LPARAM); | |
301 typedef INT CALLBACK (*EDITWORDBREAKPROCA)(LPSTR,INT,INT,INT); | |
302 typedef INT CALLBACK (*EDITWORDBREAKPROCW)(LPWSTR,INT,INT,INT); | |
303 DECL_WINELIB_TYPE_AW(EDITWORDBREAKPROC) | |
31549
77723c0716bb
Declare FARPROC/PROC/FARPROC16/PROC16 parameter lists as 'void'.
diego
parents:
30497
diff
changeset
|
304 /* Parameter list (sometimes incorrectly) declared void to silence warnings. */ |
77723c0716bb
Declare FARPROC/PROC/FARPROC16/PROC16 parameter lists as 'void'.
diego
parents:
30497
diff
changeset
|
305 typedef LRESULT CALLBACK (*FARPROC)(void); |
77723c0716bb
Declare FARPROC/PROC/FARPROC16/PROC16 parameter lists as 'void'.
diego
parents:
30497
diff
changeset
|
306 typedef INT CALLBACK (*PROC)(void); |
1 | 307 typedef WIN_BOOL CALLBACK (*GRAYSTRINGPROC)(HDC,LPARAM,INT); |
308 typedef LRESULT CALLBACK (*HOOKPROC)(INT,WPARAM,LPARAM); | |
309 typedef WIN_BOOL CALLBACK (*PROPENUMPROCA)(HWND,LPCSTR,HANDLE); | |
310 typedef WIN_BOOL CALLBACK (*PROPENUMPROCW)(HWND,LPCWSTR,HANDLE); | |
311 DECL_WINELIB_TYPE_AW(PROPENUMPROC) | |
312 typedef WIN_BOOL CALLBACK (*PROPENUMPROCEXA)(HWND,LPCSTR,HANDLE,LPARAM); | |
313 typedef WIN_BOOL CALLBACK (*PROPENUMPROCEXW)(HWND,LPCWSTR,HANDLE,LPARAM); | |
314 DECL_WINELIB_TYPE_AW(PROPENUMPROCEX) | |
315 typedef WIN_BOOL CALLBACK (* TIMEFMT_ENUMPROCA)(LPSTR); | |
316 typedef WIN_BOOL CALLBACK (* TIMEFMT_ENUMPROCW)(LPWSTR); | |
317 DECL_WINELIB_TYPE_AW(TIMEFMT_ENUMPROC) | |
318 typedef VOID CALLBACK (*TIMERPROC)(HWND,UINT,UINT,DWORD); | |
319 typedef WIN_BOOL CALLBACK (*WNDENUMPROC)(HWND,LPARAM); | |
320 typedef LRESULT CALLBACK (*WNDPROC)(HWND,UINT,WPARAM,LPARAM); | |
321 | |
322 /*---------------------------------------------------------------------------- | |
323 ** FIXME: Better isolate Wine's reliance on the xxx16 type definitions. | |
324 ** For now, we just isolate them to make the situation clear. | |
325 **--------------------------------------------------------------------------*/ | |
326 /* | |
327 * Basic type definitions for 16 bit variations on Windows types. | |
328 * These types are provided mostly to insure compatibility with | |
329 * 16 bit windows code. | |
330 */ | |
331 | |
26045 | 332 #ifndef MPLAYER_WINDEF16_H |
333 #define MPLAYER_WINDEF16_H | |
1 | 334 |
335 #include "windef.h" | |
336 | |
337 /* Standard data types */ | |
338 | |
339 typedef short INT16; | |
340 typedef unsigned short UINT16; | |
341 typedef unsigned short WIN_BOOL16; | |
342 | |
343 typedef UINT16 HANDLE16; | |
344 typedef HANDLE16 *LPHANDLE16; | |
345 | |
346 typedef UINT16 WPARAM16; | |
347 typedef INT16 *LPINT16; | |
348 typedef UINT16 *LPUINT16; | |
349 | |
350 #define DECLARE_HANDLE16(a) \ | |
351 typedef HANDLE16 a##16; \ | |
352 typedef a##16 *P##a##16; \ | |
353 typedef a##16 *NP##a##16; \ | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27757
diff
changeset
|
354 typedef a##16 *LP##a##16 |
1 | 355 |
356 DECLARE_HANDLE16(HACMDRIVERID); | |
357 DECLARE_HANDLE16(HACMDRIVER); | |
358 DECLARE_HANDLE16(HACMOBJ); | |
359 DECLARE_HANDLE16(HACMSTREAM); | |
360 DECLARE_HANDLE16(HMETAFILEPICT); | |
361 | |
362 DECLARE_HANDLE16(HACCEL); | |
363 DECLARE_HANDLE16(HBITMAP); | |
364 DECLARE_HANDLE16(HBRUSH); | |
365 DECLARE_HANDLE16(HCOLORSPACE); | |
366 DECLARE_HANDLE16(HCURSOR); | |
367 DECLARE_HANDLE16(HDC); | |
368 DECLARE_HANDLE16(HDROP); | |
369 DECLARE_HANDLE16(HDRVR); | |
370 DECLARE_HANDLE16(HDWP); | |
371 DECLARE_HANDLE16(HENHMETAFILE); | |
372 DECLARE_HANDLE16(HFILE); | |
373 DECLARE_HANDLE16(HFONT); | |
374 DECLARE_HANDLE16(HICON); | |
375 DECLARE_HANDLE16(HINSTANCE); | |
376 DECLARE_HANDLE16(HKEY); | |
377 DECLARE_HANDLE16(HMENU); | |
378 DECLARE_HANDLE16(HMETAFILE); | |
379 DECLARE_HANDLE16(HMIDI); | |
380 DECLARE_HANDLE16(HMIDIIN); | |
381 DECLARE_HANDLE16(HMIDIOUT); | |
382 DECLARE_HANDLE16(HMIDISTRM); | |
383 DECLARE_HANDLE16(HMIXER); | |
384 DECLARE_HANDLE16(HMIXEROBJ); | |
385 DECLARE_HANDLE16(HMMIO); | |
386 DECLARE_HANDLE16(HPALETTE); | |
387 DECLARE_HANDLE16(HPEN); | |
388 DECLARE_HANDLE16(HQUEUE); | |
389 DECLARE_HANDLE16(HRGN); | |
390 DECLARE_HANDLE16(HRSRC); | |
391 DECLARE_HANDLE16(HTASK); | |
392 DECLARE_HANDLE16(HWAVE); | |
393 DECLARE_HANDLE16(HWAVEIN); | |
394 DECLARE_HANDLE16(HWAVEOUT); | |
395 DECLARE_HANDLE16(HWINSTA); | |
396 DECLARE_HANDLE16(HDESK); | |
397 DECLARE_HANDLE16(HWND); | |
398 DECLARE_HANDLE16(HKL); | |
399 DECLARE_HANDLE16(HIC); | |
400 DECLARE_HANDLE16(HRASCONN); | |
401 #undef DECLARE_HANDLE16 | |
402 | |
403 typedef HINSTANCE16 HMODULE16; | |
404 typedef HANDLE16 HGDIOBJ16; | |
405 typedef HANDLE16 HGLOBAL16; | |
406 typedef HANDLE16 HLOCAL16; | |
407 | |
408 /* The SIZE structure */ | |
409 typedef struct | |
410 { | |
411 INT16 cx; | |
412 INT16 cy; | |
413 } SIZE16, *PSIZE16, *LPSIZE16; | |
414 | |
415 /* The POINT structure */ | |
416 | |
417 typedef struct | |
418 { | |
419 INT16 x; | |
420 INT16 y; | |
421 } POINT16, *PPOINT16, *LPPOINT16; | |
422 | |
423 /* The RECT structure */ | |
424 | |
425 typedef struct | |
426 { | |
427 INT16 left; | |
428 INT16 top; | |
429 INT16 right; | |
430 INT16 bottom; | |
431 } RECT16, *LPRECT16; | |
432 | |
433 /* Callback function pointers types */ | |
434 | |
435 typedef LRESULT CALLBACK (*DRIVERPROC16)(DWORD,HDRVR16,UINT16,LPARAM,LPARAM); | |
436 typedef WIN_BOOL16 CALLBACK (*DLGPROC16)(HWND16,UINT16,WPARAM16,LPARAM); | |
437 typedef INT16 CALLBACK (*EDITWORDBREAKPROC16)(LPSTR,INT16,INT16,INT16); | |
31549
77723c0716bb
Declare FARPROC/PROC/FARPROC16/PROC16 parameter lists as 'void'.
diego
parents:
30497
diff
changeset
|
438 /* Parameter list (sometimes incorrectly) declared void to silence warnings. */ |
77723c0716bb
Declare FARPROC/PROC/FARPROC16/PROC16 parameter lists as 'void'.
diego
parents:
30497
diff
changeset
|
439 typedef LRESULT CALLBACK (*FARPROC16)(void); |
77723c0716bb
Declare FARPROC/PROC/FARPROC16/PROC16 parameter lists as 'void'.
diego
parents:
30497
diff
changeset
|
440 typedef INT16 CALLBACK (*PROC16)(void); |
1 | 441 typedef WIN_BOOL16 CALLBACK (*GRAYSTRINGPROC16)(HDC16,LPARAM,INT16); |
442 typedef LRESULT CALLBACK (*HOOKPROC16)(INT16,WPARAM16,LPARAM); | |
443 typedef WIN_BOOL16 CALLBACK (*PROPENUMPROC16)(HWND16,SEGPTR,HANDLE16); | |
444 typedef VOID CALLBACK (*TIMERPROC16)(HWND16,UINT16,UINT16,DWORD); | |
445 typedef LRESULT CALLBACK (*WNDENUMPROC16)(HWND16,LPARAM); | |
446 typedef LRESULT CALLBACK (*WNDPROC16)(HWND16,UINT16,WPARAM16,LPARAM); | |
447 | |
26045 | 448 #endif /* MPLAYER_WINDEF16_H */ |
1 | 449 |
450 /* Define some empty macros for compatibility with Windows code. */ | |
451 | |
452 /* Macro for structure packing. */ | |
453 | |
454 #ifdef __GNUC__ | |
455 #define WINE_PACKED __attribute__((packed)) | |
456 #define WINE_UNUSED __attribute__((unused)) | |
457 #define WINE_NORETURN __attribute__((noreturn)) | |
458 #else | |
459 #define WINE_PACKED /* nothing */ | |
460 #define WINE_UNUSED /* nothing */ | |
461 #define WINE_NORETURN /* nothing */ | |
462 #endif | |
463 | |
464 /* Macros to split words and longs. */ | |
465 | |
466 #define LOBYTE(w) ((BYTE)(WORD)(w)) | |
467 #define HIBYTE(w) ((BYTE)((WORD)(w) >> 8)) | |
468 | |
469 #define LOWORD(l) ((WORD)(DWORD)(l)) | |
470 #define HIWORD(l) ((WORD)((DWORD)(l) >> 16)) | |
471 | |
472 #define SLOWORD(l) ((INT16)(LONG)(l)) | |
473 #define SHIWORD(l) ((INT16)((LONG)(l) >> 16)) | |
474 | |
475 #define MAKEWORD(low,high) ((WORD)(((BYTE)(low)) | ((WORD)((BYTE)(high))) << 8)) | |
476 #define MAKELONG(low,high) ((LONG)(((WORD)(low)) | (((DWORD)((WORD)(high))) << 16))) | |
477 #define MAKELPARAM(low,high) ((LPARAM)MAKELONG(low,high)) | |
478 #define MAKEWPARAM(low,high) ((WPARAM)MAKELONG(low,high)) | |
479 #define MAKELRESULT(low,high) ((LRESULT)MAKELONG(low,high)) | |
480 #define MAKEINTATOM(atom) ((LPCSTR)MAKELONG((atom),0)) | |
481 | |
482 #define SELECTOROF(ptr) (HIWORD(ptr)) | |
483 #define OFFSETOF(ptr) (LOWORD(ptr)) | |
484 | |
485 /* macros to set parts of a DWORD (not in the Windows API) */ | |
486 #define SET_LOWORD(dw,val) ((dw) = ((dw) & 0xffff0000) | LOWORD(val)) | |
487 #define SET_LOBYTE(dw,val) ((dw) = ((dw) & 0xffffff00) | LOBYTE(val)) | |
488 #define SET_HIBYTE(dw,val) ((dw) = ((dw) & 0xffff00ff) | (LOWORD(val) & 0xff00)) | |
489 #define ADD_LOWORD(dw,val) ((dw) = ((dw) & 0xffff0000) | LOWORD((DWORD)(dw)+(val))) | |
490 | |
491 /* Macros to access unaligned or wrong-endian WORDs and DWORDs. */ | |
492 /* Note: These macros are semantically broken, at least for wrc. wrc | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27757
diff
changeset
|
493 spits out data in the platform's current binary format, *not* in |
1 | 494 little-endian format. These macros are used throughout the resource |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27757
diff
changeset
|
495 code to load and store data to the resources. Since it is unlikely |
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27757
diff
changeset
|
496 that we'll ever be dealing with little-endian resource data, the |
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27757
diff
changeset
|
497 byte-swapping nature of these macros has been disabled. Rather than |
1 | 498 remove the use of these macros from the resource loading code, the |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27757
diff
changeset
|
499 macros have simply been disabled. In the future, someone may want |
1 | 500 to reactivate these macros for other purposes. In that case, the |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27757
diff
changeset
|
501 resource code will have to be modified to use different macros. */ |
1 | 502 |
503 #if 1 | |
504 #define PUT_WORD(ptr,w) (*(WORD *)(ptr) = (w)) | |
505 #define GET_WORD(ptr) (*(WORD *)(ptr)) | |
506 #define PUT_DWORD(ptr,dw) (*(DWORD *)(ptr) = (dw)) | |
507 #define GET_DWORD(ptr) (*(DWORD *)(ptr)) | |
508 #else | |
509 #define PUT_WORD(ptr,w) (*(BYTE *)(ptr) = LOBYTE(w), \ | |
510 *((BYTE *)(ptr) + 1) = HIBYTE(w)) | |
511 #define GET_WORD(ptr) ((WORD)(*(BYTE *)(ptr) | \ | |
512 (WORD)(*((BYTE *)(ptr)+1) << 8))) | |
513 #define PUT_DWORD(ptr,dw) (PUT_WORD((ptr),LOWORD(dw)), \ | |
514 PUT_WORD((WORD *)(ptr)+1,HIWORD(dw))) | |
515 #define GET_DWORD(ptr) ((DWORD)(GET_WORD(ptr) | \ | |
516 ((DWORD)GET_WORD((WORD *)(ptr)+1) << 16))) | |
517 #endif /* 1 */ | |
518 | |
519 /* min and max macros */ | |
520 #define __max(a,b) (((a) > (b)) ? (a) : (b)) | |
521 #define __min(a,b) (((a) < (b)) ? (a) : (b)) | |
522 #ifndef max | |
523 #define max(a,b) (((a) > (b)) ? (a) : (b)) | |
524 #endif | |
525 #ifndef min | |
526 #define min(a,b) (((a) < (b)) ? (a) : (b)) | |
527 #endif | |
528 | |
9978 | 529 #ifndef _MAX_PATH |
1 | 530 #define _MAX_PATH 260 |
9978 | 531 #endif |
532 #ifndef MAX_PATH | |
1 | 533 #define MAX_PATH 260 |
9978 | 534 #endif |
535 #ifndef _MAX_DRIVE | |
1 | 536 #define _MAX_DRIVE 3 |
9978 | 537 #endif |
538 #ifndef _MAX_DIR | |
1 | 539 #define _MAX_DIR 256 |
9978 | 540 #endif |
541 #ifndef _MAX_FNAME | |
1 | 542 #define _MAX_FNAME 255 |
9978 | 543 #endif |
544 #ifndef _MAX_EXT | |
1 | 545 #define _MAX_EXT 256 |
9978 | 546 #endif |
1 | 547 |
548 #define HFILE_ERROR16 ((HFILE16)-1) | |
549 #define HFILE_ERROR ((HFILE)-1) | |
550 | |
551 /* The SIZE structure */ | |
552 typedef struct tagSIZE | |
553 { | |
554 INT cx; | |
555 INT cy; | |
556 } SIZE, *PSIZE, *LPSIZE; | |
557 | |
558 | |
559 typedef SIZE SIZEL, *PSIZEL, *LPSIZEL; | |
560 | |
561 #define CONV_SIZE16TO32(s16,s32) \ | |
562 ((s32)->cx = (INT)(s16)->cx, (s32)->cy = (INT)(s16)->cy) | |
563 #define CONV_SIZE32TO16(s32,s16) \ | |
564 ((s16)->cx = (INT16)(s32)->cx, (s16)->cy = (INT16)(s32)->cy) | |
565 | |
566 /* The POINT structure */ | |
567 typedef struct tagPOINT | |
568 { | |
569 LONG x; | |
570 LONG y; | |
571 } POINT, *PPOINT, *LPPOINT; | |
572 | |
25794
2c8cdb9123b8
Fix a ton of illegal identifiers. Identifiers starting with __ or _ and a
diego
parents:
24422
diff
changeset
|
573 typedef struct POINTL |
1 | 574 { |
575 LONG x; | |
576 LONG y; | |
577 } POINTL; | |
578 | |
579 #define CONV_POINT16TO32(p16,p32) \ | |
580 ((p32)->x = (INT)(p16)->x, (p32)->y = (INT)(p16)->y) | |
581 #define CONV_POINT32TO16(p32,p16) \ | |
582 ((p16)->x = (INT16)(p32)->x, (p16)->y = (INT16)(p32)->y) | |
583 | |
584 #define MAKEPOINT16(l) (*((POINT16 *)&(l))) | |
585 | |
586 /* The POINTS structure */ | |
587 | |
588 typedef struct tagPOINTS | |
589 { | |
590 SHORT x; | |
591 SHORT y; | |
592 } POINTS, *PPOINTS, *LPPOINTS; | |
593 | |
594 | |
595 #define MAKEPOINTS(l) (*((POINTS *)&(l))) | |
596 | |
597 | |
598 /* The RECT structure */ | |
599 typedef struct tagRECT | |
600 { | |
601 short left; | |
602 short top; | |
603 short right; | |
604 short bottom; | |
605 } RECT, *PRECT, *LPRECT; | |
606 typedef const RECT *LPCRECT; | |
607 | |
608 | |
609 typedef struct tagRECTL | |
610 { | |
611 LONG left; | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27757
diff
changeset
|
612 LONG top; |
1 | 613 LONG right; |
614 LONG bottom; | |
615 } RECTL, *PRECTL, *LPRECTL; | |
616 | |
617 typedef const RECTL *LPCRECTL; | |
618 | |
619 #define CONV_RECT16TO32(r16,r32) \ | |
620 ((r32)->left = (INT)(r16)->left, (r32)->top = (INT)(r16)->top, \ | |
621 (r32)->right = (INT)(r16)->right, (r32)->bottom = (INT)(r16)->bottom) | |
622 #define CONV_RECT32TO16(r32,r16) \ | |
623 ((r16)->left = (INT16)(r32)->left, (r16)->top = (INT16)(r32)->top, \ | |
624 (r16)->right = (INT16)(r32)->right, (r16)->bottom = (INT16)(r32)->bottom) | |
625 | |
26045 | 626 #endif /* MPLAYER_WINDEF_H */ |