annotate win32/windef.d @ 1:4a9dcbd9e54f

-files of 0.13 beta -fixes so that it now compiles with the current dmd version
author marton@basel.hu
date Tue, 05 Apr 2011 20:44:01 +0200
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
1 /***********************************************************************\
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
2 * windef.d *
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
3 * *
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
4 * Windows API header module *
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
5 * *
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
6 * Translated from MinGW Windows headers *
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
7 * by Stewart Gordon *
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
8 * *
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
9 * Placed into public domain *
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
10 \***********************************************************************/
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
11 module win32.windef;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
12
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
13 public import win32.winnt;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
14 private import win32.w32api;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
15
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
16 const size_t MAX_PATH = 260;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
17
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
18 ushort MAKEWORD(ubyte a, ubyte b) {
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
19 return cast(ushort) ((b << 8) | a);
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
20 }
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
21
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
22 uint MAKELONG(ushort a, ushort b) {
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
23 return cast(uint) ((b << 16) | a);
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
24 }
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
25
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
26 ushort LOWORD(uint l) {
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
27 return cast(ushort) l;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
28 }
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
29
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
30 ushort HIWORD(uint l) {
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
31 return cast(ushort) (l >>> 16);
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
32 }
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
33
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
34 ubyte LOBYTE(ushort w) {
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
35 return cast(ubyte) w;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
36 }
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
37
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
38 ubyte HIBYTE(ushort w) {
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
39 return cast(ubyte) (w >>> 8);
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
40 }
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
41
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
42 template max(T) {
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
43 T max(T a, T b) {
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
44 return a > b ? a : b;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
45 }
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
46 }
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
47
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
48 template min(T) {
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
49 T min(T a, T b) {
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
50 return a < b ? a : b;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
51 }
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
52 }
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
53
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
54 const void* NULL = null;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
55 alias ubyte BYTE;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
56 alias ubyte* PBYTE, LPBYTE;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
57 alias ushort USHORT, WORD, ATOM;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
58 alias ushort* PUSHORT, PWORD, LPWORD;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
59 alias uint ULONG, DWORD, UINT, COLORREF;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
60 alias uint* PULONG, PDWORD, LPDWORD, PUINT, LPUINT;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
61 alias int WINBOOL, BOOL, INT, LONG, HFILE, HRESULT;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
62 alias int* PWINBOOL, LPWINBOOL, PBOOL, LPBOOL, PINT, LPINT, LPLONG;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
63 alias float FLOAT;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
64 alias float* PFLOAT;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
65 alias void* PCVOID, LPCVOID;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
66
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
67 alias UINT_PTR WPARAM;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
68 alias LONG_PTR LPARAM, LRESULT;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
69
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
70 alias HANDLE HGLOBAL, HLOCAL, GLOBALHANDLE, LOCALHANDLE, HGDIOBJ, HACCEL,
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
71 HBITMAP, HBRUSH, HCOLORSPACE, HDC, HGLRC, HDESK, HENHMETAFILE, HFONT,
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
72 HICON, HINSTANCE, HKEY, HMENU, HMETAFILE, HMODULE, HMONITOR, HPALETTE, HPEN,
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
73 HRGN, HRSRC, HSTR, HTASK, HWND, HWINSTA, HKL, HCURSOR;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
74 alias HANDLE* PHKEY;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
75
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
76 static if (WINVER >= 0x500) {
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
77 alias HANDLE HTERMINAL, HWINEVENTHOOK;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
78 }
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
79
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
80 alias extern (Windows) int function() FARPROC, NEARPROC, PROC;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
81
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
82 struct RECT {
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
83 LONG left;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
84 LONG top;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
85 LONG right;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
86 LONG bottom;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
87 }
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
88 alias RECT RECTL;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
89 alias RECT* PRECT, LPRECT, LPCRECT, PRECTL, LPRECTL, LPCRECTL;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
90
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
91 struct POINT {
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
92 LONG x;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
93 LONG y;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
94 }
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
95 alias POINT POINTL;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
96 alias POINT* PPOINT, LPPOINT, PPOINTL, LPPOINTL;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
97
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
98 struct SIZE {
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
99 LONG cx;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
100 LONG cy;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
101 }
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
102 alias SIZE SIZEL;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
103 alias SIZE* PSIZE, LPSIZE, PSIZEL, LPSIZEL;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
104
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
105 struct POINTS {
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
106 SHORT x;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
107 SHORT y;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
108 }
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
109 alias POINTS* PPOINTS, LPPOINTS;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
110
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
111 enum : BOOL {
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
112 FALSE = 0,
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
113 TRUE = 1
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
114 }