Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

4961 lines
175 KiB

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