~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Wine Cross Reference
wine/include/windef.h

Version: ~ [ wine-1.1.33 ] ~ [ wine-1.1.32 ] ~ [ wine-1.1.31 ] ~ [ wine-1.1.30 ] ~ [ wine-1.1.29 ] ~ [ wine-1.1.28 ] ~ [ wine-1.1.27 ] ~ [ wine-1.1.26 ] ~ [ wine-1.1.25 ] ~ [ wine-1.1.24 ] ~ [ wine-1.1.23 ] ~ [ wine-1.1.22 ] ~ [ wine-1.1.21 ] ~ [ wine-1.1.20 ] ~ [ wine-1.1.19 ] ~ [ wine-1.1.18 ] ~ [ wine-1.1.17 ] ~ [ wine-1.1.16 ] ~ [ wine-1.1.15 ] ~ [ wine-1.1.14 ] ~ [ wine-1.1.13 ] ~ [ wine-1.1.12 ] ~ [ wine-1.1.11 ] ~ [ wine-1.1.10 ] ~ [ wine-1.1.9 ] ~ [ wine-1.1.8 ] ~ [ wine-1.1.7 ] ~ [ wine-1.0.1 ] ~ [ wine-1.1.6 ] ~ [ wine-1.1.5 ] ~ [ wine-1.1.4 ] ~ [ wine-1.1.3 ] ~ [ wine-1.1.2 ] ~ [ wine-1.1.1 ] ~ [ wine-1.1.0 ] ~ [ wine-1.0 ] ~

  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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 19  */
 20 
 21 #ifndef _WINDEF_
 22 #define _WINDEF_
 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 #if defined(_X86_) && !defined(__i386__)
 45 # define __i386__
 46 #endif
 47 
 48 #if defined(__x86_64__) && !defined(_WIN64)
 49 #define _WIN64
 50 #endif
 51 
 52 #ifndef __stdcall
 53 # ifdef __i386__
 54 #  ifdef __GNUC__
 55 #   ifdef __APPLE__ /* Mac OS X uses a 16-byte aligned stack and not a 4-byte one */
 56 #    define __stdcall __attribute__((__stdcall__)) __attribute__((__force_align_arg_pointer__))
 57 #   else
 58 #    define __stdcall __attribute__((__stdcall__))
 59 #   endif
 60 #  elif defined(_MSC_VER)
 61     /* Nothing needs to be done. __stdcall already exists */
 62 #  else
 63 #   error You need to define __stdcall for your compiler
 64 #  endif
 65 # elif defined(__x86_64__) && defined (__GNUC__)
 66 #  define __stdcall __attribute__((ms_abi))
 67 # else  /* __i386__ */
 68 #  define __stdcall
 69 # endif  /* __i386__ */
 70 #endif /* __stdcall */
 71 
 72 #ifndef __cdecl
 73 # if defined(__i386__) && defined(__GNUC__)
 74 #  ifdef __APPLE__ /* Mac OS X uses 16-byte aligned stack and not a 4-byte one */
 75 #   define __cdecl __attribute__((__cdecl__)) __attribute__((__force_align_arg_pointer__))
 76 #  else
 77 #   define __cdecl __attribute__((__cdecl__))
 78 #  endif
 79 # elif defined(__x86_64__) && defined (__GNUC__)
 80 #  define __cdecl __attribute__((ms_abi))
 81 # elif !defined(_MSC_VER)
 82 #  define __cdecl
 83 # endif
 84 #endif /* __cdecl */
 85 
 86 #ifdef __WINESRC__
 87 #define __ONLY_IN_WINELIB(x)    do_not_use_this_in_wine
 88 #else
 89 #define __ONLY_IN_WINELIB(x)    x
 90 #endif
 91 
 92 #ifndef pascal
 93 #define pascal      __ONLY_IN_WINELIB(__stdcall)
 94 #endif
 95 #ifndef _pascal
 96 #define _pascal     __ONLY_IN_WINELIB(__stdcall)
 97 #endif
 98 #ifndef _stdcall
 99 #define _stdcall    __ONLY_IN_WINELIB(__stdcall)
100 #endif
101 #ifndef _fastcall
102 #define _fastcall   __ONLY_IN_WINELIB(__stdcall)
103 #endif
104 #ifndef __fastcall
105 #define __fastcall  __ONLY_IN_WINELIB(__stdcall)
106 #endif
107 #ifndef __export
108 #define __export    __ONLY_IN_WINELIB(__stdcall)
109 #endif
110 #ifndef cdecl
111 #define cdecl       __ONLY_IN_WINELIB(__cdecl)
112 #endif
113 #ifndef _cdecl
114 #define _cdecl      __ONLY_IN_WINELIB(__cdecl)
115 #endif
116 
117 #ifndef near
118 #define near        __ONLY_IN_WINELIB(/* nothing */)
119 #endif
120 #ifndef far
121 #define far         __ONLY_IN_WINELIB(/* nothing */)
122 #endif
123 #ifndef _near
124 #define _near       __ONLY_IN_WINELIB(/* nothing */)
125 #endif
126 #ifndef _far
127 #define _far        __ONLY_IN_WINELIB(/* nothing */)
128 #endif
129 #ifndef NEAR
130 #define NEAR        __ONLY_IN_WINELIB(/* nothing */)
131 #endif
132 #ifndef FAR
133 #define FAR         __ONLY_IN_WINELIB(/* nothing */)
134 #endif
135 
136 #ifndef _MSC_VER
137 # ifndef _declspec
138 #  define _declspec(x)    __ONLY_IN_WINELIB(/* nothing */)
139 # endif
140 # ifndef __declspec
141 #  define __declspec(x)   __ONLY_IN_WINELIB(/* nothing */)
142 # endif
143 #endif
144 
145 #ifdef _MSC_VER
146 # define inline __inline
147 #endif
148 
149 #define CALLBACK    __stdcall
150 #define WINAPI      __stdcall
151 #define APIPRIVATE  __stdcall
152 #define PASCAL      __stdcall
153 #define CDECL       __cdecl
154 #define _CDECL      __cdecl
155 #define WINAPIV     __cdecl
156 #define APIENTRY    WINAPI
157 #define CONST       const
158 
159 /* Misc. constants. */
160 
161 #undef NULL
162 #ifdef __cplusplus
163 #define NULL  0
164 #else
165 #define NULL  ((void*)0)
166 #endif
167 
168 #ifdef FALSE
169 #undef FALSE
170 #endif
171 #define FALSE 0
172 
173 #ifdef TRUE
174 #undef TRUE
175 #endif
176 #define TRUE  1
177 
178 #ifndef IN
179 #define IN
180 #endif
181 
182 #ifndef OUT
183 #define OUT
184 #endif
185 
186 #ifndef OPTIONAL
187 #define OPTIONAL
188 #endif
189 
190 /* Standard data types */
191 
192 typedef void                                   *LPVOID;
193 typedef const void                             *LPCVOID;
194 typedef int             BOOL,       *PBOOL,    *LPBOOL;
195 typedef unsigned char   BYTE,       *PBYTE,    *LPBYTE;
196 typedef unsigned char   UCHAR,      *PUCHAR;
197 typedef unsigned short  WORD,       *PWORD,    *LPWORD;
198 typedef unsigned short  USHORT,     *PUSHORT;
199 typedef int             INT,        *PINT,     *LPINT;
200 typedef unsigned int    UINT,       *PUINT;
201 typedef float           FLOAT,      *PFLOAT;
202 typedef char                        *PSZ;
203 #ifdef _MSC_VER
204 typedef long                                   *LPLONG;
205 typedef unsigned long   DWORD,      *PDWORD,   *LPDWORD;
206 typedef unsigned long   ULONG,      *PULONG;
207 #else
208 typedef int                                    *LPLONG;
209 typedef unsigned int    DWORD,      *PDWORD,   *LPDWORD;
210 typedef unsigned int    ULONG,      *PULONG;
211 #endif
212 
213 /* Macros to map Winelib names to the correct implementation name */
214 /* Note that Winelib is purely Win32.                             */
215 
216 #ifdef __WINESRC__
217 #define WINE_NO_UNICODE_MACROS
218 #endif
219 
220 #ifdef WINE_NO_UNICODE_MACROS
221 # define WINELIB_NAME_AW(func) \
222     func##_must_be_suffixed_with_W_or_A_in_this_context \
223     func##_must_be_suffixed_with_W_or_A_in_this_context
224 #else  /* WINE_NO_UNICODE_MACROS */
225 # ifdef UNICODE
226 #  define WINELIB_NAME_AW(func) func##W
227 # else
228 #  define WINELIB_NAME_AW(func) func##A
229 # endif
230 #endif  /* WINE_NO_UNICODE_MACROS */
231 
232 #ifdef WINE_NO_UNICODE_MACROS
233 # define DECL_WINELIB_TYPE_AW(type)  /* nothing */
234 #else
235 # define DECL_WINELIB_TYPE_AW(type)  typedef WINELIB_NAME_AW(type) type;
236 #endif
237 
238 #include <winnt.h>
239 
240 /* Polymorphic types */
241 
242 typedef UINT_PTR        WPARAM;
243 typedef LONG_PTR        LPARAM;
244 typedef LONG_PTR        LRESULT;
245 
246 /* Integer types */
247 
248 typedef WORD            ATOM;
249 typedef DWORD           COLORREF, *LPCOLORREF;
250 
251 
252 /* Handle types */
253 
254 typedef int HFILE;
255 DECLARE_HANDLE(HACCEL);
256 DECLARE_HANDLE(HBITMAP);
257 DECLARE_HANDLE(HBRUSH);
258 DECLARE_HANDLE(HCOLORSPACE);
259 DECLARE_HANDLE(HDC);
260 DECLARE_HANDLE(HDESK);
261 DECLARE_HANDLE(HENHMETAFILE);
262 DECLARE_HANDLE(HFONT);
263 DECLARE_HANDLE(HGLRC);
264 DECLARE_HANDLE(HHOOK);
265 DECLARE_HANDLE(HICON);
266 DECLARE_HANDLE(HINSTANCE);
267 DECLARE_HANDLE(HKEY);
268 typedef HKEY *PHKEY;
269 DECLARE_HANDLE(HKL);
270 DECLARE_HANDLE(HMENU);
271 DECLARE_HANDLE(HMETAFILE);
272 DECLARE_HANDLE(HMONITOR);
273 DECLARE_HANDLE(HPALETTE);
274 DECLARE_HANDLE(HPEN);
275 DECLARE_HANDLE(HRGN);
276 DECLARE_HANDLE(HRSRC);
277 DECLARE_HANDLE(HTASK);
278 DECLARE_HANDLE(HWINEVENTHOOK);
279 DECLARE_HANDLE(HWINSTA);
280 DECLARE_HANDLE(HWND);
281 
282 /* Handle types that must remain interchangeable even with strict on */
283 
284 typedef HINSTANCE HMODULE;
285 typedef HANDLE HGDIOBJ;
286 typedef HANDLE HGLOBAL;
287 typedef HANDLE HLOCAL;
288 typedef HANDLE GLOBALHANDLE;
289 typedef HANDLE LOCALHANDLE;
290 typedef HICON HCURSOR;
291 
292 /* Callback function pointers types */
293 
294 typedef INT_PTR (CALLBACK *FARPROC)();
295 typedef INT_PTR (CALLBACK *NEARPROC)();
296 typedef INT_PTR (CALLBACK *PROC)();
297 
298 
299 /* Macros to split words and longs. */
300 
301 #define LOBYTE(w)              ((BYTE)((DWORD_PTR)(w) & 0xFF))
302 #define HIBYTE(w)              ((BYTE)((DWORD_PTR)(w) >> 8))
303 
304 #define LOWORD(l)              ((WORD)((DWORD_PTR)(l) & 0xFFFF))
305 #define HIWORD(l)              ((WORD)((DWORD_PTR)(l) >> 16))
306 
307 #define MAKEWORD(low,high)     ((WORD)(((BYTE)((DWORD_PTR)(low) & 0xFF)) | ((WORD)((BYTE)((DWORD_PTR)(high) & 0xFF))) << 8))
308 #define MAKELONG(low,high)     ((LONG)(((WORD)((DWORD_PTR)(low) & 0xFFFF)) | ((DWORD)((WORD)((DWORD_PTR)(high) & 0xFFFF))) << 16))
309 
310 /* min and max macros */
311 #ifndef NOMINMAX
312 #ifndef max
313 #define max(a,b)   (((a) > (b)) ? (a) : (b))
314 #endif
315 #ifndef min
316 #define min(a,b)   (((a) < (b)) ? (a) : (b))
317 #endif
318 #endif  /* NOMINMAX */
319 
320 #ifdef MAX_PATH /* Work-around for Mingw */ 
321 #undef MAX_PATH
322 #endif /* MAX_PATH */
323 
324 #define MAX_PATH        260
325 #define HFILE_ERROR     ((HFILE)-1)
326 
327 /* The SIZE structure */
328 typedef struct tagSIZE
329 {
330     LONG cx;
331     LONG cy;
332 } SIZE, *PSIZE, *LPSIZE;
333 
334 typedef SIZE SIZEL, *PSIZEL, *LPSIZEL;
335 
336 /* The POINT structure */
337 typedef struct tagPOINT
338 {
339     LONG  x;
340     LONG  y;
341 } POINT, *PPOINT, *LPPOINT;
342 
343 typedef struct _POINTL
344 {
345     LONG x;
346     LONG y;
347 } POINTL, *PPOINTL;
348 
349 /* The POINTS structure */
350 
351 typedef struct tagPOINTS
352 {
353 #ifdef WORDS_BIGENDIAN
354     SHORT y;
355     SHORT x;
356 #else
357     SHORT x;
358     SHORT y;
359 #endif
360 } POINTS, *PPOINTS, *LPPOINTS;
361 
362 typedef struct _FILETIME {
363 #ifdef WORDS_BIGENDIAN
364     DWORD  dwHighDateTime;
365     DWORD  dwLowDateTime;
366 #else
367     DWORD  dwLowDateTime;
368     DWORD  dwHighDateTime;
369 #endif
370 } FILETIME, *PFILETIME, *LPFILETIME;
371 #define _FILETIME_
372 
373 /* The RECT structure */
374 typedef struct tagRECT
375 {
376     LONG left;
377     LONG top;
378     LONG right;
379     LONG bottom;
380 } RECT, *PRECT, *LPRECT;
381 typedef const RECT *LPCRECT;
382 
383 typedef struct _RECTL
384 {
385     LONG left;
386     LONG top;
387     LONG right;
388     LONG bottom;
389 } RECTL, *PRECTL, *LPRECTL;
390 
391 typedef const RECTL *LPCRECTL;
392 
393 #ifdef __cplusplus
394 }
395 #endif
396 
397 #endif /* _WINDEF_ */
398 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.