source: branches/swt/include/win/windef.h

Last change on this file was 22121, checked in by rousseau, 10 years ago

Odin modifications needed for 'gdiplus' [odin]

Modifications:
o dcdata.h

Use 'typedef' for the enum so its more compatible with plain C.

o gdiplus.h

Disabling the namespaces is a quick-hack to get 'gdiplus.dll' to
build. A more proper fix would probably be using '-xc' for g++
when building the 'gdiplus' module.

o gdiplusflat.h

Temporarily remove the majority of prototypes so yet undefined types
do not get introduced already.

o gdiplusimaging.h

Possibly revert this mod after it is clear how to properly handle the
namespaces in 'gdiplus.h'.

o shtypes.h

Includes 'wtypes.h' which defines 'PROPID'.

o windef.h

Not sure why these 'IN','OUT','...' definitions only got defined when
WINE was *not* defined.

o winnt.h

Park Wine macros here for now. Proper include ordering needs to be
revisited anyway.

Note:
The headers for GDI+ headers were already added in rev. #22082 to
satisfy building 'swt.dll'. They also came from the wine-repo.

File size: 24.4 KB
RevLine 
[21299]1/*
2 * Basic types definitions
3 *
4 * Copyright 1996 Alexandre Julliard
5 */
6
7#ifndef __WINE_WINDEF_H
8#define __WINE_WINDEF_H
9
10#if (defined(__WINE__)) && (!defined(__WIN32OS2__))
11# include "config.h"
12# undef UNICODE
13#endif /* __WINE__ */
14
[21493]15#ifdef __WIN32OS2__
16#if defined (__IBMC__) || (defined(__IBMCPP__) && (__IBMCPP__ < 400))
17#define CINTERFACE
18#endif
19#endif
20
[21299]21#define WINVER 0x0500
22
23#ifdef UNICODE
24#include <wchar.h>
25#endif
26
[21421]27#include <basetsd.h>
28
[22078]29///-------------------------------------------------------------------[swt-os2]
30/// In Windows PSDK these are in 'specstrings.h'.
31/// In Wine these are in 'imagehlp.h' and 'dbghelp.h'.
32/// While 'imagehlp.h' exists in Odin32, it is not included by default.
33/// So, we'll put these here for now.
34/* A set of documentation macros (see also dbghelp.h) */
35#ifndef __deref_out
36# define __deref_out
37#endif
38#ifndef __deref_out_opt
39# define __deref_out_opt
40#endif
41#ifndef __deref_opt_out
42# define __deref_opt_out
43#endif
44#ifndef __in
45# define __in
46#endif
47#ifndef __in_opt
48# define __in_opt
49#endif
50#ifndef __in_bcount
51# define __in_bcount(x)
52#endif
53#ifndef __in_bcount_opt
54# define __in_bcount_opt(x)
55#endif
56#ifndef __in_ecount
57# define __in_ecount(x)
58#endif
59#ifndef __inout
60# define __inout
61#endif
62#ifndef __inout_opt
63# define __inout_opt
64#endif
65#ifndef __inout_bcount
66# define __inout_bcount(x)
67#endif
68#ifndef __inout_ecount
69# define __inout_ecount(x)
70#endif
71#ifndef __out
72# define __out
73#endif
74#ifndef __out_opt
75# define __out_opt
76#endif
77#ifndef __out_bcount
78# define __out_bcount(x)
79#endif
80#ifndef __out_bcount_opt
81# define __out_bcount_opt(x)
82#endif
83#ifndef __out_ecount
84# define __out_ecount(x)
85#endif
86#ifndef __out_ecount_opt
87# define __out_ecount_opt(x)
88#endif
89#ifndef __out_xcount
90# define __out_xcount(x)
91#endif
92///----------------------------------------------------------------------------
93
[21299]94#ifdef __cplusplus
95extern "C" {
96#endif
97
98/* Misc. constants. */
99
100#ifdef FALSE
101#undef FALSE
102#endif
103#define FALSE 0
104
105#ifdef TRUE
106#undef TRUE
107#endif
108#define TRUE 1
109
110#ifdef NULL
111#undef NULL
112#endif
113#define NULL 0
114
115/* Macros to map Winelib names to the correct implementation name */
116/* depending on __WINE__ and UNICODE macros. */
117/* Note that Winelib is purely Win32. */
118
119#ifdef __WINE__
120#ifdef __WIN32OS2__
121# define WINELIB_NAME_AW(func) func
122#else
123# define WINELIB_NAME_AW(func) this_is_a_syntax_error this_is_a_syntax_error
124#endif
125#else /* __WINE__ */
126# ifdef UNICODE
127# define WINELIB_NAME_AW(func) func##W
128# else
129# define WINELIB_NAME_AW(func) func##A
130# endif /* UNICODE */
131#endif /* __WINE__ */
132
133#ifdef __WINE__
134# define DECL_WINELIB_TYPE_AW(type) /* nothing */
135#else /* __WINE__ */
136# define DECL_WINELIB_TYPE_AW(type) typedef WINELIB_NAME_AW(type) type;
137#endif /* __WINE__ */
138
139
140/* Calling conventions definitions */
141
142#ifndef __WIN32OS2__
143#ifdef __i386__
144# if defined(__GNUC__) && (__GNUC__ == 2) && (__GNUC_MINOR__ >= 7)
145# define __stdcall __attribute__((__stdcall__))
146# define __cdecl __attribute__((__cdecl__))
147# define __RESTORE_ES __asm__ __volatile__("pushl %ds\n\tpopl %es")
148# else
149# error You need gcc >= 2.7 to build Wine on a 386
150# endif /* __GNUC__ */
151#else /* __i386__ */
152# define __stdcall
153# define __cdecl
154# define __RESTORE_ES
155#endif /* __i386__ */
156#endif
157
158
[21464]159#ifdef __WIN32OS2__
[21299]160#include <odin.h>
[21464]161#if defined(__GNUC__)
162extern int _argcA;
163extern char **_argvA;
164#define __argcA _argcA
165#define __argvA _argvA
166#else
167extern int __argcA;
168extern char **__argvA;
169#endif
170#endif
[21299]171
172/* define needed macros as required */
173#ifndef CALLBACK
174 #define CALLBACK __stdcall
175#endif
176
177#ifndef WINAPI
178 #define WINAPI __stdcall
179#endif
180
181#ifndef APIPRIVATE
182 #define APIPRIVATE __stdcall
183#endif
184
185#ifndef PASCAL
186 #define PASCAL __stdcall
187#endif
188
189#ifndef pascal
190 #define pascal __stdcall
191#endif
192
193#ifndef _pascal
194 #define _pascal __stdcall
195#endif
196
197#ifndef _stdcall
198 #define _stdcall __stdcall
199#endif
200
201#ifndef _fastcall
202 #define _fastcall __stdcall
203#endif
204
205#ifndef __export
206 #define __export
207#endif
208
209#ifndef CDECL
210 #define CDECL __cdecl
211#endif
212
213#ifndef _CDECL
214 #define _CDECL __cdecl
215#endif
216
217#ifndef cdecl
218 #define cdecl __cdecl
219#endif
220
221#ifndef _cdecl
222 #define _cdecl __cdecl
223#endif
224
225#ifndef WINAPIV
226 #define WINAPIV __cdecl
227#endif
228
229#ifndef APIENTRY
230 #define APIENTRY WINAPI
231#endif
232
233#ifndef WIN32API
234 #define WIN32API WINAPI
235#endif
236
237#ifndef __EMX__
238#if (__IBMC__ < 400) && (__IBMCPP__ < 360)
239#ifndef __declspec
240 #define __declspec(x)
241#endif
242
243#ifndef dllimport
244 #define dllimport
245#endif
246
247#ifndef dllexport
248 #define dllexport
249#endif
250#endif // (__IBMC__ < 400) && (__IBMCPP__ < 360)
251#endif // __EMX__
252
253#ifndef CONST
254 #define CONST const
255#endif
256
257/* Anonymous union/struct handling */
258
259#ifndef NONAMELESSSTRUCT
260#define DUMMYSTRUCTNAME
261#define DUMMYSTRUCTNAME1
262#define DUMMYSTRUCTNAME2
263#define DUMMYSTRUCTNAME3
264#define DUMMYSTRUCTNAME4
265#define DUMMYSTRUCTNAME5
[21447]266#define DUMMYSTRUCTNAME_DOT
267#define DUMMYSTRUCTNAME1_DOT
268#define DUMMYSTRUCTNAME2_DOT
269#define DUMMYSTRUCTNAME3_DOT
270#define DUMMYSTRUCTNAME4_DOT
271#define DUMMYSTRUCTNAME5_DOT
[21299]272#else /* !defined(NONAMELESSSTRUCT) */
273#define DUMMYSTRUCTNAME s
274#define DUMMYSTRUCTNAME1 s1
275#define DUMMYSTRUCTNAME2 s2
276#define DUMMYSTRUCTNAME3 s3
277#define DUMMYSTRUCTNAME4 s4
278#define DUMMYSTRUCTNAME5 s5
[21447]279#define DUMMYSTRUCTNAME_DOT s.
280#define DUMMYSTRUCTNAME1_DOT s1.
281#define DUMMYSTRUCTNAME2_DOT s2.
282#define DUMMYSTRUCTNAME3_DOT s3.
283#define DUMMYSTRUCTNAME4_DOT s4.
284#define DUMMYSTRUCTNAME5_DOT s5.
[21299]285#endif /* !defined(NONAMELESSSTRUCT) */
286
287#ifndef NONAMELESSUNION
288#define DUMMYUNIONNAME
289#define DUMMYUNIONNAME1
290#define DUMMYUNIONNAME2
291#define DUMMYUNIONNAME3
292#define DUMMYUNIONNAME4
293#define DUMMYUNIONNAME5
294#define DUMMYUNIONNAME6
295#define DUMMYUNIONNAME7
296#define DUMMYUNIONNAME8
[21447]297#define DUMMYUNIONNAME_DOT
298#define DUMMYUNIONNAME1_DOT
299#define DUMMYUNIONNAME2_DOT
300#define DUMMYUNIONNAME3_DOT
301#define DUMMYUNIONNAME4_DOT
302#define DUMMYUNIONNAME5_DOT
303#define DUMMYUNIONNAME6_DOT
304#define DUMMYUNIONNAME7_DOT
305#define DUMMYUNIONNAME8_DOT
[21299]306#else /* !defined(NONAMELESSUNION) */
307#define DUMMYUNIONNAME u
308#define DUMMYUNIONNAME1 u1
309#define DUMMYUNIONNAME2 u2
310#define DUMMYUNIONNAME3 u3
311#define DUMMYUNIONNAME4 u4
312#define DUMMYUNIONNAME5 u5
313#define DUMMYUNIONNAME6 u6
314#define DUMMYUNIONNAME7 u7
315#define DUMMYUNIONNAME8 u8
[21447]316#define DUMMYUNIONNAME_DOT u.
317#define DUMMYUNIONNAME1_DOT u1.
318#define DUMMYUNIONNAME2_DOT u2.
319#define DUMMYUNIONNAME3_DOT u3.
320#define DUMMYUNIONNAME4_DOT u4.
321#define DUMMYUNIONNAME5_DOT u5.
322#define DUMMYUNIONNAME6_DOT u6.
323#define DUMMYUNIONNAME7_DOT u7.
324#define DUMMYUNIONNAME8_DOT u8.
[21299]325#endif /* !defined(NONAMELESSUNION) */
326
327
328/* Standard data types. These are the same for emulator and library. */
329
[21378]330#if defined(__GNUC__) && defined(__cplusplus)
331/* prototypes like foo(VOID) don't work with typedef */
332#define VOID void
333#else
[21299]334typedef void VOID;
[21378]335#endif
[21299]336typedef int INT;
337typedef unsigned int UINT;
338typedef unsigned short WORD;
339typedef unsigned long DWORD;
340typedef unsigned long ULONG;
341typedef unsigned char BYTE;
342typedef long LONG;
343typedef short SHORT;
344typedef unsigned short USHORT;
345typedef char CHAR;
346typedef unsigned char UCHAR;
347/* Some systems might have wchar_t, but we really need 16 bit characters */
348#ifdef UNICODE
349typedef wchar_t WCHAR;
350#else
351typedef unsigned short WCHAR;
352#endif
353typedef unsigned short BOOL16;
354#ifdef __FORCE_BOOL_AS_INT__
355typedef int BOOL;
356#else
357typedef unsigned long BOOL;
358#endif
359typedef double DATE;
360typedef double DOUBLE;
361#if (__IBMC__ < 360) && (__IBMCPP__ < 360) && !defined (__EMX__)
362typedef double LONGLONG;
363typedef double ULONGLONG;
364typedef double ULONGULONG;
365typedef double DWORDLONG;
366#elif defined (__EMX__)
[21352]367#ifndef _INT64_T_DECLARED
[21299]368typedef long long int64_t; /* LONGLONG */
369typedef unsigned long long u_int64_t; /* LONGLONG */
[21352]370#endif
371#ifndef _UINT64_T_DECLARED
[21299]372typedef unsigned long long uint64_t; /* LONGLONG */
[21352]373#endif
[21299]374typedef int64_t LONGLONG;
375typedef uint64_t ULONGLONG;
376typedef uint64_t ULONGULONG;
377typedef uint64_t DWORDLONG;
378#else
379#include <inttypes.h>
380typedef int64_t LONGLONG;
381typedef uint64_t ULONGLONG;
382typedef uint64_t ULONGULONG;
383typedef uint64_t DWORDLONG;
384#endif
385
386/* FIXME: Wine does not compile with strict on, therefore strict
387 * handles are presently only usable on machines where sizeof(UINT) ==
388 * sizeof(void*). HANDLEs are supposed to be void* but a large amount
389 * of WINE code operates on HANDLES as if they are UINTs. So to WINE
390 * they exist as UINTs but to the Winelib user who turns on strict,
391 * they exist as void*. If there is a size difference between UINT and
392 * void* then things get ugly. */
393#ifdef STRICT
394typedef UINT16 HANDLE16;
395typedef VOID* HANDLE;
396#else
397typedef UINT16 HANDLE16;
398typedef ULONG HANDLE;
399#endif
400
401typedef HANDLE16 *LPHANDLE16;
402typedef HANDLE *LPHANDLE;
403typedef HANDLE GLOBALHANDLE;
404typedef HANDLE LOCALHANDLE;
405
406/* Integer types. These are the same for emulator and library. */
407typedef UINT16 WPARAM16;
408typedef UINT WPARAM;
409typedef LONG LPARAM;
410typedef LONG HRESULT;
411typedef LONG LRESULT;
412typedef WORD ATOM;
413typedef WORD CATCHBUF[9];
414typedef WORD *LPCATCHBUF;
415typedef DWORD REGSAM;
416typedef HANDLE HHOOK;
417typedef HANDLE HKEY;
418typedef HANDLE HMONITOR;
419typedef DWORD LCID;
420typedef WORD LANGID;
421typedef DWORD LCTYPE;
422typedef float FLOAT;
423
424/* Pointers types. These are the same for emulator and library. */
425/* winnt types */
426typedef VOID *PVOID;
427typedef const void *PCVOID;
428typedef CHAR *PCHAR;
429typedef UCHAR *PUCHAR;
430typedef BYTE *PBYTE;
[21498]431typedef USHORT *PUSHORT;
432typedef SHORT *PSHORT;
[21299]433typedef ULONG *PULONG;
434typedef LONG *PLONG;
435typedef DWORD *PDWORD;
436/* common win32 types */
437#ifdef __WINE__
438typedef CHAR *LPTSTR;
439typedef const CHAR *LPCTSTR;
440#endif
441typedef CHAR *LPSTR;
442typedef CHAR *PSTR;
443typedef const CHAR *LPCSTR;
444typedef const CHAR *PCSTR;
445typedef WCHAR *LPWSTR;
446typedef WCHAR *PWSTR;
447typedef const WCHAR *LPCWSTR;
448typedef const WCHAR *PCWSTR;
449typedef BYTE *LPBYTE;
450typedef WORD *LPWORD;
451typedef DWORD *LPDWORD;
452typedef LONG *LPLONG;
453typedef VOID *LPVOID;
454typedef const VOID *LPCVOID;
455typedef INT16 *LPINT16;
456typedef UINT16 *LPUINT16;
457typedef INT *PINT;
458typedef INT *LPINT;
459typedef UINT *PUINT;
460typedef UINT *LPUINT;
461typedef HKEY *LPHKEY;
462typedef HKEY *PHKEY;
463typedef FLOAT *PFLOAT;
464typedef FLOAT *LPFLOAT;
465typedef BOOL *PBOOL;
466typedef BOOL *LPBOOL;
467
468/* Special case: a segmented pointer is just a pointer in the user's code. */
469
470#ifdef __WINE__
471typedef DWORD SEGPTR;
472#else
473typedef void* SEGPTR;
474#endif /* __WINE__ */
475
476/* Handle types that exist both in Win16 and Win32. */
477
478#ifdef STRICT
479#define DECLARE_HANDLE(a) \
480 typedef HANDLE16 a##16; \
481 typedef a##16 *P##a##16; \
482 typedef a##16 *NP##a##16; \
483 typedef a##16 *LP##a##16; \
484 typedef struct a##__ { int unused; } *a; \
485 typedef a *P##a; \
486 typedef a *LP##a
487#else /*STRICT*/
488#define DECLARE_HANDLE(a) \
489 typedef HANDLE16 a##16; \
490 typedef a##16 *P##a##16; \
491 typedef a##16 *NP##a##16; \
492 typedef a##16 *LP##a##16; \
493 typedef HANDLE a; \
494 typedef a *P##a; \
495 typedef a *LP##a
496#endif /*STRICT*/
497
498DECLARE_HANDLE(HACMDRIVERID);
499DECLARE_HANDLE(HACMDRIVER);
500DECLARE_HANDLE(HACMOBJ);
501DECLARE_HANDLE(HACMSTREAM);
502DECLARE_HANDLE(HMETAFILEPICT);
503
504typedef int HFILE;
505typedef HANDLE16 HFILE16;
506
507DECLARE_HANDLE(HACCEL);
508DECLARE_HANDLE(HBITMAP);
509DECLARE_HANDLE(HBRUSH);
510DECLARE_HANDLE(HCOLORSPACE);
511DECLARE_HANDLE(HDC);
512DECLARE_HANDLE(HGLRC); // OpenGL
513DECLARE_HANDLE(HDROP);
514DECLARE_HANDLE(HDRVR);
515DECLARE_HANDLE(HDWP);
516DECLARE_HANDLE(HENHMETAFILE);
517DECLARE_HANDLE(HFONT);
518DECLARE_HANDLE(HICON);
519DECLARE_HANDLE(HINSTANCE);
520DECLARE_HANDLE(HMENU);
521DECLARE_HANDLE(HMETAFILE);
522DECLARE_HANDLE(HMIDI);
523DECLARE_HANDLE(HMIDIIN);
524DECLARE_HANDLE(HMIDIOUT);
525DECLARE_HANDLE(HMIDISTRM);
526DECLARE_HANDLE(HMIXER);
527DECLARE_HANDLE(HMIXEROBJ);
528DECLARE_HANDLE(HMMIO);
529DECLARE_HANDLE(HPALETTE);
530DECLARE_HANDLE(HPEN);
531DECLARE_HANDLE(HQUEUE);
532DECLARE_HANDLE(HRGN);
533DECLARE_HANDLE(HRSRC);
534DECLARE_HANDLE(HTASK);
535DECLARE_HANDLE(HWAVE);
536DECLARE_HANDLE(HWAVEIN);
537DECLARE_HANDLE(HWAVEOUT);
538DECLARE_HANDLE(HWINSTA);
539DECLARE_HANDLE(HDESK);
540DECLARE_HANDLE(HWND);
541DECLARE_HANDLE(HKL);
542DECLARE_HANDLE(HIC);
543DECLARE_HANDLE(HRASCONN);
544DECLARE_HANDLE(HPRINTER);
545
[21495]546/* HICONs & HCURSORs are polymorphic */
547typedef HICON HCURSOR;
548typedef HICON16 HCURSOR16;
549
[21299]550/* Handle types that must remain interchangeable even with strict on */
551
552typedef HINSTANCE16 HMODULE16;
553typedef HINSTANCE HMODULE;
554typedef HANDLE16 HGDIOBJ16;
555typedef HANDLE16 HGLOBAL16;
556typedef HANDLE16 HLOCAL16;
557typedef HANDLE HGDIOBJ;
558typedef HANDLE HGLOBAL;
559typedef HANDLE HLOCAL;
560
561/* Callback function pointers types */
562
563#ifdef __IBMC__
564typedef BOOL16 (* CALLBACK DLGPROC16)(HWND16,UINT16,WPARAM16,LPARAM);
565typedef BOOL (* CALLBACK DLGPROC)(HWND,UINT,WPARAM,LPARAM);
566typedef LRESULT (* CALLBACK DRIVERPROC16)(DWORD,HDRVR16,UINT16,LPARAM,LPARAM);
567typedef LRESULT (* CALLBACK DRIVERPROC)(DWORD,HDRVR,UINT,LPARAM,LPARAM);
568typedef INT16 (* CALLBACK EDITWORDBREAKPROC16)(LPSTR,INT16,INT16,INT16);
569typedef INT (* CALLBACK EDITWORDBREAKPROCA)(LPSTR,INT,INT,INT);
570typedef INT (* CALLBACK EDITWORDBREAKPROCW)(LPWSTR,INT,INT,INT);
571DECL_WINELIB_TYPE_AW(EDITWORDBREAKPROC)
572typedef LRESULT (* CALLBACK FARPROC16)();
573typedef LRESULT (* CALLBACK FARPROC)();
574typedef INT16 (* CALLBACK PROC16)();
575typedef INT (* CALLBACK PROC)();
576typedef INT16 (* CALLBACK GOBJENUMPROC16)(SEGPTR,LPARAM);
577typedef INT (* CALLBACK GOBJENUMPROC)(LPVOID,LPARAM);
578typedef BOOL16 (* CALLBACK GRAYSTRINGPROC16)(HDC16,LPARAM,INT16);
579typedef BOOL (* CALLBACK GRAYSTRINGPROC)(HDC,LPARAM,INT);
580typedef LRESULT (* CALLBACK HOOKPROC16)(INT16,WPARAM16,LPARAM);
581typedef LRESULT (* CALLBACK HOOKPROC)(INT,WPARAM,LPARAM);
582typedef VOID (* CALLBACK LINEDDAPROC16)(INT16,INT16,LPARAM);
583typedef VOID (* CALLBACK LINEDDAPROC)(INT,INT,LPARAM);
584typedef BOOL16 (* CALLBACK PROPENUMPROC16)(HWND16,SEGPTR,HANDLE16);
585typedef BOOL (* CALLBACK PROPENUMPROCA)(HWND,LPCSTR,HANDLE);
586typedef BOOL (* CALLBACK PROPENUMPROCW)(HWND,LPCWSTR,HANDLE);
587DECL_WINELIB_TYPE_AW(PROPENUMPROC)
588typedef BOOL (* CALLBACK PROPENUMPROCEXA)(HWND,LPCSTR,HANDLE,LPARAM);
589typedef BOOL (* CALLBACK PROPENUMPROCEXW)(HWND,LPCWSTR,HANDLE,LPARAM);
590DECL_WINELIB_TYPE_AW(PROPENUMPROCEX)
591typedef VOID (* CALLBACK TIMERPROC16)(HWND16,UINT16,UINT16,DWORD);
592typedef VOID (* CALLBACK TIMERPROC)(HWND,UINT,UINT,DWORD);
593typedef LRESULT (* CALLBACK WNDENUMPROC16)(HWND16,LPARAM);
594//typedef LRESULT (* CALLBACK WNDENUMPROC)(HWND,LPARAM);
595typedef BOOL (* CALLBACK WNDENUMPROC)(HWND,LPARAM);
596typedef LRESULT (* CALLBACK WNDPROC16)(HWND16,UINT16,WPARAM16,LPARAM);
597typedef LRESULT (* CALLBACK WNDPROC)(HWND,UINT,WPARAM,LPARAM);
598#else
599typedef BOOL16 ( CALLBACK * DLGPROC16)(HWND16,UINT16,WPARAM16,LPARAM);
600typedef BOOL ( CALLBACK * DLGPROC)(HWND,UINT,WPARAM,LPARAM);
601typedef LRESULT ( CALLBACK * DRIVERPROC16)(DWORD,HDRVR16,UINT16,LPARAM,LPARAM);
602typedef LRESULT ( CALLBACK * DRIVERPROC)(DWORD,HDRVR,UINT,LPARAM,LPARAM);
603typedef INT16 ( CALLBACK * EDITWORDBREAKPROC16)(LPSTR,INT16,INT16,INT16);
604typedef INT ( CALLBACK * EDITWORDBREAKPROCA)(LPSTR,INT,INT,INT);
605typedef INT ( CALLBACK * EDITWORDBREAKPROCW)(LPWSTR,INT,INT,INT);
606DECL_WINELIB_TYPE_AW(EDITWORDBREAKPROC)
607typedef LRESULT ( CALLBACK * FARPROC16)();
608typedef LRESULT ( CALLBACK * FARPROC)();
609typedef INT16 ( CALLBACK * PROC16)();
610typedef INT ( CALLBACK * PROC)();
611typedef INT16 ( CALLBACK * GOBJENUMPROC16)(SEGPTR,LPARAM);
612typedef INT ( CALLBACK * GOBJENUMPROC)(LPVOID,LPARAM);
613typedef BOOL16 ( CALLBACK * GRAYSTRINGPROC16)(HDC16,LPARAM,INT16);
614typedef BOOL ( CALLBACK * GRAYSTRINGPROC)(HDC,LPARAM,INT);
615typedef LRESULT ( CALLBACK * HOOKPROC16)(INT16,WPARAM16,LPARAM);
616typedef LRESULT ( CALLBACK * HOOKPROC)(INT,WPARAM,LPARAM);
617typedef VOID ( CALLBACK * LINEDDAPROC16)(INT16,INT16,LPARAM);
618typedef VOID ( CALLBACK * LINEDDAPROC)(INT,INT,LPARAM);
619typedef BOOL16 ( CALLBACK * PROPENUMPROC16)(HWND16,SEGPTR,HANDLE16);
620typedef BOOL ( CALLBACK * PROPENUMPROCA)(HWND,LPCSTR,HANDLE);
621typedef BOOL ( CALLBACK * PROPENUMPROCW)(HWND,LPCWSTR,HANDLE);
622DECL_WINELIB_TYPE_AW(PROPENUMPROC)
623typedef BOOL ( CALLBACK * PROPENUMPROCEXA)(HWND,LPCSTR,HANDLE,LPARAM);
624typedef BOOL ( CALLBACK * PROPENUMPROCEXW)(HWND,LPCWSTR,HANDLE,LPARAM);
625DECL_WINELIB_TYPE_AW(PROPENUMPROCEX)
626typedef VOID ( CALLBACK * TIMERPROC16)(HWND16,UINT16,UINT16,DWORD);
627typedef VOID ( CALLBACK * TIMERPROC)(HWND,UINT,UINT,DWORD);
628typedef LRESULT ( CALLBACK * WNDENUMPROC16)(HWND16,LPARAM);
629typedef BOOL ( CALLBACK * WNDENUMPROC)(HWND,LPARAM);
630typedef LRESULT ( CALLBACK * WNDPROC16)(HWND16,UINT16,WPARAM16,LPARAM);
631typedef LRESULT ( CALLBACK * WNDPROC)(HWND,UINT,WPARAM,LPARAM);
632#endif
633
634/* TCHAR data types definitions for Winelib. */
635/* These types are _not_ defined for the emulator, because they */
636/* depend on the UNICODE macro that only exists in user's code. */
637
[21478]638#if !defined(__WINE__) && !defined(_TCHAR_DEFINED)
639#define _TCHAR_DEFINED
[21299]640# ifdef UNICODE
[21968]641typedef WCHAR TCHAR, *PTCHAR;
642typedef LPWSTR LPTSTR, PTSTR;
643typedef LPCWSTR LPCTSTR, PCTSTR;
[21299]644#define __TEXT(string) L##string /*probably wrong */
645# else /* UNICODE */
[21968]646typedef CHAR TCHAR, *PTCHAR;
647typedef LPSTR LPTSTR, PTSTR;
648typedef LPCSTR LPCTSTR, PCTSTR;
[21299]649#define __TEXT(string) string
650# endif /* UNICODE */
651#endif /* __WINE__ */
652#define TEXT(quote) __TEXT(quote)
653
654/* Data types specific to the library. These do _not_ exist in the emulator. */
655
656
657
658/* Define some empty macros for compatibility with Windows code. */
[22121]659// rousseau.201602131406
660// Why is this in a __WINE__ ifndef ?
661// Macro __WINE__ is defined when compiling gdi32 and thus gdiplus, and
662// gdiplus uses the 'IN' and 'OUT' stuff.
663// Disabled ifndef for now.
664///#ifndef __WINE__
[21299]665#define NEAR
666#define FAR
667#define near
668#define far
669#define _near
670#define _far
671#define IN
672#define OUT
673#define OPTIONAL
[22121]674///#endif /* __WINE__ */
[21299]675
676/* Macro for structure packing. */
677
678#ifdef __GNUC__
679#define WINE_PACKED __attribute__ ((packed))
680#define WINE_UNUSED __attribute__ ((unused))
681#else
682#define WINE_PACKED /* nothing */
683#define WINE_UNUSED /* nothing */
684#endif
685
686/* Macros to split words and longs. */
687
688#define LOBYTE(w) ((BYTE)(WORD)(w))
689#define HIBYTE(w) ((BYTE)((WORD)(w) >> 8))
690
691#define LOWORD(l) ((WORD)(DWORD)(l))
692#define HIWORD(l) ((WORD)((DWORD)(l) >> 16))
693
694#define SLOWORD(l) ((INT16)(LONG)(l))
695#define SHIWORD(l) ((INT16)((LONG)(l) >> 16))
696
697#define MAKEWORD(low,high) ((WORD)(((BYTE)(low)) | ((WORD)((BYTE)(high))) << 8))
698#define MAKELONG(low,high) ((LONG)(((WORD)(low)) | (((DWORD)((WORD)(high))) << 16)))
699#define MAKELPARAM(low,high) ((LPARAM)MAKELONG(low,high))
700#define MAKEWPARAM(low,high) ((WPARAM)MAKELONG(low,high))
701#define MAKELRESULT(low,high) ((LRESULT)MAKELONG(low,high))
702#define MAKEINTATOM(atom) ((LPCSTR)MAKELONG((atom),0))
703
704#define SELECTOROF(ptr) (HIWORD(ptr))
705#define OFFSETOF(ptr) (LOWORD(ptr))
706
707/* Macros to access unaligned or wrong-endian WORDs and DWORDs. */
708/* Note: These macros are semantically broken, at least for wrc. wrc
709 spits out data in the platform's current binary format, *not* in
710 little-endian format. These macros are used throughout the resource
711 code to load and store data to the resources. Since it is unlikely
712 that we'll ever be dealing with little-endian resource data, the
713 byte-swapping nature of these macros has been disabled. Rather than
714 remove the use of these macros from the resource loading code, the
715 macros have simply been disabled. In the future, someone may want
716 to reactivate these macros for other purposes. In that case, the
717 resource code will have to be modified to use different macros. */
718
719#if 1
720#define PUT_WORD(ptr,w) (*(WORD *)(ptr) = (w))
721#define GET_WORD(ptr) (*(WORD *)(ptr))
722#define PUT_DWORD(ptr,dw) (*(DWORD *)(ptr) = (dw))
723#define GET_DWORD(ptr) (*(DWORD *)(ptr))
724#else
725#define PUT_WORD(ptr,w) (*(BYTE *)(ptr) = LOBYTE(w), \
726 *((BYTE *)(ptr) + 1) = HIBYTE(w))
727#define GET_WORD(ptr) ((WORD)(*(BYTE *)(ptr) | \
728 (WORD)(*((BYTE *)(ptr)+1) << 8)))
729#define PUT_DWORD(ptr,dw) (PUT_WORD((ptr),LOWORD(dw)), \
730 PUT_WORD((WORD *)(ptr)+1,HIWORD(dw)))
731#define GET_DWORD(ptr) ((DWORD)(GET_WORD(ptr) | \
732 ((DWORD)GET_WORD((WORD *)(ptr)+1) << 16)))
733#endif /* 1 */
734
735/* MIN and MAX macros */
736
737#ifdef MAX
738#undef MAX
739#endif
740#define MAX(a,b) (((a) > (b)) ? (a) : (b))
741
742#ifdef MIN
743#undef MIN
744#endif
745#define MIN(a,b) (((a) < (b)) ? (a) : (b))
746
747#ifdef __max /* watcom stdlib.h defines this */
748#undef __max
749#endif
750#define __max(a,b) MAX(a,b)
751
752#ifdef __min /* watcom stdlib.h defines this */
753#undef __min
754#endif
755#define __min(a,b) MIN(a,b)
756#ifndef RC_INVOKED
757#include <stdlib.h>
758#endif
759
760#if !defined(__WATCOMC__) || !defined(_MAX_PATH)
761#define _MAX_PATH 260
762#endif
763#define MAX_PATH 260
764#define _MAX_DRIVE 3
765#if !defined(__WATCOMC__) && !defined(_MAX_DIR)
766#define _MAX_DIR 256
767#endif
768#if !defined(__WIN32OS2__) && !defined(_MAX_FNAME)
769#define _MAX_FNAME 255
770#endif
771#if !defined(__WATCOMC__) && !defined(_MAX_EXT)
772#define _MAX_EXT 256
773#endif
774
775#define HFILE_ERROR16 ((HFILE16)-1)
776#define HFILE_ERROR ((HFILE)-1)
777
778/* Winelib run-time flag */
779
780#ifdef __WINE__
781extern int __winelib;
782#endif /* __WINE__ */
783
784/* The SIZE structure */
785
786typedef struct
787{
788 INT16 cx;
789 INT16 cy;
790} SIZE16, *PSIZE16, *LPSIZE16;
791
792typedef struct tagSIZE
793{
794 INT cx;
795 INT cy;
796} SIZE, *PSIZE, *LPSIZE;
797
798
799typedef SIZE SIZEL, *PSIZEL, *LPSIZEL;
800
801#define CONV_SIZE16TO32(s16,s32) \
802 ((s32)->cx = (INT)(s16)->cx, (s32)->cy = (INT)(s16)->cy)
803#define CONV_SIZE32TO16(s32,s16) \
804 ((s16)->cx = (INT16)(s32)->cx, (s16)->cy = (INT16)(s32)->cy)
805
806/* The POINT structure */
807
808typedef struct
809{
810 INT16 x;
811 INT16 y;
812} POINT16, *PPOINT16, *LPPOINT16;
813
814typedef struct tagPOINT
815{
816 LONG x;
817 LONG y;
818} POINT, *PPOINT, *LPPOINT;
819
820typedef struct _POINTL
821{
822 LONG x;
823 LONG y;
824} POINTL;
825
826#define CONV_POINT16TO32(p16,p32) \
827 ((p32)->x = (INT)(p16)->x, (p32)->y = (INT)(p16)->y)
828#define CONV_POINT32TO16(p32,p16) \
829 ((p16)->x = (INT16)(p32)->x, (p16)->y = (INT16)(p32)->y)
830
831#define MAKEPOINT(l) (*((POINT *)&(l)))
832
833#define MAKEPOINT16(l) (*((POINT16 *)&(l)))
834
835/* The POINTS structure */
836
837typedef struct tagPOINTS
838{
839 SHORT x;
840 SHORT y;
841} POINTS, *PPOINTS, *LPPOINTS;
842
843
844#define MAKEPOINTS(l) (*((POINTS *)&(l)))
845
846
847/* The RECT structure */
848
849typedef struct
850{
851 INT16 left;
852 INT16 top;
853 INT16 right;
854 INT16 bottom;
855} RECT16, *LPRECT16;
856
857typedef struct tagRECT
858{
859 INT left;
860 INT top;
861 INT right;
862 INT bottom;
863} RECT, *PRECT, *LPRECT;
864typedef const RECT *LPCRECT;
865
866
867typedef struct tagRECTL
868{
869 LONG left;
870 LONG top;
871 LONG right;
872 LONG bottom;
873} RECTL, *PRECTL, *LPRECTL;
874
875typedef const RECTL *LPCRECTL;
876
877/*
878 * 8.9.99 DJR DECIMAL support
879 */
880typedef struct tagDEC
881{
882 USHORT wReserved;
883 union
884 {
885 struct
886 {
887 BYTE scale;
888 BYTE sign;
889 } a;
890 USHORT signscale;
891 } b;
892 ULONG Hi32;
893 union
894 {
895 struct
896 {
897 ULONG Lo32;
898 ULONG Mid32;
899 } c;
900 ULONGLONG Lo64;
901 } d;
902} DECIMAL;
903typedef DECIMAL *LPDECIMAL;
904
905#include <winbase.h>
906
907#ifdef __cplusplus
908}
909#endif
910
911#endif /* __WINE_WINDEF_H */
Note: See TracBrowser for help on using the repository browser.