home *** CD-ROM | disk | FTP | other *** search
/ OpenStep (Enterprise) / OpenStepENTCD.toast / OEDEV / DEV.Z / WINDEF.H < prev    next >
Encoding:
C/C++ Source or Header  |  1996-09-08  |  7.3 KB  |  319 lines

  1. #if !defined(__TOPLEVEL_NEXT_COMMON_INCLUDE__)
  2. #define __TOPLEVEL_NEXT_COMMON_INCLUDE__
  3. #define __TOPLEVEL_WINDEF_H_ 
  4. #include <next_common_defines.h>
  5. #endif /* __TOPLEVEL_NEXT_COMMON_INCLUDE__ */
  6.  
  7. /****************************************************************************
  8. *                                                                           *
  9. * windef.h -- Basic Windows Type Definitions                                *
  10. *                                                                           *
  11. * Copyright (c) 1985-1995, Microsoft Corp. All rights reserved.             *
  12. *                                                                           *
  13. ****************************************************************************/
  14.  
  15.  
  16. #ifndef _WINDEF_        
  17. #define _WINDEF_
  18.  
  19.  
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif
  23.  
  24. #ifndef WINVER
  25. #define WINVER 0x0400
  26. #endif 
  27.  
  28.  
  29. /*
  30.  * BASETYPES is defined in ntdef.h if these types are already defined
  31.  */
  32.  
  33. #ifndef BASETYPES
  34. #define BASETYPES
  35. typedef unsigned long ULONG;
  36. typedef ULONG *PULONG;
  37. typedef unsigned short USHORT;
  38. typedef USHORT *PUSHORT;
  39. typedef unsigned char UCHAR;
  40. typedef UCHAR *PUCHAR;
  41. typedef char *PSZ;
  42. #endif  /* !BASETYPES */
  43.  
  44. #define MAX_PATH          260
  45.  
  46. #ifndef NULL
  47. #ifdef __cplusplus
  48. #define NULL    0
  49. #else
  50. #define NULL    ((void *)0)
  51. #endif
  52. #endif
  53.  
  54. #ifndef FALSE
  55. #define FALSE               0
  56. #endif
  57.  
  58. #ifndef TRUE
  59. #define TRUE                1
  60. #endif
  61.  
  62. #ifndef IN
  63. #define IN
  64. #endif
  65.  
  66. #ifndef OUT
  67. #define OUT
  68. #endif
  69.  
  70. #ifndef OPTIONAL
  71. #define OPTIONAL
  72. #endif
  73.  
  74. #undef far
  75. #undef near
  76. #undef pascal
  77.  
  78. #define far
  79. #define near
  80. #if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED)
  81. #define pascal __stdcall
  82. #else
  83. #define pascal
  84. #endif
  85.  
  86. #ifdef DOSWIN32
  87. #define cdecl _cdecl
  88. #ifndef CDECL
  89. #define CDECL _cdecl
  90. #endif
  91. #else
  92. #define cdecl
  93. #ifndef CDECL
  94. #define CDECL
  95. #endif
  96. #endif
  97.  
  98. #if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED)
  99. #define CALLBACK    __stdcall
  100. #define WINAPI      __stdcall
  101. #define WINAPIV     __cdecl
  102. #define APIENTRY    WINAPI
  103. #define APIPRIVATE  __stdcall
  104. #define PASCAL      __stdcall
  105. #else
  106. #define CALLBACK
  107. #define WINAPI
  108. #define WINAPIV
  109. #define APIENTRY    WINAPI
  110. #define APIPRIVATE
  111. #define PASCAL      pascal
  112. #endif
  113.  
  114. #define FAR                 far
  115. #define NEAR                near
  116. #ifndef CONST
  117. #define CONST               const
  118. #endif
  119.  
  120. typedef unsigned long       DWORD;
  121. typedef int                 BOOL;
  122. typedef unsigned char       BYTE;
  123. typedef unsigned short      WORD;
  124. typedef float               FLOAT;
  125. typedef FLOAT               *PFLOAT;
  126. typedef BOOL near           *PBOOL;
  127. typedef BOOL far            *LPBOOL;
  128. typedef BYTE near           *PBYTE;
  129. typedef BYTE far            *LPBYTE;
  130. typedef int near            *PINT;
  131. typedef int far             *LPINT;
  132. typedef WORD near           *PWORD;
  133. typedef WORD far            *LPWORD;
  134. typedef long far            *LPLONG;
  135. typedef DWORD near          *PDWORD;
  136. typedef DWORD far           *LPDWORD;
  137. typedef void far            *LPVOID;
  138. typedef CONST void far      *LPCVOID;
  139.  
  140. typedef int                 INT;
  141. typedef unsigned int        UINT;
  142. typedef unsigned int        *PUINT;
  143.  
  144. #ifndef NT_INCLUDED
  145. #include <winnt.h>
  146. #endif /* NT_INCLUDED */
  147.  
  148. /* Types use for passing & returning polymorphic values */
  149. typedef UINT WPARAM;
  150. typedef LONG LPARAM;
  151. typedef LONG LRESULT;
  152.  
  153. #ifndef NOMINMAX
  154.  
  155. #ifndef max
  156. #define max(a,b)            (((a) > (b)) ? (a) : (b))
  157. #endif
  158.  
  159. #ifndef min
  160. #define min(a,b)            (((a) < (b)) ? (a) : (b))
  161. #endif
  162.  
  163. #endif  /* NOMINMAX */
  164.  
  165. #define MAKEWORD(a, b)      ((WORD)(((BYTE)(a)) | ((WORD)((BYTE)(b))) << 8))
  166. #define MAKELONG(a, b)      ((LONG)(((WORD)(a)) | ((DWORD)((WORD)(b))) << 16))
  167. #define LOWORD(l)           ((WORD)(l))
  168. #define HIWORD(l)           ((WORD)(((DWORD)(l) >> 16) & 0xFFFF))
  169. #define LOBYTE(w)           ((BYTE)(w))
  170. #define HIBYTE(w)           ((BYTE)(((WORD)(w) >> 8) & 0xFF))
  171.  
  172.  
  173. #ifndef WIN_INTERNAL
  174. DECLARE_HANDLE            (HWND);
  175. DECLARE_HANDLE            (HHOOK);
  176. #endif
  177.  
  178. typedef WORD                ATOM;
  179.  
  180. typedef HANDLE NEAR         *SPHANDLE;
  181. typedef HANDLE FAR          *LPHANDLE;
  182. typedef HANDLE              HGLOBAL;
  183. typedef HANDLE              HLOCAL;
  184. typedef HANDLE              GLOBALHANDLE;
  185. typedef HANDLE              LOCALHANDLE;
  186. typedef int (FAR WINAPI *FARPROC)();
  187. typedef int (NEAR WINAPI *NEARPROC)();
  188. typedef int (WINAPI *PROC)();
  189.  
  190. #ifdef STRICT
  191. typedef void NEAR* HGDIOBJ;
  192. #else
  193. DECLARE_HANDLE(HGDIOBJ);
  194. #endif
  195.  
  196. DECLARE_HANDLE(HACCEL);
  197. DECLARE_HANDLE(HBITMAP);
  198. DECLARE_HANDLE(HBRUSH);
  199. #if(WINVER >= 0x0400)
  200. DECLARE_HANDLE(HCOLORSPACE);
  201. #endif /* WINVER >= 0x0400 */
  202. DECLARE_HANDLE(HDC);
  203. DECLARE_HANDLE(HGLRC);          // OpenGL
  204. DECLARE_HANDLE(HDESK);
  205. DECLARE_HANDLE(HENHMETAFILE);
  206. DECLARE_HANDLE(HFONT);
  207. DECLARE_HANDLE(HICON);
  208. DECLARE_HANDLE(HMENU);
  209. DECLARE_HANDLE(HMETAFILE);
  210. DECLARE_HANDLE(HINSTANCE);
  211. typedef HINSTANCE HMODULE;      /* HMODULEs can be used in place of HINSTANCEs */
  212. DECLARE_HANDLE(HPALETTE);
  213. DECLARE_HANDLE(HPEN);
  214. DECLARE_HANDLE(HRGN);
  215. DECLARE_HANDLE(HRSRC);
  216. DECLARE_HANDLE(HSTR);
  217. DECLARE_HANDLE(HTASK);
  218. DECLARE_HANDLE(HWINSTA);
  219. DECLARE_HANDLE(HKL);
  220.  
  221. typedef int HFILE;      
  222. typedef HICON HCURSOR;      /* HICONs & HCURSORs are polymorphic */
  223.  
  224. typedef DWORD   COLORREF;
  225. typedef DWORD   *LPCOLORREF;
  226.  
  227. #define HFILE_ERROR ((HFILE)-1)
  228.  
  229. typedef struct tagRECT
  230. {
  231.     LONG    left;
  232.     LONG    top;
  233.     LONG    right;
  234.     LONG    bottom;
  235. } RECT, *PRECT, NEAR *NPRECT, FAR *LPRECT;
  236.  
  237. typedef const RECT FAR* LPCRECT;
  238.  
  239. typedef struct _RECTL       /* rcl */
  240. {
  241.     LONG    left;
  242.     LONG    top;
  243.     LONG    right;
  244.     LONG    bottom;
  245. } RECTL, *PRECTL, *LPRECTL;
  246.  
  247. typedef const RECTL FAR* LPCRECTL;
  248.  
  249. typedef struct tagPOINT
  250. {
  251.     LONG  x;
  252.     LONG  y;
  253. } POINT, *PPOINT, NEAR *NPPOINT, FAR *LPPOINT;
  254.  
  255. typedef struct _POINTL      /* ptl  */
  256. {
  257.     LONG  x;
  258.     LONG  y;
  259. } POINTL, *PPOINTL;
  260.  
  261. typedef struct tagSIZE
  262. {
  263.     LONG        cx;
  264.     LONG        cy;
  265. } SIZE, *PSIZE, *LPSIZE;
  266.  
  267. typedef SIZE               SIZEL;
  268. typedef SIZE               *PSIZEL, *LPSIZEL;
  269.  
  270. typedef struct tagPOINTS
  271. {
  272.     SHORT   x;
  273.     SHORT   y;
  274. } POINTS, *PPOINTS, *LPPOINTS;
  275.  
  276. /* mode selections for the device mode function */
  277. #define DM_UPDATE           1
  278. #define DM_COPY             2
  279. #define DM_PROMPT           4
  280. #define DM_MODIFY           8
  281.  
  282. #define DM_IN_BUFFER        DM_MODIFY
  283. #define DM_IN_PROMPT        DM_PROMPT
  284. #define DM_OUT_BUFFER       DM_COPY
  285. #define DM_OUT_DEFAULT      DM_UPDATE
  286.  
  287. /* device capabilities indices */
  288. #define DC_FIELDS           1
  289. #define DC_PAPERS           2
  290. #define DC_PAPERSIZE        3
  291. #define DC_MINEXTENT        4
  292. #define DC_MAXEXTENT        5
  293. #define DC_BINS             6
  294. #define DC_DUPLEX           7
  295. #define DC_SIZE             8
  296. #define DC_EXTRA            9
  297. #define DC_VERSION          10
  298. #define DC_DRIVER           11
  299. #define DC_BINNAMES         12
  300. #define DC_ENUMRESOLUTIONS  13
  301. #define DC_FILEDEPENDENCIES 14
  302. #define DC_TRUETYPE         15
  303. #define DC_PAPERNAMES       16
  304. #define DC_ORIENTATION      17
  305. #define DC_COPIES           18
  306.  
  307. #ifdef __cplusplus
  308. }
  309. #endif
  310.  
  311.  
  312. #endif /* _WINDEF_ */   
  313.  
  314. #if defined(__TOPLEVEL_WINDEF_H_)
  315. #undef __TOPLEVEL_NEXT_COMMON_INCLUDE__
  316. #undef __TOPLEVEL_WINDEF_H_
  317. #include <next_common_undefines.h>
  318. #endif /* __TOPLEVEL_WINDEF_H_ */
  319.