Artifact Content

Not logged in

Artifact 9189fd75dd1f34fce7eb9089239f57b17840c9bd


     1  module win32.ansi.windef;
     2  
     3  // Translated from Microsoft Platform SDK August 2001 Edition
     4  // by Y.Tomino (demoonlit@inter7.jp)
     5  
     6  alias void* va_list;
     7  alias long __int64;
     8  alias ulong DWORD64;
     9  alias uint SIZE_T;
    10  alias SIZE_T* PSIZE_T;
    11  alias int INT_PTR;
    12  alias uint UINT_PTR;
    13  alias uint LONG_PTR;
    14  alias uint ULONG_PTR;
    15  alias uint DWORD_PTR;
    16  alias DWORD_PTR* PDWORD_PTR;
    17  alias UINT_PTR* PUINT_PTR;
    18  alias ULONG_PTR* PULONG_PTR;
    19  enum : UINT { UINT_MAX = UINT.max }
    20  
    21  // #ifndef _WINDEF_
    22  // #define _WINDEF_
    23  
    24  // #ifndef NO_STRICT
    25  // #ifndef STRICT
    26  // #...
    27  // #endif
    28  // #endif /* NO_STRICT */
    29  
    30  // #ifdef _MAC
    31  // #ifndef _WIN32
    32  // #...
    33  // #endif
    34  // #endif //_MAC
    35  
    36  // #ifdef __cplusplus
    37  // extern "C" {
    38  // #endif
    39  
    40  // #ifndef WINVER
    41  // #...
    42  // #endif /* WINVER */
    43  
    44  // #ifndef BASETYPES
    45  // #define BASETYPES
    46  alias uint ULONG;
    47  alias ULONG* PULONG;
    48  alias ushort USHORT;
    49  alias USHORT* PUSHORT;
    50  alias ubyte UCHAR;
    51  alias UCHAR* PUCHAR;
    52  alias char* PSZ;
    53  // #endif  /* !BASETYPES */
    54  
    55  enum : uint { MAX_PATH = 260 }
    56  
    57  // #ifndef NULL
    58  // #ifdef __cplusplus
    59  const void* NULL = null;
    60  // #else
    61  // #...
    62  // #endif
    63  // #endif
    64  
    65  // #ifndef FALSE
    66  enum : uint { FALSE = 0 }
    67  // #endif
    68  
    69  // #ifndef TRUE
    70  enum : uint { TRUE = 1 }
    71  // #endif
    72  
    73  // #ifndef IN
    74  // #define IN
    75  // #endif
    76  
    77  // #ifndef OUT
    78  // #define OUT
    79  // #endif
    80  
    81  // #ifndef OPTIONAL
    82  // #define OPTIONAL
    83  // #endif
    84  
    85  // #undef far
    86  // #undef near
    87  // #undef pascal
    88  
    89  // #define far
    90  // #define near
    91  // #if (!defined(_MAC)) && ((_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED))
    92  // #define pascal __stdcall
    93  // #else
    94  // #...
    95  // #endif
    96  
    97  // #if defined(DOSWIN32) || defined(_MAC)
    98  // #...
    99  // #ifndef CDECL
   100  // #...
   101  // #endif
   102  // #else
   103  // #define cdecl
   104  // #ifndef CDECL
   105  // #define CDECL
   106  // #endif
   107  // #endif
   108  
   109  // #ifdef _MAC
   110  // #...
   111  // #...
   112  // #...
   113  // #...
   114  // #...
   115  // #ifdef _68K_
   116  // #...
   117  // #else
   118  // #...
   119  // #endif
   120  // #elif (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED)
   121  // #define CALLBACK __stdcall
   122  // #define WINAPI __stdcall
   123  // #define WINAPIV __cdecl
   124  // #define APIENTRY WINAPI
   125  // #define APIPRIVATE __stdcall
   126  // #define PASCAL __stdcall
   127  // #else
   128  // #...
   129  // #...
   130  // #...
   131  // #...
   132  // #...
   133  // #...
   134  // #endif
   135  
   136  // #undef FAR
   137  // #undef  NEAR
   138  // #define FAR far
   139  // #define NEAR near
   140  // #ifndef CONST
   141  // #define CONST const
   142  // #endif
   143  
   144  alias uint DWORD;
   145  alias int BOOL;
   146  alias ubyte BYTE;
   147  alias ushort WORD;
   148  alias float FLOAT;
   149  alias FLOAT* PFLOAT;
   150  alias BOOL* PBOOL;
   151  alias BOOL* LPBOOL;
   152  alias BYTE* PBYTE;
   153  alias BYTE* LPBYTE;
   154  alias int* PINT;
   155  alias int* LPINT;
   156  alias WORD* PWORD;
   157  alias WORD* LPWORD;
   158  alias int* LPLONG;
   159  alias DWORD* PDWORD;
   160  alias DWORD* LPDWORD;
   161  alias void* LPVOID;
   162  alias void* LPCVOID;
   163  
   164  alias int INT;
   165  alias uint UINT;
   166  alias uint* PUINT;
   167  
   168  // #ifndef NT_INCLUDED
   169  import win32.ansi.winnt;
   170  // #endif /* NT_INCLUDED */
   171  
   172  alias UINT_PTR WPARAM;
   173  alias LONG_PTR LPARAM;
   174  alias LONG_PTR LRESULT;
   175  
   176  // #ifndef NOMINMAX
   177  
   178  // #ifndef max
   179  int max(int a, int b){ return (a > b)? a : b; }
   180  uint max(uint a, uint b){ return (a > b)? a : b; }
   181  real max(real a, real b){ return (a > b)? a : b; }
   182  // #endif
   183  
   184  // #ifndef min
   185  int min(int a, int b){ return (a < b)? a : b; }
   186  uint min(uint a, uint b){ return (a < b)? a : b; }
   187  real min(real a, real b){ return (a < b)? a : b; }
   188  // #endif
   189  
   190  // #endif  /* NOMINMAX */
   191  
   192  ushort MAKEWORD(byte a, byte b){ return (a & 0xff) | ((b & 0xff) << 8); }
   193  uint MAKELONG(ushort a, ushort b){ return (a & 0xffff) | ((b & 0xffff) << 16); }
   194  ushort LOWORD(uint l){ return l & 0xffff; }
   195  ushort HIWORD(uint l){ return l >>> 16; }
   196  ubyte LOBYTE(ushort l){ return l & 0xff; }
   197  ubyte HIBYTE(ushort l){ return l >>> 8; }
   198  
   199  // #ifndef WIN_INTERNAL
   200  alias void* HWND;
   201  alias void* HHOOK;
   202  // #ifdef WINABLE
   203  // ...
   204  // #endif
   205  // #endif
   206  
   207  alias WORD ATOM;
   208  
   209  alias HANDLE* SPHANDLE;
   210  alias HANDLE* LPHANDLE;
   211  alias HANDLE HGLOBAL;
   212  alias HANDLE HLOCAL;
   213  alias HANDLE GLOBALHANDLE;
   214  alias HANDLE LOCALHANDLE;
   215  // #ifndef _MAC
   216  // #ifdef _WIN64
   217  // ...
   218  // #else
   219  extern(Windows) alias int function() FARPROC;
   220  extern(Windows) alias int function() NEARPROC;
   221  extern(Windows) alias int function() PROC;
   222  // #endif  // _WIN64
   223  // #else
   224  // ...
   225  // #endif
   226  
   227  // #if !defined(_MAC) || !defined(GDI_INTERNAL)
   228  // #ifdef STRICT
   229  alias void* HGDIOBJ;
   230  // #else
   231  // ...
   232  // #endif
   233  // #endif
   234  
   235  alias void* HKEY;
   236  alias HKEY* PHKEY;
   237  
   238  // #if !defined(_MAC) || !defined(WIN_INTERNAL)
   239  alias void* HACCEL;
   240  // #endif
   241  // #if !defined(_MAC) || !defined(GDI_INTERNAL)
   242  alias void* HBITMAP;
   243  alias void* HBRUSH;
   244  // #endif
   245  // #if(WINVER >= 0x0400)
   246  alias void* HCOLORSPACE;
   247  // #endif /* WINVER >= 0x0400 */
   248  // #if !defined(_MAC) || !defined(GDI_INTERNAL)
   249  alias void* HDC;
   250  // #endif
   251  alias void* HGLRC;
   252  alias void* HDESK;
   253  alias void* HENHMETAFILE;
   254  // #if !defined(_MAC) || !defined(GDI_INTERNAL)
   255  alias void* HFONT;
   256  // #endif
   257  alias void* HICON;
   258  // #if !defined(_MAC) || !defined(WIN_INTERNAL)
   259  alias void* HMENU;
   260  // #endif
   261  alias void* HMETAFILE;
   262  alias void* HINSTANCE;
   263  alias HINSTANCE HMODULE;
   264  // #if !defined(_MAC) || !defined(GDI_INTERNAL)
   265  alias void* HPALETTE;
   266  alias void* HPEN;
   267  // #endif
   268  alias void* HRGN;
   269  alias void* HRSRC;
   270  alias void* HSTR;
   271  alias void* HTASK;
   272  alias void* HWINSTA;
   273  alias void* HKL;
   274  
   275  // #if(WINVER >= 0x0500)
   276  // #ifndef _MAC
   277  alias void* HMONITOR;
   278  alias void* HWINEVENTHOOK;
   279  // #endif
   280  alias void* HUMPD;
   281  // #endif /* WINVER >= 0x0500 */
   282  
   283  // #ifndef _MAC
   284  alias int HFILE;
   285  alias HICON HCURSOR;
   286  // #else
   287  // ...
   288  // #endif
   289  
   290  alias DWORD COLORREF;
   291  alias DWORD* LPCOLORREF;
   292  
   293  const HFILE HFILE_ERROR = -1;
   294  
   295  struct tagRECT {
   296    LONG left;
   297    LONG top;
   298    LONG right;
   299    LONG bottom;
   300  }
   301  alias tagRECT RECT;
   302  alias tagRECT* PRECT;
   303  alias tagRECT* NPRECT;
   304  alias tagRECT* LPRECT;
   305  
   306  alias RECT* LPCRECT;
   307  
   308  struct _RECTL {
   309    LONG left;
   310    LONG top;
   311    LONG right;
   312    LONG bottom;
   313  }
   314  alias _RECTL RECTL;
   315  alias _RECTL* PRECTL;
   316  alias _RECTL* LPRECTL;
   317  
   318  alias RECTL* LPCRECTL;
   319  
   320  struct tagPOINT {
   321    LONG x;
   322    LONG y;
   323  }
   324  alias tagPOINT POINT;
   325  alias tagPOINT* PPOINT;
   326  alias tagPOINT* NPPOINT;
   327  alias tagPOINT* LPPOINT;
   328  
   329  struct _POINTL {
   330    LONG x;
   331    LONG y;
   332  }
   333  alias _POINTL POINTL;
   334  alias _POINTL* PPOINTL;
   335  
   336  struct tagSIZE {
   337    LONG cx;
   338    LONG cy;
   339  }
   340  alias tagSIZE SIZE;
   341  alias tagSIZE* PSIZE;
   342  alias tagSIZE* LPSIZE;
   343  
   344  alias SIZE SIZEL;
   345  alias SIZE* PSIZEL;
   346  alias SIZE* LPSIZEL;
   347  
   348  struct tagPOINTS {
   349  // #ifndef _MAC
   350    SHORT x;
   351    SHORT y;
   352  // #else
   353  // ...
   354  // #endif
   355  }
   356  alias tagPOINTS POINTS;
   357  alias tagPOINTS* PPOINTS;
   358  alias tagPOINTS* LPPOINTS;
   359  
   360  enum : uint { DM_UPDATE = 1 }
   361  enum : uint { DM_COPY = 2 }
   362  enum : uint { DM_PROMPT = 4 }
   363  enum : uint { DM_MODIFY = 8 }
   364  
   365  alias DM_MODIFY DM_IN_BUFFER;
   366  alias DM_PROMPT DM_IN_PROMPT;
   367  alias DM_COPY DM_OUT_BUFFER;
   368  alias DM_UPDATE DM_OUT_DEFAULT;
   369  
   370  enum : uint { DC_FIELDS = 1 }
   371  enum : uint { DC_PAPERS = 2 }
   372  enum : uint { DC_PAPERSIZE = 3 }
   373  enum : uint { DC_MINEXTENT = 4 }
   374  enum : uint { DC_MAXEXTENT = 5 }
   375  enum : uint { DC_BINS = 6 }
   376  enum : uint { DC_DUPLEX = 7 }
   377  enum : uint { DC_SIZE = 8 }
   378  enum : uint { DC_EXTRA = 9 }
   379  enum : uint { DC_VERSION = 10 }
   380  enum : uint { DC_DRIVER = 11 }
   381  enum : uint { DC_BINNAMES = 12 }
   382  enum : uint { DC_ENUMRESOLUTIONS = 13 }
   383  enum : uint { DC_FILEDEPENDENCIES = 14 }
   384  enum : uint { DC_TRUETYPE = 15 }
   385  enum : uint { DC_PAPERNAMES = 16 }
   386  enum : uint { DC_ORIENTATION = 17 }
   387  enum : uint { DC_COPIES = 18 }
   388  
   389  // #ifdef __cplusplus
   390  // }
   391  // #endif
   392  
   393  // #endif /* _WINDEF_ */
   394