wined3d: Get rid of the WINED3DGAMMARAMP typedef.
[wine] / include / wine / windef16.h
1 /*
2  * Basic type definitions for 16 bit variations on Windows types.
3  * These types are provided mostly to insure compatibility with
4  * 16 bit windows code.
5  *
6  * Copyright (C) the Wine project
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21  */
22
23 #ifndef __WINE_WINDEF16_H
24 #define __WINE_WINDEF16_H
25
26 #ifndef RC_INVOKED
27 #include <stdarg.h>
28 #endif
29 #include <windef.h>
30 #include <winbase.h>
31
32 /* Standard data types */
33
34 typedef unsigned short  BOOL16;
35 typedef DWORD           SEGPTR;
36
37 typedef UINT16          HANDLE16;
38 typedef HANDLE16       *LPHANDLE16;
39
40 typedef UINT16          WPARAM16;
41 typedef INT16          *LPINT16;
42 typedef UINT16         *LPUINT16;
43
44 typedef WORD            CATCHBUF[9];
45 typedef WORD           *LPCATCHBUF;
46
47 #define MAKESEGPTR(seg,off) ((SEGPTR)MAKELONG(off,seg))
48 #define SELECTOROF(ptr)     (HIWORD(ptr))
49 #define OFFSETOF(ptr)       (LOWORD(ptr))
50
51 typedef WORD *VA_LIST16;
52
53 #define __VA_ROUNDED16(type) \
54     ((sizeof(type) + sizeof(WORD) - 1) / sizeof(WORD) * sizeof(WORD))
55 #define VA_ARG16(list,type) \
56     (((list) = (VA_LIST16)((char *)(list) + __VA_ROUNDED16(type))), \
57      *((type *)(void *)((char *)(list) - __VA_ROUNDED16(type))))
58
59 #define HFILE_ERROR16   ((HFILE16)-1)
60
61 #define DECLARE_HANDLE16(a) \
62         typedef HANDLE16 a##16; \
63         typedef a##16 *P##a##16; \
64         typedef a##16 *NP##a##16; \
65         typedef a##16 *LP##a##16
66
67 DECLARE_HANDLE16(HACMDRIVERID);
68 DECLARE_HANDLE16(HACMDRIVER);
69 DECLARE_HANDLE16(HACMOBJ);
70 DECLARE_HANDLE16(HACMSTREAM);
71 DECLARE_HANDLE16(HMETAFILEPICT);
72
73 DECLARE_HANDLE16(HACCEL);
74 DECLARE_HANDLE16(HBITMAP);
75 DECLARE_HANDLE16(HBRUSH);
76 DECLARE_HANDLE16(HCOLORSPACE);
77 DECLARE_HANDLE16(HCURSOR);
78 DECLARE_HANDLE16(HDC);
79 DECLARE_HANDLE16(HDROP);
80 DECLARE_HANDLE16(HDRVR);
81 DECLARE_HANDLE16(HDWP);
82 DECLARE_HANDLE16(HENHMETAFILE);
83 DECLARE_HANDLE16(HFILE);
84 DECLARE_HANDLE16(HFONT);
85 DECLARE_HANDLE16(HICON);
86 DECLARE_HANDLE16(HINSTANCE);
87 DECLARE_HANDLE16(HKEY);
88 DECLARE_HANDLE16(HMENU);
89 DECLARE_HANDLE16(HMETAFILE);
90 DECLARE_HANDLE16(HMIDI);
91 DECLARE_HANDLE16(HMIDIIN);
92 DECLARE_HANDLE16(HMIDIOUT);
93 DECLARE_HANDLE16(HMIDISTRM);
94 DECLARE_HANDLE16(HMIXER);
95 DECLARE_HANDLE16(HMIXEROBJ);
96 DECLARE_HANDLE16(HMMIO);
97 DECLARE_HANDLE16(HPALETTE);
98 DECLARE_HANDLE16(HPEN);
99 DECLARE_HANDLE16(HQUEUE);
100 DECLARE_HANDLE16(HRGN);
101 DECLARE_HANDLE16(HRSRC);
102 DECLARE_HANDLE16(HTASK);
103 DECLARE_HANDLE16(HWAVE);
104 DECLARE_HANDLE16(HWAVEIN);
105 DECLARE_HANDLE16(HWAVEOUT);
106 DECLARE_HANDLE16(HWINSTA);
107 DECLARE_HANDLE16(HDESK);
108 DECLARE_HANDLE16(HWND);
109 DECLARE_HANDLE16(HKL);
110 DECLARE_HANDLE16(HIC);
111 DECLARE_HANDLE16(HRASCONN);
112 #undef DECLARE_HANDLE16
113
114 typedef HINSTANCE16 HMODULE16;
115 typedef HANDLE16 HGDIOBJ16;
116 typedef HANDLE16 HGLOBAL16;
117 typedef HANDLE16 HLOCAL16;
118
119 #include <pshpack1.h>
120
121 /* The SIZE structure */
122
123 typedef struct
124 {
125     INT16  cx;
126     INT16  cy;
127 } SIZE16, *PSIZE16, *LPSIZE16;
128
129 /* The POINT structure */
130
131 typedef struct
132 {
133     INT16  x;
134     INT16  y;
135 } POINT16, *PPOINT16, *LPPOINT16;
136
137 /* The RECT structure */
138
139 typedef struct
140 {
141     INT16  left;
142     INT16  top;
143     INT16  right;
144     INT16  bottom;
145 } RECT16, *LPRECT16;
146
147 #include <poppack.h>
148
149 /* Callback function pointers types */
150
151 typedef LRESULT (CALLBACK *DRIVERPROC16)(DWORD,HDRVR16,UINT16,LPARAM,LPARAM);
152 typedef BOOL16  (CALLBACK *DLGPROC16)(HWND16,UINT16,WPARAM16,LPARAM);
153 typedef INT16   (CALLBACK *EDITWORDBREAKPROC16)(LPSTR,INT16,INT16,INT16);
154 typedef BOOL16  (CALLBACK *GRAYSTRINGPROC16)(HDC16,LPARAM,INT16);
155 typedef LRESULT (CALLBACK *HOOKPROC16)(INT16,WPARAM16,LPARAM);
156 typedef BOOL16  (CALLBACK *PROPENUMPROC16)(HWND16,SEGPTR,HANDLE16);
157 typedef VOID    (CALLBACK *TIMERPROC16)(HWND16,UINT16,UINT16,DWORD);
158 typedef LRESULT (CALLBACK *WNDENUMPROC16)(HWND16,LPARAM);
159 typedef LRESULT (CALLBACK *WNDPROC16)(HWND16,UINT16,WPARAM16,LPARAM);
160
161 #ifdef WINE_STRICT_PROTOTYPES
162 typedef LRESULT (CALLBACK *FARPROC16)(void);
163 typedef INT16   (CALLBACK *PROC16)(void);
164 #else
165 typedef LRESULT (CALLBACK *FARPROC16)();
166 typedef INT16   (CALLBACK *PROC16)();
167 #endif
168
169 #endif /* __WINE_WINDEF16_H */