source: trunk/include/win/windef.h@ 5200

Last change on this file since 5200 was 4841, checked in by sandervl, 25 years ago

compile fix

File size: 18.7 KB
Line 
1/* $Id: windef.h,v 1.26 2000-12-27 18:31:54 sandervl Exp $ */
2
3/*
4 * Basic types definitions
5 *
6 * Copyright 1996 Alexandre Julliard
7 */
8
9#ifndef __WINE_WINDEF_H
10#define __WINE_WINDEF_H
11
12#ifdef __WINE__
13# include "config.h"
14# undef UNICODE
15#endif /* __WINE__ */
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20
21/* Misc. constants. */
22
23#ifdef FALSE
24#undef FALSE
25#endif
26#define FALSE 0
27
28#ifdef TRUE
29#undef TRUE
30#endif
31#define TRUE 1
32
33#ifdef NULL
34#undef NULL
35#endif
36#define NULL 0
37
38/* Macros to map Winelib names to the correct implementation name */
39/* depending on __WINE__ and UNICODE macros. */
40/* Note that Winelib is purely Win32. */
41
42#ifdef __WINE__
43#ifdef __WIN32OS2__
44# define WINELIB_NAME_AW(func) func
45#else
46# define WINELIB_NAME_AW(func) this_is_a_syntax_error this_is_a_syntax_error
47#endif
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/* Calling conventions definitions */
64
65#ifndef __WIN32OS2__
66#ifdef __i386__
67# if defined(__GNUC__) && (__GNUC__ == 2) && (__GNUC_MINOR__ >= 7)
68# define __stdcall __attribute__((__stdcall__))
69# define __cdecl __attribute__((__cdecl__))
70# define __RESTORE_ES __asm__ __volatile__("pushl %ds\n\tpopl %es")
71# else
72# error You need gcc >= 2.7 to build Wine on a 386
73# endif /* __GNUC__ */
74#else /* __i386__ */
75# define __stdcall
76# define __cdecl
77# define __RESTORE_ES
78#endif /* __i386__ */
79#endif
80
81
82/* define needed macros as required */
83#ifndef CALLBACK
84 #define CALLBACK __stdcall
85#endif
86
87#ifndef WINAPI
88 #define WINAPI __stdcall
89#endif
90
91#ifndef APIPRIVATE
92 #define APIPRIVATE __stdcall
93#endif
94
95#ifndef PASCAL
96 #define PASCAL __stdcall
97#endif
98
99#ifndef pascal
100 #define pascal __stdcall
101#endif
102
103#ifndef _pascal
104 #define _pascal __stdcall
105#endif
106
107#ifndef _stdcall
108 #define _stdcall __stdcall
109#endif
110
111#ifndef _fastcall
112 #define _fastcall __stdcall
113#endif
114
115#ifndef __export
116 #define __export
117#endif
118
119#ifndef CDECL
120 #define CDECL __cdecl
121#endif
122
123#ifndef _CDECL
124 #define _CDECL __cdecl
125#endif
126
127#ifndef cdecl
128 #define cdecl __cdecl
129#endif
130
131#ifndef _cdecl
132 #define _cdecl __cdecl
133#endif
134
135#ifndef WINAPIV
136 #define WINAPIV __cdecl
137#endif
138
139#ifndef APIENTRY
140 #define APIENTRY WINAPI
141#endif
142
143#if (__IBMC__ < 400) && (__IBMCPP__ < 360)
144#ifndef __declspec
145 #define __declspec(x)
146#endif
147
148#ifndef dllimport
149 #define dllimport
150#endif
151
152#ifndef dllexport
153 #define dllexport
154#endif
155#endif // (__IBMC__ < 400) && (__IBMCPP__ < 360)
156
157#ifndef CONST
158 #define CONST const
159#endif
160
161/* Anonymous union/struct handling */
162
163#if defined(__WINE__) || defined(__WIN32OS2__)
164#if defined(__cplusplus) && !defined(NONAMELESSUNION)
165# undef NONAMELESSSTRUCT
166# undef NONAMELESSUNION
167#else
168# define NONAMELESSSTRUCT
169# define NONAMELESSUNION
170#endif
171#else
172/* Anonymous struct support starts with gcc/g++ 2.96 */
173# if !defined(NONAMELESSSTRUCT) && defined(__GNUC__) && ((__GNUC__ < 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ < 96)))
174# define NONAMELESSSTRUCT
175# endif
176/* Anonymous unions support starts with gcc 2.96/g++ 2.95 */
177# if !defined(NONAMELESSUNION) && defined(__GNUC__) && ((__GNUC__ < 2) || ((__GNUC__ == 2) && ((__GNUC_MINOR__ < 95) || ((__GNUC_MINOR__ == 95) && !defined(__cplusplus)))))
178# define NONAMELESSUNION
179# endif
180#endif
181
182#ifndef NONAMELESSSTRUCT
183#define DUMMYSTRUCTNAME
184#define DUMMYSTRUCTNAME1
185#define DUMMYSTRUCTNAME2
186#define DUMMYSTRUCTNAME3
187#define DUMMYSTRUCTNAME4
188#define DUMMYSTRUCTNAME5
189#else /* !defined(NONAMELESSSTRUCT) */
190#define DUMMYSTRUCTNAME s
191#define DUMMYSTRUCTNAME1 s1
192#define DUMMYSTRUCTNAME2 s2
193#define DUMMYSTRUCTNAME3 s3
194#define DUMMYSTRUCTNAME4 s4
195#define DUMMYSTRUCTNAME5 s5
196#endif /* !defined(NONAMELESSSTRUCT) */
197
198#ifndef NONAMELESSUNION
199#define DUMMYUNIONNAME
200#define DUMMYUNIONNAME1
201#define DUMMYUNIONNAME2
202#define DUMMYUNIONNAME3
203#define DUMMYUNIONNAME4
204#define DUMMYUNIONNAME5
205#define DUMMYUNIONNAME6
206#define DUMMYUNIONNAME7
207#define DUMMYUNIONNAME8
208#else /* !defined(NONAMELESSUNION) */
209#define DUMMYUNIONNAME u
210#define DUMMYUNIONNAME1 u1
211#define DUMMYUNIONNAME2 u2
212#define DUMMYUNIONNAME3 u3
213#define DUMMYUNIONNAME4 u4
214#define DUMMYUNIONNAME5 u5
215#define DUMMYUNIONNAME6 u6
216#define DUMMYUNIONNAME7 u7
217#define DUMMYUNIONNAME8 u8
218#endif /* !defined(NONAMELESSUNION) */
219
220
221/* Standard data types. These are the same for emulator and library. */
222
223typedef void VOID;
224typedef short INT16;
225typedef unsigned short UINT16;
226typedef int INT;
227typedef unsigned int UINT;
228typedef unsigned short WORD;
229typedef unsigned long DWORD;
230typedef unsigned long ULONG;
231typedef unsigned char BYTE;
232typedef long LONG;
233typedef short SHORT;
234typedef unsigned short USHORT;
235typedef char CHAR;
236typedef unsigned char UCHAR;
237/* Some systems might have wchar_t, but we really need 16 bit characters */
238typedef unsigned short WCHAR;
239typedef unsigned short BOOL16;
240typedef unsigned long BOOL;
241typedef double DATE;
242typedef long LONG_PTR;
243typedef unsigned long ULONG_PTR;
244typedef double DOUBLE;
245typedef double LONGLONG;
246typedef double ULONGLONG;
247typedef double ULONGULONG;
248
249/* FIXME: Wine does not compile with strict on, therefore strict
250 * handles are presently only usable on machines where sizeof(UINT) ==
251 * sizeof(void*). HANDLEs are supposed to be void* but a large amount
252 * of WINE code operates on HANDLES as if they are UINTs. So to WINE
253 * they exist as UINTs but to the Winelib user who turns on strict,
254 * they exist as void*. If there is a size difference between UINT and
255 * void* then things get ugly. */
256#ifdef STRICT
257typedef UINT16 HANDLE16;
258typedef VOID* HANDLE;
259#else
260typedef UINT16 HANDLE16;
261typedef ULONG HANDLE;
262#endif
263
264typedef HANDLE16 *LPHANDLE16;
265typedef HANDLE *LPHANDLE;
266
267/* Integer types. These are the same for emulator and library. */
268typedef UINT16 WPARAM16;
269typedef UINT WPARAM;
270typedef LONG LPARAM;
271typedef LONG HRESULT;
272typedef LONG LRESULT;
273typedef WORD ATOM;
274typedef WORD CATCHBUF[9];
275typedef WORD *LPCATCHBUF;
276typedef DWORD REGSAM;
277typedef HANDLE HHOOK;
278typedef HANDLE HKEY;
279typedef HANDLE HMONITOR;
280typedef DWORD LCID;
281typedef WORD LANGID;
282typedef DWORD LCTYPE;
283typedef float FLOAT;
284#ifdef __WIN32OS2__
285#if (__IBMC__ < 400) && (__IBMCPP__ < 360) && !defined(__WATCOMC__)
286typedef double __int64;
287#endif
288#else
289typedef long long __int64;
290#endif
291
292/* Pointers types. These are the same for emulator and library. */
293/* winnt types */
294typedef VOID *PVOID;
295typedef const void *PCVOID;
296typedef CHAR *PCHAR;
297typedef UCHAR *PUCHAR;
298typedef BYTE *PBYTE;
299typedef ULONG *PULONG;
300typedef LONG *PLONG;
301typedef DWORD *PDWORD;
302/* common win32 types */
303#ifdef __WINE__
304typedef CHAR *LPTSTR;
305typedef const CHAR *LPCTSTR;
306#endif
307typedef CHAR *LPSTR;
308typedef CHAR *PSTR;
309typedef const CHAR *LPCSTR;
310typedef const CHAR *PCSTR;
311typedef WCHAR *LPWSTR;
312typedef WCHAR *PWSTR;
313typedef const WCHAR *LPCWSTR;
314typedef const WCHAR *PCWSTR;
315typedef BYTE *LPBYTE;
316typedef WORD *LPWORD;
317typedef DWORD *LPDWORD;
318typedef LONG *LPLONG;
319typedef VOID *LPVOID;
320typedef const VOID *LPCVOID;
321typedef INT16 *LPINT16;
322typedef UINT16 *LPUINT16;
323typedef INT *PINT;
324typedef INT *LPINT;
325typedef UINT *PUINT;
326typedef UINT *LPUINT;
327typedef HKEY *LPHKEY;
328typedef HKEY *PHKEY;
329typedef FLOAT *PFLOAT;
330typedef FLOAT *LPFLOAT;
331typedef BOOL *PBOOL;
332typedef BOOL *LPBOOL;
333
334/* Special case: a segmented pointer is just a pointer in the user's code. */
335
336#ifdef __WINE__
337typedef DWORD SEGPTR;
338#else
339typedef void* SEGPTR;
340#endif /* __WINE__ */
341
342/* Handle types that exist both in Win16 and Win32. */
343
344#ifdef STRICT
345#define DECLARE_HANDLE(a) \
346 typedef HANDLE16 a##16; \
347 typedef a##16 *P##a##16; \
348 typedef a##16 *NP##a##16; \
349 typedef a##16 *LP##a##16; \
350 typedef struct a##__ { int unused; } *a; \
351 typedef a *P##a; \
352 typedef a *LP##a
353#else /*STRICT*/
354#define DECLARE_HANDLE(a) \
355 typedef HANDLE16 a##16; \
356 typedef a##16 *P##a##16; \
357 typedef a##16 *NP##a##16; \
358 typedef a##16 *LP##a##16; \
359 typedef HANDLE a; \
360 typedef a *P##a; \
361 typedef a *LP##a
362#endif /*STRICT*/
363
364DECLARE_HANDLE(HACMDRIVERID);
365DECLARE_HANDLE(HACMDRIVER);
366DECLARE_HANDLE(HACMOBJ);
367DECLARE_HANDLE(HACMSTREAM);
368DECLARE_HANDLE(HMETAFILEPICT);
369
370DECLARE_HANDLE(HACCEL);
371DECLARE_HANDLE(HBITMAP);
372DECLARE_HANDLE(HBRUSH);
373DECLARE_HANDLE(HCOLORSPACE);
374DECLARE_HANDLE(HCURSOR);
375DECLARE_HANDLE(HDC);
376DECLARE_HANDLE(HGLRC); // OpenGL
377DECLARE_HANDLE(HDROP);
378DECLARE_HANDLE(HDRVR);
379DECLARE_HANDLE(HDWP);
380DECLARE_HANDLE(HENHMETAFILE);
381DECLARE_HANDLE(HFILE);
382DECLARE_HANDLE(HFONT);
383DECLARE_HANDLE(HICON);
384DECLARE_HANDLE(HINSTANCE);
385DECLARE_HANDLE(HMENU);
386DECLARE_HANDLE(HMETAFILE);
387DECLARE_HANDLE(HMIDI);
388DECLARE_HANDLE(HMIDIIN);
389DECLARE_HANDLE(HMIDIOUT);
390DECLARE_HANDLE(HMIDISTRM);
391DECLARE_HANDLE(HMIXER);
392DECLARE_HANDLE(HMIXEROBJ);
393DECLARE_HANDLE(HMMIO);
394DECLARE_HANDLE(HPALETTE);
395DECLARE_HANDLE(HPEN);
396DECLARE_HANDLE(HQUEUE);
397DECLARE_HANDLE(HRGN);
398DECLARE_HANDLE(HRSRC);
399DECLARE_HANDLE(HTASK);
400DECLARE_HANDLE(HWAVE);
401DECLARE_HANDLE(HWAVEIN);
402DECLARE_HANDLE(HWAVEOUT);
403DECLARE_HANDLE(HWINSTA);
404DECLARE_HANDLE(HDESK);
405DECLARE_HANDLE(HWND);
406DECLARE_HANDLE(HKL);
407DECLARE_HANDLE(HIC);
408DECLARE_HANDLE(HRASCONN);
409DECLARE_HANDLE(HPRINTER);
410#undef DECLARE_HANDLE
411
412/* Handle types that must remain interchangeable even with strict on */
413
414typedef HINSTANCE16 HMODULE16;
415typedef HINSTANCE HMODULE;
416typedef HANDLE16 HGDIOBJ16;
417typedef HANDLE16 HGLOBAL16;
418typedef HANDLE16 HLOCAL16;
419typedef HANDLE HGDIOBJ;
420typedef HANDLE HGLOBAL;
421typedef HANDLE HLOCAL;
422
423/* Callback function pointers types */
424
425typedef BOOL (* CALLBACK DATEFMT_ENUMPROCA)(LPSTR);
426typedef BOOL (* CALLBACK DATEFMT_ENUMPROCW)(LPWSTR);
427DECL_WINELIB_TYPE_AW(DATEFMT_ENUMPROC)
428typedef BOOL16 (* CALLBACK DLGPROC16)(HWND16,UINT16,WPARAM16,LPARAM);
429typedef BOOL (* CALLBACK DLGPROC)(HWND,UINT,WPARAM,LPARAM);
430typedef LRESULT (* CALLBACK DRIVERPROC16)(DWORD,HDRVR16,UINT16,LPARAM,LPARAM);
431typedef LRESULT (* CALLBACK DRIVERPROC)(DWORD,HDRVR,UINT,LPARAM,LPARAM);
432typedef INT16 (* CALLBACK EDITWORDBREAKPROC16)(LPSTR,INT16,INT16,INT16);
433typedef INT (* CALLBACK EDITWORDBREAKPROCA)(LPSTR,INT,INT,INT);
434typedef INT (* CALLBACK EDITWORDBREAKPROCW)(LPWSTR,INT,INT,INT);
435DECL_WINELIB_TYPE_AW(EDITWORDBREAKPROC)
436typedef LRESULT (* CALLBACK FARPROC16)();
437typedef LRESULT (* CALLBACK FARPROC)();
438typedef INT16 (* CALLBACK PROC16)();
439typedef INT (* CALLBACK PROC)();
440typedef INT16 (* CALLBACK GOBJENUMPROC16)(SEGPTR,LPARAM);
441typedef INT (* CALLBACK GOBJENUMPROC)(LPVOID,LPARAM);
442typedef BOOL16 (* CALLBACK GRAYSTRINGPROC16)(HDC16,LPARAM,INT16);
443typedef BOOL (* CALLBACK GRAYSTRINGPROC)(HDC,LPARAM,INT);
444typedef LRESULT (* CALLBACK HOOKPROC16)(INT16,WPARAM16,LPARAM);
445typedef LRESULT (* CALLBACK HOOKPROC)(INT,WPARAM,LPARAM);
446typedef VOID (* CALLBACK LINEDDAPROC16)(INT16,INT16,LPARAM);
447typedef VOID (* CALLBACK LINEDDAPROC)(INT,INT,LPARAM);
448typedef BOOL16 (* CALLBACK PROPENUMPROC16)(HWND16,SEGPTR,HANDLE16);
449typedef BOOL (* CALLBACK PROPENUMPROCA)(HWND,LPCSTR,HANDLE);
450typedef BOOL (* CALLBACK PROPENUMPROCW)(HWND,LPCWSTR,HANDLE);
451DECL_WINELIB_TYPE_AW(PROPENUMPROC)
452typedef BOOL (* CALLBACK PROPENUMPROCEXA)(HWND,LPCSTR,HANDLE,LPARAM);
453typedef BOOL (* CALLBACK PROPENUMPROCEXW)(HWND,LPCWSTR,HANDLE,LPARAM);
454DECL_WINELIB_TYPE_AW(PROPENUMPROCEX)
455typedef BOOL (* CALLBACK TIMEFMT_ENUMPROCA)(LPSTR);
456typedef BOOL (* CALLBACK TIMEFMT_ENUMPROCW)(LPWSTR);
457DECL_WINELIB_TYPE_AW(TIMEFMT_ENUMPROC)
458typedef VOID (* CALLBACK TIMERPROC16)(HWND16,UINT16,UINT16,DWORD);
459typedef VOID (* CALLBACK TIMERPROC)(HWND,UINT,UINT,DWORD);
460typedef LRESULT (* CALLBACK WNDENUMPROC16)(HWND16,LPARAM);
461//typedef LRESULT (* CALLBACK WNDENUMPROC)(HWND,LPARAM);
462typedef BOOL (* CALLBACK WNDENUMPROC)(HWND,LPARAM);
463typedef LRESULT (* CALLBACK WNDPROC16)(HWND16,UINT16,WPARAM16,LPARAM);
464typedef LRESULT (* CALLBACK WNDPROC)(HWND,UINT,WPARAM,LPARAM);
465
466/* TCHAR data types definitions for Winelib. */
467/* These types are _not_ defined for the emulator, because they */
468/* depend on the UNICODE macro that only exists in user's code. */
469
470#ifndef __WINE__
471# ifdef UNICODE
472typedef WCHAR TCHAR;
473typedef LPWSTR LPTSTR;
474typedef LPCWSTR LPCTSTR;
475#define __TEXT(string) L##string /*probably wrong */
476# else /* UNICODE */
477typedef CHAR TCHAR;
478typedef LPSTR LPTSTR;
479typedef LPCSTR LPCTSTR;
480#define __TEXT(string) string
481# endif /* UNICODE */
482#endif /* __WINE__ */
483#define TEXT(quote) __TEXT(quote)
484
485/* Data types specific to the library. These do _not_ exist in the emulator. */
486
487
488
489/* Define some empty macros for compatibility with Windows code. */
490
491#ifndef __WINE__
492#define NEAR
493#define FAR
494#define near
495#define far
496#define _near
497#define _far
498#define IN
499#define OUT
500#define OPTIONAL
501#endif /* __WINE__ */
502
503/* Macro for structure packing. */
504
505#ifdef __GNUC__
506#define WINE_PACKED __attribute__ ((packed))
507#define WINE_UNUSED __attribute__ ((unused))
508#else
509#define WINE_PACKED /* nothing */
510#define WINE_UNUSED /* nothing */
511#endif
512
513/* Macros to split words and longs. */
514
515#define LOBYTE(w) ((BYTE)(WORD)(w))
516#define HIBYTE(w) ((BYTE)((WORD)(w) >> 8))
517
518#define LOWORD(l) ((WORD)(DWORD)(l))
519#define HIWORD(l) ((WORD)((DWORD)(l) >> 16))
520
521#define SLOWORD(l) ((INT16)(LONG)(l))
522#define SHIWORD(l) ((INT16)((LONG)(l) >> 16))
523
524#define MAKEWORD(low,high) ((WORD)(((BYTE)(low)) | ((WORD)((BYTE)(high))) << 8))
525#define MAKELONG(low,high) ((LONG)(((WORD)(low)) | (((DWORD)((WORD)(high))) << 16)))
526#define MAKELPARAM(low,high) ((LPARAM)MAKELONG(low,high))
527#define MAKEWPARAM(low,high) ((WPARAM)MAKELONG(low,high))
528#define MAKELRESULT(low,high) ((LRESULT)MAKELONG(low,high))
529#define MAKEINTATOM(atom) ((LPCSTR)MAKELONG((atom),0))
530
531#define SELECTOROF(ptr) (HIWORD(ptr))
532#define OFFSETOF(ptr) (LOWORD(ptr))
533
534/* Macros to access unaligned or wrong-endian WORDs and DWORDs. */
535/* Note: These macros are semantically broken, at least for wrc. wrc
536 spits out data in the platform's current binary format, *not* in
537 little-endian format. These macros are used throughout the resource
538 code to load and store data to the resources. Since it is unlikely
539 that we'll ever be dealing with little-endian resource data, the
540 byte-swapping nature of these macros has been disabled. Rather than
541 remove the use of these macros from the resource loading code, the
542 macros have simply been disabled. In the future, someone may want
543 to reactivate these macros for other purposes. In that case, the
544 resource code will have to be modified to use different macros. */
545
546#if 1
547#define PUT_WORD(ptr,w) (*(WORD *)(ptr) = (w))
548#define GET_WORD(ptr) (*(WORD *)(ptr))
549#define PUT_DWORD(ptr,dw) (*(DWORD *)(ptr) = (dw))
550#define GET_DWORD(ptr) (*(DWORD *)(ptr))
551#else
552#define PUT_WORD(ptr,w) (*(BYTE *)(ptr) = LOBYTE(w), \
553 *((BYTE *)(ptr) + 1) = HIBYTE(w))
554#define GET_WORD(ptr) ((WORD)(*(BYTE *)(ptr) | \
555 (WORD)(*((BYTE *)(ptr)+1) << 8)))
556#define PUT_DWORD(ptr,dw) (PUT_WORD((ptr),LOWORD(dw)), \
557 PUT_WORD((WORD *)(ptr)+1,HIWORD(dw)))
558#define GET_DWORD(ptr) ((DWORD)(GET_WORD(ptr) | \
559 ((DWORD)GET_WORD((WORD *)(ptr)+1) << 16)))
560#endif /* 1 */
561
562/* MIN and MAX macros */
563
564#ifdef MAX
565#undef MAX
566#endif
567#define MAX(a,b) (((a) > (b)) ? (a) : (b))
568
569#ifdef MIN
570#undef MIN
571#endif
572#define MIN(a,b) (((a) < (b)) ? (a) : (b))
573
574#define __max(a,b) MAX(a,b)
575#define __min(a,b) MIN(a,b)
576#ifndef RC_INVOKED
577#include <stdlib.h>
578#endif
579
580#define _MAX_PATH 260
581#define MAX_PATH 260
582#define _MAX_DRIVE 3
583#define _MAX_DIR 256
584#if !defined(__WIN32OS2__) && !defined(_MAX_FNAME)
585#define _MAX_FNAME 255
586#endif
587#define _MAX_EXT 256
588
589#define HFILE_ERROR16 ((HFILE16)-1)
590#define HFILE_ERROR ((HFILE)-1)
591
592/* Winelib run-time flag */
593
594#ifdef __WINE__
595extern int __winelib;
596#endif /* __WINE__ */
597
598/* The SIZE structure */
599
600typedef struct
601{
602 INT16 cx;
603 INT16 cy;
604} SIZE16, *PSIZE16, *LPSIZE16;
605
606typedef struct tagSIZE
607{
608 INT cx;
609 INT cy;
610} SIZE, *PSIZE, *LPSIZE;
611
612
613typedef SIZE SIZEL, *PSIZEL, *LPSIZEL;
614
615#define CONV_SIZE16TO32(s16,s32) \
616 ((s32)->cx = (INT)(s16)->cx, (s32)->cy = (INT)(s16)->cy)
617#define CONV_SIZE32TO16(s32,s16) \
618 ((s16)->cx = (INT16)(s32)->cx, (s16)->cy = (INT16)(s32)->cy)
619
620/* The POINT structure */
621
622typedef struct
623{
624 INT16 x;
625 INT16 y;
626} POINT16, *PPOINT16, *LPPOINT16;
627
628typedef struct tagPOINT
629{
630 LONG x;
631 LONG y;
632} POINT, *PPOINT, *LPPOINT;
633
634typedef struct _POINTL
635{
636 LONG x;
637 LONG y;
638} POINTL;
639
640#define CONV_POINT16TO32(p16,p32) \
641 ((p32)->x = (INT)(p16)->x, (p32)->y = (INT)(p16)->y)
642#define CONV_POINT32TO16(p32,p16) \
643 ((p16)->x = (INT16)(p32)->x, (p16)->y = (INT16)(p32)->y)
644
645#define MAKEPOINT(l) (*((POINT *)&(l)))
646
647#define MAKEPOINT16(l) (*((POINT16 *)&(l)))
648
649/* The POINTS structure */
650
651typedef struct tagPOINTS
652{
653 SHORT x;
654 SHORT y;
655} POINTS, *PPOINTS, *LPPOINTS;
656
657
658#define MAKEPOINTS(l) (*((POINTS *)&(l)))
659
660
661/* The RECT structure */
662
663typedef struct
664{
665 INT16 left;
666 INT16 top;
667 INT16 right;
668 INT16 bottom;
669} RECT16, *LPRECT16;
670
671typedef struct tagRECT
672{
673 INT left;
674 INT top;
675 INT right;
676 INT bottom;
677} RECT, *PRECT, *LPRECT;
678typedef const RECT *LPCRECT;
679
680
681typedef struct tagRECTL
682{
683 LONG left;
684 LONG top;
685 LONG right;
686 LONG bottom;
687} RECTL, *PRECTL, *LPRECTL;
688
689typedef const RECTL *LPCRECTL;
690
691#define CONV_RECT16TO32(r16,r32) \
692 ((r32)->left = (INT)(r16)->left, (r32)->top = (INT)(r16)->top, \
693 (r32)->right = (INT)(r16)->right, (r32)->bottom = (INT)(r16)->bottom)
694#define CONV_RECT32TO16(r32,r16) \
695 ((r16)->left = (INT16)(r32)->left, (r16)->top = (INT16)(r32)->top, \
696 (r16)->right = (INT16)(r32)->right, (r16)->bottom = (INT16)(r32)->bottom)
697
698/*
699 * 8.9.99 DJR DECIMAL support
700 */
701typedef struct tagDEC
702{
703 USHORT wReserved;
704 union
705 {
706 struct
707 {
708 BYTE scale;
709 BYTE sign;
710 } a;
711 USHORT signscale;
712 } b;
713 ULONG Hi32;
714 union
715 {
716 struct
717 {
718 ULONG Lo32;
719 ULONG Mid32;
720 } c;
721 ULONGLONG Lo64;
722 } d;
723} DECIMAL;
724
725#ifdef __cplusplus
726}
727#endif
728
729#endif /* __WINE_WINDEF_H */
Note: See TracBrowser for help on using the repository browser.