Artifact Content

Not logged in

Artifact 9189fd75dd1f34fce7eb9089239f57b17840c9bd


module win32.ansi.windef;

// Translated from Microsoft Platform SDK August 2001 Edition
// by Y.Tomino (demoonlit@inter7.jp)

alias void* va_list;
alias long __int64;
alias ulong DWORD64;
alias uint SIZE_T;
alias SIZE_T* PSIZE_T;
alias int INT_PTR;
alias uint UINT_PTR;
alias uint LONG_PTR;
alias uint ULONG_PTR;
alias uint DWORD_PTR;
alias DWORD_PTR* PDWORD_PTR;
alias UINT_PTR* PUINT_PTR;
alias ULONG_PTR* PULONG_PTR;
enum : UINT { UINT_MAX = UINT.max }

// #ifndef _WINDEF_
// #define _WINDEF_

// #ifndef NO_STRICT
// #ifndef STRICT
// #...
// #endif
// #endif /* NO_STRICT */

// #ifdef _MAC
// #ifndef _WIN32
// #...
// #endif
// #endif //_MAC

// #ifdef __cplusplus
// extern "C" {
// #endif

// #ifndef WINVER
// #...
// #endif /* WINVER */

// #ifndef BASETYPES
// #define BASETYPES
alias uint ULONG;
alias ULONG* PULONG;
alias ushort USHORT;
alias USHORT* PUSHORT;
alias ubyte UCHAR;
alias UCHAR* PUCHAR;
alias char* PSZ;
// #endif  /* !BASETYPES */

enum : uint { MAX_PATH = 260 }

// #ifndef NULL
// #ifdef __cplusplus
const void* NULL = null;
// #else
// #...
// #endif
// #endif

// #ifndef FALSE
enum : uint { FALSE = 0 }
// #endif

// #ifndef TRUE
enum : uint { TRUE = 1 }
// #endif

// #ifndef IN
// #define IN
// #endif

// #ifndef OUT
// #define OUT
// #endif

// #ifndef OPTIONAL
// #define OPTIONAL
// #endif

// #undef far
// #undef near
// #undef pascal

// #define far
// #define near
// #if (!defined(_MAC)) && ((_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED))
// #define pascal __stdcall
// #else
// #...
// #endif

// #if defined(DOSWIN32) || defined(_MAC)
// #...
// #ifndef CDECL
// #...
// #endif
// #else
// #define cdecl
// #ifndef CDECL
// #define CDECL
// #endif
// #endif

// #ifdef _MAC
// #...
// #...
// #...
// #...
// #...
// #ifdef _68K_
// #...
// #else
// #...
// #endif
// #elif (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED)
// #define CALLBACK __stdcall
// #define WINAPI __stdcall
// #define WINAPIV __cdecl
// #define APIENTRY WINAPI
// #define APIPRIVATE __stdcall
// #define PASCAL __stdcall
// #else
// #...
// #...
// #...
// #...
// #...
// #...
// #endif

// #undef FAR
// #undef  NEAR
// #define FAR far
// #define NEAR near
// #ifndef CONST
// #define CONST const
// #endif

alias uint DWORD;
alias int BOOL;
alias ubyte BYTE;
alias ushort WORD;
alias float FLOAT;
alias FLOAT* PFLOAT;
alias BOOL* PBOOL;
alias BOOL* LPBOOL;
alias BYTE* PBYTE;
alias BYTE* LPBYTE;
alias int* PINT;
alias int* LPINT;
alias WORD* PWORD;
alias WORD* LPWORD;
alias int* LPLONG;
alias DWORD* PDWORD;
alias DWORD* LPDWORD;
alias void* LPVOID;
alias void* LPCVOID;

alias int INT;
alias uint UINT;
alias uint* PUINT;

// #ifndef NT_INCLUDED
import win32.ansi.winnt;
// #endif /* NT_INCLUDED */

alias UINT_PTR WPARAM;
alias LONG_PTR LPARAM;
alias LONG_PTR LRESULT;

// #ifndef NOMINMAX

// #ifndef max
int max(int a, int b){ return (a > b)? a : b; }
uint max(uint a, uint b){ return (a > b)? a : b; }
real max(real a, real b){ return (a > b)? a : b; }
// #endif

// #ifndef min
int min(int a, int b){ return (a < b)? a : b; }
uint min(uint a, uint b){ return (a < b)? a : b; }
real min(real a, real b){ return (a < b)? a : b; }
// #endif

// #endif  /* NOMINMAX */

ushort MAKEWORD(byte a, byte b){ return (a & 0xff) | ((b & 0xff) << 8); }
uint MAKELONG(ushort a, ushort b){ return (a & 0xffff) | ((b & 0xffff) << 16); }
ushort LOWORD(uint l){ return l & 0xffff; }
ushort HIWORD(uint l){ return l >>> 16; }
ubyte LOBYTE(ushort l){ return l & 0xff; }
ubyte HIBYTE(ushort l){ return l >>> 8; }

// #ifndef WIN_INTERNAL
alias void* HWND;
alias void* HHOOK;
// #ifdef WINABLE
// ...
// #endif
// #endif

alias WORD ATOM;

alias HANDLE* SPHANDLE;
alias HANDLE* LPHANDLE;
alias HANDLE HGLOBAL;
alias HANDLE HLOCAL;
alias HANDLE GLOBALHANDLE;
alias HANDLE LOCALHANDLE;
// #ifndef _MAC
// #ifdef _WIN64
// ...
// #else
extern(Windows) alias int function() FARPROC;
extern(Windows) alias int function() NEARPROC;
extern(Windows) alias int function() PROC;
// #endif  // _WIN64
// #else
// ...
// #endif

// #if !defined(_MAC) || !defined(GDI_INTERNAL)
// #ifdef STRICT
alias void* HGDIOBJ;
// #else
// ...
// #endif
// #endif

alias void* HKEY;
alias HKEY* PHKEY;

// #if !defined(_MAC) || !defined(WIN_INTERNAL)
alias void* HACCEL;
// #endif
// #if !defined(_MAC) || !defined(GDI_INTERNAL)
alias void* HBITMAP;
alias void* HBRUSH;
// #endif
// #if(WINVER >= 0x0400)
alias void* HCOLORSPACE;
// #endif /* WINVER >= 0x0400 */
// #if !defined(_MAC) || !defined(GDI_INTERNAL)
alias void* HDC;
// #endif
alias void* HGLRC;
alias void* HDESK;
alias void* HENHMETAFILE;
// #if !defined(_MAC) || !defined(GDI_INTERNAL)
alias void* HFONT;
// #endif
alias void* HICON;
// #if !defined(_MAC) || !defined(WIN_INTERNAL)
alias void* HMENU;
// #endif
alias void* HMETAFILE;
alias void* HINSTANCE;
alias HINSTANCE HMODULE;
// #if !defined(_MAC) || !defined(GDI_INTERNAL)
alias void* HPALETTE;
alias void* HPEN;
// #endif
alias void* HRGN;
alias void* HRSRC;
alias void* HSTR;
alias void* HTASK;
alias void* HWINSTA;
alias void* HKL;

// #if(WINVER >= 0x0500)
// #ifndef _MAC
alias void* HMONITOR;
alias void* HWINEVENTHOOK;
// #endif
alias void* HUMPD;
// #endif /* WINVER >= 0x0500 */

// #ifndef _MAC
alias int HFILE;
alias HICON HCURSOR;
// #else
// ...
// #endif

alias DWORD COLORREF;
alias DWORD* LPCOLORREF;

const HFILE HFILE_ERROR = -1;

struct tagRECT {
  LONG left;
  LONG top;
  LONG right;
  LONG bottom;
}
alias tagRECT RECT;
alias tagRECT* PRECT;
alias tagRECT* NPRECT;
alias tagRECT* LPRECT;

alias RECT* LPCRECT;

struct _RECTL {
  LONG left;
  LONG top;
  LONG right;
  LONG bottom;
}
alias _RECTL RECTL;
alias _RECTL* PRECTL;
alias _RECTL* LPRECTL;

alias RECTL* LPCRECTL;

struct tagPOINT {
  LONG x;
  LONG y;
}
alias tagPOINT POINT;
alias tagPOINT* PPOINT;
alias tagPOINT* NPPOINT;
alias tagPOINT* LPPOINT;

struct _POINTL {
  LONG x;
  LONG y;
}
alias _POINTL POINTL;
alias _POINTL* PPOINTL;

struct tagSIZE {
  LONG cx;
  LONG cy;
}
alias tagSIZE SIZE;
alias tagSIZE* PSIZE;
alias tagSIZE* LPSIZE;

alias SIZE SIZEL;
alias SIZE* PSIZEL;
alias SIZE* LPSIZEL;

struct tagPOINTS {
// #ifndef _MAC
  SHORT x;
  SHORT y;
// #else
// ...
// #endif
}
alias tagPOINTS POINTS;
alias tagPOINTS* PPOINTS;
alias tagPOINTS* LPPOINTS;

enum : uint { DM_UPDATE = 1 }
enum : uint { DM_COPY = 2 }
enum : uint { DM_PROMPT = 4 }
enum : uint { DM_MODIFY = 8 }

alias DM_MODIFY DM_IN_BUFFER;
alias DM_PROMPT DM_IN_PROMPT;
alias DM_COPY DM_OUT_BUFFER;
alias DM_UPDATE DM_OUT_DEFAULT;

enum : uint { DC_FIELDS = 1 }
enum : uint { DC_PAPERS = 2 }
enum : uint { DC_PAPERSIZE = 3 }
enum : uint { DC_MINEXTENT = 4 }
enum : uint { DC_MAXEXTENT = 5 }
enum : uint { DC_BINS = 6 }
enum : uint { DC_DUPLEX = 7 }
enum : uint { DC_SIZE = 8 }
enum : uint { DC_EXTRA = 9 }
enum : uint { DC_VERSION = 10 }
enum : uint { DC_DRIVER = 11 }
enum : uint { DC_BINNAMES = 12 }
enum : uint { DC_ENUMRESOLUTIONS = 13 }
enum : uint { DC_FILEDEPENDENCIES = 14 }
enum : uint { DC_TRUETYPE = 15 }
enum : uint { DC_PAPERNAMES = 16 }
enum : uint { DC_ORIENTATION = 17 }
enum : uint { DC_COPIES = 18 }

// #ifdef __cplusplus
// }
// #endif

// #endif /* _WINDEF_ */