- actually use the VertexBuffer stubs
[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 #ifdef __WINE__
25 # undef UNICODE
26 #endif  /* __WINE__ */
27
28 #ifndef WINVER
29 #define WINVER 0x0500
30 #endif
31
32 #include "winnt.h"
33
34
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38
39
40 /* Macros to map Winelib names to the correct implementation name */
41 /* depending on __WINE__ and UNICODE macros.                      */
42 /* Note that Winelib is purely Win32.                             */
43
44 #ifdef __WINE__
45 # define WINELIB_NAME_AW(func) \
46     func##_must_be_suffixed_with_W_or_A_in_this_context \
47     func##_must_be_suffixed_with_W_or_A_in_this_context
48 #else  /* __WINE__ */
49 # ifdef UNICODE
50 #  define WINELIB_NAME_AW(func) func##W
51 # else
52 #  define WINELIB_NAME_AW(func) func##A
53 # endif  /* UNICODE */
54 #endif  /* __WINE__ */
55
56 #ifdef __WINE__
57 # define DECL_WINELIB_TYPE_AW(type)  /* nothing */
58 #else   /* __WINE__ */
59 # define DECL_WINELIB_TYPE_AW(type)  typedef WINELIB_NAME_AW(type) type;
60 #endif  /* __WINE__ */
61
62
63 /* Integer types */
64 typedef UINT            WPARAM;
65 typedef LONG            LPARAM;
66 typedef LONG            LRESULT;
67 typedef WORD            ATOM;
68 typedef WORD            CATCHBUF[9];
69 typedef WORD           *LPCATCHBUF;
70 typedef DWORD           COLORREF, *LPCOLORREF;
71
72
73 /* Handle types that exist both in Win16 and Win32. */
74
75 typedef int HFILE;
76 DECLARE_HANDLE(HACCEL);
77 DECLARE_HANDLE(HBITMAP);
78 DECLARE_HANDLE(HBRUSH);
79 DECLARE_HANDLE(HCOLORSPACE);
80 DECLARE_HANDLE(HDC);
81 DECLARE_HANDLE(HDESK);
82 DECLARE_HANDLE(HENHMETAFILE);
83 DECLARE_HANDLE(HFONT);
84 DECLARE_HANDLE(HHOOK);
85 DECLARE_HANDLE(HICON);
86 DECLARE_HANDLE(HINSTANCE);
87 DECLARE_HANDLE(HKEY);
88 DECLARE_HANDLE(HKL);
89 DECLARE_HANDLE(HMENU);
90 DECLARE_HANDLE(HMETAFILE);
91 DECLARE_HANDLE(HMONITOR);
92 DECLARE_HANDLE(HPALETTE);
93 DECLARE_HANDLE(HPEN);
94 DECLARE_HANDLE(HRGN);
95 DECLARE_HANDLE(HRSRC);
96 DECLARE_HANDLE(HTASK);
97 DECLARE_HANDLE(HWINEVENTHOOK);
98 DECLARE_HANDLE(HWINSTA);
99 DECLARE_HANDLE(HWND);
100
101 /* Handle types that must remain interchangeable even with strict on */
102
103 typedef HINSTANCE HMODULE;
104 typedef HANDLE HGDIOBJ;
105 typedef HANDLE HGLOBAL;
106 typedef HANDLE HLOCAL;
107 typedef HANDLE GLOBALHANDLE;
108 typedef HANDLE LOCALHANDLE;
109 typedef HICON HCURSOR;
110
111 /* Callback function pointers types */
112
113 typedef INT     (CALLBACK *FARPROC)();
114 typedef INT     (CALLBACK *PROC)();
115
116
117 /* Macros to split words and longs. */
118
119 #define LOBYTE(w)              ((BYTE)(WORD)(w))
120 #define HIBYTE(w)              ((BYTE)((WORD)(w) >> 8))
121
122 #define LOWORD(l)              ((WORD)(DWORD)(l))
123 #define HIWORD(l)              ((WORD)((DWORD)(l) >> 16))
124
125 #define SLOWORD(l)             ((SHORT)(LONG)(l))
126 #define SHIWORD(l)             ((SHORT)((LONG)(l) >> 16))
127
128 #define MAKEWORD(low,high)     ((WORD)(((BYTE)(low)) | ((WORD)((BYTE)(high))) << 8))
129 #define MAKELONG(low,high)     ((LONG)(((WORD)(low)) | (((DWORD)((WORD)(high))) << 16)))
130 #define MAKELPARAM(low,high)   ((LPARAM)MAKELONG(low,high))
131 #define MAKEWPARAM(low,high)   ((WPARAM)MAKELONG(low,high))
132 #define MAKELRESULT(low,high)  ((LRESULT)MAKELONG(low,high))
133
134 #define SELECTOROF(ptr)     (HIWORD(ptr))
135 #define OFFSETOF(ptr)       (LOWORD(ptr))
136
137 #ifdef __WINE__
138 /* macros to set parts of a DWORD (not in the Windows API) */
139 #define SET_LOWORD(dw,val)  ((dw) = ((dw) & 0xffff0000) | LOWORD(val))
140 #define SET_LOBYTE(dw,val)  ((dw) = ((dw) & 0xffffff00) | LOBYTE(val))
141 #define SET_HIBYTE(dw,val)  ((dw) = ((dw) & 0xffff00ff) | (LOBYTE(val) << 8))
142 #define ADD_LOWORD(dw,val)  ((dw) = ((dw) & 0xffff0000) | LOWORD((DWORD)(dw)+(val)))
143 #endif
144
145 /* min and max macros */
146 #ifndef NOMINMAX
147 #ifndef max
148 #define max(a,b)   (((a) > (b)) ? (a) : (b))
149 #endif
150 #ifndef min
151 #define min(a,b)   (((a) < (b)) ? (a) : (b))
152 #endif
153 #endif  /* NOMINMAX */
154
155 #ifdef MAX_PATH /* Work-around for Mingw */ 
156 #undef MAX_PATH
157 #endif /* MAX_PATH */
158
159 #define MAX_PATH        260
160 #define HFILE_ERROR     ((HFILE)-1)
161
162 /* The SIZE structure */
163 typedef struct tagSIZE
164 {
165     LONG cx;
166     LONG cy;
167 } SIZE, *PSIZE, *LPSIZE;
168
169 typedef SIZE SIZEL, *PSIZEL, *LPSIZEL;
170
171 /* The POINT structure */
172 typedef struct tagPOINT
173 {
174     LONG  x;
175     LONG  y;
176 } POINT, *PPOINT, *LPPOINT;
177
178 typedef struct _POINTL
179 {
180     LONG x;
181     LONG y;
182 } POINTL;
183
184 /* The POINTS structure */
185
186 typedef struct tagPOINTS
187 {
188     SHORT x;
189     SHORT y;
190 } POINTS, *PPOINTS, *LPPOINTS;
191
192 /* The RECT structure */
193 typedef struct tagRECT
194 {
195     INT  left;
196     INT  top;
197     INT  right;
198     INT  bottom;
199 } RECT, *PRECT, *LPRECT;
200 typedef const RECT *LPCRECT;
201
202
203 typedef struct tagRECTL
204 {
205     LONG left;
206     LONG top;
207     LONG right;
208     LONG bottom;
209 } RECTL, *PRECTL, *LPRECTL;
210
211 typedef const RECTL *LPCRECTL;
212
213 #ifdef __cplusplus
214 }
215 #endif
216
217 #endif /* __WINE_WINDEF_H */