Fix function names.
[wine/multimedia.git] / include / windef.h
blob5a8fa100c371ee8ecdba36341b735299ed4357b2
1 /*
2 * Basic types definitions
4 * Copyright 1996 Alexandre Julliard
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.
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.
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
21 #ifndef _WINDEF_
22 #define _WINDEF_
24 #ifndef WINVER
25 #define WINVER 0x0500
26 #endif
28 #ifndef NO_STRICT
29 # ifndef STRICT
30 # define STRICT
31 # endif /* STRICT */
32 #endif /* NO_STRICT */
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
38 /* Calling conventions definitions */
40 #if defined(__i386__) && !defined(_X86_)
41 # define _X86_
42 #endif
44 #ifdef __x86_64__
45 #define _WIN64
46 #endif
48 #ifndef __stdcall
49 # ifdef __i386__
50 # ifdef __GNUC__
51 # define __stdcall __attribute__((__stdcall__))
52 # elif defined(_MSC_VER)
53 /* Nothing needs to be done. __stdcall already exists */
54 # else
55 # error You need to define __stdcall for your compiler
56 # endif
57 # else /* __i386__ */
58 # define __stdcall
59 # endif /* __i386__ */
60 #endif /* __stdcall */
62 #ifndef __cdecl
63 # if defined(__i386__) && defined(__GNUC__)
64 # define __cdecl __attribute__((__cdecl__))
65 # elif !defined(_MSC_VER)
66 # define __cdecl
67 # endif
68 #endif /* __cdecl */
70 #ifdef __WINESRC__
71 #define __ONLY_IN_WINELIB(x) do_not_use_this_in_wine
72 #else
73 #define __ONLY_IN_WINELIB(x) x
74 #endif
76 #ifndef pascal
77 #define pascal __ONLY_IN_WINELIB(__stdcall)
78 #endif
79 #ifndef _pascal
80 #define _pascal __ONLY_IN_WINELIB(__stdcall)
81 #endif
82 #ifndef _stdcall
83 #define _stdcall __ONLY_IN_WINELIB(__stdcall)
84 #endif
85 #ifndef _fastcall
86 #define _fastcall __ONLY_IN_WINELIB(__stdcall)
87 #endif
88 #ifndef __fastcall
89 #define __fastcall __ONLY_IN_WINELIB(__stdcall)
90 #endif
91 #ifndef __export
92 #define __export __ONLY_IN_WINELIB(__stdcall)
93 #endif
94 #ifndef cdecl
95 #define cdecl __ONLY_IN_WINELIB(__cdecl)
96 #endif
97 #ifndef _cdecl
98 #define _cdecl __ONLY_IN_WINELIB(__cdecl)
99 #endif
101 #ifndef near
102 #define near __ONLY_IN_WINELIB()
103 #endif
104 #ifndef far
105 #define far __ONLY_IN_WINELIB()
106 #endif
107 #ifndef _near
108 #define _near __ONLY_IN_WINELIB()
109 #endif
110 #ifndef _far
111 #define _far __ONLY_IN_WINELIB()
112 #endif
113 #ifndef NEAR
114 #define NEAR __ONLY_IN_WINELIB()
115 #endif
116 #ifndef FAR
117 #define FAR __ONLY_IN_WINELIB()
118 #endif
120 #ifndef _MSC_VER
121 # ifndef _declspec
122 # define _declspec(x) __ONLY_IN_WINELIB()
123 # endif
124 # ifndef __declspec
125 # define __declspec(x) __ONLY_IN_WINELIB()
126 # endif
127 #endif
129 #define CALLBACK __stdcall
130 #define WINAPI __stdcall
131 #define APIPRIVATE __stdcall
132 #define PASCAL __stdcall
133 #define CDECL __cdecl
134 #define _CDECL __cdecl
135 #define WINAPIV __cdecl
136 #define APIENTRY WINAPI
137 #define CONST const
139 /* Misc. constants. */
141 #undef NULL
142 #ifdef __cplusplus
143 #define NULL 0
144 #else
145 #define NULL ((void*)0)
146 #endif
148 #ifdef FALSE
149 #undef FALSE
150 #endif
151 #define FALSE 0
153 #ifdef TRUE
154 #undef TRUE
155 #endif
156 #define TRUE 1
158 #ifndef IN
159 #define IN
160 #endif
162 #ifndef OUT
163 #define OUT
164 #endif
166 #ifndef OPTIONAL
167 #define OPTIONAL
168 #endif
170 /* Standard data types */
172 typedef void *LPVOID;
173 typedef const void *LPCVOID;
174 typedef int BOOL, *PBOOL, *LPBOOL;
175 typedef unsigned char BYTE, *PBYTE, *LPBYTE;
176 typedef unsigned char UCHAR, *PUCHAR;
177 typedef unsigned short WORD, *PWORD, *LPWORD;
178 typedef unsigned short USHORT, *PUSHORT;
179 typedef int INT, *PINT, *LPINT;
180 typedef unsigned int UINT, *PUINT;
181 typedef float FLOAT, *PFLOAT;
182 typedef char *PSZ;
183 #if defined(_WIN64) && !defined(_MSC_VER)
184 typedef int *LPLONG;
185 typedef unsigned int DWORD, *PDWORD, *LPDWORD;
186 typedef unsigned int ULONG, *PULONG;
187 #else
188 typedef long *LPLONG;
189 typedef unsigned long DWORD, *PDWORD, *LPDWORD;
190 typedef unsigned long ULONG, *PULONG;
191 #endif
193 /* Macros to map Winelib names to the correct implementation name */
194 /* Note that Winelib is purely Win32. */
196 #ifdef __WINESRC__
197 #define WINE_NO_UNICODE_MACROS
198 #endif
200 #ifdef WINE_NO_UNICODE_MACROS
201 # define WINELIB_NAME_AW(func) \
202 func##_must_be_suffixed_with_W_or_A_in_this_context \
203 func##_must_be_suffixed_with_W_or_A_in_this_context
204 #else /* WINE_NO_UNICODE_MACROS */
205 # ifdef UNICODE
206 # define WINELIB_NAME_AW(func) func##W
207 # else
208 # define WINELIB_NAME_AW(func) func##A
209 # endif
210 #endif /* WINE_NO_UNICODE_MACROS */
212 #ifdef WINE_NO_UNICODE_MACROS
213 # define DECL_WINELIB_TYPE_AW(type) /* nothing */
214 #else
215 # define DECL_WINELIB_TYPE_AW(type) typedef WINELIB_NAME_AW(type) type;
216 #endif
218 #include <winnt.h>
220 /* Polymorphic types */
222 typedef UINT_PTR WPARAM;
223 typedef LONG_PTR LPARAM;
224 typedef LONG_PTR LRESULT;
226 /* Integer types */
228 typedef WORD ATOM;
229 typedef DWORD COLORREF, *LPCOLORREF;
232 /* Handle types */
234 typedef int HFILE;
235 DECLARE_HANDLE(HACCEL);
236 DECLARE_HANDLE(HBITMAP);
237 DECLARE_HANDLE(HBRUSH);
238 DECLARE_HANDLE(HCOLORSPACE);
239 DECLARE_HANDLE(HDC);
240 DECLARE_HANDLE(HDESK);
241 DECLARE_HANDLE(HENHMETAFILE);
242 DECLARE_HANDLE(HFONT);
243 DECLARE_HANDLE(HGLRC);
244 DECLARE_HANDLE(HHOOK);
245 DECLARE_HANDLE(HICON);
246 DECLARE_HANDLE(HINSTANCE);
247 DECLARE_HANDLE(HKEY);
248 typedef HKEY *PHKEY;
249 DECLARE_HANDLE(HKL);
250 DECLARE_HANDLE(HMENU);
251 DECLARE_HANDLE(HMETAFILE);
252 DECLARE_HANDLE(HMONITOR);
253 DECLARE_HANDLE(HPALETTE);
254 DECLARE_HANDLE(HPEN);
255 DECLARE_HANDLE(HRGN);
256 DECLARE_HANDLE(HRSRC);
257 DECLARE_HANDLE(HTASK);
258 DECLARE_HANDLE(HWINEVENTHOOK);
259 DECLARE_HANDLE(HWINSTA);
260 DECLARE_HANDLE(HWND);
262 /* Handle types that must remain interchangeable even with strict on */
264 typedef HINSTANCE HMODULE;
265 typedef HANDLE HGDIOBJ;
266 typedef HANDLE HGLOBAL;
267 typedef HANDLE HLOCAL;
268 typedef HANDLE GLOBALHANDLE;
269 typedef HANDLE LOCALHANDLE;
270 typedef HICON HCURSOR;
272 /* Callback function pointers types */
274 typedef INT (CALLBACK *FARPROC)();
275 typedef INT (CALLBACK *PROC)();
278 /* Macros to split words and longs. */
280 #define LOBYTE(w) ((BYTE)((DWORD_PTR)(w) & 0xFF))
281 #define HIBYTE(w) ((BYTE)((DWORD_PTR)(w) >> 8))
283 #define LOWORD(l) ((WORD)((DWORD_PTR)(l) & 0xFFFF))
284 #define HIWORD(l) ((WORD)((DWORD_PTR)(l) >> 16))
286 #define MAKEWORD(low,high) ((WORD)(((BYTE)((DWORD_PTR)(low) & 0xFF)) | ((WORD)((BYTE)((DWORD_PTR)(high) & 0xFF))) << 8))
287 #define MAKELONG(low,high) ((LONG)(((WORD)((DWORD_PTR)(low) & 0xFFFF)) | ((DWORD)((WORD)((DWORD_PTR)(high) & 0xFFFF))) << 16))
289 /* min and max macros */
290 #ifndef NOMINMAX
291 #ifndef max
292 #define max(a,b) (((a) > (b)) ? (a) : (b))
293 #endif
294 #ifndef min
295 #define min(a,b) (((a) < (b)) ? (a) : (b))
296 #endif
297 #endif /* NOMINMAX */
299 #ifdef MAX_PATH /* Work-around for Mingw */
300 #undef MAX_PATH
301 #endif /* MAX_PATH */
303 #define MAX_PATH 260
304 #define HFILE_ERROR ((HFILE)-1)
306 /* The SIZE structure */
307 typedef struct tagSIZE
309 LONG cx;
310 LONG cy;
311 } SIZE, *PSIZE, *LPSIZE;
313 typedef SIZE SIZEL, *PSIZEL, *LPSIZEL;
315 /* The POINT structure */
316 typedef struct tagPOINT
318 LONG x;
319 LONG y;
320 } POINT, *PPOINT, *LPPOINT;
322 typedef struct _POINTL
324 LONG x;
325 LONG y;
326 } POINTL, *PPOINTL;
328 /* The POINTS structure */
330 typedef struct tagPOINTS
332 #ifdef WORDS_BIGENDIAN
333 SHORT y;
334 SHORT x;
335 #else
336 SHORT x;
337 SHORT y;
338 #endif
339 } POINTS, *PPOINTS, *LPPOINTS;
341 /* The RECT structure */
342 typedef struct tagRECT
344 LONG left;
345 LONG top;
346 LONG right;
347 LONG bottom;
348 } RECT, *PRECT, *LPRECT;
349 typedef const RECT *LPCRECT;
351 typedef struct _RECTL
353 LONG left;
354 LONG top;
355 LONG right;
356 LONG bottom;
357 } RECTL, *PRECTL, *LPRECTL;
359 typedef const RECTL *LPCRECTL;
361 #ifdef __cplusplus
363 #endif
365 #endif /* _WINDEF_ */