1 /***********************************************************************\
2 *                                wingdi.d                               *
3 *                                                                       *
4 *                       Windows API header module                       *
5 *                                                                       *
6 *                 Translated from MinGW Windows headers                 *
7 *                                                                       *
8 *                       Placed into public domain                       *
9 \***********************************************************************/
10 module windows.wingdi;
11 pragma(lib, "gdi32");
12 nothrow:
13 // FIXME: clean up Windows version support
14 
15 private import windows.w32api, windows.windef, windows.winver;
16 
17 // BITMAPINFOHEADER.biCompression
18 enum : DWORD {
19 	BI_RGB = 0,
20 	BI_RLE8,
21 	BI_RLE4,
22 	BI_BITFIELDS,
23 	BI_JPEG,
24 	BI_PNG
25 }
26 
27 // ---
28 // COLORADJUSTMENT -- only for NT 3.1+, Win2000+
29 const WORD
30 	CA_NEGATIVE   = 1,
31 	CA_LOG_FILTER = 2;
32 
33 // COLORADJUSTMENT
34 enum : WORD  {
35 	ILLUMINANT_DEVICE_DEFAULT = 0,
36 	ILLUMINANT_A,
37 	ILLUMINANT_B,
38 	ILLUMINANT_C,
39 	ILLUMINANT_D50,
40 	ILLUMINANT_D55,
41 	ILLUMINANT_D65,
42 	ILLUMINANT_D75,
43 	ILLUMINANT_F2,
44 	ILLUMINANT_MAX_INDEX   = ILLUMINANT_F2,
45 	ILLUMINANT_TUNGSTEN    = ILLUMINANT_A,
46 	ILLUMINANT_DAYLIGHT    = ILLUMINANT_C,
47 	ILLUMINANT_FLUORESCENT = ILLUMINANT_F2,
48 	ILLUMINANT_NTSC        = ILLUMINANT_C
49 }
50 
51 enum {
52 	RGB_GAMMA_MIN       = 2500,
53 	RGB_GAMMA_MAX       = 65000,
54 	REFERENCE_WHITE_MIN = 6000,
55 	REFERENCE_WHITE_MAX = 10000,
56 	REFERENCE_BLACK_MIN = 0,
57 	REFERENCE_BLACK_MAX = 4000,
58 	COLOR_ADJ_MIN       = -100,
59 	COLOR_ADJ_MAX       = 100,
60 }
61 //---
62 
63 /* FIXME: move to windows.winuser ? */
64 // DrawIconEx()
65 enum : UINT {
66 	DI_MASK        = 1,
67 	DI_IMAGE       = 2,
68 	DI_NORMAL      = 3,
69 	DI_COMPAT      = 4,
70 	DI_DEFAULTSIZE = 8
71 }
72 
73 // DOCINFO
74 enum : DWORD {
75 	DI_APPBANDING = 1,
76 	DI_ROPS_READ_DESTINATION = 2,
77 }
78 
79 // ENHMETAHEADER
80 enum : DWORD {
81 	EMR_HEADER = 1,
82 	EMR_POLYBEZIER,
83 	EMR_POLYGON,
84 	EMR_POLYLINE,
85 	EMR_POLYBEZIERTO,
86 	EMR_POLYLINETO,
87 	EMR_POLYPOLYLINE,
88 	EMR_POLYPOLYGON,
89 	EMR_SETWINDOWEXTEX,
90 	EMR_SETWINDOWORGEX,
91 	EMR_SETVIEWPORTEXTEX,
92 	EMR_SETVIEWPORTORGEX,
93 	EMR_SETBRUSHORGEX,
94 	EMR_EOF,
95 	EMR_SETPIXELV,
96 	EMR_SETMAPPERFLAGS,
97 	EMR_SETMAPMODE,
98 	EMR_SETBKMODE,
99 	EMR_SETPOLYFILLMODE,
100 	EMR_SETROP2,
101 	EMR_SETSTRETCHBLTMODE,
102 	EMR_SETTEXTALIGN,
103 	EMR_SETCOLORADJUSTMENT,
104 	EMR_SETTEXTCOLOR,
105 	EMR_SETBKCOLOR,
106 	EMR_OFFSETCLIPRGN,
107 	EMR_MOVETOEX,
108 	EMR_SETMETARGN,
109 	EMR_EXCLUDECLIPRECT,
110 	EMR_INTERSECTCLIPRECT,
111 	EMR_SCALEVIEWPORTEXTEX,
112 	EMR_SCALEWINDOWEXTEX,
113 	EMR_SAVEDC,
114 	EMR_RESTOREDC,
115 	EMR_SETWORLDTRANSFORM,
116 	EMR_MODIFYWORLDTRANSFORM,
117 	EMR_SELECTOBJECT,
118 	EMR_CREATEPEN,
119 	EMR_CREATEBRUSHINDIRECT,
120 	EMR_DELETEOBJECT,
121 	EMR_ANGLEARC,
122 	EMR_ELLIPSE,
123 	EMR_RECTANGLE,
124 	EMR_ROUNDRECT,
125 	EMR_ARC,
126 	EMR_CHORD,
127 	EMR_PIE,
128 	EMR_SELECTPALETTE,
129 	EMR_CREATEPALETTE,
130 	EMR_SETPALETTEENTRIES,
131 	EMR_RESIZEPALETTE,
132 	EMR_REALIZEPALETTE,
133 	EMR_EXTFLOODFILL,
134 	EMR_LINETO,
135 	EMR_ARCTO,
136 	EMR_POLYDRAW,
137 	EMR_SETARCDIRECTION,
138 	EMR_SETMITERLIMIT,
139 	EMR_BEGINPATH,
140 	EMR_ENDPATH,
141 	EMR_CLOSEFIGURE,
142 	EMR_FILLPATH,
143 	EMR_STROKEANDFILLPATH,
144 	EMR_STROKEPATH,
145 	EMR_FLATTENPATH,
146 	EMR_WIDENPATH,
147 	EMR_SELECTCLIPPATH,
148 	EMR_ABORTPATH, // 68
149 	// reserved 69
150 	EMR_GDICOMMENT = 70,
151 	EMR_FILLRGN,
152 	EMR_FRAMERGN,
153 	EMR_INVERTRGN,
154 	EMR_PAINTRGN,
155 	EMR_EXTSELECTCLIPRGN,
156 	EMR_BITBLT,
157 	EMR_STRETCHBLT,
158 	EMR_MASKBLT,
159 	EMR_PLGBLT,
160 	EMR_SETDIBITSTODEVICE,
161 	EMR_STRETCHDIBITS,
162 	EMR_EXTCREATEFONTINDIRECTW,
163 	EMR_EXTTEXTOUTA,
164 	EMR_EXTTEXTOUTW,
165 	EMR_POLYBEZIER16,
166 	EMR_POLYGON16,
167 	EMR_POLYLINE16,
168 	EMR_POLYBEZIERTO16,
169 	EMR_POLYLINETO16,
170 	EMR_POLYPOLYLINE16,
171 	EMR_POLYPOLYGON16,
172 	EMR_POLYDRAW16,
173 	EMR_CREATEMONOBRUSH,
174 	EMR_CREATEDIBPATTERNBRUSHPT,
175 	EMR_EXTCREATEPEN,
176 	EMR_POLYTEXTOUTA,
177 	EMR_POLYTEXTOUTW, // 97
178 	EMR_SETICMMODE,
179 	EMR_CREATECOLORSPACE,
180 	EMR_SETCOLORSPACE,
181 	EMR_DELETECOLORSPACE,
182 	EMR_GLSRECORD,
183 	EMR_GLSBOUNDEDRECORD,
184 	EMR_PIXELFORMAT, // = 104
185 	// reserved 105 - 110
186 	EMR_COLORCORRECTPALETTE = 111,
187 	EMR_SETICMPROFILEA,
188 	EMR_SETICMPROFILEW,
189 	EMR_ALPHABLEND,
190 	EMR_SETLAYOUT,
191 	EMR_TRANSPARENTBLT, // 116
192 	// reserved 117
193 	EMR_GRADIENTFILL = 118,
194 	// reserved 119, 120
195 	EMR_COLORMATCHTOTARGETW = 121,
196 	EMR_CREATECOLORSPACEW // 122
197 }
198 
199 const EMR_MIN = EMR_HEADER;
200 
201 static if (_WIN32_WINNT >= 0x500) {
202 	const EMR_MAX = EMR_CREATECOLORSPACEW;
203 } else {
204 	const EMR_MAX = EMR_PIXELFORMAT;
205 }
206 
207 // ENHMETAHEADER.dSignature, ENHMETAHEADER3.dSignature,
208 // EMRFORMAT.dSignature
209 enum : DWORD {
210 	ENHMETA_SIGNATURE = 1179469088,
211 	EPS_SIGNATURE     = 0x46535045
212 }
213 
214 static if (_WIN32_WINNT >= 0x500) {
215 	// AddFontResourceEx()
216 	enum : DWORD {
217 		FR_PRIVATE  = 0x10,
218 		FR_NOT_ENUM = 0x20
219 	}
220 }
221 
222 enum {
223 	META_SAVEDC                = 0x1E,
224 	META_REALIZEPALETTE        = 0x35,
225 	META_SETPALENTRIES         = 0x37,
226 	META_CREATEPALETTE         = 0xf7,
227 	META_SETBKMODE             = 0x102,
228 	META_SETMAPMODE            = 0x103,
229 	META_SETROP2               = 0x104,
230 	META_SETRELABS             = 0x105,
231 	META_SETPOLYFILLMODE       = 0x106,
232 	META_SETSTRETCHBLTMODE     = 0x107,
233 	META_SETTEXTCHAREXTRA      = 0x108,
234 	META_RESTOREDC             = 0x127,
235 	META_INVERTREGION          = 0x12A,
236 	META_PAINTREGION           = 0x12B,
237 	META_SELECTCLIPREGION      = 0x12C,
238 	META_SELECTOBJECT          = 0x12D,
239 	META_SETTEXTALIGN          = 0x12E,
240 	META_RESIZEPALETTE         = 0x139,
241 	META_DIBCREATEPATTERNBRUSH = 0x142,
242 	META_SETLAYOUT             = 0x149,
243 	META_DELETEOBJECT          = 0x1F0,
244 	META_CREATEPATTERNBRUSH    = 0x1F9,
245 	META_SETBKCOLOR            = 0x201,
246 	META_SETTEXTCOLOR          = 0x209,
247 	META_SETTEXTJUSTIFICATION  = 0x20A,
248 	META_SETWINDOWORG          = 0x20B,
249 	META_SETWINDOWEXT          = 0x20C,
250 	META_SETVIEWPORTORG        = 0x20D,
251 	META_SETVIEWPORTEXT        = 0x20E,
252 	META_OFFSETWINDOWORG       = 0x20F,
253 	META_OFFSETVIEWPORTORG     = 0x211,
254 	META_LINETO                = 0x213,
255 	META_MOVETO                = 0x214,
256 	META_OFFSETCLIPRGN         = 0x220,
257 	META_FILLREGION            = 0x228,
258 	META_SETMAPPERFLAGS        = 0x231,
259 	META_SELECTPALETTE         = 0x234,
260 	META_CREATEPENINDIRECT     = 0x2FA,
261 	META_CREATEFONTINDIRECT    = 0x2FB,
262 	META_CREATEBRUSHINDIRECT   = 0x2FC,
263 	META_POLYGON               = 0x324,
264 	META_POLYLINE              = 0x325,
265 	META_SCALEWINDOWEXT        = 0x410,
266 	META_SCALEVIEWPORTEXT      = 0x412,
267 	META_EXCLUDECLIPRECT       = 0x415,
268 	META_INTERSECTCLIPRECT     = 0x416,
269 	META_ELLIPSE               = 0x418,
270 	META_FLOODFILL             = 0x419,
271 	META_RECTANGLE             = 0x41B,
272 	META_SETPIXEL              = 0x41F,
273 	META_FRAMEREGION           = 0x429,
274 	META_ANIMATEPALETTE        = 0x436,
275 	META_TEXTOUT               = 0x521,
276 	META_POLYPOLYGON           = 0x538,
277 	META_EXTFLOODFILL          = 0x548,
278 	META_ROUNDRECT             = 0x61C,
279 	META_PATBLT                = 0x61D,
280 	META_ESCAPE                = 0x626,
281 	META_CREATEREGION          = 0x6FF,
282 	META_ARC                   = 0x817,
283 	META_PIE                   = 0x81A,
284 	META_CHORD                 = 0x830,
285 	META_BITBLT                = 0x922,
286 	META_DIBBITBLT             = 0x940,
287 	META_EXTTEXTOUT            = 0xA32,
288 	META_STRETCHBLT            = 0xB23,
289 	META_DIBSTRETCHBLT         = 0xB41,
290 	META_SETDIBTODEV           = 0xD33,
291 	META_STRETCHDIB            = 0xF43
292 }
293 
294 // EMRPOLYDRAW
295 enum : BYTE {
296 	PT_CLOSEFIGURE = 1,
297 	PT_LINETO      = 2,
298 	PT_BEZIERTO    = 4,
299 	PT_MOVETO      = 6
300 }
301 
302 // ----
303 // PIXELFORMATDESCRIPTOR.iPixelType
304 enum : BYTE {
305 	PFD_TYPE_RGBA       = 0,
306 	PFD_TYPE_COLORINDEX = 1
307 }
308 
309 deprecated {
310 // PIXELFORMATDESCRIPTOR.
311 const byte
312 	PFD_MAIN_PLANE     = 0,
313 	PFD_OVERLAY_PLANE  = 1,
314 	PFD_UNDERLAY_PLANE = -1;
315 }
316 // PIXELFORMATDESCRIPTOR.dwFlags
317 const DWORD
318 	PFD_DOUBLEBUFFER          = 0x00000001,
319 	PFD_STEREO                = 0x00000002,
320 	PFD_DRAW_TO_WINDOW        = 0x00000004,
321 	PFD_DRAW_TO_BITMAP        = 0x00000008,
322 	PFD_SUPPORT_GDI           = 0x00000010,
323 	PFD_SUPPORT_OPENGL        = 0x00000020,
324 	PFD_GENERIC_FORMAT        = 0x00000040,
325 	PFD_NEED_PALETTE          = 0x00000080,
326 	PFD_NEED_SYSTEM_PALETTE   = 0x00000100,
327 	PFD_SWAP_EXCHANGE         = 0x00000200,
328 	PFD_SWAP_COPY             = 0x00000400,
329 	PFD_SWAP_LAYER_BUFFERS    = 0x00000800,
330 	PFD_GENERIC_ACCELERATED   = 0x00001000,
331 	PFD_SUPPORT_DIRECTDRAW    = 0x00002000,
332 	/* PIXELFORMATDESCRIPTOR flags for use in ChoosePixelFormat only */
333 	PFD_DEPTH_DONTCARE        = 0x20000000,
334 	PFD_DOUBLEBUFFER_DONTCARE = 0x40000000,
335 	PFD_STEREO_DONTCARE       = 0x80000000;
336 
337 // ----
338 
339 const DWORD
340 	BLACKNESS   = 0x000042,
341 	NOTSRCERASE = 0x1100A6,
342 	NOTSRCCOPY  = 0x330008,
343 	SRCERASE    = 0x440328,
344 	DSTINVERT   = 0x550009,
345 	PATINVERT   = 0x5A0049,
346 	SRCINVERT   = 0x660046,
347 	SRCAND      = 0x8800C6,
348 	MERGEPAINT  = 0xBB0226,
349 	MERGECOPY   = 0xC000CA,
350 	SRCCOPY     = 0xCC0020,
351 	SRCPAINT    = 0xEE0086,
352 	PATCOPY     = 0xF00021,
353 	PATPAINT    = 0xFB0A09,
354 	WHITENESS   = 0xFF0062;
355 static if (_WIN32_WINNT >= 0x500) {
356 	const DWORD
357 		NOMIRRORBITMAP = 0x80000000,
358 		CAPTUREBLT     = 0x40000000;
359 }
360 
361 // GetROP2(), SetROP2()
362 enum : int {
363 	R2_BLACK       = 1,
364 	R2_NOTMERGEPEN = 2,
365 	R2_MASKNOTPEN  = 3,
366 	R2_NOTCOPYPEN  = 4,
367 	R2_MASKPENNOT  = 5,
368 	R2_NOT         = 6,
369 	R2_XORPEN      = 7,
370 	R2_NOTMASKPEN  = 8,
371 	R2_MASKPEN     = 9,
372 	R2_NOTXORPEN   = 10,
373 	R2_NOP         = 11,
374 	R2_MERGENOTPEN = 12,
375 	R2_COPYPEN     = 13,
376 	R2_MERGEPENNOT = 14,
377 	R2_MERGEPEN    = 15,
378 	R2_WHITE       = 16
379 }
380 
381 const R2_LAST = R2_WHITE;
382 
383 // CheckColorsInGamut()
384 const ubyte
385 	CM_IN_GAMUT     = 0,
386 	CM_OUT_OF_GAMUT = 255;
387 
388 /* UpdateICMRegKey Constants               */
389 const int
390 	ICM_ADDPROFILE = 1,
391 	ICM_DELETEPROFILE = 2,
392 	ICM_QUERYPROFILE = 3,
393 	ICM_SETDEFAULTPROFILE = 4,
394 	ICM_REGISTERICMATCHER = 5,
395 	ICM_UNREGISTERICMATCHER = 6,
396 	ICM_QUERYMATCH = 7;
397 
398 enum : int {
399 	RGN_AND  = 1,
400 	RGN_OR   = 2,
401 	RGN_XOR  = 3,
402 	RGN_DIFF = 4,
403 	RGN_COPY = 5
404 }
405 
406 const RGN_MIN = RGN_AND;
407 const RGN_MAX = RGN_COPY;
408 
409 // Return values for CombineRgn()
410 enum {
411 	NULLREGION    = 1,
412 	SIMPLEREGION  = 2,
413 	COMPLEXREGION = 3
414 }
415 
416 const ERROR = 0;
417 alias ERROR RGN_ERROR;
418 
419 // CreateDIBitmap()
420 const DWORD CBM_INIT = 4;
421 
422 // CreateDIBitmap()
423 enum : UINT {
424 	DIB_RGB_COLORS = 0,
425 	DIB_PAL_COLORS = 1
426 }
427 
428 // ---
429 //  Values for LOGFONT and CreateFont()
430 
431 // FIXME: For D, replace with lfFaceName.length()
432 const LF_FACESIZE     = 32;
433 const LF_FULLFACESIZE = 64;
434 
435 // FIXME: Not needed for D, only EXTLOGFONT
436 const ELF_VENDOR_SIZE = 4;
437 
438 // ???
439 const ELF_VERSION = 0;
440 const ELF_CULTURE_LATIN = 0;
441 
442 // LOGFONT.lfWeight
443 const LONG
444 	FW_DONTCARE   = 0,
445 	FW_THIN       = 100,
446 	FW_EXTRALIGHT = 200,
447 	FW_ULTRALIGHT = FW_EXTRALIGHT,
448 	FW_LIGHT      = 300,
449 	FW_NORMAL     = 400,
450 	FW_REGULAR    = FW_NORMAL,
451 	FW_MEDIUM     = 500,
452 	FW_SEMIBOLD   = 600,
453 	FW_DEMIBOLD   = FW_SEMIBOLD,
454 	FW_BOLD       = 700,
455 	FW_EXTRABOLD  = 800,
456 	FW_ULTRABOLD  = FW_EXTRABOLD,
457 	FW_HEAVY      = 900,
458 	FW_BLACK      = FW_HEAVY;
459 
460 // LOGFONT.lfCharSet
461 enum : DWORD {
462 	ANSI_CHARSET        = 0,
463 	DEFAULT_CHARSET     = 1,
464 	SYMBOL_CHARSET      = 2,
465 	MAC_CHARSET         = 77,
466 	SHIFTJIS_CHARSET    = 128,
467 	HANGEUL_CHARSET     = 129,
468 	HANGUL_CHARSET      = 129,
469 	JOHAB_CHARSET       = 130,
470 	GB2312_CHARSET      = 134,
471 	CHINESEBIG5_CHARSET = 136,
472 	GREEK_CHARSET       = 161,
473 	TURKISH_CHARSET     = 162,
474 	VIETNAMESE_CHARSET  = 163,
475 	HEBREW_CHARSET      = 177,
476 	ARABIC_CHARSET      = 178,
477 	BALTIC_CHARSET      = 186,
478 	RUSSIAN_CHARSET     = 204,
479 	THAI_CHARSET        = 222,
480 	EASTEUROPE_CHARSET  = 238,
481 	OEM_CHARSET         = 255
482 }
483 
484 // LOGFONT.lfOutPrecision
485 enum : BYTE {
486 	OUT_DEFAULT_PRECIS = 0,
487 	OUT_STRING_PRECIS,
488 	OUT_CHARACTER_PRECIS,
489 	OUT_STROKE_PRECIS,
490 	OUT_TT_PRECIS,
491 	OUT_DEVICE_PRECIS,
492 	OUT_RASTER_PRECIS,
493 	OUT_TT_ONLY_PRECIS,
494 	OUT_OUTLINE_PRECIS,
495 	OUT_SCREEN_OUTLINE_PRECIS,
496 	OUT_PS_ONLY_PRECIS, // 10
497 }
498 
499 // LOGFONT.lfClipPrecision
500 enum : BYTE  {
501 	CLIP_DEFAULT_PRECIS   = 0,
502 	CLIP_CHARACTER_PRECIS = 1,
503 	CLIP_STROKE_PRECIS    = 2,
504 	CLIP_MASK             = 15,
505 	CLIP_LH_ANGLES        = 16,
506 	CLIP_TT_ALWAYS        = 32,
507 	CLIP_DFA_DISABLE      = 64,
508 	CLIP_EMBEDDED         = 128
509 }
510 
511 // LOGFONT.lfQuality
512 enum : BYTE {
513 	DEFAULT_QUALITY = 0,
514 	DRAFT_QUALITY,
515 	PROOF_QUALITY,
516 	NONANTIALIASED_QUALITY,
517 	ANTIALIASED_QUALITY
518 }
519 
520 // LOGFONT.lfPitchAndFamily
521 
522 const BYTE
523 	DEFAULT_PITCH  = 0,
524 	FIXED_PITCH    = 1,
525 	VARIABLE_PITCH = 2,
526 	MONO_FONT      = 8,
527 	FF_DONTCARE    = 0,
528 	FF_ROMAN       = 16,
529 	FF_SWISS       = 32,
530 	FF_SCRIPT      = 64,
531 	FF_MODERN      = 48,
532 	FF_DECORATIVE  = 80;
533 
534 // ----
535 // Enums for the PANOSE struct
536 
537 const PANOSE_COUNT=10;
538 
539 enum {
540 	PAN_FAMILYTYPE_INDEX = 0,
541 	PAN_SERIFSTYLE_INDEX,
542 	PAN_WEIGHT_INDEX,
543 	PAN_PROPORTION_INDEX,
544 	PAN_CONTRAST_INDEX,
545 	PAN_STROKEVARIATION_INDEX,
546 	PAN_ARMSTYLE_INDEX,
547 	PAN_LETTERFORM_INDEX,
548 	PAN_MIDLINE_INDEX,
549 	PAN_XHEIGHT_INDEX
550 }
551 
552 const PAN_CULTURE_LATIN=0;
553 
554 // NOTE: the first two values (PAN_ANY and PAN_NO_FIT) apply to all these enums!
555 enum : BYTE {
556 	PAN_ANY    = 0,
557 	PAN_NO_FIT = 1,
558 }
559 
560 enum : BYTE {
561 	PAN_FAMILY_TEXT_DISPLAY = 2,
562 	PAN_FAMILY_SCRIPT,
563 	PAN_FAMILY_DECORATIVE,
564 	PAN_FAMILY_PICTORIAL
565 }
566 enum : BYTE {
567 	PAN_SERIF_COVE = 2,
568 	PAN_SERIF_OBTUSE_COVE,
569 	PAN_SERIF_SQUARE_COVE,
570 	PAN_SERIF_OBTUSE_SQUARE_COVE,
571 	PAN_SERIF_SQUARE,
572 	PAN_SERIF_THIN,
573 	PAN_SERIF_BONE,
574 	PAN_SERIF_EXAGGERATED,
575 	PAN_SERIF_TRIANGLE,
576 	PAN_SERIF_NORMAL_SANS,
577 	PAN_SERIF_OBTUSE_SANS,
578 	PAN_SERIF_PERP_SANS,
579 	PAN_SERIF_FLARED,
580 	PAN_SERIF_ROUNDED
581 }
582 
583 enum : BYTE {
584 	PAN_WEIGHT_VERY_LIGHT = 2,
585 	PAN_WEIGHT_LIGHT,
586 	PAN_WEIGHT_THIN,
587 	PAN_WEIGHT_BOOK,
588 	PAN_WEIGHT_MEDIUM,
589 	PAN_WEIGHT_DEMI,
590 	PAN_WEIGHT_BOLD,
591 	PAN_WEIGHT_HEAVY,
592 	PAN_WEIGHT_BLACK,
593 	PAN_WEIGHT_NORD
594 }
595 
596 enum : BYTE {
597 	PAN_PROP_OLD_STYLE = 2,
598 	PAN_PROP_MODERN,
599 	PAN_PROP_EVEN_WIDTH,
600 	PAN_PROP_EXPANDED,
601 	PAN_PROP_CONDENSED,
602 	PAN_PROP_VERY_EXPANDED,
603 	PAN_PROP_VERY_CONDENSED,
604 	PAN_PROP_MONOSPACED
605 }
606 
607 enum : BYTE {
608 	PAN_CONTRAST_NONE = 2,
609 	PAN_CONTRAST_VERY_LOW,
610 	PAN_CONTRAST_LOW,
611 	PAN_CONTRAST_MEDIUM_LOW,
612 	PAN_CONTRAST_MEDIUM,
613 	PAN_CONTRAST_MEDIUM_HIGH,
614 	PAN_CONTRAST_HIGH,
615 	PAN_CONTRAST_VERY_HIGH
616 }
617 
618 // PANOSE.bStrokeVariation
619 enum : BYTE {
620 	PAN_STROKE_GRADUAL_DIAG = 2,
621 	PAN_STROKE_GRADUAL_TRAN,
622 	PAN_STROKE_GRADUAL_VERT,
623 	PAN_STROKE_GRADUAL_HORZ,
624 	PAN_STROKE_RAPID_VERT,
625 	PAN_STROKE_RAPID_HORZ,
626 	PAN_STROKE_INSTANT_VERT
627 }
628 
629 // PANOSE.bArmStyle
630 enum : BYTE {
631 	PAN_STRAIGHT_ARMS_HORZ = 2,
632 	PAN_STRAIGHT_ARMS_WEDGE,
633 	PAN_STRAIGHT_ARMS_VERT,
634 	PAN_STRAIGHT_ARMS_SINGLE_SERIF,
635 	PAN_STRAIGHT_ARMS_DOUBLE_SERIF,
636 	PAN_BENT_ARMS_HORZ,
637 	PAN_BENT_ARMS_WEDGE,
638 	PAN_BENT_ARMS_VERT,
639 	PAN_BENT_ARMS_SINGLE_SERIF,
640 	PAN_BENT_ARMS_DOUBLE_SERIF
641 }
642 
643 // PANOSE.bLetterForm
644 enum : BYTE {
645 	PAN_LETT_NORMAL_CONTACT = 2,
646 	PAN_LETT_NORMAL_WEIGHTED,
647 	PAN_LETT_NORMAL_BOXED,
648 	PAN_LETT_NORMAL_FLATTENED,
649 	PAN_LETT_NORMAL_ROUNDED,
650 	PAN_LETT_NORMAL_OFF_CENTER,
651 	PAN_LETT_NORMAL_SQUARE,
652 	PAN_LETT_OBLIQUE_CONTACT,
653 	PAN_LETT_OBLIQUE_WEIGHTED,
654 	PAN_LETT_OBLIQUE_BOXED,
655 	PAN_LETT_OBLIQUE_FLATTENED,
656 	PAN_LETT_OBLIQUE_ROUNDED,
657 	PAN_LETT_OBLIQUE_OFF_CENTER,
658 	PAN_LETT_OBLIQUE_SQUARE
659 }
660 
661 // PANOSE.bMidLine
662 enum : BYTE {
663 	PAN_MIDLINE_STANDARD_TRIMMED = 2,
664 	PAN_MIDLINE_STANDARD_POINTED,
665 	PAN_MIDLINE_STANDARD_SERIFED,
666 	PAN_MIDLINE_HIGH_TRIMMED,
667 	PAN_MIDLINE_HIGH_POINTED,
668 	PAN_MIDLINE_HIGH_SERIFED,
669 	PAN_MIDLINE_CONSTANT_TRIMMED,
670 	PAN_MIDLINE_CONSTANT_POINTED,
671 	PAN_MIDLINE_CONSTANT_SERIFED,
672 	PAN_MIDLINE_LOW_TRIMMED,
673 	PAN_MIDLINE_LOW_POINTED,
674 	PAN_MIDLINE_LOW_SERIFED
675 }
676 
677 // PANOSE.bXHeight
678 enum : BYTE {
679 	PAN_XHEIGHT_CONSTANT_SMALL = 2,
680 	PAN_XHEIGHT_CONSTANT_STD,
681 	PAN_XHEIGHT_CONSTANT_LARGE,
682 	PAN_XHEIGHT_DUCKING_SMALL,
683 	PAN_XHEIGHT_DUCKING_STD,
684 	PAN_XHEIGHT_DUCKING_LARGE
685 }
686 
687 // ----
688 // ???
689 const FS_LATIN1      = 0x00000001;
690 const FS_LATIN2      = 0x00000002;
691 const FS_CYRILLIC    = 0x00000004;
692 const FS_GREEK       = 0x00000008;
693 const FS_TURKISH     = 0x00000010;
694 const FS_HEBREW      = 0x00000020;
695 const FS_ARABIC      = 0x00000040;
696 const FS_BALTIC      = 0x00000080;
697 const FS_VIETNAMESE  = 0x00000100;
698 const FS_THAI        = 0x00010000;
699 const FS_JISJAPAN    = 0x00020000;
700 const FS_CHINESESIMP = 0x00040000;
701 const FS_WANSUNG     = 0x00080000;
702 const FS_CHINESETRAD = 0x00100000;
703 const FS_JOHAB       = 0x00200000;
704 const FS_SYMBOL      = 0x80000000;
705 
706 // ----
707 // Poly Fill Mode
708 enum : int {
709 	ALTERNATE = 1,
710 	WINDING = 2
711 }
712 const int POLYFILL_LAST = WINDING;
713 
714 //---
715 // LOGBRUSH
716 enum : LONG {
717 	HS_HORIZONTAL = 0,
718 	HS_VERTICAL,
719 	HS_FDIAGONAL,
720 	HS_BDIAGONAL,
721 	HS_CROSS,
722 	HS_DIAGCROSS
723 }
724 
725 //LOGBRUSH.lbStyle
726 enum : UINT {
727 	BS_SOLID = 0,
728 	BS_NULL  = 1,
729 	BS_HOLLOW = BS_NULL,
730 	BS_HATCHED,
731 	BS_PATTERN,
732 	BS_INDEXED,
733 	BS_DIBPATTERN,
734 	BS_DIBPATTERNPT,
735 	BS_PATTERN8X8,
736 	BS_DIBPATTERN8X8,
737 	BS_MONOPATTERN,
738 }
739 //-----
740 // EXTLOGPEN, ExtCreatePen()
741 
742 // EXTLOGPEN.elpPenStyle
743 enum : DWORD {
744 	PS_SOLID       = 0,
745 	PS_DASH        = 1,
746 	PS_DOT         = 2,
747 	PS_DASHDOT     = 3,
748 	PS_DASHDOTDOT  = 4,
749 	PS_NULL        = 5,
750 	PS_INSIDEFRAME = 6,
751 	PS_USERSTYLE   = 7,
752 	PS_ALTERNATE   = 8,
753 	PS_STYLE_MASK  = 15,
754 }
755 
756 enum : DWORD {
757 	PS_COSMETIC      = 0x00000000,
758 	PS_GEOMETRIC     = 0x00010000,
759 	PS_TYPE_MASK     = 0x000F0000,
760 }
761 enum : DWORD {
762 	PS_ENDCAP_ROUND  = 0x00000000,
763 	PS_ENDCAP_SQUARE = 0x00000100,
764 	PS_ENDCAP_FLAT   = 0x00000200,
765 	PS_ENDCAP_MASK   = 0x00000F00,
766 }
767 enum : DWORD {
768 	PS_JOIN_ROUND    = 0x00000000,
769 	PS_JOIN_BEVEL    = 0x00001000,
770 	PS_JOIN_MITER    = 0x00002000,
771 	PS_JOIN_MASK     = 0x0000F000,
772 }
773 
774 // ---
775 // DeviceCapabilities()
776 
777 enum : WORD {
778 	DC_FIELDS = 1,
779 	DC_PAPERS,
780 	DC_PAPERSIZE,
781 	DC_MINEXTENT,
782 	DC_MAXEXTENT,
783 	DC_BINS,
784 	DC_DUPLEX,
785 	DC_SIZE,
786 	DC_EXTRA,
787 	DC_VERSION,
788 	DC_DRIVER,
789 	DC_BINNAMES,
790 	DC_ENUMRESOLUTIONS,
791 	DC_FILEDEPENDENCIES,
792 	DC_TRUETYPE,
793 	DC_PAPERNAMES,
794 	DC_ORIENTATION,
795 	DC_COPIES,
796 	DC_BINADJUST,
797 	DC_EMF_COMPLIANT,
798 	DC_DATATYPE_PRODUCED,
799 	DC_COLLATE,
800 	DC_MANUFACTURER,
801 	DC_MODEL,
802 }
803 
804 static if (_WIN32_WINNT >= 0x500) {
805 	enum {
806 		DC_PERSONALITY = 25,
807 		DC_PRINTRATE = 26,
808 		DC_PRINTRATEUNIT = 27,
809 		DC_PRINTERMEM = 28,
810 		DC_MEDIAREADY = 29,
811 		DC_STAPLE = 30,
812 		DC_PRINTRATEPPM = 31,
813 		DC_COLORDEVICE = 32,
814 		DC_NUP = 33,
815 		DC_MEDIATYPENAMES = 34,
816 		DC_MEDIATYPES = 35,
817 	}
818 	enum {
819 		PRINTRATEUNIT_PPM = 1,
820 		PRINTRATEUNIT_CPS = 2,
821 		PRINTRATEUNIT_LPM = 3,
822 		PRINTRATEUNIT_IPM = 4,
823 	}
824 }
825 
826 
827 // return from DC_TRUETYPE
828 const DWORD
829 	DCTT_BITMAP           = 1,
830 	DCTT_DOWNLOAD         = 2,
831 	DCTT_SUBDEV           = 4,
832 	DCTT_DOWNLOAD_OUTLINE = 8;
833 
834 // return from DC_BINADJUST
835 enum : DWORD {
836 	DCBA_FACEUPNONE     = 0x0000,
837 	DCBA_FACEUPCENTER   = 0x0001,
838 	DCBA_FACEUPLEFT     = 0x0002,
839 	DCBA_FACEUPRIGHT    = 0x0003,
840 	DCBA_FACEDOWNNONE   = 0x0100,
841 	DCBA_FACEDOWNCENTER = 0x0101,
842 	DCBA_FACEDOWNLEFT   = 0x0102,
843 	DCBA_FACEDOWNRIGHT  = 0x0103,
844 }
845 //---
846 
847 const FLOODFILLBORDER  = 0;
848 const FLOODFILLSURFACE = 1;
849 
850 // ExtTextOut()
851 const UINT
852 	ETO_OPAQUE         = 0x0002,
853 	ETO_CLIPPED        = 0x0004,
854 	ETO_GLYPH_INDEX    = 0x0010,
855 	ETO_RTLREADING     = 0x0080,
856 	ETO_NUMERICSLOCAL  = 0x0400,
857 	ETO_NUMERICSLATIN  = 0x0800,
858 	ETO_IGNORELANGUAGE = 0x1000;
859 static if (_WIN32_WINNT >= 0x500) {
860 	const UINT
861 		ETO_PDY = 0x2000;
862 }
863 
864 // GdiComment()
865 enum {
866 	GDICOMMENT_BEGINGROUP       = 0x00000002,
867 	GDICOMMENT_ENDGROUP         = 0x00000003,
868 	GDICOMMENT_UNICODE_STRING   = 0x00000040,
869 	GDICOMMENT_UNICODE_END      = 0x00000080,
870 	GDICOMMENT_MULTIFORMATS     = 0x40000004,
871 	GDICOMMENT_IDENTIFIER       = 0x43494447,
872 	GDICOMMENT_WINDOWS_METAFILE = 0x80000001,
873 }
874 
875 // Get/SetArcDirection()
876 enum : int {
877 	AD_COUNTERCLOCKWISE = 1,
878 	AD_CLOCKWISE        = 2
879 }
880 
881 const RDH_RECTANGLES = 1;
882 
883 // GCPRESULTS.lpClass
884 enum {
885 	GCPCLASS_LATIN  = 1,
886 	GCPCLASS_HEBREW = 2,
887 	GCPCLASS_ARABIC = 2,
888 	GCPCLASS_NEUTRAL,
889 	GCPCLASS_LOCALNUMBER,
890 	GCPCLASS_LATINNUMBER,
891 	GCPCLASS_LATINNUMERICTERMINATOR,
892 	GCPCLASS_LATINNUMERICSEPARATOR,
893 	GCPCLASS_NUMERICSEPARATOR, // = 8,
894 	GCPCLASS_POSTBOUNDRTL = 16,
895 	GCPCLASS_POSTBOUNDLTR = 32,
896 	GCPCLASS_PREBOUNDRTL  = 64,
897 	GCPCLASS_PREBOUNDLTR  = 128,
898 	GCPGLYPH_LINKAFTER    = 0x4000,
899 	GCPGLYPH_LINKBEFORE   = 0x8000
900 }
901 
902 // GetBoundsRect(), SetBoundsRect()
903 const UINT
904 	DCB_RESET      = 1,
905 	DCB_ACCUMULATE = 2,
906 	DCB_SET        = DCB_RESET | DCB_ACCUMULATE,
907 	DCB_ENABLE     = 4,
908 	DCB_DISABLE    = 8,
909 	DCB_DIRTY      = DCB_ACCUMULATE;
910 
911 //---
912 // GetObjectType()
913 enum : DWORD {
914 	OBJ_PEN = 1,
915 	OBJ_BRUSH,
916 	OBJ_DC,
917 	OBJ_METADC,
918 	OBJ_PAL,
919 	OBJ_FONT,
920 	OBJ_BITMAP,
921 	OBJ_REGION,
922 	OBJ_METAFILE,
923 	OBJ_MEMDC,
924 	OBJ_EXTPEN,
925 	OBJ_ENHMETADC,
926 	OBJ_ENHMETAFILE,
927 	OBJ_COLORSPACE,
928 }
929 
930 //---------------------
931 // Capabilities for GetDeviceCaps(dc, xxx)
932 
933 enum : int {
934 	DRIVERVERSION   = 0,
935 	TECHNOLOGY      = 2,
936 	HORZSIZE        = 4,
937 	VERTSIZE        = 6,
938 	HORZRES         = 8,
939 	VERTRES         = 10,
940 	BITSPIXEL       = 12,
941 	PLANES          = 14,
942 	NUMBRUSHES      = 16,
943 	NUMPENS         = 18,
944 	NUMMARKERS      = 20,
945 	NUMFONTS        = 22,
946 	NUMCOLORS       = 24,
947 	PDEVICESIZE     = 26,
948 	CURVECAPS       = 28,
949 	LINECAPS        = 30,
950 	POLYGONALCAPS   = 32,
951 	TEXTCAPS        = 34,
952 	CLIPCAPS        = 36,
953 	RASTERCAPS      = 38,
954 	ASPECTX         = 40,
955 	ASPECTY         = 42,
956 	ASPECTXY        = 44,
957 	LOGPIXELSX      = 88,
958 	LOGPIXELSY      = 90,
959 	SIZEPALETTE     = 104,
960 	NUMRESERVED     = 106,
961 	COLORRES        = 108,
962 	PHYSICALWIDTH   = 110,
963 	PHYSICALHEIGHT  = 111,
964 	PHYSICALOFFSETX = 112,
965 	PHYSICALOFFSETY = 113,
966 	SCALINGFACTORX  = 114,
967 	SCALINGFACTORY  = 115,
968 	VREFRESH        = 116,
969 	DESKTOPVERTRES  = 117,
970 	DESKTOPHORZRES  = 118,
971 	BLTALIGNMENT    = 119
972 }
973 static if (_WIN32_WINNT >= 0x500) {
974 enum : int {
975 	SHADEBLENDCAPS  = 120,
976 	COLORMGMTCAPS   = 121,
977 }
978 }
979 
980 // Return values for GetDeviceCaps(dc, TECHNOLOGY)
981 enum : int {
982 	DT_PLOTTER = 0,
983 	DT_RASDISPLAY,
984 	DT_RASPRINTER,
985 	DT_RASCAMERA,
986 	DT_CHARSTREAM,
987 	DT_METAFILE,
988 	DT_DISPFILE // = 6
989 }
990 
991 // Return values for GetDeviceCaps(dc, RASTERCAPS)
992 const int
993 	RC_NONE         = 0,
994 	RC_BITBLT       = 1,
995 	RC_BANDING      = 2,
996 	RC_SCALING      = 4,
997 	RC_BITMAP64     = 8,
998 	RC_GDI20_OUTPUT = 16,
999 	RC_GDI20_STATE  = 32,
1000 	RC_SAVEBITMAP   = 64,
1001 	RC_DI_BITMAP    = 128,
1002 	RC_PALETTE      = 256,
1003 	RC_DIBTODEV     = 512,
1004 	RC_BIGFONT      = 1024,
1005 	RC_STRETCHBLT   = 2048,
1006 	RC_FLOODFILL    = 4096,
1007 	RC_STRETCHDIB   = 8192,
1008 	RC_OP_DX_OUTPUT = 0x4000,
1009 	RC_DEVBITS      = 0x8000;
1010 
1011 static if (_WIN32_WINNT >= 0x500) {
1012 	/* Shading and blending caps */
1013 	const SB_NONE = 0x00000000;
1014 	const SB_CONST_ALPHA = 0x00000001;
1015 	const SB_PIXEL_ALPHA = 0x00000002;
1016 	const SB_PREMULT_ALPHA = 0x00000004;
1017 	const SB_GRAD_RECT = 0x00000010;
1018 	const SB_GRAD_TRI = 0x00000020;
1019 	/* Color Management caps */
1020 	const CM_NONE = 0x00000000;
1021 	const CM_DEVICE_ICM = 0x00000001;
1022 	const CM_GAMMA_RAMP = 0x00000002;
1023 	const CM_CMYK_COLOR = 0x00000004;
1024 }
1025 
1026 // Return values for GetDeviceCaps(dc, CURVECAPS)
1027 const int
1028 	CC_NONE       = 0,
1029 	CC_CIRCLES    = 1,
1030 	CC_PIE        = 2,
1031 	CC_CHORD      = 4,
1032 	CC_ELLIPSES   = 8,
1033 	CC_WIDE       = 16,
1034 	CC_STYLED     = 32,
1035 	CC_WIDESTYLED = 64,
1036 	CC_INTERIORS  = 128,
1037 	CC_ROUNDRECT  = 256;
1038 
1039 // Return values for GetDeviceCaps(dc, LINECAPS)
1040 
1041 const int
1042 	LC_NONE       = 0,
1043 	LC_POLYLINE   = 2,
1044 	LC_MARKER     = 4,
1045 	LC_POLYMARKER = 8,
1046 	LC_WIDE       = 16,
1047 	LC_STYLED     = 32,
1048 	LC_WIDESTYLED = 64,
1049 	LC_INTERIORS  = 128;
1050 
1051 // Return values for GetDeviceCaps(dc, POLYGONALCAPS)
1052 
1053 const int
1054 	PC_NONE        = 0,
1055 	PC_POLYGON     = 1,
1056 	PC_RECTANGLE   = 2,
1057 	PC_WINDPOLYGON = 4,
1058 	PC_TRAPEZOID   = 4,
1059 	PC_SCANLINE    = 8,
1060 	PC_WIDE        = 16,
1061 	PC_STYLED      = 32,
1062 	PC_WIDESTYLED  = 64,
1063 	PC_INTERIORS   = 128,
1064 	PC_POLYPOLYGON = 256,
1065 	PC_PATHS       = 512;
1066 
1067 /* Clipping Capabilities */
1068 const int CP_NONE = 0,
1069 	CP_RECTANGLE = 1,
1070 	CP_REGION = 2;
1071 
1072 // Return values for GetDeviceCaps(dc, TEXTCAPS)
1073 
1074 const int
1075 	TC_OP_CHARACTER = 1,
1076 	TC_OP_STROKE    = 2,
1077 	TC_CP_STROKE    = 4,
1078 	TC_CR_90        = 8,
1079 	TC_CR_ANY       = 16,
1080 	TC_SF_X_YINDEP  = 32,
1081 	TC_SA_DOUBLE    = 64,
1082 	TC_SA_INTEGER   = 128,
1083 	TC_SA_CONTIN    = 256,
1084 	TC_EA_DOUBLE    = 512,
1085 	TC_IA_ABLE      = 1024,
1086 	TC_UA_ABLE      = 2048,
1087 	TC_SO_ABLE      = 4096,
1088 	TC_RA_ABLE      = 8192,
1089 	TC_VA_ABLE      = 16384,
1090 	TC_RESERVED     = 32768,
1091 	TC_SCROLLBLT    = 65536;
1092 
1093 // End GetDeviceCaps
1094 //---------------------
1095 // GetCharacterPlacement(), and GetFontLanguageInfo()
1096 const DWORD
1097 	GCP_DBCS            = 1,
1098 	GCP_REORDER         = 2,
1099 	GCP_USEKERNING      = 8,
1100 	GCP_GLYPHSHAPE      = 16,
1101 	GCP_LIGATE          = 32,
1102 	GCP_DIACRITIC       = 256,
1103 	GCP_KASHIDA         = 1024,
1104 	GCP_ERROR           = 0x8000,
1105 	GCP_JUSTIFY         = 0x10000,
1106 	GCP_CLASSIN         = 0x80000,
1107 	GCP_MAXEXTENT       = 0x100000,
1108 	GCP_JUSTIFYIN       = 0x200000,
1109 	GCP_DISPLAYZWG      = 0x400000,
1110 	GCP_SYMSWAPOFF      = 0x800000,
1111 	GCP_NUMERICOVERRIDE = 0x1000000,
1112 	GCP_NEUTRALOVERRIDE = 0x2000000,
1113 	GCP_NUMERICSLATIN   = 0x4000000,
1114 	GCP_NUMERICSLOCAL   = 0x8000000,
1115 	// Only for GetFontLanguageInfo()
1116 	FLI_GLYPHS          = 0x40000,
1117 	FLI_MASK            = 0x103b;
1118 
1119 // GetGlyphOutline()
1120 enum : UINT {
1121 	GGO_METRICS      = 0,
1122 	GGO_BITMAP       = 1,
1123 	GGO_NATIVE       = 2,
1124 	GGO_BEZIER       = 3,
1125 	GGO_GRAY2_BITMAP = 4,
1126 	GGO_GRAY4_BITMAP = 5,
1127 	GGO_GRAY8_BITMAP = 6,
1128 	GGO_GLYPH_INDEX  = 128,
1129 	GGO_UNHINTED     = 256
1130 }
1131 
1132 enum : int {
1133 	GM_COMPATIBLE = 1,
1134 	GM_ADVANCED
1135 }
1136 const GM_LAST = GM_ADVANCED;
1137 
1138 enum : int {
1139 	MM_TEXT = 1,
1140 	MM_LOMETRIC,
1141 	MM_HIMETRIC,
1142 	MM_LOENGLISH,
1143 	MM_HIENGLISH,
1144 	MM_TWIPS,
1145 	MM_ISOTROPIC,
1146 	MM_ANISOTROPIC,
1147 }
1148 
1149 const int
1150 	MM_MIN = MM_TEXT,
1151 	MM_MAX = MM_ANISOTROPIC,
1152 	MM_MAX_FIXEDSCALE = MM_TWIPS;
1153 
1154 const ABSOLUTE = 1;
1155 const RELATIVE = 2;
1156 
1157 enum : BYTE {
1158 	PC_RESERVED   = 1,
1159 	PC_EXPLICIT   = 2,
1160 	PC_NOCOLLAPSE = 4
1161 }
1162 
1163 /* FIXME: move to windows.commctrl ? */
1164 // ImageList
1165 const COLORREF
1166 	CLR_NONE    = 0xffffffff,
1167 	CLR_INVALID = CLR_NONE,
1168 	CLR_DEFAULT = 0xff000000;
1169 
1170 // RASTERIZER_STATUS.wFlags
1171 const short
1172 	TT_AVAILABLE = 1,
1173 	TT_ENABLED   = 2;
1174 
1175 // GetStockObject()
1176 enum : int {
1177 	WHITE_BRUSH = 0,
1178 	LTGRAY_BRUSH,
1179 	GRAY_BRUSH,
1180 	DKGRAY_BRUSH,
1181 	BLACK_BRUSH,
1182 	HOLLOW_BRUSH, // = 5
1183 	NULL_BRUSH = HOLLOW_BRUSH,
1184 	WHITE_PEN = 6,
1185 	BLACK_PEN,
1186 	NULL_PEN, // = 8
1187 	OEM_FIXED_FONT = 10,
1188 	ANSI_FIXED_FONT,
1189 	ANSI_VAR_FONT,
1190 	SYSTEM_FONT,
1191 	DEVICE_DEFAULT_FONT,
1192 	DEFAULT_PALETTE,
1193 	SYSTEM_FIXED_FONT,
1194 	DEFAULT_GUI_FONT = SYSTEM_FIXED_FONT + 1,
1195 }
1196 static if (_WIN32_WINNT >= 0x500) {
1197 	enum : int {
1198 		DC_BRUSH = DEFAULT_GUI_FONT + 1,
1199 		DC_PEN,
1200 	}
1201 }
1202 
1203 static if (_WIN32_WINNT >= 0x500) {
1204 	const STOCK_LAST = DC_PEN;
1205 } else {
1206 	const STOCK_LAST = DEFAULT_GUI_FONT;
1207 }
1208 
1209 // Get/SetSystemPaletteUse()
1210 enum : UINT {
1211 	SYSPAL_ERROR    = 0,
1212 	SYSPAL_STATIC   = 1,
1213 	SYSPAL_NOSTATIC = 2,
1214 	SYSPAL_NOSTATIC256 = 3,
1215 }
1216 
1217 // SetTextAlign()
1218 const UINT
1219 	TA_TOP        = 0,
1220 	TA_CENTER     = 6,
1221 	TA_BOTTOM     = 8,
1222 	TA_BASELINE   = 24,
1223 	TA_LEFT       = 0,
1224 	TA_RIGHT      = 2,
1225 	TA_RTLREADING = 256,
1226 	TA_NOUPDATECP = 0,
1227 	TA_UPDATECP   = 1,
1228 	TA_MASK       = TA_BASELINE+TA_CENTER+TA_UPDATECP+TA_RTLREADING,
1229 	VTA_BASELINE  = TA_BASELINE,
1230 	VTA_CENTER    = TA_CENTER,
1231 	VTA_LEFT      = TA_BOTTOM,
1232 	VTA_RIGHT     = TA_TOP,
1233 	VTA_BOTTOM    = TA_RIGHT,
1234 	VTA_TOP       = TA_LEFT;
1235 
1236 // EMRMODIFYWORLDTRANSFORM.iMode
1237 enum : DWORD {
1238 	MWT_IDENTITY = 1,
1239 	MWT_LEFTMULTIPLY,
1240 	MWT_RIGHTMULTIPLY
1241 }
1242 
1243 const DWORD
1244 	MWT_MIN = MWT_IDENTITY,
1245 	MWT_MAX = MWT_RIGHTMULTIPLY;
1246 
1247 enum {
1248 	TRANSPARENT = 1,
1249 	OPAQUE      = 2
1250 }
1251 
1252 // Get/SetStretchMode()
1253 enum : int {
1254 	BLACKONWHITE = 1,
1255 	WHITEONBLACK = 2,
1256 	COLORONCOLOR = 3,
1257 	HALFTONE     = 4,
1258 
1259 	STRETCH_ANDSCANS    = 1,
1260 	STRETCH_ORSCANS     = 2,
1261 	STRETCH_DELETESCANS = 3,
1262 	STRETCH_HALFTONE    = 4,
1263 
1264 	MAXSTRETCHBLTMODE   = 4
1265 }
1266 
1267 // TranslateCharsetInfo()
1268 enum : DWORD {
1269 	TCI_SRCCHARSET  = 1,
1270 	TCI_SRCCODEPAGE = 2,
1271 	TCI_SRCFONTSIG  = 3,
1272 	TCI_SRCLOCALE   = 0x1000,
1273 }
1274 
1275 // SetICMMode()
1276 enum : int {
1277 	ICM_OFF   = 1,
1278 	ICM_ON    = 2,
1279 	ICM_QUERY = 3,
1280 	ICM_DONE_OUTSIDEDC = 4,
1281 }
1282 
1283 // ----
1284 // Escape() Spooler Error Codes
1285 enum : int {
1286 	SP_NOTREPORTED = 0x4000,
1287 	SP_ERROR       = -1,
1288 	SP_APPABORT    = -2,
1289 	SP_USERABORT   = -3,
1290 	SP_OUTOFDISK   = -4,
1291 	SP_OUTOFMEMORY = -5
1292 }
1293 
1294 // Escape(), ExtEscape()
1295 // Most of the following are deprecated (Win16 only)
1296 enum : int {
1297 	NEWFRAME      = 1,
1298 	ABORTDOC      = 2,
1299 	NEXTBAND      = 3,
1300 	SETCOLORTABLE = 4,
1301 	GETCOLORTABLE = 5,
1302 	FLUSHOUTPUT   = 6,
1303 	DRAFTMODE     = 7,
1304 	QUERYESCSUPPORT = 8,
1305 	SETABORTPROC  = 9,
1306 	STARTDOC      = 10,
1307 	ENDDOC        = 11,
1308 	GETPHYSPAGESIZE   = 12,
1309 	GETPRINTINGOFFSET = 13,
1310 	GETSCALINGFACTOR  = 14,
1311 	MFCOMMENT         = 15,
1312 	GETPENWIDTH       = 16,
1313 	SETCOPYCOUNT      = 17,
1314 	SELECTPAPERSOURCE = 18,
1315 	DEVICEDATA        = 19,
1316 	PASSTHROUGH       = 19,
1317 	GETTECHNOLOGY     = 20,
1318 	SETLINECAP = 21,
1319 	SETLINEJOIN = 22,
1320 	SETMITERLIMIT = 23,
1321 	BANDINFO = 24,
1322 	DRAWPATTERNRECT = 25,
1323 	GETVECTORPENSIZE = 26,
1324 	GETVECTORBRUSHSIZE = 27,
1325 	ENABLEDUPLEX = 28,
1326 	GETSETPAPERBINS = 29,
1327 	GETSETPRINTORIENT = 30,
1328 	ENUMPAPERBINS = 31,
1329 	SETDIBSCALING = 32,
1330 	EPSPRINTING = 33,
1331 	ENUMPAPERMETRICS = 34,
1332 	GETSETPAPERMETRICS = 35,
1333 	POSTSCRIPT_DATA = 37,
1334 	POSTSCRIPT_IGNORE = 38,
1335 	MOUSETRAILS = 39,
1336 	GETDEVICEUNITS = 42,
1337 	GETEXTENDEDTEXTMETRICS = 256,
1338 	GETEXTENTTABLE = 257,
1339 	GETPAIRKERNTABLE = 258,
1340 	GETTRACKKERNTABLE = 259,
1341 	EXTTEXTOUT = 512,
1342 	GETFACENAME = 513,
1343 	DOWNLOADFACE = 514,
1344 	ENABLERELATIVEWIDTHS = 768,
1345 	ENABLEPAIRKERNING = 769,
1346 	SETKERNTRACK = 770,
1347 	SETALLJUSTVALUES = 771,
1348 	SETCHARSET = 772,
1349 	STRETCHBLT = 2048,
1350 	METAFILE_DRIVER = 2049,
1351 	GETSETSCREENPARAMS = 3072,
1352 	QUERYDIBSUPPORT = 3073,
1353 	BEGIN_PATH = 4096,
1354 	CLIP_TO_PATH = 4097,
1355 	END_PATH = 4098,
1356 	EXT_DEVICE_CAPS = 4099,
1357 	RESTORE_CTM = 4100,
1358 	SAVE_CTM = 4101,
1359 	SET_ARC_DIRECTION = 4102,
1360 	SET_BACKGROUND_COLOR = 4103,
1361 	SET_POLY_MODE = 4104,
1362 	SET_SCREEN_ANGLE = 4105,
1363 	SET_SPREAD = 4106,
1364 	TRANSFORM_CTM = 4107,
1365 	SET_CLIP_BOX = 4108,
1366 	SET_BOUNDS = 4109,
1367 	SET_MIRROR_MODE = 4110,
1368 	OPENCHANNEL = 4110,
1369 	DOWNLOADHEADER = 4111,
1370 	CLOSECHANNEL = 4112,
1371 	POSTSCRIPT_PASSTHROUGH  = 4115,
1372 	ENCAPSULATED_POSTSCRIPT = 4116,
1373 	POSTSCRIPT_IDENTIFY = 4117,
1374 	POSTSCRIPT_INJECTION = 4118,
1375 	CHECKJPEGFORMAT = 4119,
1376 	CHECKPNGFORMAT = 4120,
1377 	GET_PS_FEATURESETTING = 4121,
1378 	SPCLPASSTHROUGH2 = 4568,
1379 }
1380 
1381 enum : int {
1382 	PSIDENT_GDICENTRIC = 0,
1383 	PSIDENT_PSCENTRIC = 1,
1384 }
1385 
1386 /*
1387  * Header structure for the input buffer to POSTSCRIPT_INJECTION escape
1388  */
1389 struct PSINJECTDATA {
1390 	DWORD DataBytes;
1391 	WORD  InjectionPoint;
1392 	WORD  PageNumber;
1393 }
1394 alias PSINJECTDATA* PPSINJECTDATA;
1395 
1396 /* Constants for PSINJECTDATA.InjectionPoint field */
1397 enum {
1398 	PSINJECT_BEGINSTREAM = 1,
1399 	PSINJECT_PSADOBE = 2,
1400 	PSINJECT_PAGESATEND = 3,
1401 	PSINJECT_PAGES = 4,
1402 	PSINJECT_DOCNEEDEDRES = 5,
1403 	PSINJECT_DOCSUPPLIEDRES = 6,
1404 	PSINJECT_PAGEORDER = 7,
1405 	PSINJECT_ORIENTATION = 8,
1406 	PSINJECT_BOUNDINGBOX = 9,
1407 	PSINJECT_DOCUMENTPROCESSCOLORS = 10,
1408 	PSINJECT_COMMENTS = 11,
1409 	PSINJECT_BEGINDEFAULTS = 12,
1410 	PSINJECT_ENDDEFAULTS = 13,
1411 	PSINJECT_BEGINPROLOG = 14,
1412 	PSINJECT_ENDPROLOG = 15,
1413 	PSINJECT_BEGINSETUP = 16,
1414 	PSINJECT_ENDSETUP = 17,
1415 	PSINJECT_TRAILER = 18,
1416 	PSINJECT_EOF = 19,
1417 	PSINJECT_ENDSTREAM = 20,
1418 	PSINJECT_DOCUMENTPROCESSCOLORSATEND = 21,
1419 
1420 	PSINJECT_PAGENUMBER = 100,
1421 	PSINJECT_BEGINPAGESETUP = 101,
1422 	PSINJECT_ENDPAGESETUP = 102,
1423 	PSINJECT_PAGETRAILER = 103,
1424 	PSINJECT_PLATECOLOR = 104,
1425 	PSINJECT_SHOWPAGE = 105,
1426 	PSINJECT_PAGEBBOX = 106,
1427 	PSINJECT_ENDPAGECOMMENTS = 107,
1428 
1429 	PSINJECT_VMSAVE = 200,
1430 	PSINJECT_VMRESTORE = 201,
1431 }
1432 
1433 /* Parameter for GET_PS_FEATURESETTING escape */
1434 enum {
1435 	FEATURESETTING_NUP = 0,
1436 	FEATURESETTING_OUTPUT = 1,
1437 	FEATURESETTING_PSLEVEL = 2,
1438 	FEATURESETTING_CUSTPAPER = 3,
1439 	FEATURESETTING_MIRROR = 4,
1440 	FEATURESETTING_NEGATIVE = 5,
1441 	FEATURESETTING_PROTOCOL = 6,
1442 }
1443 
1444 enum {
1445 	FEATURESETTING_PRIVATE_BEGIN = 0x1000,
1446 	FEATURESETTING_PRIVATE_END = 0x1FFF,
1447 }
1448 
1449 /* Value returned for FEATURESETTING_PROTOCOL */
1450 const PSPROTOCOL_ASCII = 0;
1451 const PSPROTOCOL_BCP = 1;
1452 const PSPROTOCOL_TBCP = 2;
1453 const PSPROTOCOL_BINARY = 3;
1454 
1455 // ----
1456 
1457 const WPARAM PR_JOBSTATUS = 0;
1458 
1459 // ???
1460 const QDI_SETDIBITS   = 1;
1461 const QDI_GETDIBITS   = 2;
1462 const QDI_DIBTOSCREEN = 4;
1463 const QDI_STRETCHDIB  = 8;
1464 
1465 const ASPECT_FILTERING = 1;
1466 
1467 // LOGCOLORSPACE.lcsCSType
1468 enum : LCSCSTYPE {
1469 	LCS_CALIBRATED_RGB = 0,
1470 	LCS_DEVICE_RGB,
1471 	LCS_DEVICE_CMYK
1472 } /* What this for? */
1473 
1474 // LOGCOLORSPACE.lcsIntent
1475 enum : LCSGAMUTMATCH {
1476 	LCS_GM_BUSINESS         = 1,
1477 	LCS_GM_GRAPHICS         = 2,
1478 	LCS_GM_IMAGES           = 4,
1479 	LCS_GM_ABS_COLORIMETRIC = 8,
1480 }
1481 
1482 const DWORD
1483 	RASTER_FONTTYPE   = 1,
1484 	DEVICE_FONTTYPE   = 2,
1485 	TRUETYPE_FONTTYPE = 4;
1486 
1487 // ---
1488 // DEVMODE struct
1489 
1490 // FIXME: Not needed for D (use .length instead)
1491 const CCHDEVICENAME = 32;
1492 const CCHFORMNAME   = 32;
1493 
1494 // DEVMODE.dmSpecVersion
1495 // current version of specification
1496 const WORD DM_SPECVERSION = 0x0401;
1497 
1498 // DEVMODE.dmOrientation
1499 enum : short {
1500 	DMORIENT_PORTRAIT  = 1,
1501 	DMORIENT_LANDSCAPE = 2
1502 }
1503 
1504 // DEVMODE.dmPaperSize
1505 enum : short {
1506 	DMPAPER_LETTER = 1,
1507 	DMPAPER_LETTERSMALL,
1508 	DMPAPER_TABLOID,
1509 	DMPAPER_LEDGER,
1510 	DMPAPER_LEGAL,
1511 	DMPAPER_STATEMENT,
1512 	DMPAPER_EXECUTIVE,
1513 	DMPAPER_A3,
1514 	DMPAPER_A4,
1515 	DMPAPER_A4SMALL,
1516 	DMPAPER_A5,
1517 	DMPAPER_B4,
1518 	DMPAPER_B5,
1519 	DMPAPER_FOLIO,
1520 	DMPAPER_QUARTO,
1521 	DMPAPER_10X14,
1522 	DMPAPER_11X17,
1523 	DMPAPER_NOTE,
1524 	DMPAPER_ENV_9,
1525 	DMPAPER_ENV_10,
1526 	DMPAPER_ENV_11,
1527 	DMPAPER_ENV_12,
1528 	DMPAPER_ENV_14,
1529 	DMPAPER_CSHEET,
1530 	DMPAPER_DSHEET,
1531 	DMPAPER_ESHEET,
1532 	DMPAPER_ENV_DL,
1533 	DMPAPER_ENV_C5,
1534 	DMPAPER_ENV_C3,
1535 	DMPAPER_ENV_C4,
1536 	DMPAPER_ENV_C6,
1537 	DMPAPER_ENV_C65,
1538 	DMPAPER_ENV_B4,
1539 	DMPAPER_ENV_B5,
1540 	DMPAPER_ENV_B6,
1541 	DMPAPER_ENV_ITALY,
1542 	DMPAPER_ENV_MONARCH,
1543 	DMPAPER_ENV_PERSONAL,
1544 	DMPAPER_FANFOLD_US,
1545 	DMPAPER_FANFOLD_STD_GERMAN,
1546 	DMPAPER_FANFOLD_LGL_GERMAN,
1547 	DMPAPER_ISO_B4,
1548 	DMPAPER_JAPANESE_POSTCARD,
1549 	DMPAPER_9X11,
1550 	DMPAPER_10X11,
1551 	DMPAPER_15X11,
1552 	DMPAPER_ENV_INVITE,
1553 	DMPAPER_RESERVED_48,
1554 	DMPAPER_RESERVED_49,
1555 	DMPAPER_LETTER_EXTRA,
1556 	DMPAPER_LEGAL_EXTRA,
1557 	DMPAPER_TABLOID_EXTRA,
1558 	DMPAPER_A4_EXTRA,
1559 	DMPAPER_LETTER_TRANSVERSE,
1560 	DMPAPER_A4_TRANSVERSE,
1561 	DMPAPER_LETTER_EXTRA_TRANSVERSE,
1562 	DMPAPER_A_PLUS,
1563 	DMPAPER_B_PLUS,
1564 	DMPAPER_LETTER_PLUS,
1565 	DMPAPER_A4_PLUS,
1566 	DMPAPER_A5_TRANSVERSE,
1567 	DMPAPER_B5_TRANSVERSE,
1568 	DMPAPER_A3_EXTRA,
1569 	DMPAPER_A5_EXTRA,
1570 	DMPAPER_B5_EXTRA,
1571 	DMPAPER_A2,
1572 	DMPAPER_A3_TRANSVERSE,
1573 	DMPAPER_A3_EXTRA_TRANSVERSE // = 68
1574 }
1575 static if (_WIN32_WINNT >= 0x500) {
1576 	enum : short {
1577 		DMPAPER_DBL_JAPANESE_POSTCARD = 69,
1578 		DMPAPER_A6,
1579 		DMPAPER_JENV_KAKU2,
1580 		DMPAPER_JENV_KAKU3,
1581 		DMPAPER_JENV_CHOU3,
1582 		DMPAPER_JENV_CHOU4,
1583 		DMPAPER_LETTER_ROTATED,
1584 		DMPAPER_A3_ROTATED,
1585 		DMPAPER_A4_ROTATED,
1586 		DMPAPER_A5_ROTATED,
1587 		DMPAPER_B4_JIS_ROTATED,
1588 		DMPAPER_B5_JIS_ROTATED,
1589 		DMPAPER_JAPANESE_POSTCARD_ROTATED,
1590 		DMPAPER_DBL_JAPANESE_POSTCARD_ROTATED,
1591 		DMPAPER_A6_ROTATED,
1592 		DMPAPER_JENV_KAKU2_ROTATED,
1593 		DMPAPER_JENV_KAKU3_ROTATED,
1594 		DMPAPER_JENV_CHOU3_ROTATED,
1595 		DMPAPER_JENV_CHOU4_ROTATED,
1596 		DMPAPER_B6_JIS,
1597 		DMPAPER_B6_JIS_ROTATED,
1598 		DMPAPER_12X11,
1599 		DMPAPER_JENV_YOU4,
1600 		DMPAPER_JENV_YOU4_ROTATED,
1601 		DMPAPER_P16K,
1602 		DMPAPER_P32K,
1603 		DMPAPER_P32KBIG,
1604 		DMPAPER_PENV_1,
1605 		DMPAPER_PENV_2,
1606 		DMPAPER_PENV_3,
1607 		DMPAPER_PENV_4,
1608 		DMPAPER_PENV_5,
1609 		DMPAPER_PENV_6,
1610 		DMPAPER_PENV_7,
1611 		DMPAPER_PENV_8,
1612 		DMPAPER_PENV_9,
1613 		DMPAPER_PENV_10,
1614 		DMPAPER_P16K_ROTATED,
1615 		DMPAPER_P32K_ROTATED,
1616 		DMPAPER_P32KBIG_ROTATED,
1617 		DMPAPER_PENV_1_ROTATED,
1618 		DMPAPER_PENV_2_ROTATED,
1619 		DMPAPER_PENV_3_ROTATED,
1620 		DMPAPER_PENV_4_ROTATED,
1621 		DMPAPER_PENV_5_ROTATED,
1622 		DMPAPER_PENV_6_ROTATED,
1623 		DMPAPER_PENV_7_ROTATED,
1624 		DMPAPER_PENV_8_ROTATED,
1625 		DMPAPER_PENV_9_ROTATED,
1626 		DMPAPER_PENV_10_ROTATED // 118
1627 	}
1628 }
1629 
1630 const short DMPAPER_FIRST = DMPAPER_LETTER;
1631 
1632 static if (_WIN32_WINNT >= 0x500) {
1633 	const short DMPAPER_LAST = DMPAPER_PENV_10_ROTATED;
1634 } else {
1635 	const short DMPAPER_LAST = DMPAPER_A3_EXTRA_TRANSVERSE;
1636 }
1637 
1638 const short DMPAPER_USER = 256;
1639 
1640 
1641 // DEVMODE.dmDefaultSource
1642 enum : short {
1643 	DMBIN_ONLYONE = 1,
1644 	DMBIN_UPPER   = 1,
1645 	DMBIN_LOWER,
1646 	DMBIN_MIDDLE,
1647 	DMBIN_MANUAL,
1648 	DMBIN_ENVELOPE,
1649 	DMBIN_ENVMANUAL,
1650 	DMBIN_AUTO,
1651 	DMBIN_TRACTOR,
1652 	DMBIN_SMALLFMT,
1653 	DMBIN_LARGEFMT,
1654 	DMBIN_LARGECAPACITY, // = 11
1655 	DMBIN_CASSETTE   = 14,
1656 	DMBIN_FORMSOURCE,
1657 }
1658 enum : short {
1659 	DMBIN_FIRST = DMBIN_UPPER,
1660 	DMBIN_LAST = DMBIN_FORMSOURCE,
1661 	DMBIN_USER = 256,
1662 }
1663 
1664 // DEVMODE.dmPrintQuality
1665 enum : short {
1666 	DMRES_DRAFT  = -1,
1667 	DMRES_LOW    = -2,
1668 	DMRES_MEDIUM = -3,
1669 	DMRES_HIGH   = -4
1670 }
1671 
1672 // DEVMODE.dmColor
1673 enum : short {
1674 	DMCOLOR_MONOCHROME = 1,
1675 	DMCOLOR_COLOR      = 2
1676 }
1677 
1678 // DEVMODE.dmDuplex
1679 enum : short {
1680 	DMDUP_SIMPLEX    = 1,
1681 	DMDUP_VERTICAL   = 2,
1682 	DMDUP_HORIZONTAL = 3
1683 }
1684 
1685 // DEVMODE.dmTTOption
1686 enum : short {
1687 	DMTT_BITMAP = 1,
1688 	DMTT_DOWNLOAD,
1689 	DMTT_SUBDEV,
1690 	DMTT_DOWNLOAD_OUTLINE
1691 }
1692 
1693 // DEVMODE.dmCollate
1694 enum : short {
1695 	DMCOLLATE_FALSE = 0,
1696 	DMCOLLATE_TRUE
1697 }
1698 
1699 static if (_WIN32_WINNT >= 0x501) {
1700 	/* DEVMODE dmDisplayOrientation specifiations */
1701 	enum : short {
1702 		DMDO_DEFAULT = 0,
1703 		DMDO_90 = 1,
1704 		DMDO_180 = 2,
1705 		DMDO_270 = 3,
1706 	}
1707 
1708 	/* DEVMODE dmDisplayFixedOutput specifiations */
1709 	enum : short {
1710 		DMDFO_DEFAULT = 0,
1711 		DMDFO_STRETCH = 1,
1712 		DMDFO_CENTER = 2,
1713 	}
1714 }
1715 
1716 
1717 /* FIXME: this flags are deprecated ? */
1718 // DEVMODE.dmDisplayFlags
1719 const DWORD
1720 	DM_GRAYSCALE  = 1,
1721 	DM_INTERLACED = 2;
1722 
1723 const DWORD
1724 	DMDISPLAYFLAGS_TEXTMODE = 0x00000004;
1725 
1726 /* dmNup , multiple logical page per physical page options */
1727 const DWORD
1728 	DMNUP_SYSTEM = 1,
1729 	DMNUP_ONEUP = 2;
1730 
1731 // DEVMODE.dmFields
1732 const DWORD
1733 	DM_ORIENTATION        = 0x00000001,
1734 	DM_PAPERSIZE          = 0x00000002,
1735 	DM_PAPERLENGTH        = 0x00000004,
1736 	DM_PAPERWIDTH         = 0x00000008,
1737 	DM_SCALE              = 0x00000010;
1738 static if (_WIN32_WINNT >= 0x500) {
1739 	const DWORD
1740 		DM_POSITION       = 0x00000020,
1741 		DM_NUP            = 0x00000040;
1742 }
1743 static if (_WIN32_WINNT >= 0x501) {
1744 	const DWORD
1745 		DM_DISPLAYORIENTATION = 0x00000080;
1746 }
1747 const DWORD
1748 	DM_COPIES             = 0x00000100,
1749 	DM_DEFAULTSOURCE      = 0x00000200,
1750 	DM_PRINTQUALITY       = 0x00000400,
1751 	DM_COLOR              = 0x00000800,
1752 	DM_DUPLEX             = 0x00001000,
1753 	DM_YRESOLUTION        = 0x00002000,
1754 	DM_TTOPTION           = 0x00004000,
1755 	DM_COLLATE            = 0x00008000,
1756 	DM_FORMNAME           = 0x00010000,
1757 	DM_LOGPIXELS          = 0x00020000,
1758 	DM_BITSPERPEL         = 0x00040000,
1759 	DM_PELSWIDTH          = 0x00080000,
1760 	DM_PELSHEIGHT         = 0x00100000,
1761 	DM_DISPLAYFLAGS       = 0x00200000,
1762 	DM_DISPLAYFREQUENCY   = 0x00400000,
1763 	DM_ICMMETHOD          = 0x00800000,
1764 	DM_ICMINTENT          = 0x01000000,
1765 	DM_MEDIATYPE          = 0x02000000,
1766 	DM_DITHERTYPE         = 0x04000000,
1767 	DM_PANNINGWIDTH       = 0x08000000,
1768 	DM_PANNINGHEIGHT      = 0x10000000;
1769 static if (_WIN32_WINNT >= 0x501) {
1770 	const DWORD
1771 		DM_DISPLAYFIXEDOUTPUT = 0x20000000;
1772 }
1773 
1774 // DEVMODE.dmICMMethod
1775 enum : DWORD {
1776 	DMICMMETHOD_NONE   = 1,
1777 	DMICMMETHOD_SYSTEM = 2,
1778 	DMICMMETHOD_DRIVER = 3,
1779 	DMICMMETHOD_DEVICE = 4,
1780 	DMICMMETHOD_USER   = 256
1781 }
1782 
1783 // DEVMODE.dmICMIntent
1784 enum : DWORD {
1785 	DMICM_SATURATE    = 1,
1786 	DMICM_CONTRAST    = 2,
1787 	DMICM_COLORIMETRIC = 3,
1788 	DMICM_ABS_COLORIMETRIC = 4,
1789 	DMICM_USER        = 256
1790 }
1791 
1792 // DEVMODE.dmMediaType
1793 enum : DWORD {
1794 	DMMEDIA_STANDARD     = 1,
1795 	DMMEDIA_TRANSPARENCY = 2,
1796 	DMMEDIA_GLOSSY       = 3,
1797 	DMMEDIA_USER         = 256
1798 }
1799 
1800 // DEVMODE.dmDitherType
1801 enum : DWORD {
1802 	DMDITHER_NONE = 1,
1803 	DMDITHER_COARSE,
1804 	DMDITHER_FINE,
1805 	DMDITHER_LINEART,
1806 	DMDITHER_ERRORDIFFUSION,
1807 	DMDITHER_RESERVED6,
1808 	DMDITHER_RESERVED7,
1809 	DMDITHER_RESERVED8,
1810 	DMDITHER_RESERVED9,
1811 	DMDITHER_GRAYSCALE,
1812 	DMDITHER_USER = 256
1813 }
1814 
1815 // ----
1816 // DocumentProperties()
1817 const DWORD
1818 	DM_UPDATE      = 1,
1819 	DM_COPY        = 2,
1820 	DM_PROMPT      = 4,
1821 	DM_MODIFY      = 8,
1822 	DM_IN_BUFFER   = DM_MODIFY,
1823 	DM_IN_PROMPT   = DM_PROMPT,
1824 	DM_OUT_BUFFER  = DM_COPY,
1825 	DM_OUT_DEFAULT = DM_UPDATE;
1826 // ---
1827 
1828 const GDI_ERROR = 0xFFFFFFFF;
1829 const HGDI_ERROR= cast(HANDLE)GDI_ERROR;
1830 
1831 // TEXTMETRIC.tmPitchAndFamily
1832 const BYTE
1833 	TMPF_FIXED_PITCH = 1,
1834 	TMPF_VECTOR      = 2,
1835 	TMPF_TRUETYPE    = 4,
1836 	TMPF_DEVICE      = 8;
1837 
1838 // NEWTEXTMETRIC.ntmFlags
1839 const DWORD
1840 	NTM_ITALIC         = 0x00000001,
1841 	NTM_BOLD           = 0x00000020,
1842 	NTM_REGULAR        = 0x00000040,
1843 	NTM_NONNEGATIVE_AC = 0x00010000,
1844 	NTM_PS_OPENTYPE    = 0x00020000,
1845 	NTM_TT_OPENTYPE    = 0x00040000,
1846 	NTM_MULTIPLEMASTER = 0x00080000,
1847 	NTM_TYPE1          = 0x00100000,
1848 	NTM_DSIG           = 0x00200000;
1849 
1850 // ---
1851 const DWORD TT_POLYGON_TYPE = 24;
1852 
1853 // TTPOLYCURVE
1854 enum : WORD {
1855 	TT_PRIM_LINE    = 1,
1856 	TT_PRIM_QSPLINE = 2,
1857 	TT_PRIM_CSPLINE = 3,
1858 }
1859 // ---
1860 const FONTMAPPER_MAX = 10;
1861 const ENHMETA_STOCK_OBJECT = 0x80000000;
1862 const WGL_FONT_LINES = 0;
1863 const WGL_FONT_POLYGONS = 1;
1864 
1865 // ---
1866 // LAYERPLANEDESCRIPTOR.dwFlags
1867 const DWORD
1868 	LPD_DOUBLEBUFFER   = 1,
1869 	LPD_STEREO         = 2,
1870 	LPD_SUPPORT_GDI    = 16,
1871 	LPD_SUPPORT_OPENGL = 32,
1872 	LPD_SHARE_DEPTH    = 64,
1873 	LPD_SHARE_STENCIL  = 128,
1874 	LPD_SHARE_ACCUM    = 256,
1875 	LPD_SWAP_EXCHANGE  = 512,
1876 	LPD_SWAP_COPY      = 1024,
1877 	LPD_TRANSPARENT    = 4096;
1878 
1879 // LAYERPLANEDESCRIPTOR.iPixelType
1880 enum : BYTE {
1881 	LPD_TYPE_RGBA       = 0,
1882 	LPD_TYPE_COLORINDEX = 1
1883 }
1884 
1885 // ---
1886 
1887 // wglSwapLayerBuffers()
1888 const UINT
1889 	WGL_SWAP_MAIN_PLANE = 1,
1890 	WGL_SWAP_OVERLAY1   = 2,
1891 	WGL_SWAP_OVERLAY2   = 4,
1892 	WGL_SWAP_OVERLAY3   = 8,
1893 	WGL_SWAP_OVERLAY4   = 16,
1894 	WGL_SWAP_OVERLAY5   = 32,
1895 	WGL_SWAP_OVERLAY6   = 64,
1896 	WGL_SWAP_OVERLAY7   = 128,
1897 	WGL_SWAP_OVERLAY8   = 256,
1898 	WGL_SWAP_OVERLAY9   = 512,
1899 	WGL_SWAP_OVERLAY10  = 1024,
1900 	WGL_SWAP_OVERLAY11  = 2048,
1901 	WGL_SWAP_OVERLAY12  = 4096,
1902 	WGL_SWAP_OVERLAY13  = 8192,
1903 	WGL_SWAP_OVERLAY14  = 16384,
1904 	WGL_SWAP_OVERLAY15  = 32768,
1905 	WGL_SWAP_UNDERLAY1  = 65536,
1906 	WGL_SWAP_UNDERLAY2  = 0x20000,
1907 	WGL_SWAP_UNDERLAY3  = 0x40000,
1908 	WGL_SWAP_UNDERLAY4  = 0x80000,
1909 	WGL_SWAP_UNDERLAY5  = 0x100000,
1910 	WGL_SWAP_UNDERLAY6  = 0x200000,
1911 	WGL_SWAP_UNDERLAY7  = 0x400000,
1912 	WGL_SWAP_UNDERLAY8  = 0x800000,
1913 	WGL_SWAP_UNDERLAY9  = 0x1000000,
1914 	WGL_SWAP_UNDERLAY10 = 0x2000000,
1915 	WGL_SWAP_UNDERLAY11 = 0x4000000,
1916 	WGL_SWAP_UNDERLAY12 = 0x8000000,
1917 	WGL_SWAP_UNDERLAY13 = 0x10000000,
1918 	WGL_SWAP_UNDERLAY14 = 0x20000000,
1919 	WGL_SWAP_UNDERLAY15 = 0x40000000;
1920 
1921 const AC_SRC_OVER  = 0x00;
1922 const AC_SRC_ALPHA = 0x01;
1923 
1924 // ???
1925 const AC_SRC_NO_PREMULT_ALPHA = 0x01;
1926 const AC_SRC_NO_ALPHA         = 0x02;
1927 const AC_DST_NO_PREMULT_ALPHA = 0x10;
1928 const AC_DST_NO_ALPHA         = 0x20;
1929 
1930 const LAYOUT_RTL = 1;
1931 const LAYOUT_BTT = 2;
1932 const LAYOUT_VBH = 4;
1933 const LAYOUT_BITMAPORIENTATIONPRESERVED = 8;
1934 
1935 const CS_ENABLE = 0x00000001;
1936 const CS_DISABLE = 0x00000002;
1937 const CS_DELETE_TRANSFORM = 0x00000003;
1938 
1939 static if (_WIN32_WINNT > 0x500) {
1940 	const GRADIENT_FILL_RECT_H=0x00;
1941 	const GRADIENT_FILL_RECT_V=0x01;
1942 	const GRADIENT_FILL_TRIANGLE=0x02;
1943 	const GRADIENT_FILL_OP_FLAG=0xff;
1944 	const COLORMATCHTOTARGET_EMBEDED=0x00000001;
1945 	const CREATECOLORSPACE_EMBEDED=0x00000001;
1946 	const SETICMPROFILE_EMBEDED=0x00000001;
1947 }
1948 
1949 // DISPLAY_DEVICE.StateFlags
1950 const DWORD
1951 	DISPLAY_DEVICE_ATTACHED_TO_DESKTOP = 0x00000001,
1952 	DISPLAY_DEVICE_MULTI_DRIVER        = 0x00000002,
1953 	DISPLAY_DEVICE_PRIMARY_DEVICE      = 0x00000004,
1954 	DISPLAY_DEVICE_MIRRORING_DRIVER    = 0x00000008,
1955 	DISPLAY_DEVICE_VGA_COMPATIBLE      = 0x00000010,
1956 	DISPLAY_DEVICE_REMOVABLE           = 0x00000020,
1957 	DISPLAY_DEVICE_DISCONNECT          = 0x02000000,
1958 	DISPLAY_DEVICE_REMOTE              = 0x04000000,
1959 	DISPLAY_DEVICE_MODESPRUNED         = 0x08000000;
1960 
1961 /* Child device state */
1962 const DWORD
1963 	DISPLAY_DEVICE_ACTIVE = 0x00000001,
1964 	DISPLAY_DEVICE_ATTACHED = 0x00000002;
1965 
1966 static if (_WIN32_WINNT >= 0x500) {
1967 	const GGI_MARK_NONEXISTING_GLYPHS = 1;
1968 }
1969 
1970 // ----------
1971 //   STRUCTS
1972 // ----------
1973 
1974 struct ABC {
1975 	int  abcA;
1976 	UINT abcB;
1977 	int  abcC;
1978 }
1979 alias ABC* PABC, NPABC, LPABC;
1980 
1981 struct ABCFLOAT {
1982 	FLOAT abcfA;
1983 	FLOAT abcfB;
1984 	FLOAT abcfC;
1985 }
1986 alias ABCFLOAT* PABCFLOAT, NPABCFLOAT, LPABCFLOAT;
1987 
1988 struct BITMAP {
1989 	LONG   bmType;
1990 	LONG   bmWidth;
1991 	LONG   bmHeight;
1992 	LONG   bmWidthBytes;
1993 	WORD   bmPlanes;
1994 	WORD   bmBitsPixel;
1995 	LPVOID bmBits;
1996 }
1997 alias BITMAP* PBITMAP, NPBITMAP, LPBITMAP;
1998 
1999 struct BITMAPCOREHEADER {
2000 	DWORD bcSize;
2001 	WORD  bcWidth;
2002 	WORD  bcHeight;
2003 	WORD  bcPlanes;
2004 	WORD  bcBitCount;
2005 }
2006 alias BITMAPCOREHEADER* PBITMAPCOREHEADER, LPBITMAPCOREHEADER;
2007 
2008 align(1):
2009 struct RGBTRIPLE {
2010 	BYTE rgbtBlue;
2011 	BYTE rgbtGreen;
2012 	BYTE rgbtRed;
2013 }
2014 alias RGBTRIPLE* LPRGBTRIPLE;
2015 
2016 align(2):
2017 struct BITMAPFILEHEADER {
2018 	WORD  bfType;
2019 	DWORD bfSize;
2020 	WORD  bfReserved1;
2021 	WORD  bfReserved2;
2022 	DWORD bfOffBits;
2023 }
2024 alias BITMAPFILEHEADER* LPBITMAPFILEHEADER, PBITMAPFILEHEADER;
2025 
2026 align:
2027 
2028 struct BITMAPCOREINFO {
2029 	BITMAPCOREHEADER bmciHeader;
2030 	RGBTRIPLE[1]     bmciColors;
2031 }
2032 alias BITMAPCOREINFO* LPBITMAPCOREINFO, PBITMAPCOREINFO;
2033 
2034 struct BITMAPINFOHEADER {
2035 	DWORD biSize;
2036 	LONG  biWidth;
2037 	LONG  biHeight;
2038 	WORD  biPlanes;
2039 	WORD  biBitCount;
2040 	DWORD biCompression;
2041 	DWORD biSizeImage;
2042 	LONG  biXPelsPerMeter;
2043 	LONG  biYPelsPerMeter;
2044 	DWORD biClrUsed;
2045 	DWORD biClrImportant;
2046 }
2047 
2048 alias BITMAPINFOHEADER* LPBITMAPINFOHEADER, PBITMAPINFOHEADER;
2049 
2050 struct RGBQUAD {
2051 	BYTE rgbBlue;
2052 	BYTE rgbGreen;
2053 	BYTE rgbRed;
2054 	BYTE rgbReserved;
2055 };
2056 alias RGBQUAD* LPRGBQUAD;
2057 
2058 struct BITMAPINFO {
2059 	BITMAPINFOHEADER bmiHeader;
2060 	RGBQUAD[1]       bmiColors;
2061 };
2062 alias BITMAPINFO* PBITMAPINFO, LPBITMAPINFO;
2063 
2064 alias int FXPT16DOT16;
2065 alias int* LPFXPT16DOT16;
2066 alias int FXPT2DOT30;
2067 alias int* LPFXPT2DOT30;
2068 
2069 struct CIEXYZ {
2070 	FXPT2DOT30 ciexyzX;
2071 	FXPT2DOT30 ciexyzY;
2072 	FXPT2DOT30 ciexyzZ;
2073 }
2074 alias CIEXYZ* LPCIEXYZ;
2075 
2076 struct CIEXYZTRIPLE {
2077 	CIEXYZ ciexyzRed;
2078 	CIEXYZ ciexyzGreen;
2079 	CIEXYZ ciexyzBlue;
2080 }
2081 alias CIEXYZTRIPLE* LPCIEXYZTRIPLE;
2082 
2083 struct BITMAPV4HEADER {
2084 	DWORD        bV4Size;
2085 	LONG         bV4Width;
2086 	LONG         bV4Height;
2087 	WORD         bV4Planes;
2088 	WORD         bV4BitCount;
2089 	DWORD        bV4V4Compression;
2090 	DWORD        bV4SizeImage;
2091 	LONG         bV4XPelsPerMeter;
2092 	LONG         bV4YPelsPerMeter;
2093 	DWORD        bV4ClrUsed;
2094 	DWORD        bV4ClrImportant;
2095 	DWORD        bV4RedMask;
2096 	DWORD        bV4GreenMask;
2097 	DWORD        bV4BlueMask;
2098 	DWORD        bV4AlphaMask;
2099 	DWORD        bV4CSType;
2100 	CIEXYZTRIPLE bV4Endpoints;
2101 	DWORD        bV4GammaRed;
2102 	DWORD        bV4GammaGreen;
2103 	DWORD        bV4GammaBlue;
2104 }
2105 alias BITMAPV4HEADER* LPBITMAPV4HEADER, PBITMAPV4HEADER;
2106 
2107 struct BITMAPV5HEADER {
2108 	DWORD bV5Size;
2109 	LONG bV5Width;
2110 	LONG bV5Height;
2111 	WORD bV5Planes;
2112 	WORD bV5BitCount;
2113 	DWORD bV5Compression;
2114 	DWORD bV5SizeImage;
2115 	LONG bV5XPelsPerMeter;
2116 	LONG bV5YPelsPerMeter;
2117 	DWORD bV5ClrUsed;
2118 	DWORD bV5ClrImportant;
2119 	DWORD bV5RedMask;
2120 	DWORD bV5GreenMask;
2121 	DWORD bV5BlueMask;
2122 	DWORD bV5AlphaMask;
2123 	DWORD bV5CSType;
2124 	CIEXYZTRIPLE bV5Endpoints;
2125 	DWORD bV5GammaRed;
2126 	DWORD bV5GammaGreen;
2127 	DWORD bV5GammaBlue;
2128 	DWORD bV5Intent;
2129 	DWORD bV5ProfileData;
2130 	DWORD bV5ProfileSize;
2131 	DWORD bV5Reserved;
2132 }
2133 alias BITMAPV5HEADER* LPBITMAPV5HEADER, PBITMAPV5HEADER;
2134 
2135 struct FONTSIGNATURE {
2136 	DWORD[4] fsUsb;
2137 	DWORD[2] fsCsb;
2138 }
2139 alias FONTSIGNATURE* PFONTSIGNATURE, LPFONTSIGNATURE;
2140 
2141 struct CHARSETINFO {
2142 	UINT ciCharset;
2143 	UINT ciACP;
2144 	FONTSIGNATURE fs;
2145 }
2146 alias CHARSETINFO* PCHARSETINFO, NPCHARSETINFO, LPCHARSETINFO;
2147 
2148 struct COLORADJUSTMENT {
2149 	WORD  caSize;
2150 	WORD  caFlags;
2151 	WORD  caIlluminantIndex;
2152 	WORD  caRedGamma;
2153 	WORD  caGreenGamma;
2154 	WORD  caBlueGamma;
2155 	WORD  caReferenceBlack;
2156 	WORD  caReferenceWhite;
2157 	SHORT caContrast;
2158 	SHORT caBrightness;
2159 	SHORT caColorfulness;
2160 	SHORT caRedGreenTint;
2161 }
2162 alias COLORADJUSTMENT* PCOLORADJUSTMENT, LPCOLORADJUSTMENT;
2163 
2164 struct DEVMODEA {
2165 	BYTE[CCHDEVICENAME] dmDeviceName;
2166 	WORD   dmSpecVersion;
2167 	WORD   dmDriverVersion;
2168 	WORD   dmSize;
2169 	WORD   dmDriverExtra;
2170 	DWORD  dmFields;
2171 	union {
2172 		struct {
2173 			short dmOrientation;
2174 			short dmPaperSize;
2175 			short dmPaperLength;
2176 			short dmPaperWidth;
2177 			short dmScale;
2178 			short dmCopies;
2179 			short dmDefaultSource;
2180 			short dmPrintQuality;
2181 		}
2182 		POINTL dmPosition;
2183 		DWORD  dmDisplayOrientation;
2184 		DWORD  dmDisplayFixedOutput;
2185 	}
2186 	short  dmColor;
2187 	short  dmDuplex;
2188 	short  dmYResolution;
2189 	short  dmTTOption;
2190 	short  dmCollate;
2191 	BYTE[CCHFORMNAME]   dmFormName;
2192 	WORD   dmLogPixels;
2193 	DWORD  dmBitsPerPel;
2194 	DWORD  dmPelsWidth;
2195 	DWORD  dmPelsHeight;
2196 	union {
2197 		DWORD  dmDisplayFlags;
2198 		DWORD  dmNup;
2199 	}
2200 	DWORD  dmDisplayFrequency;
2201 	DWORD  dmICMMethod;
2202 	DWORD  dmICMIntent;
2203 	DWORD  dmMediaType;
2204 	DWORD  dmDitherType;
2205 	DWORD  dmReserved1;
2206 	DWORD  dmReserved2;
2207 	DWORD  dmPanningWidth;
2208 	DWORD  dmPanningHeight;
2209 }
2210 alias DEVMODEA* PDEVMODEA, NPDEVMODEA, LPDEVMODEA;
2211 
2212 struct DEVMODEW {
2213 	WCHAR[CCHDEVICENAME]   dmDeviceName;
2214 	WORD   dmSpecVersion;
2215 	WORD   dmDriverVersion;
2216 	WORD   dmSize;
2217 	WORD   dmDriverExtra;
2218 	DWORD  dmFields;
2219 	union {
2220 		struct {
2221 			short dmOrientation;
2222 			short dmPaperSize;
2223 			short dmPaperLength;
2224 			short dmPaperWidth;
2225 			short dmScale;
2226 			short dmCopies;
2227 			short dmDefaultSource;
2228 			short dmPrintQuality;
2229 		}
2230 		POINTL dmPosition;
2231 		DWORD  dmDisplayOrientation;
2232 		DWORD  dmDisplayFixedOutput;
2233 	}
2234 
2235 	short  dmColor;
2236 	short  dmDuplex;
2237 	short  dmYResolution;
2238 	short  dmTTOption;
2239 	short  dmCollate;
2240 	WCHAR[CCHFORMNAME]  dmFormName;
2241 	WORD   dmLogPixels;
2242 	DWORD  dmBitsPerPel;
2243 	DWORD  dmPelsWidth;
2244 	DWORD  dmPelsHeight;
2245 	union {
2246 		DWORD  dmDisplayFlags;
2247 		DWORD  dmNup;
2248 	}
2249 	DWORD  dmDisplayFrequency;
2250 	DWORD  dmICMMethod;
2251 	DWORD  dmICMIntent;
2252 	DWORD  dmMediaType;
2253 	DWORD  dmDitherType;
2254 	DWORD  dmReserved1;
2255 	DWORD  dmReserved2;
2256 	DWORD  dmPanningWidth;
2257 	DWORD  dmPanningHeight;
2258 }
2259 alias DEVMODEW* PDEVMODEW, NPDEVMODEW, LPDEVMODEW;
2260 
2261 /*
2262  * Information about output options
2263  */
2264 struct PSFEATURE_OUTPUT {
2265 	BOOL bPageIndependent;
2266 	BOOL bSetPageDevice;
2267 }
2268 alias PSFEATURE_OUTPUT* PPSFEATURE_OUTPUT;
2269 
2270 /*
2271  * Information about custom paper size
2272  */
2273 struct PSFEATURE_CUSTPAPER {
2274 	LONG lOrientation;
2275 	LONG lWidth;
2276 	LONG lHeight;
2277 	LONG lWidthOffset;
2278 	LONG lHeightOffset;
2279 }
2280 alias PSFEATURE_CUSTPAPER* PPSFEATURE_CUSTPAPER;
2281 
2282 struct DIBSECTION {
2283 	BITMAP           dsBm;
2284 	BITMAPINFOHEADER dsBmih;
2285 	DWORD[3]         dsBitfields;
2286 	HANDLE           dshSection;
2287 	DWORD            dsOffset;
2288 }
2289 alias DIBSECTION* PDIBSECTION;
2290 
2291 struct DOCINFOA {
2292 	int    cbSize = DOCINFOA.sizeof;
2293 	LPCSTR lpszDocName;
2294 	LPCSTR lpszOutput;
2295 	LPCSTR lpszDatatype;
2296 	DWORD  fwType;
2297 }
2298 alias DOCINFOA* LPDOCINFOA;
2299 
2300 struct DOCINFOW {
2301 	int     cbSize = DOCINFOW.sizeof;
2302 	LPCWSTR lpszDocName;
2303 	LPCWSTR lpszOutput;
2304 	LPCWSTR lpszDatatype;
2305 	DWORD   fwType;
2306 }
2307 alias DOCINFOW* LPDOCINFOW;
2308 
2309 
2310 struct PANOSE {
2311 	BYTE bFamilyType;
2312 	BYTE bSerifStyle;
2313 	BYTE bWeight;
2314 	BYTE bProportion;
2315 	BYTE bContrast;
2316 	BYTE bStrokeVariation;
2317 	BYTE bArmStyle;
2318 	BYTE bLetterform;
2319 	BYTE bMidline;
2320 	BYTE bXHeight;
2321 }
2322 alias PANOSE* LPPANOSE;
2323 
2324 struct LOGFONTA {
2325 	LONG lfHeight;
2326 	LONG lfWidth;
2327 	LONG lfEscapement;
2328 	LONG lfOrientation;
2329 	LONG lfWeight;
2330 	BYTE lfItalic;
2331 	BYTE lfUnderline;
2332 	BYTE lfStrikeOut;
2333 	BYTE lfCharSet;
2334 	BYTE lfOutPrecision;
2335 	BYTE lfClipPrecision;
2336 	BYTE lfQuality;
2337 	BYTE lfPitchAndFamily;
2338 	CHAR[LF_FACESIZE] lfFaceName;
2339 }
2340 alias LOGFONTA* PLOGFONTA, NPLOGFONTA, LPLOGFONTA;
2341 
2342 struct LOGFONTW {
2343 	LONG lfHeight;
2344 	LONG lfWidth;
2345 	LONG lfEscapement;
2346 	LONG lfOrientation;
2347 	LONG lfWeight;
2348 	BYTE lfItalic;
2349 	BYTE lfUnderline;
2350 	BYTE lfStrikeOut;
2351 	BYTE lfCharSet;
2352 	BYTE lfOutPrecision;
2353 	BYTE lfClipPrecision;
2354 	BYTE lfQuality;
2355 	BYTE lfPitchAndFamily;
2356 	WCHAR[LF_FACESIZE] lfFaceName;
2357 }
2358 alias LOGFONTW* PLOGFONTW, NPLOGFONTW, LPLOGFONTW;
2359 
2360 struct EXTLOGFONTA {
2361 	LOGFONTA              elfLogFont;
2362 	BYTE[LF_FULLFACESIZE] elfFullName;
2363 	BYTE[LF_FACESIZE]     elfStyle;
2364 	DWORD                 elfVersion;
2365 	DWORD                 elfStyleSize;
2366 	DWORD                 elfMatch;
2367 	DWORD                 elfReserved;
2368 	BYTE[ELF_VENDOR_SIZE] elfVendorId;
2369 	DWORD                 elfCulture;
2370 	PANOSE                elfPanose;
2371 }
2372 alias EXTLOGFONTA* PEXTLOGFONTA, NPEXTLOGFONTA, LPEXTLOGFONTA;
2373 
2374 struct EXTLOGFONTW {
2375 	LOGFONTW               elfLogFont;
2376 	WCHAR[LF_FULLFACESIZE] elfFullName;
2377 	WCHAR[LF_FACESIZE]     elfStyle;
2378 	DWORD                  elfVersion;
2379 	DWORD                  elfStyleSize;
2380 	DWORD                  elfMatch;
2381 	DWORD                  elfReserved;
2382 	BYTE[ELF_VENDOR_SIZE]  elfVendorId;
2383 	DWORD                  elfCulture;
2384 	PANOSE                 elfPanose;
2385 }
2386 alias EXTLOGFONTW* PEXTLOGFONTW, NPEXTLOGFONTW, LPEXTLOGFONTW;
2387 
2388 struct LOGPEN {
2389 	UINT     lopnStyle;
2390 	POINT    lopnWidth;
2391 	COLORREF lopnColor;
2392 }
2393 alias LOGPEN* PLOGPEN, NPLOGPEN, LPLOGPEN;
2394 
2395 // ---------------------- EMR ------------
2396 
2397 struct EMR {
2398 	DWORD iType;
2399 	DWORD nSize;
2400 }
2401 alias EMR* PEMR;
2402 
2403 struct EMRANGLEARC {
2404 	EMR    emr;
2405 	POINTL ptlCenter;
2406 	DWORD  nRadius;
2407 	FLOAT  eStartAngle;
2408 	FLOAT  eSweepAngle;
2409 }
2410 alias EMRANGLEARC* PEMRANGLEARC;
2411 
2412 struct EMRARC {
2413 	EMR    emr;
2414 	RECTL  rclBox;
2415 	POINTL ptlStart;
2416 	POINTL ptlEnd;
2417 }
2418 alias EMRARC* PEMRARC;
2419 alias TypeDef!(EMRARC) EMRARCTO;
2420 alias EMRARCTO* PEMRARCTO;
2421 alias TypeDef!(EMRARC) EMRCHORD;
2422 alias EMRCHORD* PEMRCHORD;
2423 alias TypeDef!(EMRARC) EMRPIE;
2424 alias EMRPIE* PEMRPIE;
2425 
2426 struct XFORM {
2427 	FLOAT eM11;
2428 	FLOAT eM12;
2429 	FLOAT eM21;
2430 	FLOAT eM22;
2431 	FLOAT eDx;
2432 	FLOAT eDy;
2433 }
2434 alias XFORM* PXFORM, LPXFORM;
2435 
2436 struct EMRBITBLT {
2437 	EMR      emr;
2438 	RECTL    rclBounds;
2439 	LONG     xDest;
2440 	LONG     yDest;
2441 	LONG     cxDest;
2442 	LONG     cyDest;
2443 	DWORD    dwRop;
2444 	LONG     xSrc;
2445 	LONG     ySrc;
2446 	XFORM    xformSrc;
2447 	COLORREF crBkColorSrc;
2448 	DWORD    iUsageSrc;
2449 	DWORD    offBmiSrc;
2450 	DWORD    cbBmiSrc;
2451 	DWORD    offBitsSrc;
2452 	DWORD    cbBitsSrc;
2453 }
2454 alias EMRBITBLT* PEMRBITBLT;
2455 
2456 struct LOGBRUSH {
2457 	UINT     lbStyle;
2458 	COLORREF lbColor;
2459 	LONG     lbHatch;
2460 }
2461 alias TypeDef!(LOGBRUSH) PATTERN;
2462 alias LOGBRUSH* PLOGBRUSH, NPLOGBRUSH, LPLOGBRUSH;
2463 alias PATTERN* PPATTERN, NPPATTERN, LPPATTERN;
2464 
2465 struct LOGBRUSH32 {
2466 	UINT lbStyle;
2467 	COLORREF lbColor;
2468 	ULONG lbHatch;
2469 }
2470 alias LOGBRUSH32* PLOGBRUSH32, NPLOGBRUSH32, LPLOGBRUSH32;
2471 
2472 struct EMRCREATEBRUSHINDIRECT {
2473 	EMR      emr;
2474 	DWORD    ihBrush;
2475 	LOGBRUSH32 lb;
2476 }
2477 alias EMRCREATEBRUSHINDIRECT* PEMRCREATEBRUSHINDIRECT;
2478 
2479 alias LONG LCSCSTYPE, LCSGAMUTMATCH;
2480 
2481 struct LOGCOLORSPACEA {
2482 	DWORD lcsSignature;
2483 	DWORD lcsVersion;
2484 	DWORD lcsSize;
2485 	LCSCSTYPE lcsCSType;
2486 	LCSGAMUTMATCH lcsIntent;
2487 	CIEXYZTRIPLE lcsEndpoints;
2488 	DWORD lcsGammaRed;
2489 	DWORD lcsGammaGreen;
2490 	DWORD lcsGammaBlue;
2491 	CHAR[MAX_PATH] lcsFilename;
2492 }
2493 alias LOGCOLORSPACEA* LPLOGCOLORSPACEA;
2494 
2495 struct LOGCOLORSPACEW {
2496 	DWORD lcsSignature;
2497 	DWORD lcsVersion;
2498 	DWORD lcsSize;
2499 	LCSCSTYPE lcsCSType;
2500 	LCSGAMUTMATCH lcsIntent;
2501 	CIEXYZTRIPLE lcsEndpoints;
2502 	DWORD lcsGammaRed;
2503 	DWORD lcsGammaGreen;
2504 	DWORD lcsGammaBlue;
2505 	WCHAR[MAX_PATH] lcsFilename;
2506 }
2507 alias LOGCOLORSPACEW* LPLOGCOLORSPACEW;
2508 
2509 alias USHORT COLOR16;
2510 struct TRIVERTEX {
2511 	LONG x;
2512 	LONG y;
2513 	COLOR16 Red;
2514 	COLOR16 Green;
2515 	COLOR16 Blue;
2516 	COLOR16 Alpha;
2517 }
2518 alias TRIVERTEX* PTRIVERTEX, LPTRIVERTEX;
2519 
2520 struct EMRGLSRECORD {
2521 	EMR emr;
2522 	DWORD cbData;
2523 	BYTE[1] Data;
2524 }
2525 alias EMRGLSRECORD* PEMRGLSRECORD;
2526 
2527 struct EMRGLSBOUNDEDRECORD {
2528 	EMR emr;
2529 	RECTL rclBounds;
2530 	DWORD cbData;
2531 	BYTE[1] Data;
2532 }
2533 alias EMRGLSBOUNDEDRECORD* PEMRGLSBOUNDEDRECORD;
2534 
2535 struct EMRPIXELFORMAT {
2536 	EMR emr;
2537 	PIXELFORMATDESCRIPTOR pfd;
2538 }
2539 alias EMRPIXELFORMAT* PEMRPIXELFORMAT;
2540 
2541 struct EMRCREATECOLORSPACE {
2542 	EMR emr;
2543 	DWORD ihCS;
2544 	LOGCOLORSPACE lcs;
2545 }
2546 alias EMRCREATECOLORSPACE* PEMRCREATECOLORSPACE;
2547 
2548 struct EMRSETCOLORSPACE {
2549 	EMR emr;
2550 	DWORD ihCS;
2551 }
2552 alias EMRSETCOLORSPACE* PEMRSETCOLORSPACE;
2553 alias TypeDef!(EMRSETCOLORSPACE) EMRSELECTCOLORSPACE;
2554 alias EMRSELECTCOLORSPACE* PEMRSELECTCOLORSPACE;
2555 alias TypeDef!(EMRSETCOLORSPACE) EMRDELETECOLORSPACE;
2556 alias EMRDELETECOLORSPACE* PEMRDELETECOLORSPACE;
2557 
2558 static if (_WIN32_WINNT >= 0x500) {
2559 
2560 	struct EMREXTESCAPE {
2561 		EMR emr;
2562 		INT iEscape;
2563 		INT cbEscData;
2564 		BYTE[1] EscData;
2565 	}
2566 	alias EMREXTESCAPE* PEMREXTESCAPE;
2567 	alias TypeDef!(EMREXTESCAPE) EMRDRAWESCAPE;
2568 	alias EMRDRAWESCAPE* PEMRDRAWESCAPE;
2569 
2570 	struct EMRNAMEDESCAPE {
2571 		EMR emr;
2572 		INT iEscape;
2573 		INT cbDriver;
2574 		INT cbEscData;
2575 		BYTE[1] EscData;
2576 	}
2577 	alias EMRNAMEDESCAPE* PEMRNAMEDESCAPE;
2578 
2579 	struct EMRSETICMPROFILE {
2580 		EMR emr;
2581 		DWORD dwFlags;
2582 		DWORD cbName;
2583 		DWORD cbData;
2584 		BYTE[1] Data;
2585 	}
2586 	alias EMRSETICMPROFILE* PEMRSETICMPROFILE;
2587 	alias TypeDef!(EMRSETICMPROFILE) EMRSETICMPROFILEA;
2588 	alias EMRSETICMPROFILEA* PEMRSETICMPROFILEA;
2589 	alias TypeDef!(EMRSETICMPROFILE) EMRSETICMPROFILEW;
2590 	alias EMRSETICMPROFILEW* PEMRSETICMPROFILEW;
2591 
2592 	struct EMRCREATECOLORSPACEW {
2593 		EMR emr;
2594 		DWORD ihCS;
2595 		LOGCOLORSPACEW lcs;
2596 		DWORD dwFlags;
2597 		DWORD cbData;
2598 		BYTE[1] Data;
2599 	}
2600 	alias EMRCREATECOLORSPACEW* PEMRCREATECOLORSPACEW;
2601 
2602 	struct EMRCOLORMATCHTOTARGET {
2603 		EMR emr;
2604 		DWORD dwAction;
2605 		DWORD dwFlags;
2606 		DWORD cbName;
2607 		DWORD cbData;
2608 		BYTE[1] Data;
2609 	}
2610 	alias EMRCOLORMATCHTOTARGET* PEMRCOLORMATCHTOTARGET;
2611 
2612 	struct EMRCOLORCORRECTPALETTE {
2613 		EMR emr;
2614 		DWORD ihPalette;
2615 		DWORD nFirstEntry;
2616 		DWORD nPalEntries;
2617 		DWORD nReserved;
2618 	}
2619 	alias EMRCOLORCORRECTPALETTE* PEMRCOLORCORRECTPALETTE;
2620 
2621 	struct EMRALPHABLEND {
2622 		EMR emr;
2623 		RECTL rclBounds;
2624 		LONG xDest;
2625 		LONG yDest;
2626 		LONG cxDest;
2627 		LONG cyDest;
2628 		DWORD dwRop;
2629 		LONG xSrc;
2630 		LONG ySrc;
2631 		XFORM xformSrc;
2632 		COLORREF crBkColorSrc;
2633 		DWORD iUsageSrc;
2634 		DWORD offBmiSrc;
2635 		DWORD cbBmiSrc;
2636 		DWORD offBitsSrc;
2637 		DWORD cbBitsSrc;
2638 		LONG cxSrc;
2639 		LONG cySrc;
2640 	}
2641 	alias EMRALPHABLEND* PEMRALPHABLEND;
2642 
2643 	struct EMRGRADIENTFILL {
2644 		EMR emr;
2645 		RECTL rclBounds;
2646 		DWORD nVer;
2647 		DWORD nTri;
2648 		ULONG ulMode;
2649 		TRIVERTEX[1] Ver;
2650 	}
2651 	alias EMRGRADIENTFILL* PEMRGRADIENTFILL;
2652 
2653 	struct EMRTRANSPARENTBLT {
2654 		EMR emr;
2655 		RECTL rclBounds;
2656 		LONG xDest;
2657 		LONG yDest;
2658 		LONG cxDest;
2659 		LONG cyDest;
2660 		DWORD dwRop;
2661 		LONG xSrc;
2662 		LONG ySrc;
2663 		XFORM xformSrc;
2664 		COLORREF crBkColorSrc;
2665 		DWORD iUsageSrc;
2666 		DWORD offBmiSrc;
2667 		DWORD cbBmiSrc;
2668 		DWORD offBitsSrc;
2669 		DWORD cbBitsSrc;
2670 		LONG cxSrc;
2671 		LONG cySrc;
2672 	}
2673 	alias EMRTRANSPARENTBLT* PEMRTRANSPARENTBLT;
2674 }
2675 
2676 struct EMRCREATEDIBPATTERNBRUSHPT {
2677 	EMR emr;
2678 	DWORD ihBrush;
2679 	DWORD iUsage;
2680 	DWORD offBmi;
2681 	DWORD cbBmi;
2682 	DWORD offBits;
2683 	DWORD cbBits;
2684 }
2685 alias EMRCREATEDIBPATTERNBRUSHPT* PEMRCREATEDIBPATTERNBRUSHPT;
2686 
2687 struct EMRCREATEMONOBRUSH {
2688 	EMR emr;
2689 	DWORD ihBrush;
2690 	DWORD iUsage;
2691 	DWORD offBmi;
2692 	DWORD cbBmi;
2693 	DWORD offBits;
2694 	DWORD cbBits;
2695 }
2696 alias EMRCREATEMONOBRUSH* PEMRCREATEMONOBRUSH;
2697 
2698 struct PALETTEENTRY {
2699 	BYTE peRed;
2700 	BYTE peGreen;
2701 	BYTE peBlue;
2702 	BYTE peFlags;
2703 }
2704 alias PALETTEENTRY* PPALETTEENTRY, LPPALETTEENTRY;
2705 
2706 struct LOGPALETTE {
2707 	WORD palVersion;
2708 	WORD palNumEntries;
2709 	PALETTEENTRY[1] palPalEntry;
2710 }
2711 alias LOGPALETTE* PLOGPALETTE, NPLOGPALETTE, LPLOGPALETTE;
2712 
2713 struct EMRCREATEPALETTE {
2714 	EMR emr;
2715 	DWORD ihPal;
2716 	LOGPALETTE lgpl;
2717 }
2718 alias EMRCREATEPALETTE* PEMRCREATEPALETTE;
2719 
2720 struct EMRCREATEPEN {
2721 	EMR emr;
2722 	DWORD ihPen;
2723 	LOGPEN lopn;
2724 }
2725 alias EMRCREATEPEN* PEMRCREATEPEN;
2726 
2727 struct EMRELLIPSE {
2728 	EMR emr;
2729 	RECTL rclBox;
2730 }
2731 alias EMRELLIPSE* PEMRELLIPSE;
2732 
2733 alias TypeDef!(EMRELLIPSE) EMRRECTANGLE;
2734 alias EMRRECTANGLE* PEMRRECTANGLE;
2735 
2736 struct EMREOF {
2737 	EMR emr;
2738 	DWORD nPalEntries;
2739 	DWORD offPalEntries;
2740 	DWORD nSizeLast;
2741 }
2742 alias EMREOF* PEMREOF;
2743 
2744 struct EMREXCLUDECLIPRECT {
2745 	EMR emr;
2746 	RECTL rclClip;
2747 }
2748 alias EMREXCLUDECLIPRECT* PEMREXCLUDECLIPRECT;
2749 alias TypeDef!(EMREXCLUDECLIPRECT) EMRINTERSECTCLIPRECT;
2750 alias EMRINTERSECTCLIPRECT* PEMRINTERSECTCLIPRECT;
2751 
2752 struct EMREXTCREATEFONTINDIRECTW {
2753 	EMR emr;
2754 	DWORD ihFont;
2755 	EXTLOGFONTW elfw;
2756 }
2757 alias EMREXTCREATEFONTINDIRECTW* PEMREXTCREATEFONTINDIRECTW;
2758 
2759 struct EXTLOGPEN {
2760 	UINT elpPenStyle;
2761 	UINT elpWidth;
2762 	UINT elpBrushStyle;
2763 	COLORREF elpColor;
2764 	LONG elpHatch;
2765 	DWORD elpNumEntries;
2766 	DWORD[1] elpStyleEntry;
2767 }
2768 alias EXTLOGPEN* PEXTLOGPEN, NPEXTLOGPEN, LPEXTLOGPEN;
2769 
2770 struct EMREXTCREATEPEN {
2771 	EMR emr;
2772 	DWORD ihPen;
2773 	DWORD offBmi;
2774 	DWORD cbBmi;
2775 	DWORD offBits;
2776 	DWORD cbBits;
2777 	EXTLOGPEN elp;
2778 }
2779 alias EMREXTCREATEPEN* PEMREXTCREATEPEN;
2780 
2781 struct EMREXTFLOODFILL {
2782 	EMR emr;
2783 	POINTL ptlStart;
2784 	COLORREF crColor;
2785 	DWORD iMode;
2786 }
2787 alias EMREXTFLOODFILL* PEMREXTFLOODFILL;
2788 
2789 struct EMREXTSELECTCLIPRGN {
2790 	EMR emr;
2791 	DWORD cbRgnData;
2792 	DWORD iMode;
2793 	BYTE [1]RgnData;
2794 }
2795 alias EMREXTSELECTCLIPRGN* PEMREXTSELECTCLIPRGN;
2796 
2797 struct EMRTEXT {
2798 	POINTL ptlReference;
2799 	DWORD nChars;
2800 	DWORD offString;
2801 	DWORD fOptions;
2802 	RECTL rcl;
2803 	DWORD offDx;
2804 }
2805 alias EMRTEXT* PEMRTEXT;
2806 
2807 struct EMREXTTEXTOUTA {
2808 	EMR emr;
2809 	RECTL rclBounds;
2810 	DWORD iGraphicsMode;
2811 	FLOAT exScale;
2812 	FLOAT eyScale;
2813 	EMRTEXT emrtext;
2814 }
2815 alias EMREXTTEXTOUTA* PEMREXTTEXTOUTA;
2816 alias TypeDef!(EMREXTTEXTOUTA) EMREXTTEXTOUTW;
2817 alias EMREXTTEXTOUTW* PEMREXTTEXTOUTW;
2818 
2819 struct EMRFILLPATH {
2820 	EMR emr;
2821 	RECTL rclBounds;
2822 }
2823 alias EMRFILLPATH* PEMRFILLPATH;
2824 
2825 alias TypeDef!(EMRFILLPATH) EMRSTROKEANDFILLPATH;
2826 alias EMRSTROKEANDFILLPATH* PEMRSTROKEANDFILLPATH;
2827 
2828 alias TypeDef!(EMRFILLPATH) EMRSTROKEPATH;
2829 alias EMRSTROKEPATH* PEMRSTROKEPATH;
2830 
2831 struct EMRFILLRGN {
2832 	EMR emr;
2833 	RECTL rclBounds;
2834 	DWORD cbRgnData;
2835 	DWORD ihBrush;
2836 	BYTE[1] RgnData;
2837 }
2838 alias EMRFILLRGN* PEMRFILLRGN;
2839 
2840 struct EMRFORMAT {
2841 	DWORD dSignature;
2842 	DWORD nVersion;
2843 	DWORD cbData;
2844 	DWORD offData;
2845 }
2846 alias EMRFORMAT* PEMRFORMAT;
2847 
2848 struct EMRFRAMERGN {
2849 	EMR emr;
2850 	RECTL rclBounds;
2851 	DWORD cbRgnData;
2852 	DWORD ihBrush;
2853 	SIZEL szlStroke;
2854 	BYTE[1] RgnData;
2855 }
2856 alias EMRFRAMERGN* PEMRFRAMERGN;
2857 
2858 struct EMRGDICOMMENT {
2859 	EMR emr;
2860 	DWORD cbData;
2861 	BYTE[1] Data;
2862 }
2863 alias EMRGDICOMMENT* PEMRGDICOMMENT;
2864 
2865 struct EMRINVERTRGN {
2866 	EMR emr;
2867 	RECTL rclBounds;
2868 	DWORD cbRgnData;
2869 	BYTE[1] RgnData;
2870 }
2871 alias EMRINVERTRGN* PEMRINVERTRGN;
2872 alias TypeDef!(EMRINVERTRGN) EMRPAINTRGN;
2873 alias EMRPAINTRGN* PEMRPAINTRGN;
2874 
2875 struct EMRLINETO {
2876 	EMR emr;
2877 	POINTL ptl;
2878 }
2879 alias EMRLINETO* PEMRLINETO;
2880 alias TypeDef!(EMRLINETO) EMRMOVETOEX;
2881 alias EMRMOVETOEX* PEMRMOVETOEX;
2882 
2883 struct EMRMASKBLT {
2884 	EMR emr;
2885 	RECTL rclBounds;
2886 	LONG xDest;
2887 	LONG yDest;
2888 	LONG cxDest;
2889 	LONG cyDest;
2890 	DWORD dwRop;
2891 	LONG xSrc;
2892 	LONG ySrc;
2893 	XFORM xformSrc;
2894 	COLORREF crBkColorSrc;
2895 	DWORD iUsageSrc;
2896 	DWORD offBmiSrc;
2897 	DWORD cbBmiSrc;
2898 	DWORD offBitsSrc;
2899 	DWORD cbBitsSrc;
2900 	LONG xMask;
2901 	LONG yMask;
2902 	DWORD iUsageMask;
2903 	DWORD offBmiMask;
2904 	DWORD cbBmiMask;
2905 	DWORD offBitsMask;
2906 	DWORD cbBitsMask;
2907 }
2908 alias EMRMASKBLT* PEMRMASKBLT;
2909 
2910 struct EMRMODIFYWORLDTRANSFORM {
2911 	EMR emr;
2912 	XFORM xform;
2913 	DWORD iMode;
2914 }
2915 alias EMRMODIFYWORLDTRANSFORM* PEMRMODIFYWORLDTRANSFORM;
2916 
2917 struct EMROFFSETCLIPRGN {
2918 	EMR emr;
2919 	POINTL ptlOffset;
2920 }
2921 alias EMROFFSETCLIPRGN* PEMROFFSETCLIPRGN;
2922 
2923 struct EMRPLGBLT {
2924 	EMR emr;
2925 	RECTL rclBounds;
2926 	POINTL[3] aptlDest;
2927 	LONG xSrc;
2928 	LONG ySrc;
2929 	LONG cxSrc;
2930 	LONG cySrc;
2931 	XFORM xformSrc;
2932 	COLORREF crBkColorSrc;
2933 	DWORD iUsageSrc;
2934 	DWORD offBmiSrc;
2935 	DWORD cbBmiSrc;
2936 	DWORD offBitsSrc;
2937 	DWORD cbBitsSrc;
2938 	LONG xMask;
2939 	LONG yMask;
2940 	DWORD iUsageMask;
2941 	DWORD offBmiMask;
2942 	DWORD cbBmiMask;
2943 	DWORD offBitsMask;
2944 	DWORD cbBitsMask;
2945 }
2946 alias EMRPLGBLT* PEMRPLGBLT;
2947 
2948 struct EMRPOLYDRAW {
2949 	EMR emr;
2950 	RECTL rclBounds;
2951 	DWORD cptl;
2952 	POINTL[1] aptl;
2953 	BYTE[1] abTypes;
2954 }
2955 alias EMRPOLYDRAW* PEMRPOLYDRAW;
2956 
2957 struct EMRPOLYDRAW16 {
2958 	EMR emr;
2959 	RECTL rclBounds;
2960 	DWORD cpts;
2961 	POINTS[1] apts;
2962 	BYTE[1] abTypes;
2963 }
2964 alias EMRPOLYDRAW16* PEMRPOLYDRAW16;
2965 
2966 struct EMRPOLYLINE {
2967 	EMR emr;
2968 	RECTL rclBounds;
2969 	DWORD cptl;
2970 	POINTL[1] aptl;
2971 }
2972 alias EMRPOLYLINE* PEMRPOLYLINE;
2973 alias TypeDef!(EMRPOLYLINE) EMRPOLYBEZIER;
2974 alias EMRPOLYBEZIER* PEMRPOLYBEZIER;
2975 alias TypeDef!(EMRPOLYLINE) EMRPOLYGON;
2976 alias EMRPOLYGON* PEMRPOLYGON;
2977 alias TypeDef!(EMRPOLYLINE) EMRPOLYBEZIERTO;
2978 alias EMRPOLYBEZIERTO* PEMRPOLYBEZIERTO;
2979 alias TypeDef!(EMRPOLYLINE) EMRPOLYLINETO;
2980 alias EMRPOLYLINETO* PEMRPOLYLINETO;
2981 
2982 struct EMRPOLYLINE16 {
2983 	EMR emr;
2984 	RECTL rclBounds;
2985 	DWORD cpts;
2986 	POINTS[1] apts;
2987 }
2988 alias EMRPOLYLINE16* PEMRPOLYLINE16;
2989 alias TypeDef!(EMRPOLYLINE16) EMRPOLYBEZIER16;
2990 alias EMRPOLYBEZIER16* PEMRPOLYBEZIER16;
2991 alias TypeDef!(EMRPOLYLINE16) EMRPOLYGON16;
2992 alias EMRPOLYGON16* PEMRPOLYGON16;
2993 alias TypeDef!(EMRPOLYLINE16) EMRPOLYBEZIERTO16;
2994 alias EMRPOLYBEZIERTO16* PEMRPOLYBEZIERTO16;
2995 alias TypeDef!(EMRPOLYLINE16) EMRPOLYLINETO16;
2996 alias EMRPOLYLINETO16* PEMRPOLYLINETO16;
2997 
2998 struct EMRPOLYPOLYLINE {
2999 	EMR emr;
3000 	RECTL rclBounds;
3001 	DWORD nPolys;
3002 	DWORD cptl;
3003 	DWORD[1] aPolyCounts;
3004 	POINTL[1] aptl;
3005 }
3006 alias EMRPOLYPOLYLINE* PEMRPOLYPOLYLINE;
3007 alias TypeDef!(EMRPOLYPOLYLINE) EMRPOLYPOLYGON;
3008 alias EMRPOLYPOLYGON* PEMRPOLYPOLYGON;
3009 
3010 struct EMRPOLYPOLYLINE16 {
3011 	EMR emr;
3012 	RECTL rclBounds;
3013 	DWORD nPolys;
3014 	DWORD cpts;
3015 	DWORD[1] aPolyCounts;
3016 	POINTS[1] apts;
3017 }
3018 alias EMRPOLYPOLYLINE16* PEMRPOLYPOLYLINE16;
3019 alias TypeDef!(EMRPOLYPOLYLINE16) EMRPOLYPOLYGON16;
3020 alias EMRPOLYPOLYGON16* PEMRPOLYPOLYGON16;
3021 
3022 struct EMRPOLYTEXTOUTA {
3023 	EMR emr;
3024 	RECTL rclBounds;
3025 	DWORD iGraphicsMode;
3026 	FLOAT exScale;
3027 	FLOAT eyScale;
3028 	LONG cStrings;
3029 	EMRTEXT[1] aemrtext;
3030 }
3031 alias EMRPOLYTEXTOUTA* PEMRPOLYTEXTOUTA;
3032 alias TypeDef!(EMRPOLYTEXTOUTA) EMRPOLYTEXTOUTW;
3033 alias EMRPOLYTEXTOUTW* PEMRPOLYTEXTOUTW;
3034 
3035 struct EMRRESIZEPALETTE {
3036 	EMR emr;
3037 	DWORD ihPal;
3038 	DWORD cEntries;
3039 }
3040 alias EMRRESIZEPALETTE* PEMRRESIZEPALETTE;
3041 
3042 struct EMRRESTOREDC {
3043 	EMR emr;
3044 	LONG iRelative;
3045 }
3046 alias EMRRESTOREDC* PEMRRESTOREDC;
3047 
3048 struct EMRROUNDRECT {
3049 	EMR emr;
3050 	RECTL rclBox;
3051 	SIZEL szlCorner;
3052 }
3053 alias EMRROUNDRECT* PEMRROUNDRECT;
3054 
3055 struct EMRSCALEVIEWPORTEXTEX {
3056 	EMR emr;
3057 	LONG xNum;
3058 	LONG xDenom;
3059 	LONG yNum;
3060 	LONG yDenom;
3061 }
3062 alias EMRSCALEVIEWPORTEXTEX* PEMRSCALEVIEWPORTEXTEX;
3063 alias TypeDef!(EMRSCALEVIEWPORTEXTEX) EMRSCALEWINDOWEXTEX;
3064 alias EMRSCALEWINDOWEXTEX* PEMRSCALEWINDOWEXTEX;
3065 
3066 struct EMRSELECTOBJECT {
3067 	EMR emr;
3068 	DWORD ihObject;
3069 }
3070 alias EMRSELECTOBJECT* PEMRSELECTOBJECT;
3071 alias TypeDef!(EMRSELECTOBJECT) EMRDELETEOBJECT;
3072 alias EMRDELETEOBJECT* PEMRDELETEOBJECT;
3073 
3074 struct EMRSELECTPALETTE {
3075 	EMR emr;
3076 	DWORD ihPal;
3077 }
3078 alias EMRSELECTPALETTE* PEMRSELECTPALETTE;
3079 
3080 struct EMRSETARCDIRECTION {
3081 	EMR emr;
3082 	DWORD iArcDirection;
3083 }
3084 alias EMRSETARCDIRECTION* PEMRSETARCDIRECTION;
3085 
3086 struct EMRSETTEXTCOLOR {
3087 	EMR emr;
3088 	COLORREF crColor;
3089 }
3090 alias EMRSETTEXTCOLOR* PEMRSETTEXTCOLOR;
3091 alias TypeDef!(EMRSETTEXTCOLOR) EMRSETBKCOLOR;
3092 alias EMRSETBKCOLOR* PEMRSETBKCOLOR;
3093 
3094 struct EMRSETCOLORADJUSTMENT {
3095 	EMR emr;
3096 	COLORADJUSTMENT ColorAdjustment;
3097 }
3098 alias EMRSETCOLORADJUSTMENT* PEMRSETCOLORADJUSTMENT;
3099 
3100 struct EMRSETDIBITSTODEVICE {
3101 	EMR emr;
3102 	RECTL rclBounds;
3103 	LONG xDest;
3104 	LONG yDest;
3105 	LONG xSrc;
3106 	LONG ySrc;
3107 	LONG cxSrc;
3108 	LONG cySrc;
3109 	DWORD offBmiSrc;
3110 	DWORD cbBmiSrc;
3111 	DWORD offBitsSrc;
3112 	DWORD cbBitsSrc;
3113 	DWORD iUsageSrc;
3114 	DWORD iStartScan;
3115 	DWORD cScans;
3116 }
3117 alias EMRSETDIBITSTODEVICE* PEMRSETDIBITSTODEVICE;
3118 
3119 struct EMRSETMAPPERFLAGS {
3120 	EMR emr;
3121 	DWORD dwFlags;
3122 }
3123 alias EMRSETMAPPERFLAGS* PEMRSETMAPPERFLAGS;
3124 
3125 struct EMRSETMITERLIMIT {
3126 	EMR emr;
3127 	FLOAT eMiterLimit;
3128 }
3129 alias EMRSETMITERLIMIT* PEMRSETMITERLIMIT;
3130 
3131 struct EMRSETPALETTEENTRIES {
3132 	EMR emr;
3133 	DWORD ihPal;
3134 	DWORD iStart;
3135 	DWORD cEntries;
3136 	PALETTEENTRY[1] aPalEntries;
3137 }
3138 alias EMRSETPALETTEENTRIES* PEMRSETPALETTEENTRIES;
3139 
3140 struct EMRSETPIXELV {
3141 	EMR emr;
3142 	POINTL ptlPixel;
3143 	COLORREF crColor;
3144 }
3145 alias EMRSETPIXELV* PEMRSETPIXELV;
3146 
3147 struct EMRSETVIEWPORTEXTEX {
3148 	EMR emr;
3149 	SIZEL szlExtent;
3150 }
3151 alias EMRSETVIEWPORTEXTEX* PEMRSETVIEWPORTEXTEX;
3152 alias TypeDef!(EMRSETVIEWPORTEXTEX) EMRSETWINDOWEXTEX;
3153 alias EMRSETWINDOWEXTEX* PEMRSETWINDOWEXTEX;
3154 
3155 struct EMRSETVIEWPORTORGEX {
3156 	EMR emr;
3157 	POINTL ptlOrigin;
3158 }
3159 alias EMRSETVIEWPORTORGEX* PEMRSETVIEWPORTORGEX;
3160 alias TypeDef!(EMRSETVIEWPORTORGEX) EMRSETWINDOWORGEX;
3161 alias EMRSETWINDOWORGEX* PEMRSETWINDOWORGEX;
3162 alias TypeDef!(EMRSETVIEWPORTORGEX) EMRSETBRUSHORGEX;
3163 alias EMRSETBRUSHORGEX* PEMRSETBRUSHORGEX;
3164 
3165 struct EMRSETWORLDTRANSFORM {
3166 	EMR emr;
3167 	XFORM xform;
3168 }
3169 alias EMRSETWORLDTRANSFORM* PEMRSETWORLDTRANSFORM;
3170 
3171 struct EMRSTRETCHBLT {
3172 	EMR emr;
3173 	RECTL rclBounds;
3174 	LONG xDest;
3175 	LONG yDest;
3176 	LONG cxDest;
3177 	LONG cyDest;
3178 	DWORD dwRop;
3179 	LONG xSrc;
3180 	LONG ySrc;
3181 	XFORM xformSrc;
3182 	COLORREF crBkColorSrc;
3183 	DWORD iUsageSrc;
3184 	DWORD offBmiSrc;
3185 	DWORD cbBmiSrc;
3186 	DWORD offBitsSrc;
3187 	DWORD cbBitsSrc;
3188 	LONG cxSrc;
3189 	LONG cySrc;
3190 }
3191 alias EMRSTRETCHBLT* PEMRSTRETCHBLT;
3192 
3193 struct EMRSTRETCHDIBITS {
3194 	EMR emr;
3195 	RECTL rclBounds;
3196 	LONG xDest;
3197 	LONG yDest;
3198 	LONG xSrc;
3199 	LONG ySrc;
3200 	LONG cxSrc;
3201 	LONG cySrc;
3202 	DWORD offBmiSrc;
3203 	DWORD cbBmiSrc;
3204 	DWORD offBitsSrc;
3205 	DWORD cbBitsSrc;
3206 	DWORD iUsageSrc;
3207 	DWORD dwRop;
3208 	LONG cxDest;
3209 	LONG cyDest;
3210 }
3211 alias EMRSTRETCHDIBITS* PEMRSTRETCHDIBITS;
3212 
3213 struct EMRABORTPATH {
3214 	EMR emr;
3215 }
3216 alias EMRABORTPATH* PEMRABORTPATH;
3217 alias TypeDef!(EMRABORTPATH) EMRBEGINPATH;
3218 alias EMRBEGINPATH* PEMRBEGINPATH;
3219 alias TypeDef!(EMRABORTPATH) EMRENDPATH;
3220 alias EMRENDPATH* PEMRENDPATH;
3221 alias TypeDef!(EMRABORTPATH) EMRCLOSEFIGURE;
3222 alias EMRCLOSEFIGURE* PEMRCLOSEFIGURE;
3223 alias TypeDef!(EMRABORTPATH) EMRFLATTENPATH;
3224 alias EMRFLATTENPATH* PEMRFLATTENPATH;
3225 alias TypeDef!(EMRABORTPATH) EMRWIDENPATH;
3226 alias EMRWIDENPATH* PEMRWIDENPATH;
3227 alias TypeDef!(EMRABORTPATH) EMRSETMETARGN;
3228 alias EMRSETMETARGN* PEMRSETMETARGN;
3229 alias TypeDef!(EMRABORTPATH) EMRSAVEDC;
3230 alias EMRSAVEDC* PEMRSAVEDC;
3231 alias TypeDef!(EMRABORTPATH) EMRREALIZEPALETTE;
3232 alias EMRREALIZEPALETTE* PEMRREALIZEPALETTE;
3233 
3234 struct EMRSELECTCLIPPATH {
3235 	EMR emr;
3236 	DWORD iMode;
3237 }
3238 alias EMRSELECTCLIPPATH* PEMRSELECTCLIPPATH;
3239 alias TypeDef!(EMRSELECTCLIPPATH) EMRSETBKMODE;
3240 alias EMRSETBKMODE* PEMRSETBKMODE;
3241 alias TypeDef!(EMRSELECTCLIPPATH) EMRSETMAPMODE;
3242 alias EMRSETMAPMODE* PEMRSETMAPMODE;
3243 alias TypeDef!(EMRSELECTCLIPPATH) EMRSETPOLYFILLMODE;
3244 alias EMRSETPOLYFILLMODE* PEMRSETPOLYFILLMODE;
3245 alias TypeDef!(EMRSELECTCLIPPATH) EMRSETROP2;
3246 alias EMRSETROP2* PEMRSETROP2;
3247 alias TypeDef!(EMRSELECTCLIPPATH) EMRSETSTRETCHBLTMODE;
3248 alias EMRSETSTRETCHBLTMODE* PEMRSETSTRETCHBLTMODE;
3249 alias TypeDef!(EMRSELECTCLIPPATH) EMRSETICMMODE;
3250 alias EMRSETICMMODE* PEMRSETICMMODE;
3251 alias TypeDef!(EMRSELECTCLIPPATH) EMRSETTEXTALIGN;
3252 alias EMRSETTEXTALIGN* PEMRSETTEXTALIGN;
3253 alias TypeDef!(EMRSELECTCLIPPATH) EMRENABLEICM;
3254 alias EMRENABLEICM* PEMRENABLEICM;
3255 static if (_WIN32_WINNT >= 0x500) {
3256 	alias TypeDef!(EMRSELECTCLIPPATH) EMRSETLAYOUT;
3257 	alias EMRSETLAYOUT* PEMRSETLAYOUT;
3258 }
3259 
3260 align(2):
3261 struct METAHEADER {
3262 	WORD mtType;
3263 	WORD mtHeaderSize;
3264 	WORD mtVersion;
3265 	DWORD mtSize;
3266 	WORD mtNoObjects;
3267 	DWORD mtMaxRecord;
3268 	WORD mtNoParameters;
3269 }
3270 alias METAHEADER* PMETAHEADER;
3271 alias METAHEADER* LPMETAHEADER;
3272 
3273 align:
3274 
3275 struct ENHMETAHEADER {
3276 	DWORD iType = EMR_HEADER;
3277 	DWORD nSize = ENHMETAHEADER.sizeof;
3278 	RECTL rclBounds;
3279 	RECTL rclFrame;
3280 	DWORD dSignature = ENHMETA_SIGNATURE;
3281 	DWORD nVersion;
3282 	DWORD nBytes;
3283 	DWORD nRecords;
3284 	WORD nHandles;
3285 	WORD sReserved;
3286 	DWORD nDescription;
3287 	DWORD offDescription;
3288 	DWORD nPalEntries;
3289 	SIZEL szlDevice;
3290 	SIZEL szlMillimeters;
3291 	DWORD cbPixelFormat;
3292 	DWORD offPixelFormat;
3293 	DWORD bOpenGL;
3294 	static if (_WIN32_WINNT >= 0x500) {
3295 		SIZEL szlMicrometers;
3296 	}
3297 }
3298 alias ENHMETAHEADER* PENHMETAHEADER, LPENHMETAHEADER;
3299 
3300 struct METARECORD {
3301 	DWORD rdSize;
3302 	WORD rdFunction;
3303 	WORD[1] rdParm;
3304 }
3305 alias METARECORD* PMETARECORD;
3306 alias METARECORD* LPMETARECORD;
3307 
3308 struct ENHMETARECORD {
3309 	DWORD iType;
3310 	DWORD nSize;
3311 	DWORD[1] dParm;
3312 }
3313 alias ENHMETARECORD* PENHMETARECORD, LPENHMETARECORD;
3314 
3315 // ---
3316 
3317 struct HANDLETABLE {
3318 	HGDIOBJ[1] objectHandle;
3319 }
3320 alias HANDLETABLE* PHANDLETABLE, LPHANDLETABLE;
3321 
3322 struct TEXTMETRICA {
3323 	LONG tmHeight;
3324 	LONG tmAscent;
3325 	LONG tmDescent;
3326 	LONG tmInternalLeading;
3327 	LONG tmExternalLeading;
3328 	LONG tmAveCharWidth;
3329 	LONG tmMaxCharWidth;
3330 	LONG tmWeight;
3331 	LONG tmOverhang;
3332 	LONG tmDigitizedAspectX;
3333 	LONG tmDigitizedAspectY;
3334 	BYTE tmFirstChar;
3335 	BYTE tmLastChar;
3336 	BYTE tmDefaultChar;
3337 	BYTE tmBreakChar;
3338 	BYTE tmItalic;
3339 	BYTE tmUnderlined;
3340 	BYTE tmStruckOut;
3341 	BYTE tmPitchAndFamily;
3342 	BYTE tmCharSet;
3343 }
3344 alias TEXTMETRICA* PTEXTMETRICA, NPTEXTMETRICA, LPTEXTMETRICA;
3345 
3346 struct TEXTMETRICW {
3347 	LONG tmHeight;
3348 	LONG tmAscent;
3349 	LONG tmDescent;
3350 	LONG tmInternalLeading;
3351 	LONG tmExternalLeading;
3352 	LONG tmAveCharWidth;
3353 	LONG tmMaxCharWidth;
3354 	LONG tmWeight;
3355 	LONG tmOverhang;
3356 	LONG tmDigitizedAspectX;
3357 	LONG tmDigitizedAspectY;
3358 	WCHAR tmFirstChar;
3359 	WCHAR tmLastChar;
3360 	WCHAR tmDefaultChar;
3361 	WCHAR tmBreakChar;
3362 	BYTE tmItalic;
3363 	BYTE tmUnderlined;
3364 	BYTE tmStruckOut;
3365 	BYTE tmPitchAndFamily;
3366 	BYTE tmCharSet;
3367 }
3368 alias TEXTMETRICW* PTEXTMETRICW, NPTEXTMETRICW, LPTEXTMETRICW;
3369 
3370 struct RGNDATAHEADER {
3371 	DWORD dwSize;
3372 	DWORD iType;
3373 	DWORD nCount;
3374 	DWORD nRgnSize;
3375 	RECT rcBound;
3376 }
3377 alias RGNDATAHEADER* PRGNDATAHEADER;
3378 
3379 struct RGNDATA {
3380 	RGNDATAHEADER rdh;
3381 	char[1] Buffer;
3382 }
3383 alias RGNDATA* PRGNDATA, NPRGNDATA, LPRGNDATA;
3384 
3385 /* for GetRandomRgn */
3386 const SYSRGN=4;
3387 struct GCP_RESULTSA {
3388 	DWORD lStructSize;
3389 	LPSTR lpOutString;
3390 	UINT* lpOrder;
3391 	INT* lpDx;
3392 	INT* lpCaretPos;
3393 	LPSTR lpClass;
3394 	LPWSTR lpGlyphs;
3395 	UINT nGlyphs;
3396 	UINT nMaxFit;
3397 }
3398 alias GCP_RESULTSA* LPGCP_RESULTSA;
3399 
3400 struct GCP_RESULTSW {
3401 	DWORD lStructSize;
3402 	LPWSTR lpOutString;
3403 	UINT* lpOrder;
3404 	INT* lpDx;
3405 	INT* lpCaretPos;
3406 	LPWSTR lpClass;
3407 	LPWSTR lpGlyphs;
3408 	UINT nGlyphs;
3409 	UINT nMaxFit;
3410 }
3411 alias GCP_RESULTSW* LPGCP_RESULTSW;
3412 
3413 struct GLYPHMETRICS {
3414 	UINT gmBlackBoxX;
3415 	UINT gmBlackBoxY;
3416 	POINT gmptGlyphOrigin;
3417 	short gmCellIncX;
3418 	short gmCellIncY;
3419 }
3420 alias GLYPHMETRICS* LPGLYPHMETRICS;
3421 
3422 static if (_WIN32_WINNT >= 0x500) {
3423 	struct WCRANGE {
3424 		WCHAR  wcLow;
3425 		USHORT cGlyphs;
3426 	}
3427 	alias WCRANGE* PWCRANGE, LPWCRANGE;
3428 
3429 	struct GLYPHSET {
3430 		DWORD cbThis;
3431 		DWORD flAccel;
3432 		DWORD cGlyphsSupported;
3433 		DWORD cRanges;
3434 		WCRANGE[1] ranges;
3435 	}
3436 	alias GLYPHSET* PGLYPHSET, LPGLYPHSET;
3437 
3438 	const DWORD GS_8BIT_INDICES = 0x00000001;
3439 }
3440 
3441 struct KERNINGPAIR {
3442 	WORD wFirst;
3443 	WORD wSecond;
3444 	int iKernAmount;
3445 }
3446 alias KERNINGPAIR* LPKERNINGPAIR;
3447 
3448 struct FIXED {
3449 	WORD fract;
3450 	short value;
3451 }
3452 
3453 struct MAT2 {
3454 	FIXED eM11;
3455 	FIXED eM12;
3456 	FIXED eM21;
3457 	FIXED eM22;
3458 }
3459 alias MAT2* LPMAT2;
3460 
3461 struct OUTLINETEXTMETRICA {
3462 	UINT otmSize;
3463 	TEXTMETRICA otmTextMetrics;
3464 	BYTE otmFiller;
3465 	PANOSE otmPanoseNumber;
3466 	UINT otmfsSelection;
3467 	UINT otmfsType;
3468 	int otmsCharSlopeRise;
3469 	int otmsCharSlopeRun;
3470 	int otmItalicAngle;
3471 	UINT otmEMSquare;
3472 	int otmAscent;
3473 	int otmDescent;
3474 	UINT otmLineGap;
3475 	UINT otmsCapEmHeight;
3476 	UINT otmsXHeight;
3477 	RECT otmrcFontBox;
3478 	int otmMacAscent;
3479 	int otmMacDescent;
3480 	UINT otmMacLineGap;
3481 	UINT otmusMinimumPPEM;
3482 	POINT otmptSubscriptSize;
3483 	POINT otmptSubscriptOffset;
3484 	POINT otmptSuperscriptSize;
3485 	POINT otmptSuperscriptOffset;
3486 	UINT otmsStrikeoutSize;
3487 	int otmsStrikeoutPosition;
3488 	int otmsUnderscoreSize;
3489 	int otmsUnderscorePosition;
3490 	PSTR otmpFamilyName;
3491 	PSTR otmpFaceName;
3492 	PSTR otmpStyleName;
3493 	PSTR otmpFullName;
3494 }
3495 alias OUTLINETEXTMETRICA* POUTLINETEXTMETRICA, NPOUTLINETEXTMETRICA, LPOUTLINETEXTMETRICA;
3496 
3497 struct OUTLINETEXTMETRICW {
3498 	UINT otmSize;
3499 	TEXTMETRICW otmTextMetrics;
3500 	BYTE otmFiller;
3501 	PANOSE otmPanoseNumber;
3502 	UINT otmfsSelection;
3503 	UINT otmfsType;
3504 	int otmsCharSlopeRise;
3505 	int otmsCharSlopeRun;
3506 	int otmItalicAngle;
3507 	UINT otmEMSquare;
3508 	int otmAscent;
3509 	int otmDescent;
3510 	UINT otmLineGap;
3511 	UINT otmsCapEmHeight;
3512 	UINT otmsXHeight;
3513 	RECT otmrcFontBox;
3514 	int otmMacAscent;
3515 	int otmMacDescent;
3516 	UINT otmMacLineGap;
3517 	UINT otmusMinimumPPEM;
3518 	POINT otmptSubscriptSize;
3519 	POINT otmptSubscriptOffset;
3520 	POINT otmptSuperscriptSize;
3521 	POINT otmptSuperscriptOffset;
3522 	UINT otmsStrikeoutSize;
3523 	int otmsStrikeoutPosition;
3524 	int otmsUnderscoreSize;
3525 	int otmsUnderscorePosition;
3526 	PSTR otmpFamilyName;
3527 	PSTR otmpFaceName;
3528 	PSTR otmpStyleName;
3529 	PSTR otmpFullName;
3530 }
3531 alias OUTLINETEXTMETRICW* POUTLINETEXTMETRICW, NPOUTLINETEXTMETRICW, LPOUTLINETEXTMETRICW;
3532 
3533 struct RASTERIZER_STATUS {
3534 	short nSize;
3535 	short wFlags;
3536 	short nLanguageID;
3537 }
3538 alias RASTERIZER_STATUS* LPRASTERIZER_STATUS;
3539 
3540 struct POLYTEXTA {
3541 	int x;
3542 	int y;
3543 	UINT n;
3544 	LPCSTR lpstr;
3545 	UINT uiFlags;
3546 	RECT rcl;
3547 	int* pdx;
3548 }
3549 alias POLYTEXTA* PPOLYTEXTA, NPPOLYTEXTA, LPPOLYTEXTA;
3550 
3551 struct POLYTEXTW {
3552 	int x;
3553 	int y;
3554 	UINT n;
3555 	LPCWSTR lpstr;
3556 	UINT uiFlags;
3557 	RECT rcl;
3558 	int* pdx;
3559 }
3560 alias POLYTEXTW* PPOLYTEXTW, NPPOLYTEXTW, LPPOLYTEXTW;
3561 
3562 struct PIXELFORMATDESCRIPTOR {
3563 	WORD nSize;
3564 	WORD nVersion;
3565 	DWORD dwFlags;
3566 	BYTE iPixelType;
3567 	BYTE cColorBits;
3568 	BYTE cRedBits;
3569 	BYTE cRedShift;
3570 	BYTE cGreenBits;
3571 	BYTE cGreenShift;
3572 	BYTE cBlueBits;
3573 	BYTE cBlueShift;
3574 	BYTE cAlphaBits;
3575 	BYTE cAlphaShift;
3576 	BYTE cAccumBits;
3577 	BYTE cAccumRedBits;
3578 	BYTE cAccumGreenBits;
3579 	BYTE cAccumBlueBits;
3580 	BYTE cAccumAlphaBits;
3581 	BYTE cDepthBits;
3582 	BYTE cStencilBits;
3583 	BYTE cAuxBuffers;
3584 	BYTE iLayerType;
3585 	BYTE bReserved;
3586 	DWORD dwLayerMask;
3587 	DWORD dwVisibleMask;
3588 	DWORD dwDamageMask;
3589 }
3590 alias PIXELFORMATDESCRIPTOR* PPIXELFORMATDESCRIPTOR, LPPIXELFORMATDESCRIPTOR;
3591 
3592 struct METAFILEPICT {
3593 	LONG mm;
3594 	LONG xExt;
3595 	LONG yExt;
3596 	HMETAFILE hMF;
3597 }
3598 alias METAFILEPICT* LPMETAFILEPICT;
3599 
3600 struct LOCALESIGNATURE {
3601 	DWORD[4] lsUsb;
3602 	DWORD[2] lsCsbDefault;
3603 	DWORD[2] lsCsbSupported;
3604 }
3605 alias LOCALESIGNATURE* PLOCALESIGNATURE, LPLOCALESIGNATURE;
3606 
3607 alias LONG LCSTYPE; /* What this for? */
3608 
3609 align(4):
3610 struct NEWTEXTMETRICA {
3611 	LONG tmHeight;
3612 	LONG tmAscent;
3613 	LONG tmDescent;
3614 	LONG tmInternalLeading;
3615 	LONG tmExternalLeading;
3616 	LONG tmAveCharWidth;
3617 	LONG tmMaxCharWidth;
3618 	LONG tmWeight;
3619 	LONG tmOverhang;
3620 	LONG tmDigitizedAspectX;
3621 	LONG tmDigitizedAspectY;
3622 	BYTE tmFirstChar;
3623 	BYTE tmLastChar;
3624 	BYTE tmDefaultChar;
3625 	BYTE tmBreakChar;
3626 	BYTE tmItalic;
3627 	BYTE tmUnderlined;
3628 	BYTE tmStruckOut;
3629 	BYTE tmPitchAndFamily;
3630 	BYTE tmCharSet;
3631 	DWORD ntmFlags;
3632 	UINT ntmSizeEM;
3633 	UINT ntmCellHeight;
3634 	UINT ntmAvgWidth;
3635 }
3636 alias NEWTEXTMETRICA* PNEWTEXTMETRICA, NPNEWTEXTMETRICA, LPNEWTEXTMETRICA;
3637 
3638 struct NEWTEXTMETRICW {
3639 	LONG tmHeight;
3640 	LONG tmAscent;
3641 	LONG tmDescent;
3642 	LONG tmInternalLeading;
3643 	LONG tmExternalLeading;
3644 	LONG tmAveCharWidth;
3645 	LONG tmMaxCharWidth;
3646 	LONG tmWeight;
3647 	LONG tmOverhang;
3648 	LONG tmDigitizedAspectX;
3649 	LONG tmDigitizedAspectY;
3650 	WCHAR tmFirstChar;
3651 	WCHAR tmLastChar;
3652 	WCHAR tmDefaultChar;
3653 	WCHAR tmBreakChar;
3654 	BYTE tmItalic;
3655 	BYTE tmUnderlined;
3656 	BYTE tmStruckOut;
3657 	BYTE tmPitchAndFamily;
3658 	BYTE tmCharSet;
3659 	DWORD ntmFlags;
3660 	UINT ntmSizeEM;
3661 	UINT ntmCellHeight;
3662 	UINT ntmAvgWidth;
3663 }
3664 alias NEWTEXTMETRICW* PNEWTEXTMETRICW, NPNEWTEXTMETRICW, LPNEWTEXTMETRICW;
3665 
3666 align:
3667 struct NEWTEXTMETRICEXA {
3668 	NEWTEXTMETRICA ntmTm;
3669 	FONTSIGNATURE ntmFontSig;
3670 }
3671 
3672 struct NEWTEXTMETRICEXW {
3673 	NEWTEXTMETRICW ntmTm;
3674 	FONTSIGNATURE ntmFontSig;
3675 }
3676 
3677 struct PELARRAY {
3678 	LONG paXCount;
3679 	LONG paYCount;
3680 	LONG paXExt;
3681 	LONG paYExt;
3682 	BYTE paRGBs;
3683 }
3684 alias PELARRAY* PPELARRAY, NPPELARRAY, LPPELARRAY;
3685 
3686 struct ENUMLOGFONTA {
3687 	LOGFONTA elfLogFont;
3688 	BYTE[LF_FULLFACESIZE] elfFullName;
3689 	BYTE[LF_FACESIZE] elfStyle;
3690 }
3691 alias ENUMLOGFONTA* LPENUMLOGFONTA;
3692 
3693 struct ENUMLOGFONTW {
3694 	LOGFONTW elfLogFont;
3695 	WCHAR[LF_FULLFACESIZE] elfFullName;
3696 	WCHAR[LF_FACESIZE] elfStyle;
3697 }
3698 alias ENUMLOGFONTW* LPENUMLOGFONTW;
3699 
3700 struct ENUMLOGFONTEXA {
3701 	LOGFONTA elfLogFont;
3702 	BYTE[LF_FULLFACESIZE] elfFullName;
3703 	BYTE[LF_FACESIZE] elfStyle;
3704 	BYTE[LF_FACESIZE] elfScript;
3705 }
3706 alias ENUMLOGFONTEXA* LPENUMLOGFONTEXA;
3707 
3708 struct ENUMLOGFONTEXW {
3709 	LOGFONTW elfLogFont;
3710 	WCHAR[LF_FULLFACESIZE] elfFullName;
3711 	WCHAR[LF_FACESIZE] elfStyle;
3712 	WCHAR[LF_FACESIZE] elfScript;
3713 }
3714 alias ENUMLOGFONTEXW* LPENUMLOGFONTEXW;
3715 
3716 struct POINTFX {
3717 	FIXED x;
3718 	FIXED y;
3719 }
3720 alias POINTFX* LPPOINTFX;
3721 
3722 struct TTPOLYCURVE {
3723 	WORD wType;
3724 	WORD cpfx;
3725 	POINTFX[1] apfx;
3726 }
3727 alias TTPOLYCURVE* LPTTPOLYCURVE;
3728 
3729 struct TTPOLYGONHEADER {
3730 	DWORD cb;
3731 	DWORD dwType;
3732 	POINTFX pfxStart;
3733 }
3734 alias TTPOLYGONHEADER* LPTTPOLYGONHEADER;
3735 
3736 struct POINTFLOAT {
3737 	FLOAT x;
3738 	FLOAT y;
3739 }
3740 alias POINTFLOAT* PPOINTFLOAT;
3741 
3742 struct GLYPHMETRICSFLOAT {
3743 	FLOAT gmfBlackBoxX;
3744 	FLOAT gmfBlackBoxY;
3745 	POINTFLOAT gmfptGlyphOrigin;
3746 	FLOAT gmfCellIncX;
3747 	FLOAT gmfCellIncY;
3748 }
3749 alias GLYPHMETRICSFLOAT* PGLYPHMETRICSFLOAT, LPGLYPHMETRICSFLOAT;
3750 
3751 struct LAYERPLANEDESCRIPTOR {
3752 	WORD nSize;
3753 	WORD nVersion;
3754 	DWORD dwFlags;
3755 	BYTE iPixelType;
3756 	BYTE cColorBits;
3757 	BYTE cRedBits;
3758 	BYTE cRedShift;
3759 	BYTE cGreenBits;
3760 	BYTE cGreenShift;
3761 	BYTE cBlueBits;
3762 	BYTE cBlueShift;
3763 	BYTE cAlphaBits;
3764 	BYTE cAlphaShift;
3765 	BYTE cAccumBits;
3766 	BYTE cAccumRedBits;
3767 	BYTE cAccumGreenBits;
3768 	BYTE cAccumBlueBits;
3769 	BYTE cAccumAlphaBits;
3770 	BYTE cDepthBits;
3771 	BYTE cStencilBits;
3772 	BYTE cAuxBuffers;
3773 	BYTE iLayerPlane;
3774 	BYTE bReserved;
3775 	COLORREF crTransparent;
3776 }
3777 alias LAYERPLANEDESCRIPTOR* PLAYERPLANEDESCRIPTOR, LPLAYERPLANEDESCRIPTOR;
3778 
3779 struct BLENDFUNCTION {
3780 	BYTE BlendOp;
3781 	BYTE BlendFlags;
3782 	BYTE SourceConstantAlpha;
3783 	BYTE AlphaFormat;
3784 }
3785 alias BLENDFUNCTION* PBLENDFUNCTION, LPBLENDFUNCTION;
3786 
3787 const MM_MAX_NUMAXES = 16;
3788 
3789 struct DESIGNVECTOR {
3790 	DWORD dvReserved;
3791 	DWORD dvNumAxes;
3792 	LONG[MM_MAX_NUMAXES] dvValues;
3793 }
3794 alias DESIGNVECTOR* PDESIGNVECTOR, LPDESIGNVECTOR;
3795 const STAMP_DESIGNVECTOR = 0x8000000 + 'd' + ('v' << 8);
3796 const STAMP_AXESLIST     = 0x8000000 + 'a' + ('l' << 8);
3797 
3798 static if (_WIN32_WINNT >= 0x500) {
3799 
3800 	const MM_MAX_AXES_NAMELEN = 16;
3801 
3802 	struct AXISINFOA {
3803 		LONG axMinValue;
3804 		LONG axMaxValue;
3805 		BYTE[MM_MAX_AXES_NAMELEN] axAxisName;
3806 	}
3807 	alias AXISINFOA* PAXISINFOA, LPAXISINFOA;
3808 
3809 	struct AXISINFOW {
3810 		LONG axMinValue;
3811 		LONG axMaxValue;
3812 		WCHAR[MM_MAX_AXES_NAMELEN] axAxisName;
3813 	}
3814 	alias AXISINFOW* PAXISINFOW, LPAXISINFOW;
3815 
3816 	version (Unicode) {
3817 		alias AXISINFOW AXISINFO;
3818 		alias PAXISINFOW PAXISINFO;
3819 		alias LPAXISINFOW LPAXISINFO;
3820 	}
3821 	else {
3822 		alias AXISINFOA AXISINFO;
3823 		alias PAXISINFOA PAXISINFO;
3824 		alias LPAXISINFOA LPAXISINFO;
3825 	}
3826 
3827 	struct AXESLISTA {
3828 		DWORD axlReserved;
3829 		DWORD axlNumAxes;
3830 		AXISINFOA[MM_MAX_NUMAXES] axlAxisInfo;
3831 	}
3832 	alias AXESLISTA* PAXESLISTA, LPAXESLISTA;
3833 
3834 	struct AXESLISTW {
3835 		DWORD axlReserved;
3836 		DWORD axlNumAxes;
3837 		AXISINFOW[MM_MAX_NUMAXES] axlAxisInfo;
3838 	}
3839 	alias AXESLISTW* PAXESLISTW, LPAXESLISTW;
3840 
3841 	version (Unicode) {
3842 		alias AXESLISTW AXESLIST;
3843 		alias PAXESLISTW PAXESLIST;
3844 		alias LPAXESLISTW LPAXESLIST;
3845 	}
3846 	else {
3847 		alias AXESLISTA AXESLIST;
3848 		alias PAXESLISTA PAXESLIST;
3849 		alias LPAXESLISTA LPAXESLIST;
3850 	}
3851 
3852 	struct ENUMLOGFONTEXDVA {
3853 		ENUMLOGFONTEXA elfEnumLogfontEx;
3854 		DESIGNVECTOR   elfDesignVector;
3855 	}
3856 	alias ENUMLOGFONTEXDVA* PENUMLOGFONTEXDVA, LPENUMLOGFONTEXDVA;
3857 
3858 	struct ENUMLOGFONTEXDVW {
3859 		ENUMLOGFONTEXW elfEnumLogfontEx;
3860 		DESIGNVECTOR   elfDesignVector;
3861 	}
3862 	alias ENUMLOGFONTEXDVW* PENUMLOGFONTEXDVW, LPENUMLOGFONTEXDVW;
3863 
3864 	HFONT CreateFontIndirectExA(const(ENUMLOGFONTEXDVA)*);
3865 	HFONT CreateFontIndirectExW(const(ENUMLOGFONTEXDVW)*);
3866 	version (Unicode)
3867 		alias CreateFontIndirectExW CreateFontIndirectEx;
3868 	else
3869 		alias CreateFontIndirectExA CreateFontIndirectEx;
3870 
3871 	struct ENUMTEXTMETRICA {
3872 		NEWTEXTMETRICEXA etmNewTextMetricEx;
3873 		AXESLISTA etmAxesList;
3874 	}
3875 	alias ENUMTEXTMETRICA* PENUMTEXTMETRICA, LPENUMTEXTMETRICA;
3876 
3877 	struct ENUMTEXTMETRICW {
3878 		NEWTEXTMETRICEXW etmNewTextMetricEx;
3879 		AXESLISTW etmAxesList;
3880 	}
3881 	alias ENUMTEXTMETRICW* PENUMTEXTMETRICW, LPENUMTEXTMETRICW;
3882 
3883 	version (Unicode) {
3884 		alias ENUMTEXTMETRICW ENUMTEXTMETRIC;
3885 		alias PENUMTEXTMETRICW PENUMTEXTMETRIC;
3886 		alias LPENUMTEXTMETRICW LPENUMTEXTMETRIC;
3887 	}
3888 	else {
3889 		alias ENUMTEXTMETRICA ENUMTEXTMETRIC;
3890 		alias PENUMTEXTMETRICA PENUMTEXTMETRIC;
3891 		alias LPENUMTEXTMETRICA LPENUMTEXTMETRIC;
3892 	}
3893 } /* _WIN32_WINNT >= 0x500 */
3894 
3895 struct GRADIENT_TRIANGLE {
3896 	ULONG Vertex1;
3897 	ULONG Vertex2;
3898 	ULONG Vertex3;
3899 }
3900 alias GRADIENT_TRIANGLE* PGRADIENT_TRIANGLE, LPGRADIENT_TRIANGLE;
3901 
3902 struct GRADIENT_RECT {
3903 	ULONG UpperLeft;
3904 	ULONG LowerRight;
3905 }
3906 alias GRADIENT_RECT* PGRADIENT_RECT, LPGRADIENT_RECT;
3907 
3908 struct DISPLAY_DEVICEA {
3909 	DWORD cb;
3910 	CHAR[32] DeviceName;
3911 	CHAR[128] DeviceString;
3912 	DWORD StateFlags;
3913 	CHAR[128] DeviceID;
3914 	CHAR[128] DeviceKey;
3915 }
3916 alias DISPLAY_DEVICEA* PDISPLAY_DEVICEA, LPDISPLAY_DEVICEA;
3917 
3918 struct DISPLAY_DEVICEW {
3919 	DWORD cb;
3920 	WCHAR[32] DeviceName;
3921 	WCHAR[128] DeviceString;
3922 	DWORD StateFlags;
3923 	WCHAR[128] DeviceID;
3924 	WCHAR[128] DeviceKey;
3925 }
3926 alias DISPLAY_DEVICEW* PDISPLAY_DEVICEW, LPDISPLAY_DEVICEW;
3927 
3928 struct DRAWPATRECT {
3929 	POINT ptPosition;
3930 	POINT ptSize;
3931 	WORD wStyle;
3932 	WORD wPattern;
3933 }
3934 alias DRAWPATRECT* PDRAWPATRECT;
3935 
3936 // ---------
3937 // Callbacks
3938 
3939 alias BOOL function (HDC, int) ABORTPROC;
3940 alias int function (HDC, HANDLETABLE*, METARECORD*, int, LPARAM) MFENUMPROC;
3941 alias int function (HDC, HANDLETABLE*, const(ENHMETARECORD)*, int, LPARAM) ENHMFENUMPROC;
3942 alias int function (const(LOGFONTA)*, const(TEXTMETRICA)*, DWORD, LPARAM) FONTENUMPROCA, OLDFONTENUMPROCA;
3943 alias int function (const(LOGFONTW)*, const(TEXTMETRICW)*, DWORD, LPARAM) FONTENUMPROCW, OLDFONTENUMPROCW;
3944 alias int function (LPSTR, LPARAM) ICMENUMPROCA;
3945 alias int function (LPWSTR, LPARAM) ICMENUMPROCW;
3946 alias void function (LPVOID, LPARAM) GOBJENUMPROC;
3947 alias void function (int, int, LPARAM) LINEDDAPROC;
3948 alias UINT function (HWND, HMODULE, LPDEVMODEA, LPSTR, LPSTR, LPDEVMODEA, LPSTR, UINT) LPFNDEVMODE;
3949 alias DWORD function (LPSTR, LPSTR, UINT, LPSTR, LPDEVMODEA) LPFNDEVCAPS;
3950 
3951 
3952 // ---------
3953 // C Macros.
3954 // FIXME:
3955 //POINTS MAKEPOINTS(DWORD dwValue) #define MAKEPOINTS(l) (*((POINTS*)&(l)))
3956 
3957 DWORD MAKEROP4(DWORD fore, DWORD back) {
3958 	return ((back<<8) & 0xFF000000) | (fore);
3959 }
3960 
3961 COLORREF CMYK(BYTE c, BYTE m, BYTE y, BYTE k) {
3962 	return cast(COLORREF)(k | (y << 8) | (m << 16) | (c << 24));
3963 }
3964 
3965 BYTE GetCValue(COLORREF cmyk) {
3966 	return cast(BYTE)(cmyk >> 24);
3967 }
3968 
3969 BYTE GetMValue(COLORREF cmyk) {
3970 	return cast(BYTE)(cmyk >> 16);
3971 }
3972 
3973 BYTE GetYValue(COLORREF cmyk) {
3974 	return cast(BYTE)(cmyk >> 8);
3975 }
3976 
3977 BYTE GetKValue(COLORREF cmyk) {
3978 	return cast(BYTE)cmyk;
3979 }
3980 
3981 COLORREF RGB(BYTE r, BYTE g, BYTE b) {
3982 	return cast(COLORREF)(r | (g << 8) | (b << 16));
3983 }
3984 
3985 BYTE GetRValue(COLORREF c) {
3986 	return cast(BYTE)c;
3987 }
3988 
3989 BYTE GetGValue(COLORREF c) {
3990 	return cast(BYTE)(c >> 8);
3991 }
3992 
3993 BYTE GetBValue(COLORREF c) {
3994 	return cast(BYTE)(c >> 16);
3995 }
3996 
3997 COLORREF PALETTEINDEX(WORD i) {
3998 	return 0x01000000 | cast(COLORREF) i;
3999 }
4000 
4001 COLORREF PALETTERGB(BYTE r, BYTE g, BYTE b) {
4002 	return 0x02000000|RGB(r, g, b);
4003 }
4004 
4005 extern(Windows) {
4006 	int AbortDoc(HDC);
4007 	BOOL AbortPath(HDC);
4008 	int AddFontResourceA(LPCSTR);
4009 	int AddFontResourceW(LPCWSTR);
4010 	BOOL AngleArc(HDC, int, int, DWORD, FLOAT, FLOAT);
4011 	BOOL AnimatePalette(HPALETTE, UINT, UINT, const(PALETTEENTRY)*);
4012 	BOOL Arc(HDC, int, int, int, int, int, int, int, int);
4013 	BOOL ArcTo(HDC, int, int, int, int, int, int, int, int);
4014 	BOOL BeginPath(HDC);
4015 	BOOL BitBlt(HDC, int, int, int, int, HDC, int, int, DWORD);
4016 	BOOL CancelDC(HDC);
4017 	BOOL CheckColorsInGamut(HDC, PVOID, PVOID, DWORD);
4018 	BOOL Chord(HDC, int, int, int, int, int, int, int, int);
4019 	int ChoosePixelFormat(HDC, const(PIXELFORMATDESCRIPTOR)*);
4020 	HENHMETAFILE CloseEnhMetaFile(HDC);
4021 	BOOL CloseFigure(HDC);
4022 	HMETAFILE CloseMetaFile(HDC);
4023 	BOOL ColorMatchToTarget(HDC, HDC, DWORD);
4024 	BOOL ColorCorrectPalette(HDC, HPALETTE, DWORD, DWORD);
4025 	int CombineRgn(HRGN, HRGN, HRGN, int);
4026 	BOOL CombineTransform(LPXFORM, const(XFORM)*, const(XFORM)*);
4027 	HENHMETAFILE CopyEnhMetaFileA(HENHMETAFILE, LPCSTR);
4028 	HENHMETAFILE CopyEnhMetaFileW(HENHMETAFILE, LPCWSTR);
4029 	HMETAFILE CopyMetaFileA(HMETAFILE, LPCSTR);
4030 	HMETAFILE CopyMetaFileW(HMETAFILE, LPCWSTR);
4031 	HBITMAP CreateBitmap(int, int, UINT, UINT, PCVOID);
4032 	HBITMAP CreateBitmapIndirect(const(BITMAP)*);
4033 	HBRUSH CreateBrushIndirect(const(LOGBRUSH)*);
4034 	HCOLORSPACE CreateColorSpaceA(LPLOGCOLORSPACEA);
4035 	HCOLORSPACE CreateColorSpaceW(LPLOGCOLORSPACEW);
4036 	HBITMAP CreateCompatibleBitmap(HDC, int, int);
4037 	HDC CreateCompatibleDC(HDC);
4038 	HDC CreateDCA(LPCSTR, LPCSTR, LPCSTR, const(DEVMODEA)*);
4039 	HDC CreateDCW(LPCWSTR, LPCWSTR, LPCWSTR, const(DEVMODEW)*);
4040 	HBITMAP CreateDIBitmap(HDC, const(BITMAPINFOHEADER)*, DWORD, PCVOID, const(BITMAPINFO)*, UINT);
4041 	HBRUSH CreateDIBPatternBrush(HGLOBAL, UINT);
4042 	HBRUSH CreateDIBPatternBrushPt(PCVOID, UINT);
4043 	HBITMAP CreateDIBSection(HDC, const(BITMAPINFO)*, UINT, void**, HANDLE, DWORD);
4044 	HBITMAP CreateDiscardableBitmap(HDC, int, int);
4045 	HRGN CreateEllipticRgn(int, int, int, int);
4046 	HRGN CreateEllipticRgnIndirect(LPCRECT);
4047 	HDC CreateEnhMetaFileA(HDC, LPCSTR, LPCRECT, LPCSTR);
4048 	HDC CreateEnhMetaFileW(HDC, LPCWSTR, LPCRECT, LPCWSTR);
4049 	HFONT CreateFontA(int, int, int, int, int, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, LPCSTR);
4050 	HFONT CreateFontW(int, int, int, int, int, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, LPCWSTR);
4051 	HFONT CreateFontIndirectA(const(LOGFONTA)*);
4052 	HFONT CreateFontIndirectW(const(LOGFONTW)*);
4053 	HPALETTE CreateHalftonePalette(HDC);
4054 	HBRUSH CreateHatchBrush(int, COLORREF);
4055 	HDC CreateICA(LPCSTR, LPCSTR, LPCSTR, const(DEVMODEA)*);
4056 	HDC CreateICW(LPCWSTR, LPCWSTR, LPCWSTR, const(DEVMODEW)*);
4057 	HDC CreateMetaFileA(LPCSTR);
4058 	HDC CreateMetaFileW(LPCWSTR);
4059 	HPALETTE CreatePalette(const(LOGPALETTE)*);
4060 	HBRUSH CreatePatternBrush(HBITMAP);
4061 	HPEN CreatePen(int, int, COLORREF);
4062 	HPEN CreatePenIndirect(const(LOGPEN)*);
4063 	HRGN CreatePolygonRgn(const(POINT)*, int, int);
4064 	HRGN CreatePolyPolygonRgn(const(POINT)*, const(INT)*, int, int);
4065 	HRGN CreateRectRgn(int, int, int, int);
4066 	HRGN CreateRectRgnIndirect(LPCRECT);
4067 	HRGN CreateRoundRectRgn(int, int, int, int, int, int);
4068 	BOOL CreateScalableFontResourceA(DWORD, LPCSTR, LPCSTR, LPCSTR);
4069 	BOOL CreateScalableFontResourceW(DWORD, LPCWSTR, LPCWSTR, LPCWSTR);
4070 	HBRUSH CreateSolidBrush(COLORREF);
4071 	BOOL DeleteColorSpace(HCOLORSPACE);
4072 	BOOL DeleteDC(HDC);
4073 	BOOL DeleteEnhMetaFile(HENHMETAFILE);
4074 	BOOL DeleteMetaFile(HMETAFILE);
4075 	BOOL DeleteObject(HGDIOBJ);
4076 	int DescribePixelFormat(HDC, int, UINT, LPPIXELFORMATDESCRIPTOR);
4077 	DWORD DeviceCapabilitiesA(LPCSTR, LPCSTR, WORD, LPSTR, const(DEVMODEA)*);
4078 	DWORD DeviceCapabilitiesW(LPCWSTR, LPCWSTR, WORD, LPWSTR, const(DEVMODEW)*);
4079 	BOOL DPtoLP(HDC, LPPOINT, int);
4080 	int DrawEscape(HDC, int, int, LPCSTR);
4081 	BOOL Ellipse(HDC, int, int, int, int);
4082 	int EndDoc(HDC);
4083 	int EndPage(HDC);
4084 	BOOL EndPath(HDC);
4085 	BOOL EnumEnhMetaFile(HDC, HENHMETAFILE, ENHMFENUMPROC, PVOID, LPCRECT);
4086 	int EnumFontFamiliesA(HDC, LPCSTR, FONTENUMPROCA, LPARAM);
4087 	int EnumFontFamiliesW(HDC, LPCWSTR, FONTENUMPROCW, LPARAM);
4088 	int EnumFontFamiliesExA(HDC, PLOGFONTA, FONTENUMPROCA, LPARAM, DWORD);
4089 	int EnumFontFamiliesExW(HDC, PLOGFONTW, FONTENUMPROCW, LPARAM, DWORD);
4090 	int EnumFontsA(HDC, LPCSTR, FONTENUMPROCA, LPARAM);
4091 	int EnumFontsW(HDC, LPCWSTR, FONTENUMPROCW, LPARAM);
4092 	int EnumICMProfilesA(HDC, ICMENUMPROCA, LPARAM);
4093 	int EnumICMProfilesW(HDC, ICMENUMPROCW, LPARAM);
4094 	BOOL EnumMetaFile(HDC, HMETAFILE, MFENUMPROC, LPARAM);
4095 	int EnumObjects(HDC, int, GOBJENUMPROC, LPARAM);
4096 	BOOL EqualRgn(HRGN, HRGN);
4097 	int Escape(HDC, int, int, LPCSTR, PVOID);
4098 	int ExcludeClipRect(HDC, int, int, int, int);
4099 	int ExcludeUpdateRgn(HDC, HWND);
4100 	HPEN ExtCreatePen(DWORD, DWORD, const(LOGBRUSH)*, DWORD, const(DWORD)*);
4101 	HRGN ExtCreateRegion(const(XFORM)*, DWORD, const(RGNDATA)*);
4102 	int ExtEscape(HDC, int, int, LPCSTR, int, LPSTR);
4103 	BOOL ExtFloodFill(HDC, int, int, COLORREF, UINT);
4104 	int ExtSelectClipRgn(HDC, HRGN, int);
4105 	BOOL ExtTextOutA(HDC, int, int, UINT, LPCRECT, LPCSTR, UINT, const(INT)*);
4106 	BOOL ExtTextOutW(HDC, int, int, UINT, LPCRECT, LPCWSTR, UINT, const(INT)*);
4107 	BOOL FillPath(HDC);
4108 	int FillRect(HDC, LPCRECT, HBRUSH);
4109 	int FillRgn(HDC, HRGN, HBRUSH);
4110 	BOOL FixBrushOrgEx(HDC, int, int, LPPOINT);
4111 	BOOL FlattenPath(HDC);
4112 	BOOL FloodFill(HDC, int, int, COLORREF);
4113 	BOOL FrameRgn(HDC, HRGN, HBRUSH, int, int);
4114 	BOOL GdiComment(HDC, UINT, const(BYTE)*);
4115 	BOOL GdiFlush();
4116 	DWORD GdiGetBatchLimit();
4117 	DWORD GdiSetBatchLimit(DWORD);
4118 	int GetArcDirection(HDC);
4119 	BOOL GetAspectRatioFilterEx(HDC, LPSIZE);
4120 	LONG GetBitmapBits(HBITMAP, LONG, PVOID);
4121 	BOOL GetBitmapDimensionEx(HBITMAP, LPSIZE);
4122 	COLORREF GetBkColor(HDC);
4123 	int GetBkMode(HDC);
4124 	UINT GetBoundsRect(HDC, LPRECT, UINT);
4125 	BOOL GetBrushOrgEx(HDC, LPPOINT);
4126 	BOOL GetCharABCWidthsA(HDC, UINT, UINT, LPABC);
4127 	BOOL GetCharABCWidthsW(HDC, UINT, UINT, LPABC);
4128 	BOOL GetCharABCWidthsFloatA(HDC, UINT, UINT, LPABCFLOAT);
4129 	BOOL GetCharABCWidthsFloatW(HDC, UINT, UINT, LPABCFLOAT);
4130 	DWORD GetCharacterPlacementA(HDC, LPCSTR, int, int, LPGCP_RESULTSA, DWORD);
4131 	DWORD GetCharacterPlacementW(HDC, LPCWSTR, int, int, LPGCP_RESULTSW, DWORD);
4132 	BOOL GetCharWidth32A(HDC, UINT, UINT, LPINT);
4133 	BOOL GetCharWidth32W(HDC, UINT, UINT, LPINT);
4134 	BOOL GetCharWidthA(HDC, UINT, UINT, LPINT);
4135 	BOOL GetCharWidthW(HDC, UINT, UINT, LPINT);
4136 	BOOL GetCharWidthFloatA(HDC, UINT, UINT, PFLOAT);
4137 	BOOL GetCharWidthFloatW(HDC, UINT, UINT, PFLOAT);
4138 	int GetClipBox(HDC, LPRECT);
4139 	int GetClipRgn(HDC, HRGN);
4140 	BOOL GetColorAdjustment(HDC, LPCOLORADJUSTMENT);
4141 	HANDLE GetColorSpace(HDC);
4142 	HGDIOBJ GetCurrentObject(HDC, UINT);
4143 	BOOL GetCurrentPositionEx(HDC, LPPOINT);
4144 	HCURSOR GetCursor();
4145 	BOOL GetDCOrgEx(HDC, LPPOINT);
4146     static if (_WIN32_WINNT >= 0x500)
4147     {
4148         DWORD GetDCPenColor(HGDIOBJ);
4149         COLORREF GetDCBrushColor(HGDIOBJ);
4150     }
4151 	int GetDeviceCaps(HDC, int);
4152 	BOOL GetDeviceGammaRamp(HDC, PVOID);
4153 	UINT GetDIBColorTable(HDC, UINT, UINT, RGBQUAD*);
4154 	int GetDIBits(HDC, HBITMAP, UINT, UINT, PVOID, LPBITMAPINFO, UINT);
4155 	HENHMETAFILE GetEnhMetaFileA(LPCSTR);
4156 	HENHMETAFILE GetEnhMetaFileW(LPCWSTR);
4157 	UINT GetEnhMetaFileBits(HENHMETAFILE, UINT, LPBYTE);
4158 	UINT GetEnhMetaFileDescriptionA(HENHMETAFILE, UINT, LPSTR);
4159 	UINT GetEnhMetaFileDescriptionW(HENHMETAFILE, UINT, LPWSTR);
4160 	UINT GetEnhMetaFileHeader(HENHMETAFILE, UINT, LPENHMETAHEADER);
4161 	UINT GetEnhMetaFilePaletteEntries(HENHMETAFILE, UINT, LPPALETTEENTRY);
4162 	UINT GetEnhMetaFilePixelFormat(HENHMETAFILE, DWORD, const(PIXELFORMATDESCRIPTOR)*);
4163 	DWORD GetFontData(HDC, DWORD, DWORD, PVOID, DWORD);
4164 	DWORD GetFontLanguageInfo(HDC);
4165 	DWORD GetGlyphOutlineA(HDC, UINT, UINT, LPGLYPHMETRICS, DWORD, PVOID, const(MAT2)*);
4166 	DWORD GetGlyphOutlineW(HDC, UINT, UINT, LPGLYPHMETRICS, DWORD, PVOID, const(MAT2)*);
4167 	int GetGraphicsMode(HDC);
4168 	BOOL GetICMProfileA(HDC, DWORD, LPSTR);
4169 	BOOL GetICMProfileW(HDC, DWORD, LPWSTR);
4170 	DWORD GetKerningPairsA(HDC, DWORD, LPKERNINGPAIR);
4171 	DWORD GetKerningPairsW(HDC, DWORD, LPKERNINGPAIR);
4172 	BOOL GetLogColorSpaceA(HCOLORSPACE, LPLOGCOLORSPACEA, DWORD);
4173 	BOOL GetLogColorSpaceW(HCOLORSPACE, LPLOGCOLORSPACEW, DWORD);
4174 	int GetMapMode(HDC);
4175 	HMETAFILE GetMetaFileA(LPCSTR);
4176 	HMETAFILE GetMetaFileW(LPCWSTR);
4177 	UINT GetMetaFileBitsEx(HMETAFILE, UINT, PVOID);
4178 	int GetMetaRgn(HDC, HRGN);
4179 	BOOL GetMiterLimit(HDC, PFLOAT);
4180 	COLORREF GetNearestColor(HDC, COLORREF);
4181 	UINT GetNearestPaletteIndex(HPALETTE, COLORREF);
4182 	int GetObjectA(HGDIOBJ, int, PVOID);
4183 	int GetObjectW(HGDIOBJ, int, PVOID);
4184 	DWORD GetObjectType(HGDIOBJ);
4185 	UINT GetOutlineTextMetricsA(HDC, UINT, LPOUTLINETEXTMETRICA);
4186 	UINT GetOutlineTextMetricsW(HDC, UINT, LPOUTLINETEXTMETRICW);
4187 	UINT GetPaletteEntries(HPALETTE, UINT, UINT, LPPALETTEENTRY);
4188 	int GetPath(HDC, LPPOINT, PBYTE, int);
4189 	COLORREF GetPixel(HDC, int, int);
4190 	int GetPixelFormat(HDC);
4191 	int GetPolyFillMode(HDC);
4192 	BOOL GetRasterizerCaps(LPRASTERIZER_STATUS, UINT);
4193 	int GetRandomRgn (HDC, HRGN, INT);
4194 	DWORD GetRegionData(HRGN, DWORD, LPRGNDATA);
4195 	int GetRgnBox(HRGN, LPRECT);
4196 	int GetROP2(HDC);
4197 	HGDIOBJ GetStockObject(int);
4198 	int GetStretchBltMode(HDC);
4199 	UINT GetSystemPaletteEntries(HDC, UINT, UINT, LPPALETTEENTRY);
4200 	UINT GetSystemPaletteUse(HDC);
4201 	UINT GetTextAlign(HDC);
4202 	int GetTextCharacterExtra(HDC);
4203 	int GetTextCharset(HDC);
4204 	int GetTextCharsetInfo(HDC, LPFONTSIGNATURE, DWORD);
4205 	COLORREF GetTextColor(HDC);
4206 	BOOL GetTextExtentExPointA(HDC, LPCSTR, int, int, LPINT, LPINT, LPSIZE);
4207 	BOOL GetTextExtentExPointW(HDC, LPCWSTR, int, int, LPINT, LPINT, LPSIZE);
4208 	BOOL GetTextExtentPointA(HDC, LPCSTR, int, LPSIZE);
4209 	BOOL GetTextExtentPointW(HDC, LPCWSTR, int, LPSIZE);
4210 	BOOL GetTextExtentPoint32A(HDC, LPCSTR, int, LPSIZE);
4211 	BOOL GetTextExtentPoint32W(HDC, LPCWSTR, int, LPSIZE);
4212 	int GetTextFaceA(HDC, int, LPSTR);
4213 	int GetTextFaceW(HDC, int, LPWSTR);
4214 	BOOL GetTextMetricsA(HDC, LPTEXTMETRICA);
4215 	BOOL GetTextMetricsW(HDC, LPTEXTMETRICW);
4216 	BOOL GetViewportExtEx(HDC, LPSIZE);
4217 	BOOL GetViewportOrgEx(HDC, LPPOINT);
4218 	BOOL GetWindowExtEx(HDC, LPSIZE);
4219 	BOOL GetWindowOrgEx(HDC, LPPOINT);
4220 	UINT GetWinMetaFileBits(HENHMETAFILE, UINT, LPBYTE, INT, HDC);
4221 	BOOL GetWorldTransform(HDC, LPXFORM);
4222 	int IntersectClipRect(HDC, int, int, int, int);
4223 	BOOL InvertRgn(HDC, HRGN);
4224 	BOOL LineDDA(int, int, int, int, LINEDDAPROC, LPARAM);
4225 	BOOL LineTo(HDC, int, int);
4226 	BOOL LPtoDP(HDC, LPPOINT, int);
4227 	BOOL MaskBlt(HDC, int, int, int, int, HDC, int, int, HBITMAP, int, int, DWORD);
4228 	BOOL ModifyWorldTransform(HDC, const(XFORM)*, DWORD);
4229 	BOOL MoveToEx(HDC, int, int, LPPOINT);
4230 	int OffsetClipRgn(HDC, int, int);
4231 	int OffsetRgn(HRGN, int, int);
4232 	BOOL OffsetViewportOrgEx(HDC, int, int, LPPOINT);
4233 	BOOL OffsetWindowOrgEx(HDC, int, int, LPPOINT);
4234 	BOOL PaintRgn(HDC, HRGN);
4235 	BOOL PatBlt(HDC, int, int, int, int, DWORD);
4236 	HRGN PathToRegion(HDC);
4237 	BOOL Pie(HDC, int, int, int, int, int, int, int, int);
4238 	BOOL PlayEnhMetaFile(HDC, HENHMETAFILE, LPCRECT);
4239 	BOOL PlayEnhMetaFileRecord(HDC, LPHANDLETABLE, const(ENHMETARECORD)*, UINT);
4240 	BOOL PlayMetaFile(HDC, HMETAFILE);
4241 	BOOL PlayMetaFileRecord(HDC, LPHANDLETABLE, LPMETARECORD, UINT);
4242 	BOOL PlgBlt(HDC, const(POINT)*, HDC, int, int, int, int, HBITMAP, int, int);
4243 	BOOL PolyBezier(HDC, const(POINT)*, DWORD);
4244 	BOOL PolyBezierTo(HDC, const(POINT)*, DWORD);
4245 	BOOL PolyDraw(HDC, const(POINT)*, const(BYTE)*, int);
4246 	BOOL Polygon(HDC, const(POINT)*, int);
4247 	BOOL Polyline(HDC, const(POINT)*, int);
4248 	BOOL PolylineTo(HDC, const(POINT)*, DWORD);
4249 	BOOL PolyPolygon(HDC, const(POINT)*, const(INT)*, int);
4250 	BOOL PolyPolyline(HDC, const(POINT)*, const(DWORD)*, DWORD);
4251 	BOOL PolyTextOutA(HDC, const(POLYTEXTA)*, int);
4252 	BOOL PolyTextOutW(HDC, const(POLYTEXTW)*, int);
4253 	BOOL PtInRegion(HRGN, int, int);
4254 	BOOL PtVisible(HDC, int, int);
4255 	UINT RealizePalette(HDC);
4256 	BOOL Rectangle(HDC, int, int, int, int);
4257 	BOOL RectInRegion(HRGN, LPCRECT);
4258 	BOOL RectVisible(HDC, LPCRECT);
4259 	BOOL RemoveFontResourceA(LPCSTR);
4260 	BOOL RemoveFontResourceW(LPCWSTR);
4261 
4262 	HDC ResetDCA(HDC, const(DEVMODEA)*);
4263 	HDC ResetDCW(HDC, const(DEVMODEW)*);
4264 	BOOL ResizePalette(HPALETTE, UINT);
4265 	BOOL RestoreDC(HDC, int);
4266 	BOOL RoundRect(HDC, int, int, int, int, int, int);
4267 	int SaveDC(HDC);
4268 	BOOL ScaleViewportExtEx(HDC, int, int, int, int, LPSIZE);
4269 	BOOL ScaleWindowExtEx(HDC, int, int, int, int, LPSIZE);
4270 	BOOL SelectClipPath(HDC, int);
4271 	int SelectClipRgn(HDC, HRGN);
4272 	HGDIOBJ SelectObject(HDC, HGDIOBJ);
4273 	HPALETTE SelectPalette(HDC, HPALETTE, BOOL);
4274 	int SetAbortProc(HDC, ABORTPROC);
4275 	int SetArcDirection(HDC, int);
4276 	LONG SetBitmapBits(HBITMAP, DWORD, PCVOID);
4277 	BOOL SetBitmapDimensionEx(HBITMAP, int, int, LPSIZE);
4278 	COLORREF SetBkColor(HDC, COLORREF);
4279 	int SetBkMode(HDC, int);
4280 	UINT SetBoundsRect(HDC, LPCRECT, UINT);
4281 	BOOL SetBrushOrgEx(HDC, int, int, LPPOINT);
4282 	BOOL SetColorAdjustment(HDC, const(COLORADJUSTMENT)*);
4283 	BOOL SetColorSpace(HDC, HCOLORSPACE);
4284 
4285 	BOOL SetDeviceGammaRamp(HDC, PVOID);
4286 	UINT SetDIBColorTable(HDC, UINT, UINT, const(RGBQUAD)*);
4287 	int SetDIBits(HDC, HBITMAP, UINT, UINT, PCVOID, const(BITMAPINFO)*, UINT);
4288 	int SetDIBitsToDevice(HDC, int, int, DWORD, DWORD, int, int, UINT, UINT, PCVOID, const(BITMAPINFO)*, UINT);
4289 	HENHMETAFILE SetEnhMetaFileBits(UINT, const(BYTE)*);
4290 	int SetGraphicsMode(HDC, int);
4291 	int SetICMMode(HDC, int);
4292 	BOOL SetICMProfileA(HDC, LPSTR);
4293 	BOOL SetICMProfileW(HDC, LPWSTR);
4294 	int SetMapMode(HDC, int);
4295 
4296 	static if (_WIN32_WINNT >= 0x500) {
4297 		DWORD SetLayout(HDC hdc, DWORD l);
4298 		DWORD GetLayout(HDC hdc);
4299 	}
4300 
4301 	DWORD SetMapperFlags(HDC, DWORD);
4302 	HMETAFILE SetMetaFileBitsEx(UINT, const(BYTE)*);
4303 	int SetMetaRgn(HDC);
4304 	BOOL SetMiterLimit(HDC, FLOAT, PFLOAT);
4305 	UINT SetPaletteEntries(HPALETTE, UINT, UINT, const(PALETTEENTRY)*);
4306 	COLORREF SetPixel(HDC, int, int, COLORREF);
4307 	BOOL SetPixelFormat(HDC, int, const(PIXELFORMATDESCRIPTOR)*);
4308 	BOOL SetPixelV(HDC, int, int, COLORREF);
4309 	int SetPolyFillMode(HDC, int);
4310 	BOOL SetRectRgn(HRGN, int, int, int, int);
4311 	int SetROP2(HDC, int);
4312 	int SetStretchBltMode(HDC, int);
4313 	UINT SetSystemPaletteUse(HDC, UINT);
4314 	UINT SetTextAlign(HDC, UINT);
4315 	int SetTextCharacterExtra(HDC, int);
4316 	COLORREF SetTextColor(HDC, COLORREF);
4317 	BOOL SetTextJustification(HDC, int, int);
4318 	BOOL SetViewportExtEx(HDC, int, int, LPSIZE);
4319 	BOOL SetViewportOrgEx(HDC, int, int, LPPOINT);
4320 	BOOL SetWindowExtEx(HDC, int, int, LPSIZE);
4321 	BOOL SetWindowOrgEx(HDC, int, int, LPPOINT);
4322 	HENHMETAFILE SetWinMetaFileBits(UINT, const(BYTE)*, HDC, const(METAFILEPICT)*);
4323 	BOOL SetWorldTransform(HDC, const(XFORM)*);
4324 	int StartDocA(HDC, const(DOCINFOA)*);
4325 	int StartDocW(HDC, const(DOCINFOW)*);
4326 	int StartPage(HDC);
4327 	BOOL StretchBlt(HDC, int, int, int, int, HDC, int, int, int, int, DWORD);
4328 	int StretchDIBits(HDC, int, int, int, int, int, int, int, int, const(VOID)* , const(BITMAPINFO)* , UINT, DWORD);
4329 	BOOL StrokeAndFillPath(HDC);
4330 	BOOL StrokePath(HDC);
4331 	BOOL SwapBuffers(HDC);
4332 	BOOL TextOutA(HDC, int, int, LPCSTR, int);
4333 	BOOL TextOutW(HDC, int, int, LPCWSTR, int);
4334 	BOOL TranslateCharsetInfo(PDWORD, LPCHARSETINFO, DWORD);
4335 	BOOL UnrealizeObject(HGDIOBJ);
4336 	BOOL UpdateColors(HDC);
4337 	BOOL UpdateICMRegKeyA(DWORD, DWORD, LPSTR, UINT);
4338 	BOOL UpdateICMRegKeyW(DWORD, DWORD, LPWSTR, UINT);
4339 	BOOL WidenPath(HDC);
4340 	BOOL wglCopyContext(HGLRC, HGLRC, UINT);
4341 	HGLRC wglCreateContext(HDC);
4342 	HGLRC wglCreateLayerContext(HDC, int);
4343 	BOOL wglDeleteContext(HGLRC);
4344 	BOOL wglDescribeLayerPlane(HDC, int, int, UINT, LPLAYERPLANEDESCRIPTOR);
4345 	HGLRC wglGetCurrentContext();
4346 	HDC wglGetCurrentDC();
4347 	int wglGetLayerPaletteEntries(HDC, int, int, int, COLORREF*);
4348 	PROC wglGetProcAddress(LPCSTR);
4349 	BOOL wglMakeCurrent(HDC, HGLRC);
4350 	BOOL wglRealizeLayerPalette(HDC, int, BOOL);
4351 	int wglSetLayerPaletteEntries(HDC, int, int, int, const(COLORREF)*);
4352 	BOOL wglShareLists(HGLRC, HGLRC);
4353 	BOOL wglSwapLayerBuffers(HDC, UINT);
4354 	BOOL wglUseFontBitmapsA(HDC, DWORD, DWORD, DWORD);
4355 	BOOL wglUseFontBitmapsW(HDC, DWORD, DWORD, DWORD);
4356 	BOOL wglUseFontOutlinesA(HDC, DWORD, DWORD, DWORD, FLOAT, FLOAT, int, LPGLYPHMETRICSFLOAT);
4357 	BOOL wglUseFontOutlinesW(HDC, DWORD, DWORD, DWORD, FLOAT, FLOAT, int, LPGLYPHMETRICSFLOAT);
4358 
4359 	static if (_WIN32_WINNT >= 0x500) {
4360 	alias WGLSWAP* PWGLSWAP;
4361 	struct WGLSWAP {
4362 		HDC hdc;
4363 		UINT uiFlags;
4364 	}
4365 	const WGL_SWAPMULTIPLE_MAX = 16;
4366 	DWORD  wglSwapMultipleBuffers(UINT, WGLSWAP*);
4367 }
4368 
4369 static if (_WIN32_WINNT >= 0x500) {
4370 		BOOL AlphaBlend(HDC, int, int, int, int, HDC, int, int, int, int, BLENDFUNCTION);
4371 		BOOL GradientFill(HDC, PTRIVERTEX, ULONG, PVOID, ULONG, ULONG);
4372 		BOOL TransparentBlt(HDC, int, int, int, int, HDC, int, int, int, int, UINT);
4373 	}
4374 
4375 	static if (_WIN32_WINNT >= 0x500) {
4376 		COLORREF SetDCBrushColor(HDC, COLORREF);
4377 		COLORREF SetDCPenColor(HDC, COLORREF);
4378 		HANDLE AddFontMemResourceEx(PVOID, DWORD, PVOID, DWORD*);
4379 		int AddFontResourceExA(LPCSTR, DWORD, PVOID);
4380 		int AddFontResourceExW(LPCWSTR, DWORD, PVOID);
4381 		BOOL RemoveFontMemResourceEx(HANDLE);
4382 		BOOL RemoveFontResourceExA(LPCSTR, DWORD, PVOID);
4383 		BOOL RemoveFontResourceExW(LPCWSTR, DWORD, PVOID);
4384 		DWORD GetFontUnicodeRanges(HDC, LPGLYPHSET);
4385 		DWORD GetGlyphIndicesA(HDC, LPCSTR, int, LPWORD, DWORD);
4386 		DWORD GetGlyphIndicesW(HDC, LPCWSTR, int, LPWORD, DWORD);
4387 		BOOL GetTextExtentPointI(HDC, LPWORD, int, LPSIZE);
4388 		BOOL GetTextExtentExPointI(HDC, LPWORD, int, int, LPINT, LPINT, LPSIZE);
4389 		BOOL GetCharWidthI(HDC, UINT, UINT, LPWORD, LPINT);
4390 		BOOL GetCharABCWidthsI(HDC, UINT, UINT, LPWORD, LPABC);
4391 	}
4392 } // extern (Windows)
4393 
4394 version(Unicode) {
4395 	alias WCHAR BCHAR;
4396 	alias DOCINFOW DOCINFO;
4397 	alias LOGFONTW LOGFONT;
4398 
4399 	alias TEXTMETRICW TEXTMETRIC;
4400 	alias NPTEXTMETRICW NPTEXTMETRIC;
4401 	alias ICMENUMPROCW ICMENUMPROC;
4402 	alias FONTENUMPROCW FONTENUMPROC;
4403 	alias DEVMODEW DEVMODE;
4404 
4405 	alias EXTLOGFONTW EXTLOGFONT;
4406 	alias GCP_RESULTSW GCP_RESULTS;
4407 	alias OUTLINETEXTMETRICW OUTLINETEXTMETRIC;
4408 	alias POLYTEXTW POLYTEXT;
4409 	alias LOGCOLORSPACEW LOGCOLORSPACE;
4410 	alias NEWTEXTMETRICW NEWTEXTMETRIC;
4411 	alias NEWTEXTMETRICEXW NEWTEXTMETRICEX;
4412 	alias ENUMLOGFONTW ENUMLOGFONT;
4413 	alias ENUMLOGFONTEXW ENUMLOGFONTEX;
4414 	alias DISPLAY_DEVICEW DISPLAY_DEVICE;
4415 	alias AddFontResourceW AddFontResource;
4416 
4417 	alias CopyEnhMetaFileW CopyEnhMetaFile;
4418 	alias CopyMetaFileW CopyMetaFile;
4419 	alias CreateColorSpaceW CreateColorSpace;
4420 	alias CreateDCW CreateDC;
4421 	alias CreateEnhMetaFileW CreateEnhMetaFile;
4422 	alias CreateFontW CreateFont;
4423 	alias CreateFontIndirectW CreateFontIndirect;
4424 	alias CreateICW CreateIC;
4425 	alias CreateMetaFileW CreateMetaFile;
4426 	alias CreateScalableFontResourceW CreateScalableFontResource;
4427 	alias DeviceCapabilitiesW DeviceCapabilities;
4428 	alias EnumFontFamiliesW EnumFontFamilies;
4429 	alias EnumFontFamiliesExW EnumFontFamiliesEx;
4430 	alias EnumFontsW EnumFonts;
4431 	alias EnumICMProfilesW EnumICMProfiles;
4432 	alias ExtTextOutW ExtTextOut;
4433 	alias GetCharABCWidthsFloatW GetCharABCWidthsFloat;
4434 	alias GetCharABCWidthsW GetCharABCWidths;
4435 	alias GetCharacterPlacementW GetCharacterPlacement;
4436 	alias GetCharWidth32W GetCharWidth32;
4437 	alias GetCharWidthFloatW GetCharWidthFloat;
4438 	alias GetCharWidthW GetCharWidth;
4439 	alias GetEnhMetaFileW GetEnhMetaFile;
4440 	alias GetEnhMetaFileDescriptionW GetEnhMetaFileDescription;
4441 	alias GetGlyphOutlineW GetGlyphOutline;
4442 	alias GetICMProfileW GetICMProfile;
4443 	alias GetKerningPairsW GetKerningPairs;
4444 	alias GetLogColorSpaceW GetLogColorSpace;
4445 	alias GetMetaFileW GetMetaFile;
4446 	alias GetObjectW GetObject;
4447 	alias GetOutlineTextMetricsW GetOutlineTextMetrics;
4448 	alias GetTextExtentPointW GetTextExtentPoint;
4449 	alias GetTextExtentExPointW GetTextExtentExPoint;
4450 	alias GetTextExtentPoint32W GetTextExtentPoint32;
4451 	alias GetTextFaceW GetTextFace;
4452 	alias GetTextMetricsW GetTextMetrics;
4453 	alias PolyTextOutW PolyTextOut;
4454 	alias RemoveFontResourceW RemoveFontResource;
4455 
4456 	alias ResetDCW ResetDC;
4457 	alias SetICMProfileW SetICMProfile;
4458 	alias StartDocW StartDoc;
4459 	alias TextOutW TextOut;
4460 	alias UpdateICMRegKeyW UpdateICMRegKey;
4461 	alias wglUseFontBitmapsW wglUseFontBitmaps;
4462 	alias wglUseFontOutlinesW wglUseFontOutlines;
4463 	static if (_WIN32_WINNT >= 0x500) {
4464 		alias ENUMLOGFONTEXDVW ENUMLOGFONTEXDV;
4465 		alias PENUMLOGFONTEXDVW PENUMLOGFONTEXDV;
4466 		alias LPENUMLOGFONTEXDVW LPENUMLOGFONTEXDV;
4467 		alias AddFontResourceExW AddFontResourceEx;
4468 		alias RemoveFontResourceExW RemoveFontResourceEx;
4469 		alias GetGlyphIndicesW GetGlyphIndices;
4470 	}
4471 } else { /* non-unicode build */
4472 	alias BYTE BCHAR;
4473 	alias DOCINFOA DOCINFO;
4474 	alias LOGFONTA LOGFONT;
4475 	alias TEXTMETRICA TEXTMETRIC;
4476 	alias NPTEXTMETRICA NPTEXTMETRIC;
4477 	alias ICMENUMPROCA ICMENUMPROC;
4478 	alias FONTENUMPROCA FONTENUMPROC;
4479 	alias DEVMODEA DEVMODE;
4480 	alias EXTLOGFONTA EXTLOGFONT;
4481 	alias GCP_RESULTSA GCP_RESULTS;
4482 	alias OUTLINETEXTMETRICA OUTLINETEXTMETRIC;
4483 	alias POLYTEXTA POLYTEXT;
4484 	alias LOGCOLORSPACEA LOGCOLORSPACE;
4485 	alias NEWTEXTMETRICA NEWTEXTMETRIC;
4486 	alias NEWTEXTMETRICEXA NEWTEXTMETRICEX;
4487 	alias ENUMLOGFONTA ENUMLOGFONT;
4488 	alias ENUMLOGFONTEXA ENUMLOGFONTEX;
4489 	alias DISPLAY_DEVICEA DISPLAY_DEVICE;
4490 
4491 	alias AddFontResourceA AddFontResource;
4492 	alias CopyEnhMetaFileA CopyEnhMetaFile;
4493 	alias CopyMetaFileA CopyMetaFile;
4494 	alias CreateColorSpaceA CreateColorSpace;
4495 	alias CreateDCA CreateDC;
4496 	alias CreateEnhMetaFileA CreateEnhMetaFile;
4497 	alias CreateFontA CreateFont;
4498 	alias CreateFontIndirectA CreateFontIndirect;
4499 	alias CreateICA CreateIC;
4500 	alias CreateMetaFileA CreateMetaFile;
4501 	alias CreateScalableFontResourceA CreateScalableFontResource;
4502 	alias DeviceCapabilitiesA DeviceCapabilities;
4503 	alias EnumFontFamiliesA EnumFontFamilies;
4504 	alias EnumFontFamiliesExA EnumFontFamiliesEx;
4505 	alias EnumFontsA EnumFonts;
4506 	alias EnumICMProfilesA EnumICMProfiles;
4507 	alias ExtTextOutA ExtTextOut;
4508 	alias GetCharWidthFloatA GetCharWidthFloat;
4509 	alias GetCharWidthA GetCharWidth;
4510 	alias GetCharacterPlacementA GetCharacterPlacement;
4511 	alias GetCharABCWidthsA GetCharABCWidths;
4512 	alias GetCharABCWidthsFloatA GetCharABCWidthsFloat;
4513 	alias GetCharWidth32A GetCharWidth32;
4514 	alias GetEnhMetaFileA GetEnhMetaFile;
4515 	alias GetEnhMetaFileDescriptionA GetEnhMetaFileDescription;
4516 	alias GetGlyphOutlineA GetGlyphOutline;
4517 	alias GetICMProfileA GetICMProfile;
4518 	alias GetKerningPairsA GetKerningPairs;
4519 	alias GetLogColorSpaceA GetLogColorSpace;
4520 	alias GetMetaFileA GetMetaFile;
4521 	alias GetObjectA GetObject;
4522 	alias GetOutlineTextMetricsA GetOutlineTextMetrics;
4523 	alias GetTextExtentPointA GetTextExtentPoint;
4524 	alias GetTextExtentExPointA GetTextExtentExPoint;
4525 	alias GetTextExtentPoint32A GetTextExtentPoint32;
4526 	alias GetTextFaceA GetTextFace;
4527 	alias GetTextMetricsA GetTextMetrics;
4528 	alias PolyTextOutA PolyTextOut;
4529 	alias RemoveFontResourceA RemoveFontResource;
4530 	alias ResetDCA ResetDC;
4531 	alias SetICMProfileA SetICMProfile;
4532 	alias StartDocA StartDoc;
4533 	alias TextOutA TextOut;
4534 	alias UpdateICMRegKeyA UpdateICMRegKey;
4535 	alias wglUseFontBitmapsA wglUseFontBitmaps;
4536 	alias wglUseFontOutlinesA wglUseFontOutlines;
4537 	static if (_WIN32_WINNT >= 0x500) {
4538 		alias ENUMLOGFONTEXDVA ENUMLOGFONTEXDV;
4539 		alias PENUMLOGFONTEXDVA PENUMLOGFONTEXDV;
4540 		alias LPENUMLOGFONTEXDVA LPENUMLOGFONTEXDV;
4541 		alias AddFontResourceExA AddFontResourceEx;
4542 		alias RemoveFontResourceExA RemoveFontResourceEx;
4543 		alias GetGlyphIndicesA GetGlyphIndices;
4544 	}
4545 }
4546 
4547 // Common to both ASCII & UNICODE
4548 alias DOCINFO* LPDOCINFO;
4549 alias LOGFONT* PLOGFONT, NPLOGFONT, LPLOGFONT;
4550 alias TEXTMETRIC* PTEXTMETRIC, LPTEXTMETRIC;
4551 alias DEVMODE* PDEVMODE, NPDEVMODE, LPDEVMODE;
4552 alias EXTLOGFONT* PEXTLOGFONT, NPEXTLOGFONT, LPEXTLOGFONT;
4553 alias GCP_RESULTS* LPGCP_RESULTS;
4554 alias OUTLINETEXTMETRIC* POUTLINETEXTMETRIC, NPOUTLINETEXTMETRIC, LPOUTLINETEXTMETRIC;
4555 alias POLYTEXT* PPOLYTEXT, NPPOLYTEXT, LPPOLYTEXT;
4556 alias LOGCOLORSPACE* LPLOGCOLORSPACE;
4557 alias NEWTEXTMETRIC* PNEWTEXTMETRIC, NPNEWTEXTMETRIC, LPNEWTEXTMETRIC;
4558 alias ENUMLOGFONT* LPENUMLOGFONT;
4559 alias ENUMLOGFONTEX* LPENUMLOGFONTEX;
4560 alias DISPLAY_DEVICE* PDISPLAY_DEVICE, LPDISPLAY_DEVICE;