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