Fix the case of product and company names.
[wine] / include / windef.h
1 /*
2  * Basic types definitions
3  *
4  * Copyright 1996 Alexandre Julliard
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  */
20
21 #ifndef __WINE_WINDEF_H
22 #define __WINE_WINDEF_H
23
24 #ifndef WINVER
25 #define WINVER 0x0500
26 #endif
27
28 #ifndef NO_STRICT
29 # ifndef STRICT
30 #  define STRICT
31 # endif /* STRICT */
32 #endif /* NO_STRICT */
33
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37
38 /* Calling conventions definitions */
39
40 #if defined(__i386__) && !defined(_X86_)
41 # define _X86_
42 #endif
43
44 #ifndef __stdcall
45 # ifdef __i386__
46 #  ifdef __GNUC__
47 #   define __stdcall __attribute__((__stdcall__))
48 #  elif defined(_MSC_VER)
49     /* Nothing needs to be done. __stdcall already exists */
50 #  else
51 #   error You need to define __stdcall for your compiler
52 #  endif
53 # else  /* __i386__ */
54 #  define __stdcall
55 # endif  /* __i386__ */
56 #endif /* __stdcall */
57
58 #ifndef __cdecl
59 # if defined(__i386__) && defined(__GNUC__)
60 #  define __cdecl __attribute__((__cdecl__))
61 # elif !defined(_MSC_VER)
62 #  define __cdecl
63 # endif
64 #endif /* __stdcall */
65
66 #ifdef __WINESRC__
67 #define __ONLY_IN_WINELIB(x)    do_not_use_this_in_wine
68 #else
69 #define __ONLY_IN_WINELIB(x)    x
70 #endif
71
72 #ifndef pascal
73 #define pascal      __ONLY_IN_WINELIB(__stdcall)
74 #endif
75 #ifndef _pascal
76 #define _pascal     __ONLY_IN_WINELIB(__stdcall)
77 #endif
78 #ifndef _stdcall
79 #define _stdcall    __ONLY_IN_WINELIB(__stdcall)
80 #endif
81 #ifndef _fastcall
82 #define _fastcall   __ONLY_IN_WINELIB(__stdcall)
83 #endif
84 #ifndef __fastcall
85 #define __fastcall  __ONLY_IN_WINELIB(__stdcall)
86 #endif
87 #ifndef __export
88 #define __export    __ONLY_IN_WINELIB(__stdcall)
89 #endif
90 #ifndef cdecl
91 #define cdecl       __ONLY_IN_WINELIB(__cdecl)
92 #endif
93 #ifndef _cdecl
94 #define _cdecl      __ONLY_IN_WINELIB(__cdecl)
95 #endif
96
97 #ifndef near
98 #define near        __ONLY_IN_WINELIB()
99 #endif
100 #ifndef far
101 #define far         __ONLY_IN_WINELIB()
102 #endif
103 #ifndef _near
104 #define _near       __ONLY_IN_WINELIB()
105 #endif
106 #ifndef _far
107 #define _far        __ONLY_IN_WINELIB()
108 #endif
109 #ifndef NEAR
110 #define NEAR        __ONLY_IN_WINELIB()
111 #endif
112 #ifndef FAR
113 #define FAR         __ONLY_IN_WINELIB()
114 #endif
115
116 #ifndef _declspec
117 #define _declspec(x)    __ONLY_IN_WINELIB()
118 #endif
119 #ifndef __declspec
120 #define __declspec(x)   __ONLY_IN_WINELIB()
121 #endif
122
123 #define CALLBACK    __stdcall
124 #define WINAPI      __stdcall
125 #define APIPRIVATE  __stdcall
126 #define PASCAL      __stdcall
127 #define CDECL       __cdecl
128 #define _CDECL      __cdecl
129 #define WINAPIV     __cdecl
130 #define APIENTRY    WINAPI
131 #define CONST       const
132
133 /* Misc. constants. */
134
135 #undef NULL
136 #ifdef __cplusplus
137 #define NULL  0
138 #else
139 #define NULL  ((void*)0)
140 #endif
141
142 #ifdef FALSE
143 #undef FALSE
144 #endif
145 #define FALSE 0
146
147 #ifdef TRUE
148 #undef TRUE
149 #endif
150 #define TRUE  1
151
152 #ifndef IN
153 #define IN
154 #endif
155
156 #ifndef OUT
157 #define OUT
158 #endif
159
160 #ifndef OPTIONAL
161 #define OPTIONAL
162 #endif
163
164 /* Standard data types */
165
166 typedef void                                   *LPVOID;
167 typedef const void                             *LPCVOID;
168 typedef int             BOOL,       *PBOOL,    *LPBOOL;
169 typedef unsigned char   BYTE,       *PBYTE,    *LPBYTE;
170 typedef unsigned char   UCHAR,      *PUCHAR;
171 typedef unsigned short  WORD,       *PWORD,    *LPWORD;
172 typedef unsigned short  USHORT,     *PUSHORT;
173 typedef int             INT,        *PINT,     *LPINT;
174 typedef unsigned int    UINT,       *PUINT;
175 typedef long                                   *LPLONG;
176 typedef unsigned long   DWORD,      *PDWORD,   *LPDWORD;
177 typedef unsigned long   ULONG,      *PULONG;
178 typedef float           FLOAT,      *PFLOAT;
179 typedef double          DOUBLE;
180 typedef double          DATE;
181
182 #include <winnt.h>
183
184 /* Macros to map Winelib names to the correct implementation name */
185 /* Note that Winelib is purely Win32.                             */
186
187 #ifdef __WINESRC__
188 # define WINELIB_NAME_AW(func) \
189     func##_must_be_suffixed_with_W_or_A_in_this_context \
190     func##_must_be_suffixed_with_W_or_A_in_this_context
191 #else  /* __WINESRC__ */
192 # ifdef UNICODE
193 #  define WINELIB_NAME_AW(func) func##W
194 # else
195 #  define WINELIB_NAME_AW(func) func##A
196 # endif  /* UNICODE */
197 #endif  /* __WINESRC__ */
198
199 #ifdef __WINESRC__
200 # define DECL_WINELIB_TYPE_AW(type)  /* nothing */
201 #else   /* __WINESRC__ */
202 # define DECL_WINELIB_TYPE_AW(type)  typedef WINELIB_NAME_AW(type) type;
203 #endif  /* __WINESRC__ */
204
205
206 /* Polymorphic types */
207
208 typedef UINT_PTR        WPARAM;
209 typedef LONG_PTR        LPARAM;
210 typedef LONG_PTR        LRESULT;
211
212 /* Integer types */
213
214 typedef WORD            ATOM;
215 typedef WORD            CATCHBUF[9];
216 typedef WORD           *LPCATCHBUF;
217 typedef DWORD           COLORREF, *LPCOLORREF;
218
219
220 /* Handle types */
221
222 typedef int HFILE;
223 DECLARE_HANDLE(HACCEL);
224 DECLARE_HANDLE(HBITMAP);
225 DECLARE_HANDLE(HBRUSH);
226 DECLARE_HANDLE(HCOLORSPACE);
227 DECLARE_HANDLE(HDC);
228 DECLARE_HANDLE(HDESK);
229 DECLARE_HANDLE(HENHMETAFILE);
230 DECLARE_HANDLE(HFONT);
231 DECLARE_HANDLE(HHOOK);
232 DECLARE_HANDLE(HICON);
233 DECLARE_HANDLE(HINSTANCE);
234 DECLARE_HANDLE(HKEY);
235 typedef HKEY *PHKEY;
236 DECLARE_HANDLE(HKL);
237 DECLARE_HANDLE(HMENU);
238 DECLARE_HANDLE(HMETAFILE);
239 DECLARE_HANDLE(HMONITOR);
240 DECLARE_HANDLE(HPALETTE);
241 DECLARE_HANDLE(HPEN);
242 DECLARE_HANDLE(HRGN);
243 DECLARE_HANDLE(HRSRC);
244 DECLARE_HANDLE(HTASK);
245 DECLARE_HANDLE(HWINEVENTHOOK);
246 DECLARE_HANDLE(HWINSTA);
247 DECLARE_HANDLE(HWND);
248
249 /* Handle types that must remain interchangeable even with strict on */
250
251 typedef HINSTANCE HMODULE;
252 typedef HANDLE HGDIOBJ;
253 typedef HANDLE HGLOBAL;
254 typedef HANDLE HLOCAL;
255 typedef HANDLE GLOBALHANDLE;
256 typedef HANDLE LOCALHANDLE;
257 typedef HICON HCURSOR;
258
259 /* Callback function pointers types */
260
261 typedef INT     (CALLBACK *FARPROC)();
262 typedef INT     (CALLBACK *PROC)();
263
264
265 /* Macros to split words and longs. */
266
267 #define LOBYTE(w)              ((BYTE)(WORD)(w))
268 #define HIBYTE(w)              ((BYTE)((WORD)(w) >> 8))
269
270 #define LOWORD(l)              ((WORD)(DWORD)(l))
271 #define HIWORD(l)              ((WORD)((DWORD)(l) >> 16))
272
273 #define SLOWORD(l)             ((SHORT)(LONG)(l))
274 #define SHIWORD(l)             ((SHORT)((LONG)(l) >> 16))
275
276 #define MAKEWORD(low,high)     ((WORD)(((BYTE)(low)) | ((WORD)((BYTE)(high))) << 8))
277 #define MAKELONG(low,high)     ((LONG)(((WORD)(low)) | (((DWORD)((WORD)(high))) << 16)))
278 #define MAKELPARAM(low,high)   ((LPARAM)MAKELONG(low,high))
279 #define MAKEWPARAM(low,high)   ((WPARAM)MAKELONG(low,high))
280 #define MAKELRESULT(low,high)  ((LRESULT)MAKELONG(low,high))
281
282 #define SELECTOROF(ptr)     (HIWORD(ptr))
283 #define OFFSETOF(ptr)       (LOWORD(ptr))
284
285 /* min and max macros */
286 #ifndef NOMINMAX
287 #ifndef max
288 #define max(a,b)   (((a) > (b)) ? (a) : (b))
289 #endif
290 #ifndef min
291 #define min(a,b)   (((a) < (b)) ? (a) : (b))
292 #endif
293 #endif  /* NOMINMAX */
294
295 #ifdef MAX_PATH /* Work-around for Mingw */ 
296 #undef MAX_PATH
297 #endif /* MAX_PATH */
298
299 #define MAX_PATH        260
300 #define HFILE_ERROR     ((HFILE)-1)
301
302 /* The SIZE structure */
303 typedef struct tagSIZE
304 {
305     LONG cx;
306     LONG cy;
307 } SIZE, *PSIZE, *LPSIZE;
308
309 typedef SIZE SIZEL, *PSIZEL, *LPSIZEL;
310
311 /* The POINT structure */
312 typedef struct tagPOINT
313 {
314     LONG  x;
315     LONG  y;
316 } POINT, *PPOINT, *LPPOINT;
317
318 typedef struct _POINTL
319 {
320     LONG x;
321     LONG y;
322 } POINTL;
323
324 /* The POINTS structure */
325
326 typedef struct tagPOINTS
327 {
328     SHORT x;
329     SHORT y;
330 } POINTS, *PPOINTS, *LPPOINTS;
331
332 /* The RECT structure */
333 typedef struct tagRECT
334 {
335     LONG left;
336     LONG top;
337     LONG right;
338     LONG bottom;
339 } RECT, *PRECT, *LPRECT;
340 typedef const RECT *LPCRECT;
341
342 typedef struct tagRECTL
343 {
344     LONG left;
345     LONG top;
346     LONG right;
347     LONG bottom;
348 } RECTL, *PRECTL, *LPRECTL;
349
350 typedef const RECTL *LPCRECTL;
351
352 #ifdef __cplusplus
353 }
354 #endif
355
356 #endif /* __WINE_WINDEF_H */