Leaked source code of windows server 2003
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.

813 lines
23 KiB

  1. /*++ BUILD Version: 0004 // Increment this if a change has global effects
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Module Name:
  4. wingdi.h
  5. Abstract:
  6. Procedure declarations, constant definitions and macros for the GDI
  7. component.
  8. --*/
  9. #ifndef _WINGDIP_
  10. #define _WINGDIP_
  11. #ifdef __cplusplus
  12. extern "C" {
  13. #endif
  14. // BitBlt RTL mirroring rop (RTL_MIRRORING)
  15. // RTL Layout Constants (RTL_MIRRORING)
  16. // SetLayout Metafile call (RTL_MIRRORING)
  17. #define LCS_DEVICE_RGB 0x00000001L
  18. #define LCS_DEVICE_CMYK 0x00000002L
  19. #define BI_CMYK 10L
  20. #define BI_CMYKRLE8 11L
  21. #define BI_CMYKRLE4 12L
  22. #define CAPS1 94 /* Extra Caps */
  23. /* CAPS1 (Win 9x internal) */
  24. #define C1_TRANSPARENT 0x0001
  25. #define TC_TT_ABLE 0x0002
  26. #define C1_TT_CR_ANY 0x0004
  27. #define C1_EMF_COMPLIANT 0x0008
  28. #define C1_DIBENGINE 0x0010
  29. #define C1_GAMMA_RAMP 0x0020 /* CM_GAMMA_RAMP for NT */
  30. #define C1_DIC 0x0040 /* CM_DEVICE_ICM for NT */
  31. #define C1_REINIT_ABLE 0x0080
  32. #define C1_GLYPH_INDEX 0x0100
  33. #define C1_BIT_PACKED 0x0200
  34. #define C1_BYTE_PACKED 0x0400
  35. #define C1_COLORCURSOR 0x0800
  36. #define C1_CMYK_ABLE 0x1000 /* CM_CMYK_COLOR for NT */
  37. #define C1_SLOW_CARD 0x2000
  38. /* CAPS1 (NT 5 internal) */
  39. #define C1_MIRROR_DEVICE 0x4000
  40. #define CBM_CREATEDIB 0x02L /* create DIB bitmap */
  41. #define DMDUP_LAST DMDUP_HORIZONTAL
  42. #define DMTT_LAST DMTT_DOWNLOAD_OUTLINE
  43. #define DMDO_LAST DMDO_270
  44. #define DMDFO_LAST DMDFO_CENTER
  45. #define DMDISPLAYFLAGS_VALID 0x00000004
  46. #define DMICMMETHOD_LAST DMICMMETHOD_DEVICE
  47. #define DMICM_LAST DMICM_ABS_COLORIMETRIC
  48. #define DMMEDIA_LAST DMMEDIA_GLOSSY
  49. #define DMDITHER_LAST DMDITHER_GRAYSCALE
  50. /* EnumDisplayDevices */
  51. #if (_WIN32_WINNT >= 0x0501)
  52. #define EDD_DISPLAY_DEVICE_PRUNED 0x00000001
  53. #endif /* _WIN32_WINNT >= 0x0501 */
  54. #define DISPLAY_DEVICE_POWERED_OFF 0x80000000
  55. #define DISPLAY_DEVICE_ACPI 0x40000000
  56. #define DISPLAY_DEVICE_DUALVIEW 0x20000000
  57. #define DISPLAY_DEVICE_PRUNE_FREQ 0x80000000
  58. #define DISPLAY_DEVICE_PRUNE_RESOLUTION 0x40000000
  59. WINGDIAPI int WINAPI GetTextFaceAliasW(HDC hdc,int c,LPWSTR pwsz);
  60. WINGDIAPI HBITMAP SetBitmapAttributes(HBITMAP hbm, DWORD dwFlags);
  61. WINGDIAPI HBITMAP ClearBitmapAttributes(HBITMAP hbm, DWORD dwFlags);
  62. WINGDIAPI DWORD GetBitmapAttributes(HBITMAP hbm);
  63. #define SBA_STOCK 0x00000001
  64. WINGDIAPI HBRUSH SetBrushAttributes(HBRUSH hbr, DWORD dwFlags);
  65. WINGDIAPI HBRUSH ClearBrushAttributes(HBRUSH hbr, DWORD dwFlags);
  66. WINGDIAPI DWORD GetBrushAttributes(HBRUSH hbr);
  67. /* DC_MANUFACTURER is DC_ICC_MANUFACTURER in 16 bit PRINT.H */
  68. /* DC_MODEL is DC_ICC_MODEL in 16 bit PRINT.H */
  69. HANDLE WINAPI SetObjectOwner( IN HGDIOBJ, IN HANDLE);
  70. // Mirroring APIs (RTL_MIRRORING)
  71. #if(WINVER >= 0x0500)
  72. WINGDIAPI BOOL WINAPI MirrorRgn(IN HWND, IN HRGN);
  73. WINGDIAPI DWORD WINAPI SetLayoutWidth(IN HDC, IN LONG, IN DWORD);
  74. #endif /* WINVER >= 0x0500 */
  75. #if (_WIN32_WINNT >= 0x0500)
  76. //
  77. // alpha blend flags
  78. //
  79. #define AC_USE_HIGHQUALITYFILTER 0x01
  80. #define AC_MIRRORBITMAP 0x80
  81. WINGDIAPI BOOL WINAPI GdiAlphaBlend( IN HDC, IN int, IN int, IN int, IN int, IN HDC, IN int, IN int, IN int, IN int, IN BLENDFUNCTION);
  82. WINGDIAPI BOOL WINAPI GdiTransparentBlt(IN HDC,IN int,IN int,IN int,IN int,IN HDC,IN int,IN int,IN int,IN int,IN UINT);
  83. WINGDIAPI BOOL WINAPI GdiGradientFill( IN HDC, IN PTRIVERTEX, IN ULONG, IN PVOID, IN ULONG, IN ULONG);
  84. #endif
  85. #if (_WIN32_WINNT >= 0x0501)
  86. #ifndef DS_ENABLE_BLT
  87. #define DS_ENABLE_BLT 0
  88. #endif
  89. #define DS_MAGIC 'DrwS'
  90. #define DS_SETTARGETID 0
  91. #define DS_SETSOURCEID 1
  92. #define DS_NINEGRIDID 9
  93. #if DS_ENABLE_BLT
  94. #define DS_BLTID 10
  95. #define DS_SETBLENDID 11
  96. #define DS_SETCOLORKEYID 12
  97. #endif
  98. typedef struct _DS_HEADER
  99. {
  100. ULONG magic;
  101. } DS_HEADER;
  102. typedef struct _DS_SETTARGET
  103. {
  104. ULONG ulCmdID;
  105. ULONG hdc;
  106. RECTL rclDstClip;
  107. } DS_SETTARGET;
  108. typedef struct _DS_SETSOURCE
  109. {
  110. ULONG ulCmdID;
  111. ULONG hbm;
  112. } DS_SETSOURCE;
  113. #define DSDNG_STRETCH 0x01
  114. #define DSDNG_TILE 0x02
  115. #define DSDNG_PERPIXELALPHA 0x04
  116. #define DSDNG_TRANSPARENT 0x08
  117. #define DSDNG_MUSTFLIP 0x10
  118. #define DSDNG_TRUESIZE 0x20
  119. typedef struct _DS_NINEGRIDINFO
  120. {
  121. ULONG flFlags;
  122. LONG ulLeftWidth;
  123. LONG ulRightWidth;
  124. LONG ulTopHeight;
  125. LONG ulBottomHeight;
  126. COLORREF crTransparent;
  127. } DS_NINEGRIDINFO;
  128. typedef struct _DS_NINEGRID
  129. {
  130. ULONG ulCmdID;
  131. RECTL rclDst;
  132. RECTL rclSrc;
  133. DS_NINEGRIDINFO ngi;
  134. } DS_NINEGRID;
  135. #if DS_EANBLE_BLT
  136. #define DSBLT_HTILE 0x01
  137. #define DSBLT_VTILE 0x02
  138. #define DSBLT_ALPHABLEND 0x04
  139. #define DSBLT_TRANSPARENT 0x08
  140. typedef struct _DS_BLT
  141. {
  142. ULONG ulCmdID;
  143. RECTL rclDst;
  144. RECTL rclSrc;
  145. FLONG flFlags;
  146. } DS_BLT;
  147. typedef struct _DS_SETBLEND
  148. {
  149. BLENDFUNCTION blendFunction;
  150. } DS_SETBLEND;
  151. typedef struct _DS_SETCOLORKEY
  152. {
  153. COLORREF crColorKey;
  154. } DS_SETCOLORKEY;
  155. #endif
  156. WINGDIAPI BOOL WINAPI GdiDrawStream( IN HDC, IN ULONG, IN VOID *);
  157. #endif
  158. // Ansi version of CreateColorSpace
  159. // (Windows 98 comaptible record)
  160. // Unicode version of StartDoc record
  161. // SetLayout Metafile Record (RTL_MIRRORING)
  162. #ifdef __cplusplus
  163. }
  164. #endif
  165. #define CCB_NOVIDEOMEMORY 0x01000000
  166. // Old fields that Chicago won't support that we can't publically
  167. // support anymore
  168. #define HS_SOLIDCLR 6
  169. #define HS_DITHEREDCLR 7
  170. #define HS_SOLIDTEXTCLR 8
  171. #define HS_DITHEREDTEXTCLR 9
  172. #define HS_SOLIDBKCLR 10
  173. #define HS_DITHEREDBKCLR 11
  174. #define HS_API_MAX 12
  175. #define DIB_PAL_INDICES 2 /* No color table indices into surf palette */
  176. // Private indicies for GetStockObject over the CS interface.
  177. #define PRIV_STOCK_COLORSPACE (STOCK_LAST + 1)
  178. #define PRIV_STOCK_BITMAP (STOCK_LAST + 2)
  179. #define PRIV_STOCK_LAST PRIV_STOCK_BITMAP
  180. #define DCB_WINDOWMGR 0x00008000L
  181. // GetTransform flags.
  182. #define XFORM_WORLD_TO_PAGE 0x0203
  183. #define XFORM_WORLD_TO_DEVICE 0x0204
  184. #define XFORM_PAGE_TO_DEVICE 0x0304
  185. #define XFORM_PAGE_TO_WORLD 0x0302
  186. #define XFORM_DEVICE_TO_WORLD 0x0402
  187. #define XFORM_DEVICE_TO_PAGE 0x0403
  188. #if(WINVER >= 0x0500)
  189. #define EMR_DRAWESCAPE 105
  190. #define EMR_EXTESCAPE 106
  191. // Unicode version of StartDoc record
  192. #define EMR_STARTDOC 107
  193. #define EMR_SMALLTEXTOUT 108
  194. #define EMR_FORCEUFIMAPPING 109
  195. #define EMR_NAMEDESCAPE 110
  196. #define EMR_SETLINKEDUFIS 119
  197. #define EMR_SETTEXTJUSTIFICATION 120
  198. #endif /* WINVER >= 0x0500 */
  199. enum DCTYPE {
  200. DCTYPE_DIRECT,
  201. DCTYPE_MEMORY,
  202. DCTYPE_INFO};
  203. // the following structure is only used for GetETM postscript escape
  204. typedef struct _EXTTEXTMETRIC {
  205. SHORT etmSize;
  206. SHORT etmPointSize;
  207. SHORT etmOrientation;
  208. SHORT etmMasterHeight;
  209. SHORT etmMinScale;
  210. SHORT etmMaxScale;
  211. SHORT etmMasterUnits;
  212. SHORT etmCapHeight;
  213. SHORT etmXHeight;
  214. SHORT etmLowerCaseAscent;
  215. SHORT etmLowerCaseDescent;
  216. SHORT etmSlant;
  217. SHORT etmSuperScript;
  218. SHORT etmSubScript;
  219. SHORT etmSuperScriptSize;
  220. SHORT etmSubScriptSize;
  221. SHORT etmUnderlineOffset;
  222. SHORT etmUnderlineWidth;
  223. SHORT etmDoubleUpperUnderlineOffset;
  224. SHORT etmDoubleLowerUnderlineOffset;
  225. SHORT etmDoubleUpperUnderlineWidth;
  226. SHORT etmDoubleLowerUnderlineWidth;
  227. SHORT etmStrikeOutOffset;
  228. SHORT etmStrikeOutWidth;
  229. WORD etmNKernPairs;
  230. WORD etmNKernTracks;
  231. } EXTTEXTMETRIC;
  232. // the following structure is only used for GETPAIRKERNTABLE escape
  233. #pragma pack(1)
  234. typedef struct _KERNPAIR
  235. {
  236. WORD wBoth;
  237. SHORT sAmount;
  238. } KERNPAIR, *LPKERNPAIR;
  239. #pragma pack()
  240. BOOL
  241. GetETM(
  242. HDC hdc,
  243. EXTTEXTMETRIC *petm);
  244. HFONT
  245. APIENTRY
  246. GetHFONT(
  247. HDC);
  248. HANDLE GdiCreateLocalMetaFilePict(HANDLE hRemote);
  249. HENHMETAFILE GdiCreateLocalEnhMetaFile(HANDLE hRemote);
  250. HANDLE GdiConvertBitmapV5(LPBYTE,int,HPALETTE,UINT);
  251. HANDLE GdiConvertMetaFilePict(HANDLE hmfp);
  252. HANDLE GdiConvertEnhMetaFile(HENHMETAFILE hmf);
  253. HDC GdiConvertAndCheckDC(HDC hdc);
  254. HBRUSH GdiConvertBrush(HBRUSH hbrush);
  255. HDC GdiConvertDC(HDC hdc);
  256. HRGN GdiConvertRegion(HRGN hrgn);
  257. BOOL GdiValidateHandle(HANDLE hObj);
  258. BOOL GdiReleaseDC(HDC hdc);
  259. HANDLE GdiFixUpHandle(HANDLE h);
  260. int GdiGetCharDimensions(HDC hdc,TEXTMETRICW *lptm,LPINT lpcy);
  261. DWORD GdiGetCodePage(HDC hdc);
  262. // Driver-specific pixel format support in GDI
  263. int APIENTRY GdiDescribePixelFormat(HDC, int, UINT, LPPIXELFORMATDESCRIPTOR);
  264. BOOL APIENTRY GdiSetPixelFormat(HDC, int);
  265. BOOL APIENTRY GdiSwapBuffers(HDC);
  266. // OpenGL metafile support in GDI
  267. BOOL APIENTRY GdiAddGlsRecord(HDC hdc, DWORD cb, BYTE *pb, LPRECTL prclBounds);
  268. BOOL APIENTRY GdiAddGlsBounds(HDC hdc, LPRECTL prclBounds);
  269. BOOL APIENTRY GdiIsMetaPrintDC(HDC hdc);
  270. // OpenGL metafile support in OpenGL
  271. BOOL APIENTRY GlmfInitPlayback(HDC hdc, ENHMETAHEADER *pemh,
  272. LPRECTL prclDest);
  273. BOOL APIENTRY GlmfBeginGlsBlock(HDC hdc);
  274. BOOL APIENTRY GlmfPlayGlsRecord(HDC hdc, DWORD cb, BYTE *pb,
  275. LPRECTL prclBounds);
  276. BOOL APIENTRY GlmfEndGlsBlock(HDC hdc);
  277. BOOL APIENTRY GlmfEndPlayback(HDC hdc);
  278. BOOL APIENTRY GlmfCloseMetaFile(HDC hdc);
  279. BOOL APIENTRY GdiPlayJournal(HDC,LPWSTR,DWORD,DWORD,int);
  280. typedef int (CALLBACK* EMFPLAYPROC)( HDC, INT, HANDLE );
  281. // User Mode Driver Unload
  282. BOOL WINAPI GdiArtificialDecrementDriver(
  283. LPWSTR pDriverDllName,
  284. DWORD dwDriverAttributes
  285. );
  286. // Print processor interfaces and definitions
  287. #define EMF_PP_NORMAL 0x01
  288. #define EMF_PP_FORM 0x02
  289. #define EMF_PP_COLOR_OPTIMIZATION 0x01
  290. BOOL WINAPI GdiPlayEMF(
  291. LPWSTR pwszPrinterName,
  292. LPDEVMODEW pDevmode,
  293. LPWSTR pwszDocName,
  294. EMFPLAYPROC pfnPageQueryFn,
  295. HANDLE hPageQuery
  296. );
  297. HANDLE WINAPI GdiGetSpoolFileHandle(
  298. LPWSTR pwszPrinterName,
  299. LPDEVMODEW pDevmode,
  300. LPWSTR pwszDocName);
  301. BOOL WINAPI GdiDeleteSpoolFileHandle(
  302. HANDLE SpoolFileHandle);
  303. DWORD WINAPI GdiGetPageCount(
  304. HANDLE SpoolFileHandle);
  305. HDC WINAPI GdiGetDC(
  306. HANDLE SpoolFileHandle);
  307. HANDLE WINAPI GdiGetPageHandle(
  308. HANDLE SpoolFileHandle,
  309. DWORD Page,
  310. LPDWORD pdwPageType);
  311. BOOL WINAPI GdiStartDocEMF(
  312. HANDLE SpoolFileHandle,
  313. DOCINFOW *pDocInfo);
  314. BOOL WINAPI GdiStartPageEMF(
  315. HANDLE SpoolFileHandle);
  316. BOOL WINAPI GdiPlayPageEMF(
  317. HANDLE SpoolFileHandle,
  318. HANDLE hemf,
  319. RECT *prectDocument,
  320. RECT *prectBorder,
  321. RECT *prectClip);
  322. BOOL WINAPI GdiPlayPrivatePageEMF(
  323. HANDLE SpoolFileHandle,
  324. HENHMETAFILE hEnhMetaFile,
  325. RECT *prectDocument);
  326. BOOL WINAPI GdiEndPageEMF(
  327. HANDLE SpoolFileHandle,
  328. DWORD dwOptimization);
  329. BOOL WINAPI GdiEndDocEMF(
  330. HANDLE SpoolFileHandle);
  331. BOOL WINAPI GdiGetDevmodeForPage(
  332. HANDLE SpoolFileHandle,
  333. DWORD dwPageNumber,
  334. PDEVMODEW *pCurrDM,
  335. PDEVMODEW *pLastDM);
  336. BOOL WINAPI GdiResetDCEMF(
  337. HANDLE SpoolFileHandle,
  338. PDEVMODEW pCurrDM);
  339. ULONG cGetTTFFromFOT(WCHAR *,ULONG,WCHAR *,FLONG *,FLONG *, DWORD *, BOOL);
  340. BOOL bMakePathNameW (WCHAR *, WCHAR *, WCHAR **, FLONG *);
  341. BOOL bInitSystemAndFontsDirectoriesW(WCHAR **, WCHAR **);
  342. #define FONT_IN_FONTS_DIR 1
  343. #define FONT_IN_SYSTEM_DIR 2
  344. #define FONT_RELATIVE_PATH 4
  345. #define FONT_ISNOT_FOT 8
  346. #ifdef LANGPACK
  347. BOOL LpkInitialize();
  348. VOID APIENTRY GdiSetLastError(ULONG iError);
  349. #define FRINFO_BITMAP 1
  350. #define FRINFO_VECTOR 2
  351. #define FRINFO_OTHER 3
  352. typedef struct tagREALIZATION_INFO {
  353. UINT uFontTechnology;
  354. UINT uRealizationID;
  355. UINT uFontFileID;
  356. } REALIZATION_INFO, *PREALIZATION_INFO;
  357. BOOL APIENTRY GdiRealizationInfo(HDC, PREALIZATION_INFO);
  358. WINGDIAPI BOOL WINAPI GetTextExtentExPointWPri(HDC, LPCWSTR, int, int, LPINT, LPINT, LPSIZE);
  359. BOOL APIENTRY GdiIsPlayMetafileDC(HDC hdc);
  360. #endif
  361. //
  362. // Font Enumeration defines
  363. //
  364. #define FE_FILTER_NONE 0L
  365. #define FE_FILTER_TRUETYPE 1L
  366. #define FE_AA_ON 2L // force antialiased text
  367. #define FE_SET_AA 4L
  368. #define FE_AA_ANY_SIZE 8L
  369. #define FE_CT_ON 16L // set antialiazing type to ClearType
  370. #define FE_SET_CT 32L
  371. #define FE_CT_BGR 64L // set color stripes order RGB vs BGR
  372. #define FE_SET_RGB_BGR 128L
  373. #define FE_CT_HORSTRIPES 256L // set color stripes direction VERTICAL vs HORIZINTAL
  374. #define FE_SET_STRIPES_DIR 512L
  375. #define FE_SET_CONTRAST 1024L
  376. #define DEFAULT_CT_CONTRAST 1400
  377. ULONG
  378. WINAPI SetFontEnumeration (
  379. ULONG ulType);
  380. //
  381. // Private Control Panel entry point to enumerate fonts by file.
  382. //
  383. #define GFRI_NUMFONTS 0L
  384. #define GFRI_DESCRIPTION 1L
  385. #define GFRI_LOGFONTS 2L
  386. #define GFRI_ISTRUETYPE 3L
  387. #define GFRI_TTFILENAME 4L
  388. #define GFRI_ISREMOVED 5L
  389. #if defined(FE_SB) // for GetFontResourceInfo()
  390. #define GFRI_FONTMETRICS 6L
  391. #endif // FE_SB
  392. // file path separator for Add/RemoveFontResourceA/W
  393. #define PATH_SEPARATOR L'|'
  394. WINGDIAPI BOOL
  395. WINAPI
  396. GetFontResourceInfoW(
  397. LPWSTR lpPathname,
  398. LPDWORD lpBytes,
  399. LPVOID lpBuffer,
  400. DWORD iType);
  401. BOOL WINAPI GdiGetMessage(VOID *pv);
  402. typedef enum _GdiCallId {
  403. MapFontFile_ = 1
  404. , UnmapFontFile_ = 2
  405. , GetFilePath_ = 3
  406. , LpkInstalled_ = 4
  407. , ComputeGlyphSet_ = 5
  408. , LoadModuleForWrite_ = 6
  409. , FreeModule_ = 7
  410. , GetFileChangeTime_ = 8
  411. , GetCurrentCodePage_ = 9
  412. } GdiCallId;
  413. typedef struct _GDICALL {
  414. GdiCallId Id;
  415. union {
  416. struct {
  417. ULONG iFile;
  418. PVOID pvUser;
  419. ULONG ByteCount;
  420. } MapFontFileArgs;
  421. struct {
  422. ULONG iFile;
  423. } UnmapFontFileArgs;
  424. struct {
  425. BOOL ReturnValue;
  426. HANDLE h;
  427. WCHAR (*pDest)[MAX_PATH+1];
  428. } GetFilePathArgs;
  429. struct {
  430. BOOL ReturnValue;
  431. } LpkInstalledArgs;
  432. struct {
  433. BOOL ReturnValue;
  434. struct _FD_GLYPHSET **ppGlyphSet;
  435. union {
  436. ULONG ByteCount;
  437. struct _FD_GLYPHSET *pGlyphSet;
  438. };
  439. INT nCodePage;
  440. INT nFirstChar;
  441. INT cChars;
  442. } ComputeGlyphSetArgs;
  443. struct {
  444. HANDLE ReturnValue;
  445. WCHAR *pwsz; // pointer to string
  446. ULONG cj;
  447. } LoadModuleForWriteArgs;
  448. struct {
  449. HANDLE h;
  450. } FreeModuleArgs;
  451. struct {
  452. BOOL ReturnValue;
  453. HANDLE h;
  454. LARGE_INTEGER Time;
  455. } GetFileChangeTimeArgs;
  456. struct {
  457. USHORT OemCodePage;
  458. USHORT AnsiCodePage;
  459. } GetCurrentCodePageArgs;
  460. };
  461. } GDICALL;
  462. BOOL WINAPI GdiCall(GDICALL *pCall);
  463. typedef struct _CHWIDTHINFO
  464. {
  465. LONG lMaxNegA;
  466. LONG lMaxNegC;
  467. LONG lMinWidthD;
  468. } CHWIDTHINFO, *PCHWIDTHINFO;
  469. BOOL
  470. APIENTRY
  471. GetCharWidthInfo(
  472. HDC hdc,
  473. PCHWIDTHINFO pChWidthInfo
  474. );
  475. /**************************************************************************\
  476. *
  477. * tmdiff struc, contains the fields that are possibly different
  478. * between ansi and unicode versions of TEXTMETRICA and TEXTMETRICW
  479. *
  480. * ONLY independent quantities are put into the strucure. Dependent ones,
  481. * such as tmDescent and maybe tmOverhang should be computed on the fly
  482. *
  483. * tmDesc = tmHt - tmAsc
  484. * tmOverhang = tt ? 0 : ((tmHt - 1)/2 + (BOLD ? 1 : 0))
  485. *
  486. \**************************************************************************/
  487. // this is a font with nonnegative a and c spaces, good for console
  488. #if (_WIN32_WINNT >= 0x0500)
  489. typedef struct _TMDIFF
  490. {
  491. ULONG cjotma; // size of OUTLINETEXTMETRICSA
  492. BYTE chFirst;
  493. BYTE chLast;
  494. BYTE chDefault;
  495. BYTE chBreak;
  496. } TMDIFF; // DIFF between TEXTMETRICA and TEXTMETRICW
  497. #else
  498. typedef struct _TMDIFF
  499. {
  500. ULONG cjotma; // size of OUTLINETEXTMETRICSA
  501. FLONG fl; // flags, for now only TMD_NONNEGATIVE_AC
  502. BYTE chFirst;
  503. BYTE chLast;
  504. BYTE chDefault;
  505. BYTE chBreak;
  506. } TMDIFF; // DIFF between TEXTMETRICA and TEXTMETRICW
  507. #endif // (_WIN32_WINNT >= 0x0500)
  508. // used to return correct GetTextMetricsA/W
  509. typedef struct _TMW_INTERNAL
  510. {
  511. TEXTMETRICW tmw;
  512. TMDIFF tmdTmw;
  513. } TMW_INTERNAL;
  514. #if (_WIN32_WINNT >= 0x0500)
  515. // this one is only used in enumeration,
  516. // new textmetricsex returned by EnumFontFamiliesEx, fontsignature is returned
  517. typedef struct _NTMW_INTERNAL
  518. {
  519. TMDIFF tmdNtmw;
  520. ENUMTEXTMETRICW entmw;
  521. } NTMW_INTERNAL;
  522. #else
  523. #define TMD_NONNEGATIVE_AC 1
  524. typedef struct _NTMW_INTERNAL
  525. {
  526. NEWTEXTMETRICEXW ntmw;
  527. TMDIFF tmd;
  528. } NTMW_INTERNAL;
  529. #endif // (_WIN32_WINNT >= 0x0500)
  530. // flags for AddFontResourceW
  531. // AFRW_ADD_LOCAL_FONT : add ONLY if it is a local font
  532. // AFRW_ADD_REMOTE_FONT: add ONLY if it is NOT local font
  533. // if neither one LOCAL or REMOTE bit is set, just add the font
  534. #define AFRW_ADD_LOCAL_FONT 0X01
  535. #define AFRW_ADD_REMOTE_FONT 0X02
  536. #define FRW_EMB_TID 0x04
  537. #define FRW_EMB_PID 0x08
  538. #define FRW_PVT_CLEANUP 0x80
  539. #if (_WIN32_WINNT >= 0x0500)
  540. int GdiAddFontResourceW( LPWSTR, DWORD, DESIGNVECTOR *);
  541. #endif
  542. // Win31 compatibility stuff
  543. // GetAppCompatFlags flag values
  544. #define GACF_IGNORENODISCARD 0x00000001
  545. #define GACF_FORCETEXTBAND 0x00000002
  546. #define GACF_ONELANDGRXBAND 0x00000004
  547. #define GACF_IGNORETOPMOST 0x00000008
  548. #define GACF_CALLTTDEVICE 0x00000010
  549. #define GACF_MULTIPLEBANDS 0x00000020
  550. #define GACF_ALWAYSSENDNCPAINT 0x00000040
  551. #define GACF_EDITSETTEXTMUNGE 0x00000080
  552. #define GACF_MOREEXTRAWNDWORDS 0x00000100
  553. #define GACF_TTIGNORERASTERDUPE 0x00000200
  554. #define GACF_HACKWINFLAGS 0x00000400
  555. #define GACF_DELAYHWHNDSHAKECHK 0x00000800
  556. #define GACF_ENUMHELVNTMSRMN 0x00001000
  557. #define GACF_ENUMTTNOTDEVICE 0x00002000
  558. #define GACF_SUBTRACTCLIPSIBS 0x00004000
  559. #define GACF_FORCETTGRAPHICS 0x00008000
  560. #define GACF_NOHRGN1 0x00010000
  561. #define GACF_NCCALCSIZEONMOVE 0x00020000
  562. #define GACF_SENDMENUDBLCLK 0x00040000
  563. #define GACF_30AVGWIDTH 0x00080000
  564. #define GACF_GETDEVCAPSNUMLIE 0x00100000
  565. #define GACF_WINVER31 0x00200000 //
  566. #define GACF_INCREASESTACK 0x00400000 //
  567. #define GACF_HEAPSLACK 0x00400000 //
  568. #define GACF_FORCEWIN31DEVMODESIZE 0x00800000 // (replaces PEEKMESSAGEIDLE)
  569. #define GACF_31VALIDMASK 0xFFE4800C //
  570. #define GACF_DISABLEFONTASSOC 0x01000000 // Used in FE only
  571. #define GACF_JAPANESCAPEMENT 0x01000000 // Used in FE only
  572. #define GACF_IGNOREFAULTS 0x02000000 //
  573. #define GACF_NOEMFSPOOLING 0x04000000 //
  574. #define GACF_RANDOM3XUI 0x08000000 //
  575. #define GACF_USEPRINTINGESCAPES 0x00000004 // re-use GACF_ONELANDGRXBAND
  576. #define GACF_FORCERASTERMODE 0x00008000 // re-use GACF_FORCETTGRAPHICS
  577. #define GACF_DONTJOURNALATTACH 0x10000000 //
  578. #define GACF_DISABLEDBCSPROPTT 0x20000000 // Used in FE only
  579. #define GACF_NOBRUSHCACHE 0x20000000 // re-use GACF_DISABLEDBCSPROPTT
  580. #define GACF_MIRRORREGFONTS 0x40000000 //
  581. #define GACF_NOSMOOTHSCROLLING 0x40000000 // re-use GACF_MIRRORREGFONTS
  582. #define GACF_TTIGNOREDDEVICE 0x80000000 // Used in Word97-J only
  583. #define GACF_NOSCROLLBARCTXMENU 0x80000000 // re-use GACF_TTIGNOREDDEVICE #119380
  584. LPDEVMODEW
  585. WINAPI
  586. GdiConvertToDevmodeW(
  587. LPDEVMODEA pdma
  588. );
  589. typedef struct _UNIVERSAL_FONT_ID {
  590. ULONG CheckSum;
  591. ULONG Index;
  592. } UNIVERSAL_FONT_ID, *PUNIVERSAL_FONT_ID;
  593. WINGDIAPI
  594. INT
  595. WINAPI
  596. GdiQueryFonts(
  597. PUNIVERSAL_FONT_ID,
  598. ULONG,
  599. PLARGE_INTEGER
  600. );
  601. WINGDIAPI
  602. BOOL
  603. WINAPI
  604. GdiConsoleTextOut(
  605. HDC hdc,
  606. POLYTEXTW *lpto,
  607. UINT nStrings,
  608. RECTL *prclBounds
  609. );
  610. typedef enum _FULLSCREENCONTROL {
  611. FullscreenControlEnable, // 0
  612. FullscreenControlDisable, // 1
  613. FullscreenControlSetCursorPosition, // 2
  614. FullscreenControlSetCursorAttributes, // 3
  615. FullscreenControlRegisterVdm, // 4
  616. FullscreenControlSetPalette, // 5
  617. FullscreenControlSetColors, // 6
  618. FullscreenControlLoadFont, // 7
  619. FullscreenControlRestoreHardwareState, // 8
  620. FullscreenControlSaveHardwareState, // 9
  621. FullscreenControlCopyFrameBuffer, // a
  622. FullscreenControlReadFromFrameBuffer, // b
  623. FullscreenControlWriteToFrameBuffer, // c
  624. FullscreenControlReverseMousePointer, // d
  625. FullscreenControlSetMode, // e
  626. FullscreenControlSetScreenInformation, // f
  627. FullscreenControlSpecificVideoControl, // 10 (for specific NEC PC-98)
  628. FullscreenControlCopyFrameBufferDB, // 11
  629. FullscreenControlWriteToFrameBufferDB, // 12
  630. FullscreenControlReverseMousePointerDB // 13
  631. } FULLSCREENCONTROL;
  632. WINGDIAPI
  633. BOOL
  634. WINAPI
  635. GdiFullscreenControl(
  636. FULLSCREENCONTROL FullscreenCommand,
  637. PVOID FullscreenInuut,
  638. DWORD FullscreenInputLength,
  639. PVOID FullscreenOutput,
  640. PULONG FullscreenOutputLength
  641. );
  642. #define IS_ANY_DBCS_CHARSET( CharSet ) \
  643. ( ((CharSet) == SHIFTJIS_CHARSET) ? TRUE : \
  644. ((CharSet) == HANGEUL_CHARSET) ? TRUE : \
  645. ((CharSet) == CHINESEBIG5_CHARSET) ? TRUE : \
  646. ((CharSet) == GB2312_CHARSET) ? TRUE : FALSE )
  647. typedef struct _UMTHDR {
  648. ULONG cjSize;
  649. ULONG ulType;
  650. ULONG ulReserved1;
  651. ULONG ulReserved2;
  652. } UMTHDR;
  653. WINGDIAPI
  654. ULONG
  655. WINAPI
  656. GdiPrinterThunk(
  657. UMTHDR *pumth,
  658. PVOID pvOut,
  659. ULONG cjOut
  660. );
  661. #define GPT_ERROR 0xffffffff
  662. #endif /* _WINGDIP_ */