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.

4241 lines
115 KiB

  1. /*++
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Module Name:
  4. winddi.h
  5. Abstract:
  6. Private entry points, defines and types for Windows NT GDI device
  7. driver interface.
  8. --*/
  9. #ifndef _WINDDI_
  10. #define _WINDDI_
  11. //
  12. // GUID definitions for use with kernel-mode GDI drivers
  13. //
  14. #ifndef _NO_DDRAWINT_NO_COM
  15. #ifndef EXTERN_C
  16. #ifdef __cplusplus
  17. #define EXTERN_C extern "C"
  18. #else // !defined(__cplusplus)
  19. #define EXTERN_C extern
  20. #endif // !defined(__cplusplus)
  21. #endif // !defined(EXTERN_C)
  22. #ifndef DEFINE_GUID
  23. #ifndef INITGUID
  24. #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
  25. EXTERN_C const GUID FAR name
  26. #else // !defined(INITGUID)
  27. #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
  28. EXTERN_C const GUID name \
  29. = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
  30. #endif // !defined(INITGUID)
  31. #endif // !defined(DEFINE_GUID)
  32. #ifndef DEFINE_GUIDEX
  33. #define DEFINE_GUIDEX(name) EXTERN_C const CDECL GUID name
  34. #endif // !defined(DEFINE_GUIDEX)
  35. #ifndef STATICGUIDOF
  36. #define STATICGUIDOF(guid) STATIC_##guid
  37. #endif // !defined(STATICGUIDOF)
  38. #ifndef GUID_DEFINED
  39. #define GUID_DEFINED
  40. typedef struct _GUID {
  41. ULONG Data1;
  42. USHORT Data2;
  43. USHORT Data3;
  44. UCHAR Data4[8];
  45. } GUID;
  46. #endif // !defined(GUID_DEFINED)
  47. #ifndef IsEqualGUID
  48. #define IsEqualGUID(guid1, guid2) \
  49. (!memcmp((guid1), (guid2), sizeof(GUID)))
  50. #endif // !defined(IsEqualGUID)
  51. #ifndef IsEqualIID
  52. #define IsEqualIID IsEqualGUID
  53. #endif // !defined(IsEqualIID)
  54. #endif // !defined(_NO_DDRAWINT_NO_COM)
  55. //
  56. // Standard DirectX HAL includes
  57. //
  58. #include <ddrawint.h>
  59. #include <d3dnthal.h>
  60. #ifdef __cplusplus
  61. extern "C" {
  62. #endif
  63. //
  64. // drivers and other components that include this should NOT include
  65. // windows.h They should be system conponents that only use GDI internals
  66. // and therefore only include wingdi.h
  67. //
  68. #if defined(_X86_) && !defined(USERMODE_DRIVER) && !defined(BUILD_WOW6432)
  69. //
  70. // x86 does not support floating-point instruction in the kernel mode,
  71. // the floating-point data would like be handled 32bits value as double words.
  72. //
  73. typedef DWORD FLOATL;
  74. #else
  75. //
  76. // Any platform that has support for floats in the kernel
  77. //
  78. typedef FLOAT FLOATL;
  79. #endif // _X86_
  80. typedef LONG PTRDIFF;
  81. typedef PTRDIFF *PPTRDIFF;
  82. typedef LONG FIX;
  83. typedef FIX *PFIX;
  84. typedef ULONG ROP4;
  85. typedef ULONG MIX;
  86. typedef ULONG HGLYPH;
  87. typedef HGLYPH *PHGLYPH;
  88. #define HGLYPH_INVALID ((HGLYPH)-1)
  89. typedef ULONG IDENT;
  90. //
  91. // handles for font file and font context objects
  92. //
  93. typedef ULONG_PTR HFF;
  94. typedef ULONG_PTR HFC;
  95. #define HFF_INVALID ((HFF) 0)
  96. #define HFC_INVALID ((HFC) 0)
  97. #define FD_ERROR 0xFFFFFFFF
  98. #define DDI_ERROR 0xFFFFFFFF
  99. typedef struct _POINTE /* pte */
  100. {
  101. FLOATL x;
  102. FLOATL y;
  103. } POINTE, *PPOINTE;
  104. typedef union _FLOAT_LONG
  105. {
  106. FLOATL e;
  107. LONG l;
  108. } FLOAT_LONG, *PFLOAT_LONG;
  109. typedef struct _POINTFIX
  110. {
  111. FIX x;
  112. FIX y;
  113. } POINTFIX, *PPOINTFIX;
  114. typedef struct _RECTFX
  115. {
  116. FIX xLeft;
  117. FIX yTop;
  118. FIX xRight;
  119. FIX yBottom;
  120. } RECTFX, *PRECTFX;
  121. DECLARE_HANDLE(HBM);
  122. DECLARE_HANDLE(HDEV);
  123. DECLARE_HANDLE(HSURF);
  124. DECLARE_HANDLE(DHSURF);
  125. DECLARE_HANDLE(DHPDEV);
  126. DECLARE_HANDLE(HDRVOBJ);
  127. #define LTOFX(x) ((x)<<4)
  128. #define FXTOL(x) ((x)>>4)
  129. #define FXTOLFLOOR(x) ((x)>>4)
  130. #define FXTOLCEILING(x) ((x + 0x0F)>>4)
  131. #define FXTOLROUND(x) ((((x) >> 3) + 1) >> 1)
  132. // context information
  133. typedef struct _FD_XFORM {
  134. FLOATL eXX;
  135. FLOATL eXY;
  136. FLOATL eYX;
  137. FLOATL eYY;
  138. } FD_XFORM, *PFD_XFORM;
  139. typedef struct _FD_DEVICEMETRICS { // devm
  140. FLONG flRealizedType;
  141. POINTE pteBase;
  142. POINTE pteSide;
  143. LONG lD;
  144. FIX fxMaxAscender;
  145. FIX fxMaxDescender;
  146. POINTL ptlUnderline1;
  147. POINTL ptlStrikeOut;
  148. POINTL ptlULThickness;
  149. POINTL ptlSOThickness;
  150. ULONG cxMax; // max pel width of bitmaps
  151. // the fields formerly in REALIZE_EXTRA as well as some new fields:
  152. ULONG cyMax; // did not use to be here
  153. ULONG cjGlyphMax; // (cxMax + 7)/8 * cyMax, or at least it should be
  154. FD_XFORM fdxQuantized;
  155. LONG lNonLinearExtLeading;
  156. LONG lNonLinearIntLeading;
  157. LONG lNonLinearMaxCharWidth;
  158. LONG lNonLinearAvgCharWidth;
  159. // some new fields
  160. LONG lMinA;
  161. LONG lMinC;
  162. LONG lMinD;
  163. LONG alReserved[1]; // just in case we need it.
  164. } FD_DEVICEMETRICS, *PFD_DEVICEMETRICS;
  165. typedef struct _LIGATURE { /* lig */
  166. ULONG culSize;
  167. LPWSTR pwsz;
  168. ULONG chglyph;
  169. HGLYPH ahglyph[1];
  170. } LIGATURE, *PLIGATURE;
  171. typedef struct _FD_LIGATURE {
  172. ULONG culThis;
  173. ULONG ulType;
  174. ULONG cLigatures;
  175. LIGATURE alig[1];
  176. } FD_LIGATURE;
  177. // glyph handle must be 32 bit
  178. // signed 16 bit integer type denoting number of FUnit's
  179. typedef SHORT FWORD;
  180. // point in the 32.32 bit precission
  181. typedef struct _POINTQF // ptq
  182. {
  183. LARGE_INTEGER x;
  184. LARGE_INTEGER y;
  185. } POINTQF, *PPOINTQF;
  186. //. Structures
  187. // devm.flRealizedType flags
  188. // FDM_TYPE_ZERO_BEARINGS // all glyphs have zero a and c spaces
  189. // the following two features refer to all glyphs in this font realization
  190. // FDM_TYPE_CHAR_INC_EQUAL_BM_BASE // base width == cx for horiz, == cy for vert.
  191. // FDM_TYPE_MAXEXT_EQUAL_BM_SIDE // side width == cy for horiz, == cx for vert.
  192. #define FDM_TYPE_BM_SIDE_CONST 0x00000001
  193. #define FDM_TYPE_MAXEXT_EQUAL_BM_SIDE 0x00000002
  194. #define FDM_TYPE_CHAR_INC_EQUAL_BM_BASE 0x00000004
  195. #define FDM_TYPE_ZERO_BEARINGS 0x00000008
  196. #define FDM_TYPE_CONST_BEARINGS 0x00000010
  197. // structures for describing a supported set of glyphs in a font
  198. typedef struct _WCRUN {
  199. WCHAR wcLow; // lowest character in run inclusive
  200. USHORT cGlyphs; // wcHighInclusive = wcLow + cGlyphs - 1;
  201. HGLYPH *phg; // pointer to an array of cGlyphs HGLYPH's
  202. } WCRUN, *PWCRUN;
  203. // If phg is set to (HGLYPH *)NULL, for all wc's in this particular run
  204. // the handle can be computed as simple zero extension:
  205. // HGLYPH hg = (HGLYPH) wc;
  206. //
  207. // If phg is not NULL, memory pointed to by phg, allocated by the driver,
  208. // WILL NOT MOVE.
  209. typedef struct _FD_GLYPHSET {
  210. ULONG cjThis; // size of this structure in butes
  211. FLONG flAccel; // accel flags, bits to be explained below
  212. ULONG cGlyphsSupported; // sum over all wcrun's of wcrun.cGlyphs
  213. ULONG cRuns;
  214. WCRUN awcrun[1]; // an array of cRun WCRUN structures
  215. } FD_GLYPHSET, *PFD_GLYPHSET;
  216. typedef struct _FD_GLYPHATTR {
  217. ULONG cjThis; // size of this structure in butes
  218. ULONG cGlyphs;
  219. ULONG iMode;
  220. BYTE aGlyphAttr[1]; // an array of byte
  221. } FD_GLYPHATTR, *PFD_GLYPHATTR;
  222. // If GS_UNICODE_HANDLES bit is set,
  223. // for ALL WCRUNS in this FD_GLYPHSET the handles are
  224. // obtained by zero extending unicode code points of
  225. // the corresponding supported glyphs, i.e. all gs.phg's are NULL
  226. #define GS_UNICODE_HANDLES 0x00000001
  227. // If GS_8BIT_HANDLES bit is set, all handles are in 0-255 range.
  228. // This is just an ansi font then and we are really making up all
  229. // the unicode stuff about this font.
  230. #define GS_8BIT_HANDLES 0x00000002
  231. // all handles fit in 16 bits.
  232. // to 8 bit handles as it should.
  233. #define GS_16BIT_HANDLES 0x00000004
  234. // ligatures
  235. typedef struct _FD_KERNINGPAIR {
  236. WCHAR wcFirst;
  237. WCHAR wcSecond;
  238. FWORD fwdKern;
  239. } FD_KERNINGPAIR;
  240. // IFIMETRICS constants
  241. #define FM_VERSION_NUMBER 0x0
  242. //
  243. // IFIMETRICS::fsType flags
  244. //
  245. #define FM_TYPE_LICENSED 0x2
  246. #define FM_READONLY_EMBED 0x4
  247. #define FM_EDITABLE_EMBED 0x8
  248. #define FM_NO_EMBEDDING FM_TYPE_LICENSED
  249. //
  250. // IFIMETRICS::flInfo flags
  251. //
  252. #define FM_INFO_TECH_TRUETYPE 0x00000001
  253. #define FM_INFO_TECH_BITMAP 0x00000002
  254. #define FM_INFO_TECH_STROKE 0x00000004
  255. #define FM_INFO_TECH_OUTLINE_NOT_TRUETYPE 0x00000008
  256. #define FM_INFO_ARB_XFORMS 0x00000010
  257. #define FM_INFO_1BPP 0x00000020
  258. #define FM_INFO_4BPP 0x00000040
  259. #define FM_INFO_8BPP 0x00000080
  260. #define FM_INFO_16BPP 0x00000100
  261. #define FM_INFO_24BPP 0x00000200
  262. #define FM_INFO_32BPP 0x00000400
  263. #define FM_INFO_INTEGER_WIDTH 0x00000800
  264. #define FM_INFO_CONSTANT_WIDTH 0x00001000
  265. #define FM_INFO_NOT_CONTIGUOUS 0x00002000
  266. #define FM_INFO_TECH_MM 0x00004000
  267. #define FM_INFO_RETURNS_OUTLINES 0x00008000
  268. #define FM_INFO_RETURNS_STROKES 0x00010000
  269. #define FM_INFO_RETURNS_BITMAPS 0x00020000
  270. #define FM_INFO_DSIG 0x00040000 // FM_INFO_UNICODE_COMPLIANT
  271. #define FM_INFO_RIGHT_HANDED 0x00080000
  272. #define FM_INFO_INTEGRAL_SCALING 0x00100000
  273. #define FM_INFO_90DEGREE_ROTATIONS 0x00200000
  274. #define FM_INFO_OPTICALLY_FIXED_PITCH 0x00400000
  275. #define FM_INFO_DO_NOT_ENUMERATE 0x00800000
  276. #define FM_INFO_ISOTROPIC_SCALING_ONLY 0x01000000
  277. #define FM_INFO_ANISOTROPIC_SCALING_ONLY 0x02000000
  278. #define FM_INFO_TECH_CFF 0x04000000
  279. #define FM_INFO_FAMILY_EQUIV 0x08000000
  280. #define FM_INFO_DBCS_FIXED_PITCH 0x10000000
  281. #define FM_INFO_NONNEGATIVE_AC 0x20000000
  282. #define FM_INFO_IGNORE_TC_RA_ABLE 0x40000000
  283. #define FM_INFO_TECH_TYPE1 0x80000000
  284. // max number of charsets supported in a tt font, 16 according to win95 guys
  285. #define MAXCHARSETS 16
  286. //
  287. // IFIMETRICS::ulPanoseCulture
  288. //
  289. #define FM_PANOSE_CULTURE_LATIN 0x0
  290. //
  291. // IFMETRICS::fsSelection flags
  292. //
  293. #define FM_SEL_ITALIC 0x0001
  294. #define FM_SEL_UNDERSCORE 0x0002
  295. #define FM_SEL_NEGATIVE 0x0004
  296. #define FM_SEL_OUTLINED 0x0008
  297. #define FM_SEL_STRIKEOUT 0x0010
  298. #define FM_SEL_BOLD 0x0020
  299. #define FM_SEL_REGULAR 0x0040
  300. //
  301. // The FONTDIFF structure contains all of the fields that could
  302. // possibly change under simulation
  303. //
  304. typedef struct _FONTDIFF {
  305. BYTE jReserved1; // 0x0
  306. BYTE jReserved2; // 0x1
  307. BYTE jReserved3; // 0x2
  308. BYTE bWeight; // 0x3 Panose Weight
  309. USHORT usWinWeight; // 0x4
  310. FSHORT fsSelection; // 0x6
  311. FWORD fwdAveCharWidth; // 0x8
  312. FWORD fwdMaxCharInc; // 0xA
  313. POINTL ptlCaret; // 0xC
  314. } FONTDIFF;
  315. typedef struct _FONTSIM {
  316. PTRDIFF dpBold; // offset from beginning of FONTSIM to FONTDIFF
  317. PTRDIFF dpItalic; // offset from beginning of FONTSIM to FONTDIFF
  318. PTRDIFF dpBoldItalic; // offset from beginning of FONTSIM to FONTDIFF
  319. } FONTSIM;
  320. typedef struct _IFIMETRICS {
  321. ULONG cjThis; // includes attached information
  322. ULONG cjIfiExtra; // sizeof IFIEXTRA if any, formerly ulVersion
  323. PTRDIFF dpwszFamilyName;
  324. PTRDIFF dpwszStyleName;
  325. PTRDIFF dpwszFaceName;
  326. PTRDIFF dpwszUniqueName;
  327. PTRDIFF dpFontSim;
  328. LONG lEmbedId;
  329. LONG lItalicAngle;
  330. LONG lCharBias;
  331. // dpCharSet field replaced alReserved[0].
  332. // If the 3.51 pcl minidrivers are still to work on NT 4.0 this field must not
  333. // move because they will have 0 at this position.
  334. PTRDIFF dpCharSets; // only used if > 1 charset supported
  335. BYTE jWinCharSet; // as in LOGFONT::lfCharSet
  336. BYTE jWinPitchAndFamily; // as in LOGFONT::lfPitchAndFamily
  337. USHORT usWinWeight; // as in LOGFONT::lfWeight
  338. ULONG flInfo; // see above
  339. USHORT fsSelection; // see above
  340. USHORT fsType; // see above
  341. FWORD fwdUnitsPerEm; // em height
  342. FWORD fwdLowestPPEm; // readable limit
  343. FWORD fwdWinAscender;
  344. FWORD fwdWinDescender;
  345. FWORD fwdMacAscender;
  346. FWORD fwdMacDescender;
  347. FWORD fwdMacLineGap;
  348. FWORD fwdTypoAscender;
  349. FWORD fwdTypoDescender;
  350. FWORD fwdTypoLineGap;
  351. FWORD fwdAveCharWidth;
  352. FWORD fwdMaxCharInc;
  353. FWORD fwdCapHeight;
  354. FWORD fwdXHeight;
  355. FWORD fwdSubscriptXSize;
  356. FWORD fwdSubscriptYSize;
  357. FWORD fwdSubscriptXOffset;
  358. FWORD fwdSubscriptYOffset;
  359. FWORD fwdSuperscriptXSize;
  360. FWORD fwdSuperscriptYSize;
  361. FWORD fwdSuperscriptXOffset;
  362. FWORD fwdSuperscriptYOffset;
  363. FWORD fwdUnderscoreSize;
  364. FWORD fwdUnderscorePosition;
  365. FWORD fwdStrikeoutSize;
  366. FWORD fwdStrikeoutPosition;
  367. BYTE chFirstChar; // for win 3.1 compatibility
  368. BYTE chLastChar; // for win 3.1 compatibility
  369. BYTE chDefaultChar; // for win 3.1 compatibility
  370. BYTE chBreakChar; // for win 3.1 compatibility
  371. WCHAR wcFirstChar; // lowest supported code in Unicode set
  372. WCHAR wcLastChar; // highest supported code in Unicode set
  373. WCHAR wcDefaultChar;
  374. WCHAR wcBreakChar;
  375. POINTL ptlBaseline; //
  376. POINTL ptlAspect; // designed aspect ratio (bitmaps)
  377. POINTL ptlCaret; // points along caret
  378. RECTL rclFontBox; // bounding box for all glyphs (font space)
  379. BYTE achVendId[4]; // as per TrueType
  380. ULONG cKerningPairs;
  381. ULONG ulPanoseCulture;
  382. PANOSE panose;
  383. #if defined(_WIN64)
  384. //
  385. // IFIMETRICS must begin on a 64-bit boundary
  386. //
  387. PVOID Align;
  388. #endif
  389. } IFIMETRICS, *PIFIMETRICS;
  390. // rather than adding the fields of IFIEXTRA to IFIMETRICS itself
  391. // we add them as a separate structure. This structure, if present at all,
  392. // lies below IFIMETRICS in memory.
  393. // If IFIEXTRA is present at all, ifi.cjIfiExtra (formerly ulVersion)
  394. // will contain size of IFIEXTRA including any reserved fields.
  395. // That way ulVersion = 0 (NT 3.51 or less) printer minidrivers
  396. // will work with NT 4.0.
  397. typedef struct _IFIEXTRA
  398. {
  399. ULONG ulIdentifier; // used for Type 1 fonts only
  400. PTRDIFF dpFontSig; // nontrivial for tt only, at least for now.
  401. ULONG cig; // maxp->numGlyphs, # of distinct glyph indicies
  402. PTRDIFF dpDesignVector; // offset to design vector for mm instances
  403. PTRDIFF dpAxesInfoW; // offset to full axes info for base mm font
  404. ULONG aulReserved[1]; // in case we need even more stuff in the future
  405. } IFIEXTRA, *PIFIEXTRA;
  406. #define SIZEOFDV(cAxes) (offsetof(DESIGNVECTOR,dvValues) + (cAxes)*sizeof(LONG))
  407. #define SIZEOFAXIW(cAxes) (offsetof(AXESLISTW,axlAxisInfo) + (cAxes)*sizeof(AXISINFOW))
  408. #define SIZEOFAXIA(cAxes) (offsetof(AXESLISTA,axlAxisInfo) + (cAxes)*sizeof(AXISINFOA))
  409. /**************************************************************************\
  410. *
  411. \**************************************************************************/
  412. /* OpenGL DDI ExtEscape escape numbers (4352 - 4607) */
  413. #define OPENGL_CMD 4352 /* for OpenGL ExtEscape */
  414. #define OPENGL_GETINFO 4353 /* for OpenGL ExtEscape */
  415. #define WNDOBJ_SETUP 4354 /* for live video ExtEscape */
  416. /**************************************************************************\
  417. * Display Driver version numbers
  418. *
  419. * Note: DDI_DRIVER_VERSION has been removed. Drivers must specify
  420. * what version of the DDI they support using one of the below
  421. * DDI_DRIVER_VERSION_Xxx macros.
  422. * DDI_DRIVER_VERSION_NT4 is equivalent to old DDI_DRIVER_VERSION.
  423. \**************************************************************************/
  424. #define DDI_DRIVER_VERSION_NT4 0x00020000
  425. #define DDI_DRIVER_VERSION_SP3 0x00020003
  426. #define DDI_DRIVER_VERSION_NT5 0x00030000
  427. #define DDI_DRIVER_VERSION_NT5_01 0x00030100
  428. #define DDI_DRIVER_VERSION_NT5_01_SP1 0x00030101
  429. #define GDI_DRIVER_VERSION 0x4000 /* for NT version 4.0.00 */
  430. typedef LONG_PTR (APIENTRY *PFN)();
  431. typedef struct _DRVFN /* drvfn */
  432. {
  433. ULONG iFunc;
  434. PFN pfn;
  435. } DRVFN, *PDRVFN;
  436. /* Required functions */
  437. #define INDEX_DrvEnablePDEV 0L
  438. #define INDEX_DrvCompletePDEV 1L
  439. #define INDEX_DrvDisablePDEV 2L
  440. #define INDEX_DrvEnableSurface 3L
  441. #define INDEX_DrvDisableSurface 4L
  442. /* Other functions */
  443. #define INDEX_DrvAssertMode 5L
  444. #define INDEX_DrvOffset 6L // Obsolete
  445. #define INDEX_DrvResetPDEV 7L
  446. #define INDEX_DrvDisableDriver 8L
  447. #define INDEX_DrvCreateDeviceBitmap 10L
  448. #define INDEX_DrvDeleteDeviceBitmap 11L
  449. #define INDEX_DrvRealizeBrush 12L
  450. #define INDEX_DrvDitherColor 13L
  451. #define INDEX_DrvStrokePath 14L
  452. #define INDEX_DrvFillPath 15L
  453. #define INDEX_DrvStrokeAndFillPath 16L
  454. #define INDEX_DrvPaint 17L
  455. #define INDEX_DrvBitBlt 18L
  456. #define INDEX_DrvCopyBits 19L
  457. #define INDEX_DrvStretchBlt 20L
  458. #define INDEX_DrvSetPalette 22L
  459. #define INDEX_DrvTextOut 23L
  460. #define INDEX_DrvEscape 24L
  461. #define INDEX_DrvDrawEscape 25L
  462. #define INDEX_DrvQueryFont 26L
  463. #define INDEX_DrvQueryFontTree 27L
  464. #define INDEX_DrvQueryFontData 28L
  465. #define INDEX_DrvSetPointerShape 29L
  466. #define INDEX_DrvMovePointer 30L
  467. #define INDEX_DrvLineTo 31L
  468. #define INDEX_DrvSendPage 32L
  469. #define INDEX_DrvStartPage 33L
  470. #define INDEX_DrvEndDoc 34L
  471. #define INDEX_DrvStartDoc 35L
  472. #define INDEX_DrvGetGlyphMode 37L
  473. #define INDEX_DrvSynchronize 38L
  474. #define INDEX_DrvSaveScreenBits 40L
  475. #define INDEX_DrvGetModes 41L
  476. #define INDEX_DrvFree 42L
  477. #define INDEX_DrvDestroyFont 43L
  478. #define INDEX_DrvQueryFontCaps 44L
  479. #define INDEX_DrvLoadFontFile 45L
  480. #define INDEX_DrvUnloadFontFile 46L
  481. #define INDEX_DrvFontManagement 47L
  482. #define INDEX_DrvQueryTrueTypeTable 48L
  483. #define INDEX_DrvQueryTrueTypeOutline 49L
  484. #define INDEX_DrvGetTrueTypeFile 50L
  485. #define INDEX_DrvQueryFontFile 51L
  486. #define INDEX_DrvMovePanning 52L
  487. #define INDEX_DrvQueryAdvanceWidths 53L
  488. #define INDEX_DrvSetPixelFormat 54L
  489. #define INDEX_DrvDescribePixelFormat 55L
  490. #define INDEX_DrvSwapBuffers 56L
  491. #define INDEX_DrvStartBanding 57L
  492. #define INDEX_DrvNextBand 58L
  493. #define INDEX_DrvGetDirectDrawInfo 59L
  494. #define INDEX_DrvEnableDirectDraw 60L
  495. #define INDEX_DrvDisableDirectDraw 61L
  496. #define INDEX_DrvQuerySpoolType 62L
  497. #define INDEX_DrvIcmCreateColorTransform 64L
  498. #define INDEX_DrvIcmDeleteColorTransform 65L
  499. #define INDEX_DrvIcmCheckBitmapBits 66L
  500. #define INDEX_DrvIcmSetDeviceGammaRamp 67L
  501. #define INDEX_DrvGradientFill 68L
  502. #define INDEX_DrvStretchBltROP 69L
  503. #define INDEX_DrvPlgBlt 70L
  504. #define INDEX_DrvAlphaBlend 71L
  505. #define INDEX_DrvSynthesizeFont 72L
  506. #define INDEX_DrvGetSynthesizedFontFiles 73L
  507. #define INDEX_DrvTransparentBlt 74L
  508. #define INDEX_DrvQueryPerBandInfo 75L
  509. #define INDEX_DrvQueryDeviceSupport 76L
  510. #define INDEX_DrvReserved1 77L
  511. #define INDEX_DrvReserved2 78L
  512. #define INDEX_DrvReserved3 79L
  513. #define INDEX_DrvReserved4 80L
  514. #define INDEX_DrvReserved5 81L
  515. #define INDEX_DrvReserved6 82L
  516. #define INDEX_DrvReserved7 83L
  517. #define INDEX_DrvReserved8 84L
  518. #define INDEX_DrvDeriveSurface 85L
  519. #define INDEX_DrvQueryGlyphAttrs 86L
  520. #define INDEX_DrvNotify 87L
  521. #define INDEX_DrvSynchronizeSurface 88L
  522. #define INDEX_DrvResetDevice 89L
  523. #define INDEX_DrvReserved9 90L
  524. #define INDEX_DrvReserved10 91L
  525. #define INDEX_DrvReserved11 92L
  526. /* The total number of dispatched functions */
  527. #define INDEX_LAST 93L
  528. typedef struct tagDRVENABLEDATA
  529. {
  530. ULONG iDriverVersion;
  531. ULONG c;
  532. DRVFN *pdrvfn;
  533. } DRVENABLEDATA, *PDRVENABLEDATA;
  534. typedef struct tagDEVINFO
  535. {
  536. FLONG flGraphicsCaps;
  537. LOGFONTW lfDefaultFont;
  538. LOGFONTW lfAnsiVarFont;
  539. LOGFONTW lfAnsiFixFont;
  540. ULONG cFonts;
  541. ULONG iDitherFormat;
  542. USHORT cxDither;
  543. USHORT cyDither;
  544. HPALETTE hpalDefault;
  545. FLONG flGraphicsCaps2;
  546. } DEVINFO, *PDEVINFO;
  547. // flGraphicsCaps flags for DEVINFO:
  548. #define GCAPS_BEZIERS 0x00000001
  549. #define GCAPS_GEOMETRICWIDE 0x00000002
  550. #define GCAPS_ALTERNATEFILL 0x00000004
  551. #define GCAPS_WINDINGFILL 0x00000008
  552. #define GCAPS_HALFTONE 0x00000010
  553. #define GCAPS_COLOR_DITHER 0x00000020
  554. #define GCAPS_HORIZSTRIKE 0x00000040 // Obsolete
  555. #define GCAPS_VERTSTRIKE 0x00000080 // Obsolete
  556. #define GCAPS_OPAQUERECT 0x00000100
  557. #define GCAPS_VECTORFONT 0x00000200
  558. #define GCAPS_MONO_DITHER 0x00000400
  559. #define GCAPS_ASYNCCHANGE 0x00000800 // Obsolete
  560. #define GCAPS_ASYNCMOVE 0x00001000
  561. #define GCAPS_DONTJOURNAL 0x00002000
  562. #define GCAPS_DIRECTDRAW 0x00004000 // Obsolete
  563. #define GCAPS_ARBRUSHOPAQUE 0x00008000
  564. #define GCAPS_PANNING 0x00010000
  565. #define GCAPS_HIGHRESTEXT 0x00040000
  566. #define GCAPS_PALMANAGED 0x00080000
  567. #define GCAPS_DITHERONREALIZE 0x00200000
  568. #define GCAPS_NO64BITMEMACCESS 0x00400000 // Obsolete
  569. #define GCAPS_FORCEDITHER 0x00800000
  570. #define GCAPS_GRAY16 0x01000000
  571. #define GCAPS_ICM 0x02000000
  572. #define GCAPS_CMYKCOLOR 0x04000000
  573. #define GCAPS_LAYERED 0x08000000
  574. #define GCAPS_ARBRUSHTEXT 0x10000000
  575. #define GCAPS_SCREENPRECISION 0x20000000
  576. #define GCAPS_FONT_RASTERIZER 0x40000000 // the device has built in tt rasterizer
  577. #define GCAPS_NUP 0x80000000
  578. // flGraphicsCaps2 flags for DEVINFO:
  579. #define GCAPS2_JPEGSRC 0x00000001
  580. #define GCAPS2_xxxx 0x00000002
  581. #define GCAPS2_PNGSRC 0x00000008
  582. #define GCAPS2_CHANGEGAMMARAMP 0x00000010
  583. #define GCAPS2_ALPHACURSOR 0x00000020
  584. #define GCAPS2_SYNCFLUSH 0x00000040
  585. #define GCAPS2_SYNCTIMER 0x00000080
  586. #define GCAPS2_ICD_MULTIMON 0x00000100
  587. #define GCAPS2_MOUSETRAILS 0x00000200
  588. #define GCAPS2_RESERVED1 0x00000400
  589. typedef struct _LINEATTRS
  590. {
  591. FLONG fl;
  592. ULONG iJoin;
  593. ULONG iEndCap;
  594. FLOAT_LONG elWidth;
  595. FLOATL eMiterLimit;
  596. ULONG cstyle;
  597. PFLOAT_LONG pstyle;
  598. FLOAT_LONG elStyleState;
  599. } LINEATTRS, *PLINEATTRS;
  600. #define LA_GEOMETRIC 0x00000001
  601. #define LA_ALTERNATE 0x00000002
  602. #define LA_STARTGAP 0x00000004
  603. #define LA_STYLED 0x00000008
  604. #define JOIN_ROUND 0L
  605. #define JOIN_BEVEL 1L
  606. #define JOIN_MITER 2L
  607. #define ENDCAP_ROUND 0L
  608. #define ENDCAP_SQUARE 1L
  609. #define ENDCAP_BUTT 2L
  610. typedef LONG LDECI4;
  611. typedef struct _XFORML {
  612. FLOATL eM11;
  613. FLOATL eM12;
  614. FLOATL eM21;
  615. FLOATL eM22;
  616. FLOATL eDx;
  617. FLOATL eDy;
  618. } XFORML, *PXFORML;
  619. typedef struct _CIECHROMA
  620. {
  621. LDECI4 x;
  622. LDECI4 y;
  623. LDECI4 Y;
  624. }CIECHROMA;
  625. typedef struct _COLORINFO
  626. {
  627. CIECHROMA Red;
  628. CIECHROMA Green;
  629. CIECHROMA Blue;
  630. CIECHROMA Cyan;
  631. CIECHROMA Magenta;
  632. CIECHROMA Yellow;
  633. CIECHROMA AlignmentWhite;
  634. LDECI4 RedGamma;
  635. LDECI4 GreenGamma;
  636. LDECI4 BlueGamma;
  637. LDECI4 MagentaInCyanDye;
  638. LDECI4 YellowInCyanDye;
  639. LDECI4 CyanInMagentaDye;
  640. LDECI4 YellowInMagentaDye;
  641. LDECI4 CyanInYellowDye;
  642. LDECI4 MagentaInYellowDye;
  643. }COLORINFO, *PCOLORINFO;
  644. // Allowed values for GDIINFO.ulPrimaryOrder.
  645. #define PRIMARY_ORDER_ABC 0
  646. #define PRIMARY_ORDER_ACB 1
  647. #define PRIMARY_ORDER_BAC 2
  648. #define PRIMARY_ORDER_BCA 3
  649. #define PRIMARY_ORDER_CBA 4
  650. #define PRIMARY_ORDER_CAB 5
  651. // Allowed values for GDIINFO.ulHTPatternSize.
  652. #define HT_PATSIZE_2x2 0
  653. #define HT_PATSIZE_2x2_M 1
  654. #define HT_PATSIZE_4x4 2
  655. #define HT_PATSIZE_4x4_M 3
  656. #define HT_PATSIZE_6x6 4
  657. #define HT_PATSIZE_6x6_M 5
  658. #define HT_PATSIZE_8x8 6
  659. #define HT_PATSIZE_8x8_M 7
  660. #define HT_PATSIZE_10x10 8
  661. #define HT_PATSIZE_10x10_M 9
  662. #define HT_PATSIZE_12x12 10
  663. #define HT_PATSIZE_12x12_M 11
  664. #define HT_PATSIZE_14x14 12
  665. #define HT_PATSIZE_14x14_M 13
  666. #define HT_PATSIZE_16x16 14
  667. #define HT_PATSIZE_16x16_M 15
  668. #define HT_PATSIZE_SUPERCELL 16
  669. #define HT_PATSIZE_SUPERCELL_M 17
  670. #define HT_PATSIZE_USER 18
  671. #define HT_PATSIZE_MAX_INDEX HT_PATSIZE_USER
  672. #define HT_PATSIZE_DEFAULT HT_PATSIZE_SUPERCELL_M
  673. #define HT_USERPAT_CX_MIN 4
  674. #define HT_USERPAT_CX_MAX 256
  675. #define HT_USERPAT_CY_MIN 4
  676. #define HT_USERPAT_CY_MAX 256
  677. // Allowed values for GDIINFO.ulHTOutputFormat.
  678. #define HT_FORMAT_1BPP 0
  679. #define HT_FORMAT_4BPP 2
  680. #define HT_FORMAT_4BPP_IRGB 3
  681. #define HT_FORMAT_8BPP 4
  682. #define HT_FORMAT_16BPP 5
  683. #define HT_FORMAT_24BPP 6
  684. #define HT_FORMAT_32BPP 7
  685. // Allowed values for GDIINFO.flHTFlags.
  686. #define HT_FLAG_SQUARE_DEVICE_PEL 0x00000001
  687. #define HT_FLAG_HAS_BLACK_DYE 0x00000002
  688. #define HT_FLAG_ADDITIVE_PRIMS 0x00000004
  689. #define HT_FLAG_USE_8BPP_BITMASK 0x00000008
  690. #define HT_FLAG_INK_HIGH_ABSORPTION 0x00000010
  691. #define HT_FLAG_INK_ABSORPTION_INDICES 0x00000060
  692. #define HT_FLAG_DO_DEVCLR_XFORM 0x00000080
  693. #define HT_FLAG_OUTPUT_CMY 0x00000100
  694. #define HT_FLAG_PRINT_DRAFT_MODE 0x00000200
  695. #define HT_FLAG_INVERT_8BPP_BITMASK_IDX 0x00000400
  696. #define HT_FLAG_8BPP_CMY332_MASK 0xFF000000
  697. #define MAKE_CMYMASK_BYTE(c,m,y) ((BYTE)(((BYTE)(c) & 0x07) << 5) | \
  698. (BYTE)(((BYTE)(m) & 0x07) << 2) | \
  699. (BYTE)((BYTE)(y) & 0x03))
  700. #define MAKE_CMY332_MASK(c,m,y) ((DWORD)(((DWORD)(c) & 0x07) << 29) | \
  701. (DWORD)(((DWORD)(m) & 0x07) << 26) | \
  702. (DWORD)(((DWORD)(y) & 0x03) << 24))
  703. #define HT_FLAG_INK_ABSORPTION_IDX0 0x00000000
  704. #define HT_FLAG_INK_ABSORPTION_IDX1 0x00000020
  705. #define HT_FLAG_INK_ABSORPTION_IDX2 0x00000040
  706. #define HT_FLAG_INK_ABSORPTION_IDX3 0x00000060
  707. #define HT_FLAG_HIGHEST_INK_ABSORPTION (HT_FLAG_INK_HIGH_ABSORPTION | \
  708. HT_FLAG_INK_ABSORPTION_IDX3)
  709. #define HT_FLAG_HIGHER_INK_ABSORPTION (HT_FLAG_INK_HIGH_ABSORPTION | \
  710. HT_FLAG_INK_ABSORPTION_IDX2)
  711. #define HT_FLAG_HIGH_INK_ABSORPTION (HT_FLAG_INK_HIGH_ABSORPTION | \
  712. HT_FLAG_INK_ABSORPTION_IDX1)
  713. #define HT_FLAG_NORMAL_INK_ABSORPTION HT_FLAG_INK_ABSORPTION_IDX0
  714. #define HT_FLAG_LOW_INK_ABSORPTION (HT_FLAG_INK_ABSORPTION_IDX1)
  715. #define HT_FLAG_LOWER_INK_ABSORPTION (HT_FLAG_INK_ABSORPTION_IDX2)
  716. #define HT_FLAG_LOWEST_INK_ABSORPTION (HT_FLAG_INK_ABSORPTION_IDX3)
  717. // Setting/checking halftone 8bpp bitmask RGB mode
  718. #define HT_BITMASKPALRGB (DWORD)'0BGR'
  719. #define HT_SET_BITMASKPAL2RGB(pPal) (*((LPDWORD)(pPal)) = HT_BITMASKPALRGB)
  720. #define HT_IS_BITMASKPALRGB(pPal) (*((LPDWORD)(pPal)) == (DWORD)0)
  721. // Allowed values for GDIINFO.ulPhysicalPixelCharacteristics
  722. #define PPC_DEFAULT 0x0
  723. #define PPC_UNDEFINED 0x1
  724. #define PPC_RGB_ORDER_VERTICAL_STRIPES 0x2
  725. #define PPC_BGR_ORDER_VERTICAL_STRIPES 0x3
  726. #define PPC_RGB_ORDER_HORIZONTAL_STRIPES 0x4
  727. #define PPC_BGR_ORDER_HORIZONTAL_STRIPES 0x5
  728. // GDIINFO.ulPhysicalPixelGamma should be set either to the scaled
  729. // gamma (x1000) of the physical pixel or one of the following
  730. // values. For example, a 2.2 gamma would be represented as 2200
  731. #define PPG_DEFAULT 0
  732. #define PPG_SRGB 1
  733. //============================================================================
  734. // HALFTONE INFORMATION
  735. //============================================================================
  736. //
  737. // HT_FLAG_DO_DEVCLR_XFORM flag specified devices and/or drivers are required
  738. // gdi halftone to do a device transform when ICM is off, the device transform
  739. // take a input RGB value and map it to the device color space to produced
  740. // perceived density same as input RGB color values. This flag only valid if
  741. // it is a printer device surface and its format is 16bpp or 24bpp.
  742. //
  743. // ** If devices are additive and/or device surface is 1bpp, 4bpp or 8bpp, then
  744. // gdi halftone will always performed device transform regardless the
  745. // setting of HT_FLAG_DO_DEVCLR_XFORM flag.
  746. //
  747. // HT_FLAG_8BPP_CMY332_MASK - define the bit mask for 8-bpp format halftone
  748. // palette, this palette only used if a HT_FORMAT_8BPP is specified in
  749. // flHTOutputFormat and HT_FLAG_USE_8BPP_BITMASK bit is set in the flHTFlags.
  750. // if HT_FLAG_USE_8BPP_BITMAP is not set then a standard NT4.0 8-bpp format is
  751. // assumed. The format of 8BPP is set per PDEV, it cannot be changed after
  752. // the pDEV is created.
  753. //
  754. // To set HT_FLAG_8BPP_CMY332_MASK, macro MAKE_CMY332_MASK() can be used. When
  755. // specified, the bit mask cover total of 8 bits area which describe the
  756. // highest of level of CYAN, MAGENTA and YELLOW primary color, the maximum of
  757. // Cyan is 3 bits (7 levels), Magenta is 3 bits (7 levels) and Yellow is 2 bit
  758. // (3 levels).
  759. //
  760. // CMYMask Meaning
  761. // ======= =======
  762. // 0x6F Cyan=3, Magenta=3, Yellow=3
  763. // 0xFF Cyan=7, Magenta=7, Yellow=3
  764. // 0x25 Cyan=1, Magenta=1, Yellow=1, is same as using CMY 4bpp
  765. //
  766. // SPECIAL
  767. // CMYMask Meagning
  768. // ======= =======
  769. // 0x00 Gray scale 256 levels
  770. // 0x01 5 Levels (0-4) each of Cyan, Magenta and yellow, 5^3=125 color
  771. // 0x02 6 Levels (0-5) each of Cyan, Magenta and yellow, 6^3=216 color
  772. //
  773. // Any other invalid combinations (any of Cyan, Magenta, Yellow level bits is
  774. // 0 (zero) then it will returned palette entries 0
  775. //
  776. // The Palette indics are arranged as CMY entries with CYAN at highest bit
  777. // numbers and YELLOW at lowest bit number as shown below for palette indics
  778. // bit's (8 bit) definition.
  779. //
  780. // Pallete Index BIT#: 7 6 5 4 3 2 1 0
  781. // | | | | | |
  782. // +---C---+ +---M---+ +-Y-+
  783. // | | |
  784. // | | 0x03
  785. // | | +-- Yellow 0-3, Max=4 levels
  786. // | 0x1c
  787. // | +-- Magenta 0-7, Max=8 levels
  788. // 0xe0
  789. // +-- Cyan 0-7, Max=8 levels
  790. //
  791. //
  792. // If a primray color level in an index is greater than the prmary color
  793. // levels then it is eqaul to the maximum primary color level, for example
  794. // if C=7 (0xe0), and Cyan level only 5 then level 6 and 7 are same as 5
  795. //
  796. // To retrieve the palette definition for 8bpp format, use
  797. //
  798. // LONG APIENTRY
  799. // HT_Get8BPPMaskPalette(PPALETTEENTRY pPaletteEntry,
  800. // BOOL Use8BPPMaskPal,
  801. // BYTE CMYMask,
  802. // USHORT RedGamma,
  803. // USHORT GreenGamma,
  804. // USHORT BlueGamma);
  805. //
  806. // pPaletteEntry - Pointer to the PALETTEENTRY, if NULL it return palette
  807. // count needed,
  808. //
  809. // * See note below for the pPaletteEntry[0] special settings.
  810. //
  811. // Use8BPPmaskPal - FALSE if a NT4.0 standard 8bpp palette requested, FALSE
  812. // if a CMYMask 8bpp mask palette is needed.
  813. //
  814. // CMYMask - CMY bit mask for CMY as defined above. This must be the
  815. // same primary level as defined in GDIInfo.flHTFlags.
  816. // It should be same as ((GDIInfo.flHTFlags >> 24) & 0xFF).
  817. // The CMYMask also can be specified using predefined macro
  818. // MAKS_CMYMASK_BYTE(cLevel, mLevel, yLevel)
  819. //
  820. // RedGamma - Red gamma if Use8BPPMaskPal is FALSE, Cyan gamma
  821. // if Use8BPPMaskPal is TRUE
  822. //
  823. // GreenGamma - Green gamma if Use8BPPMaskPal is FALSE, Magenta gamma
  824. // if Use8BPPMaskPal is TRUE
  825. //
  826. // BlueGamma - Blue gamma if Use8BPPMaskPal is FALSE, Yellow gamma
  827. // if Use8BPPMaskPal is TRUE
  828. //
  829. //
  830. // ***************************************************************************
  831. // * SPECIAL NOTE for Windows NT version later than Windows 2000 Release *
  832. // ***************************************************************************
  833. // Current version of Window NT (Post Windows 2000) will Overloading the
  834. // pPaletteEntry in HT_Get8BPPMaskPalette(DoUseCMYMask) API to returned a
  835. // inverted indices palette based on additive palette entries composition.
  836. // Because Windows GDI ROP assume index 0 always black and last index always
  837. // white without checking the palette entries. (Indices based ROPs rather color
  838. // based) This cause many ROPS got wrong result which has inverted output.
  839. //
  840. // To correct this GDI ROPs behavior, the POST windows 2000 version of GDI
  841. // Halftone will supports a special CMY_INVERTED format. All new drivers should
  842. // use this CMY_INVERTED method for future compabilities
  843. //
  844. // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  845. // @ Following Steps are required for ALL POST Windows 2000 Drivers when @
  846. // @ using Window GDI Halftone 8bpp CMY332 Mask mode @
  847. // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  848. //
  849. // 1. Must set HT_FLAG_INVERT_8BPP_BITMASK_IDX flags
  850. //
  851. // 2. Must set pPaleteEntry[0] when calling HT_Get8BPPMaskPalette() with
  852. //
  853. // pPaletteEntry[0].peRed = 'R';
  854. // pPaletteEntry[0].peGreen = 'G';
  855. // pPaletteEntry[0].peBlue = 'B';
  856. // pPaletteEntry[0].peFlags = '0';
  857. //
  858. // The caller can use following supplied macro to set this for future
  859. // compabilities
  860. //
  861. // HT_SET_BITMASKPAL2RGB(pPaletteEntry)
  862. //
  863. // where pPaletteEntry is the pointer to the PALETTEENTRY that passed to
  864. // the HT_GET8BPPMaskPalette() fucntion call
  865. //
  866. // 3. Must Check the return Palette from HT_Get8BPPMaskPalette() using
  867. // following Macro
  868. //
  869. // HT_IS_BITMASKPALRGB(pPaletteEntry)
  870. //
  871. // where pPaletteEntry is the pointer to the PALETTEENTRY that passed to the
  872. // HT_GET8BPPMaskPalette() fucntion call,
  873. //
  874. // If this macro return FALSE then the current version of GDI HALFTONE does
  875. // NOT support the CMY_INVERTED 8bpp bitmaask mode and it only supports CMY
  876. // mode.
  877. //
  878. // If this macro return TRUE then the GDI HALFTONE DOES support the
  879. // CMY_INVERTED 8bpp bitmaask mode and the caller must using a translation
  880. // table to obtain final halftone surface bitmap 8bpp indices ink levels.
  881. //
  882. // 4. Behavior changes for GDI halftone that supports 8bpp CMY_INVERTED bitmask
  883. // mode, following is a list of changes of CMYMask mode passed to
  884. // the HT_Get8BPPMaskPalette()
  885. //
  886. // CMYMask CMY Mode Indices CMY_INVERTED Mode Indices
  887. // ======= ========================= =============================
  888. // 0 0: WHITE 0: BLACK
  889. // 1-254: Light->Dark Gray 1-254: Dark->Light Gray
  890. // 255: BLACK 255: WHITE
  891. // -------------------------------------------------------------------
  892. // 1 0: WHITE 0-65: BLACK
  893. // 1-123: 5^3 CMY color 66-188: 5^3 RGB color
  894. // 124-255: BLACK 189-255: WHITE
  895. // 127-128: Duplicate for XOR ROP
  896. // (CMY Levels 2:2:2)
  897. // -------------------------------------------------------------------
  898. // 2 0: WHITE 0-20: BLACK
  899. // 1-214: 6^3 CMY color 21-234: 6^3 RGB color
  900. // 215-255: BLACK 235-255: WHITE
  901. // -------------------------------------------------------------------
  902. // 3-255* 0: WHITE 0: BLACK
  903. // 1-254: CMY Color BitMask 1-254: Centered CxMxY BitMask*
  904. // 255: BLACK 255: WHITE
  905. // ===================================================================
  906. //
  907. // * For CMYMask mode 3-255, the valid combination must NOT have any
  908. // of Cyan, Magenta or Yellow ink level equal to 0.
  909. //
  910. // * The reason for CMY_INVERTED mode that pading BLACK and WHITE entires
  911. // at both end and have all other color in the middle is to make sure
  912. // all 256 color palette entries are even distributed so that GDI ROPs
  913. // (raster operation) will work more correctly. This is because GDI ROPs
  914. // are based on the indices not color
  915. //
  916. // * The CMY_INVERTED Mode has all non-black, non white indices centered
  917. // and even distributed within the total 256 palette indices. For
  918. // example; if a CMY=333 levels then it has total 3x3x3=27 indices,
  919. // these 27 indices will be centered by packing 114 black indices at
  920. // begining and packing 114 white indices at end to ensure that ROP
  921. // will be correct rendered.
  922. //
  923. // See following sample function of for how to generate these ink levels
  924. // and Windows 2000 CMY332 Index translation table
  925. //
  926. //
  927. // 5. For CMYMask index mode 0 to 255, the caller can use following sample
  928. // function to genrate INKLEVELS translation table
  929. //
  930. // The follwing structure and tables are examples of how to translate 8bpp
  931. // bitmask halftone bitmap indices to ink levels
  932. //
  933. // typedef struct _INKLEVELS {
  934. // BYTE Cyan; // Cyan level from 0 to max
  935. // BYTE Magenta; // Magenta level from 0 to max
  936. // BYTE Yellow; // Yellow level from 0 to max
  937. // BYTE CMY332Idx; // Original windows 2000 CMY332 Index
  938. // } INKLEVELS, *PINKLEVELS;
  939. //
  940. // To Compute a 8bpp translate table of INKLEVELS, following sample
  941. // function show how to genrate a INKLEVELS translate table for a valid
  942. // CMYMask range from 0 to 255. It can be use to generate either Windows
  943. // 2000 CMY Mode or new Post Windows 2000's CMY_INVERTED mode translation
  944. // table. It also generate a windows 2000 CMY Mode CMY332Idx so caller
  945. // can map CMY_INVERTED new indices to old index for current existing
  946. // indices processing function.
  947. //
  948. // Example Function that generate translate table for CMYMask 0 to 255,
  949. // the pInkLevels must pointed to a valid memory location of 256 INKLEVELS
  950. // entries, if return value is TRUE then it can be used to trnaslate 8bpp
  951. // indices to ink levels or mapp to the older CMY332 style indices.
  952. //
  953. //
  954. // BOOL
  955. // GenerateInkLevels(
  956. // PINKLEVELS pInkLevels, // Pointer to 256 INKLEVELS table
  957. // BYTE CMYMask, // CMYMask mode
  958. // BOOL CMYInverted // TRUE for CMY_INVERTED mode
  959. // )
  960. // {
  961. // PINKLEVELS pILDup;
  962. // PINKLEVELS pILEnd;
  963. // INKLEVELS InkLevels;
  964. // INT Count;
  965. // INT IdxInc;
  966. // INT cC;
  967. // INT cM;
  968. // INT cY;
  969. // INT xC;
  970. // INT xM;
  971. // INT xY;
  972. // INT iC;
  973. // INT iM;
  974. // INT iY;
  975. // INT mC;
  976. // INT mM;
  977. //
  978. //
  979. // switch (CMYMask) {
  980. //
  981. // case 0:
  982. //
  983. // cC =
  984. // cM =
  985. // xC =
  986. // xM = 0;
  987. // cY =
  988. // xY = 255;
  989. // break;
  990. //
  991. // case 1:
  992. // case 2:
  993. //
  994. // cC =
  995. // cM =
  996. // cY =
  997. // xC =
  998. // xM =
  999. // xY = 3 + (INT)CMYMask;
  1000. // break;
  1001. //
  1002. // default:
  1003. //
  1004. // cC = (INT)((CMYMask >> 5) & 0x07);
  1005. // cM = (INT)((CMYMask >> 2) & 0x07);
  1006. // cY = (INT)( CMYMask & 0x03);
  1007. // xC = 7;
  1008. // xM = 7;
  1009. // xY = 3;
  1010. // break;
  1011. // }
  1012. //
  1013. // Count = (cC + 1) * (cM + 1) * (cY + 1);
  1014. //
  1015. // if ((Count < 1) || (Count > 256)) {
  1016. //
  1017. // return(FALSE);
  1018. // }
  1019. //
  1020. // InkLevels.Cyan =
  1021. // InkLevels.Magenta =
  1022. // InkLevels.Yellow =
  1023. // InkLevels.CMY332Idx = 0;
  1024. // mC = (xM + 1) * (xY + 1);
  1025. // mM = xY + 1;
  1026. // pILDup = NULL;
  1027. //
  1028. // if (CMYInverted) {
  1029. //
  1030. // //
  1031. // // Move the pInkLevels to the first entry which center around
  1032. // // 256 table entries, if we skip any then all entries skipped
  1033. // // will be white (CMY levels all zeros). Because this is
  1034. // // CMY_INVERTED so entries start from back of the table and
  1035. // // moving backward to the begining of the table
  1036. // //
  1037. //
  1038. // pILEnd = pInkLevels - 1;
  1039. // IdxInc = ((256 - Count - (Count & 0x01)) / 2);
  1040. // pInkLevels += 255;
  1041. //
  1042. // while (IdxInc--) {
  1043. //
  1044. // *pInkLevels-- = InkLevels;
  1045. // }
  1046. //
  1047. // if (Count & 0x01) {
  1048. //
  1049. // //
  1050. // // If we have odd number of entries then we need to
  1051. // // duplicate the center one for correct XOR ROP to
  1052. // // operated correctly. The pILDup will always be index
  1053. // // 127, the duplication are indices 127, 128
  1054. // //
  1055. //
  1056. // pILDup = pInkLevels - (Count / 2) - 1;
  1057. // }
  1058. //
  1059. // //
  1060. // // We running from end of table to the begining, because
  1061. // // when in CMYInverted mode, the index 0 is black and index
  1062. // // 255 is white. Since we only generate 'Count' of index
  1063. // // and place them at center, we will change xC, xM, xY max.
  1064. // // index to same as cC, cM and cY.
  1065. // //
  1066. //
  1067. // IdxInc = -1;
  1068. // xC = cC;
  1069. // xM = cM;
  1070. // xY = cY;
  1071. //
  1072. // } else {
  1073. //
  1074. // IdxInc = 1;
  1075. // pILEnd = pInkLevels + 256;
  1076. // }
  1077. //
  1078. // //
  1079. // // At following, the composition of ink levels, index always
  1080. // // from 0 CMY Ink levels (WHITE) to maximum ink levels (BLACK),
  1081. // // the different with CMY_INVERTED mode is we compose it from
  1082. // // index 255 to index 0 rather than from index 0 to 255
  1083. // //
  1084. //
  1085. // if (CMYMask) {
  1086. //
  1087. // INT Idx332C;
  1088. // INT Idx332M;
  1089. //
  1090. // for (iC = 0, Idx332C = -mC; iC <= xC; iC++) {
  1091. //
  1092. // if (iC <= cC) {
  1093. //
  1094. // InkLevels.Cyan = (BYTE)iC;
  1095. // Idx332C += mC;
  1096. // }
  1097. //
  1098. // for (iM = 0, Idx332M = -mM; iM <= xM; iM++) {
  1099. //
  1100. // if (iM <= cM) {
  1101. //
  1102. // InkLevels.Magenta = (BYTE)iM;
  1103. // Idx332M += mM;
  1104. // }
  1105. //
  1106. // for (iY = 0; iY <= xY; iY++) {
  1107. //
  1108. // if (iY <= cY) {
  1109. //
  1110. // InkLevels.Yellow = (BYTE)iY;
  1111. // }
  1112. //
  1113. // InkLevels.CMY332Idx = (BYTE)(Idx332C + Idx332M) +
  1114. // InkLevels.Yellow;
  1115. // *pInkLevels = InkLevels;
  1116. //
  1117. // if ((pInkLevels += IdxInc) == pILDup) {
  1118. //
  1119. // *pInkLevels = InkLevels;
  1120. // pInkLevels += IdxInc;
  1121. // }
  1122. // }
  1123. // }
  1124. // }
  1125. //
  1126. // //
  1127. // // Now if we need to pack black at other end of the
  1128. // // translation table then do it here, Notice that InkLevels
  1129. // // are at cC, cM and cY here and the CMY332Idx is at BLACK
  1130. // //
  1131. //
  1132. // while (pInkLevels != pILEnd) {
  1133. //
  1134. // *pInkLevels = InkLevels;
  1135. // pInkLevels += IdxInc;
  1136. // }
  1137. //
  1138. // } else {
  1139. //
  1140. // //
  1141. // // Gray Scale case
  1142. // //
  1143. //
  1144. // for (iC = 0; iC < 256; iC++, pInkLevels += IdxInc) {
  1145. //
  1146. // pInkLevels->Cyan =
  1147. // pInkLevels->Magenta =
  1148. // pInkLevels->Yellow =
  1149. // pInkLevels->CMY332Idx = (BYTE)iC;
  1150. // }
  1151. // }
  1152. //
  1153. // return(TRUE);
  1154. // }
  1155. //
  1156. //
  1157. // 6. For CMYMask Mode 0 (Gray scale), the gray scale table just inverted
  1158. // between CMY and CMY_INVERTED mode.
  1159. //
  1160. // CMY mode: 0 to 255 gray scale from WHITE to BLACK increment,
  1161. // CMY_INVERTED Mode: 0 to 255 gray scale from BLACK to WHITE increment.
  1162. //
  1163. //
  1164. // 7. For CMYMask Mode 1 and 2, the caller should use a translation table for
  1165. // translate indices to CMY ink levels.
  1166. //
  1167. // 8. For CMYMode mode 3 to 255,
  1168. //
  1169. // if in CMY Mode (Windows 2000) is specified then The final CMY ink levels
  1170. // indices byte has following meanings
  1171. //
  1172. // Bit 7 6 5 4 3 2 1 0
  1173. // | | | | | |
  1174. // +---+ +---+ +=+
  1175. // | | |
  1176. // | | +-- Yellow 0-3 (Max. 4 levels)
  1177. // | |
  1178. // | +-- Magenta 0-7 (Max. 8 levels)
  1179. // |
  1180. // +-- Cyan 0-7 (Max. 8 levels)
  1181. //
  1182. //
  1183. // If a CMY_INVERTED mode is specified then caller must use a translation
  1184. // table to convert a index to the ink levels, to generate this table,
  1185. // please see above #5 description.
  1186. //
  1187. //============================================================================
  1188. // END HALFTONE INFORMATION
  1189. //============================================================================
  1190. typedef struct _GDIINFO
  1191. {
  1192. ULONG ulVersion;
  1193. ULONG ulTechnology;
  1194. ULONG ulHorzSize;
  1195. ULONG ulVertSize;
  1196. ULONG ulHorzRes;
  1197. ULONG ulVertRes;
  1198. ULONG cBitsPixel;
  1199. ULONG cPlanes;
  1200. ULONG ulNumColors;
  1201. ULONG flRaster;
  1202. ULONG ulLogPixelsX;
  1203. ULONG ulLogPixelsY;
  1204. ULONG flTextCaps;
  1205. ULONG ulDACRed;
  1206. ULONG ulDACGreen;
  1207. ULONG ulDACBlue;
  1208. ULONG ulAspectX;
  1209. ULONG ulAspectY;
  1210. ULONG ulAspectXY;
  1211. LONG xStyleStep;
  1212. LONG yStyleStep;
  1213. LONG denStyleStep;
  1214. POINTL ptlPhysOffset;
  1215. SIZEL szlPhysSize;
  1216. ULONG ulNumPalReg;
  1217. // These fields are for halftone initialization.
  1218. COLORINFO ciDevice;
  1219. ULONG ulDevicePelsDPI;
  1220. ULONG ulPrimaryOrder;
  1221. ULONG ulHTPatternSize;
  1222. ULONG ulHTOutputFormat;
  1223. ULONG flHTFlags;
  1224. ULONG ulVRefresh;
  1225. ULONG ulBltAlignment;
  1226. ULONG ulPanningHorzRes;
  1227. ULONG ulPanningVertRes;
  1228. ULONG xPanningAlignment;
  1229. ULONG yPanningAlignment;
  1230. // The following fields are for user defined halftone dither patterns. These
  1231. // fields are only checked if ulHTPatternSize is eqaul to HT_PATSIZE_USER.
  1232. //
  1233. // The user defined pHTPatA, pHTPatB, pHTPatC pointers correspond to the primary
  1234. // color order defined in ulPrimaryOrder as PRIMARY_ORDER_xxx.
  1235. //
  1236. // The size of halftone dither pattern must range from 4 to 256. For each
  1237. // dither pattern, pHTPatA, pHTPatB, pHTPatC must point to a
  1238. // valid byte array of (cxHTPat x cyHTPat) size. pHTPatA, pHTPatB and
  1239. // pHTPatC may point to the same dither pattern array.
  1240. //
  1241. // Each byte threshold within the dither pattern defines the additive
  1242. // intensity threshold of pixels. A zero threshold value indicates the pixel
  1243. // location is ignored (always black), while 1 to 255 threshold values give the
  1244. // dither pattern 255 level of grays.
  1245. ULONG cxHTPat; // cxHTPat must range from 4-256
  1246. ULONG cyHTPat; // cyHTPat must range from 4-256
  1247. LPBYTE pHTPatA; // for Primary Color Order A
  1248. LPBYTE pHTPatB; // for Primary Color Order B
  1249. LPBYTE pHTPatC; // for Primary Color Order C
  1250. // Shade and blend caps
  1251. ULONG flShadeBlend;
  1252. ULONG ulPhysicalPixelCharacteristics;
  1253. ULONG ulPhysicalPixelGamma;
  1254. } GDIINFO, *PGDIINFO;
  1255. /*
  1256. * User objects
  1257. */
  1258. typedef struct _BRUSHOBJ
  1259. {
  1260. ULONG iSolidColor;
  1261. PVOID pvRbrush;
  1262. FLONG flColorType;
  1263. } BRUSHOBJ;
  1264. //
  1265. // BRUSHOBJ::flColorType
  1266. //
  1267. #define BR_DEVICE_ICM 0x01
  1268. #define BR_HOST_ICM 0x02
  1269. #define BR_CMYKCOLOR 0x04
  1270. #define BR_ORIGCOLOR 0x08
  1271. typedef struct _CLIPOBJ
  1272. {
  1273. ULONG iUniq;
  1274. RECTL rclBounds;
  1275. BYTE iDComplexity;
  1276. BYTE iFComplexity;
  1277. BYTE iMode;
  1278. BYTE fjOptions;
  1279. } CLIPOBJ;
  1280. typedef struct _DRIVEROBJ DRIVEROBJ;
  1281. typedef BOOL (CALLBACK * FREEOBJPROC)(DRIVEROBJ *pDriverObj);
  1282. typedef struct _DRIVEROBJ
  1283. {
  1284. PVOID pvObj;
  1285. FREEOBJPROC pFreeProc;
  1286. HDEV hdev;
  1287. DHPDEV dhpdev;
  1288. } DRIVEROBJ;
  1289. typedef struct _FONTOBJ
  1290. {
  1291. ULONG iUniq;
  1292. ULONG iFace;
  1293. ULONG cxMax;
  1294. FLONG flFontType;
  1295. ULONG_PTR iTTUniq;
  1296. ULONG_PTR iFile;
  1297. SIZE sizLogResPpi;
  1298. ULONG ulStyleSize;
  1299. PVOID pvConsumer;
  1300. PVOID pvProducer;
  1301. } FONTOBJ;
  1302. typedef struct _BLENDOBJ
  1303. {
  1304. BLENDFUNCTION BlendFunction;
  1305. }BLENDOBJ,*PBLENDOBJ;
  1306. typedef BYTE GAMMA_TABLES[2][256];
  1307. //
  1308. // FONTOBJ::flFontType
  1309. //
  1310. #define FO_TYPE_RASTER RASTER_FONTTYPE /* 0x1 */
  1311. #define FO_TYPE_DEVICE DEVICE_FONTTYPE /* 0x2 */
  1312. #define FO_TYPE_TRUETYPE TRUETYPE_FONTTYPE /* 0x4 */
  1313. #define FO_TYPE_OPENTYPE OPENTYPE_FONTTYPE /* 0X8 */
  1314. #define FO_SIM_BOLD 0x00002000
  1315. #define FO_SIM_ITALIC 0x00004000
  1316. #define FO_EM_HEIGHT 0x00008000
  1317. #define FO_GRAY16 0x00010000 /* [1] */
  1318. #define FO_NOGRAY16 0x00020000 /* [1] */
  1319. #define FO_NOHINTS 0x00040000 /* [3] */
  1320. #define FO_NO_CHOICE 0x00080000 /* [3] */
  1321. // new accelerators so that printer drivers do not need to look to ifimetrics
  1322. #define FO_CFF 0x00100000
  1323. #define FO_POSTSCRIPT 0x00200000
  1324. #define FO_MULTIPLEMASTER 0x00400000
  1325. #define FO_VERT_FACE 0x00800000
  1326. #define FO_DBCS_FONT 0X01000000
  1327. // cleartype flags for horizontally or vertically striped LCD screen
  1328. #define FO_NOCLEARTYPE 0x02000000
  1329. #define FO_CLEARTYPE_X 0x10000000
  1330. #define FO_CLEARTYPE_Y 0x20000000
  1331. #define FO_CLEARTYPENATURAL_X 0x40000000
  1332. /**************************************************************************\
  1333. *
  1334. * [1]
  1335. *
  1336. * If the FO_GRAY16 flag is set then the bitmaps of the font
  1337. * are 4-bit per pixel blending (alpha) values. A value of zero
  1338. * means that the the resulting pixel should be equal to the
  1339. * background color. If the value of the alpha value is k != 0
  1340. * then the resulting pixel must be:
  1341. *
  1342. * c0 = background color
  1343. * c1 = foreground color
  1344. * b = blending value = (k+1)/16 // {k = 1,2,..,15}
  1345. * b = 0 (k = 0)
  1346. * d0 = gamma[c0], d1 = gamma[c1] // luminance components
  1347. * d = (1 - b)*d0 + b*d1 // blended luminance
  1348. * c = lambda[d] // blended device voltage
  1349. *
  1350. * where gamma[] takes a color component from application space
  1351. * to CIE space and labmda[] takes a color from CIE space to
  1352. * device color space
  1353. *
  1354. * GDI will set this bit if it request a font be gray scaled
  1355. * to 16 values then GDI will set FO_GRAY16 upon entry to
  1356. * DrvQueryFontData(). If the font driver cannot (or will
  1357. * not) grayscale a particular realization of a font then the
  1358. * font provider will zero out FO_GRAY16 and set FO_NOGRAY16
  1359. * to inform GDI that
  1360. * the gray scaling request cannot (or should not) be
  1361. * satisfied.
  1362. *
  1363. * [2]
  1364. *
  1365. * The FO_NOHINTS indicates that hints were not used in the formation
  1366. * of the glyph images. GDI will set this bit to request that hinting
  1367. * be supressed. The font provider will set this bit accroding to the
  1368. * rendering scheme that it used in generating the glyph image.
  1369. *
  1370. * [3]
  1371. *
  1372. * The FO_NO_CHOICE flag indicates that the flags FO_GRAY16 and
  1373. * FO_NOHINTS must be obeyed if at all possible.
  1374. *
  1375. \**************************************************************************/
  1376. typedef struct _PALOBJ
  1377. {
  1378. ULONG ulReserved;
  1379. } PALOBJ;
  1380. typedef struct _PATHOBJ
  1381. {
  1382. FLONG fl;
  1383. ULONG cCurves;
  1384. } PATHOBJ;
  1385. typedef struct _SURFOBJ
  1386. {
  1387. DHSURF dhsurf;
  1388. HSURF hsurf;
  1389. DHPDEV dhpdev;
  1390. HDEV hdev;
  1391. SIZEL sizlBitmap;
  1392. ULONG cjBits;
  1393. PVOID pvBits;
  1394. PVOID pvScan0;
  1395. LONG lDelta;
  1396. ULONG iUniq;
  1397. ULONG iBitmapFormat;
  1398. USHORT iType;
  1399. USHORT fjBitmap;
  1400. } SURFOBJ;
  1401. typedef struct _WNDOBJ
  1402. {
  1403. CLIPOBJ coClient;
  1404. PVOID pvConsumer;
  1405. RECTL rclClient;
  1406. SURFOBJ *psoOwner;
  1407. } WNDOBJ, *PWNDOBJ;
  1408. typedef struct _XFORMOBJ
  1409. {
  1410. ULONG ulReserved;
  1411. } XFORMOBJ;
  1412. typedef struct _XLATEOBJ
  1413. {
  1414. ULONG iUniq;
  1415. FLONG flXlate;
  1416. USHORT iSrcType; // Obsolete
  1417. USHORT iDstType; // Obsolete
  1418. ULONG cEntries;
  1419. ULONG *pulXlate;
  1420. } XLATEOBJ;
  1421. /*
  1422. * BRUSHOBJ callbacks
  1423. */
  1424. PVOID APIENTRY BRUSHOBJ_pvAllocRbrush(
  1425. BRUSHOBJ *pbo,
  1426. ULONG cj
  1427. );
  1428. PVOID APIENTRY BRUSHOBJ_pvGetRbrush(
  1429. BRUSHOBJ *pbo
  1430. );
  1431. ULONG APIENTRY BRUSHOBJ_ulGetBrushColor(
  1432. BRUSHOBJ *pbo
  1433. );
  1434. HANDLE APIENTRY BRUSHOBJ_hGetColorTransform(
  1435. BRUSHOBJ *pbo
  1436. );
  1437. /*
  1438. * CLIPOBJ callbacks
  1439. */
  1440. #define DC_TRIVIAL 0
  1441. #define DC_RECT 1
  1442. #define DC_COMPLEX 3
  1443. #define FC_RECT 1
  1444. #define FC_RECT4 2
  1445. #define FC_COMPLEX 3
  1446. #define TC_RECTANGLES 0
  1447. #define TC_PATHOBJ 2
  1448. #define OC_BANK_CLIP 1 // Obsolete
  1449. #define CT_RECTANGLES 0L
  1450. #define CD_RIGHTDOWN 0L
  1451. #define CD_LEFTDOWN 1L
  1452. #define CD_RIGHTUP 2L
  1453. #define CD_LEFTUP 3L
  1454. #define CD_ANY 4L
  1455. #define CD_LEFTWARDS 1L
  1456. #define CD_UPWARDS 2L
  1457. typedef struct _ENUMRECTS
  1458. {
  1459. ULONG c;
  1460. RECTL arcl[1];
  1461. } ENUMRECTS;
  1462. ULONG APIENTRY CLIPOBJ_cEnumStart(
  1463. CLIPOBJ *pco,
  1464. BOOL bAll,
  1465. ULONG iType,
  1466. ULONG iDirection,
  1467. ULONG cLimit
  1468. );
  1469. BOOL APIENTRY CLIPOBJ_bEnum(
  1470. CLIPOBJ *pco,
  1471. ULONG cj,
  1472. ULONG *pul
  1473. );
  1474. PATHOBJ* APIENTRY CLIPOBJ_ppoGetPath(
  1475. CLIPOBJ* pco
  1476. );
  1477. /*
  1478. * FONTOBJ callbacks
  1479. */
  1480. typedef struct _GLYPHBITS
  1481. {
  1482. POINTL ptlOrigin;
  1483. SIZEL sizlBitmap;
  1484. BYTE aj[1];
  1485. } GLYPHBITS;
  1486. #define FO_HGLYPHS 0L
  1487. #define FO_GLYPHBITS 1L
  1488. #define FO_PATHOBJ 2L
  1489. #define FD_NEGATIVE_FONT 1L
  1490. #define FO_DEVICE_FONT 1L
  1491. #define FO_OUTLINE_CAPABLE 2L
  1492. typedef union _GLYPHDEF
  1493. {
  1494. GLYPHBITS *pgb;
  1495. PATHOBJ *ppo;
  1496. } GLYPHDEF;
  1497. typedef struct _GLYPHPOS /* gp */
  1498. {
  1499. HGLYPH hg;
  1500. GLYPHDEF *pgdf;
  1501. POINTL ptl;
  1502. } GLYPHPOS,*PGLYPHPOS;
  1503. // individual glyph data
  1504. // r is a unit vector along the baseline in device coordinates.
  1505. // s is a unit vector in the ascent direction in device coordinates.
  1506. // A, B, and C, are simple tranforms of the notional space versions into
  1507. // (28.4) device coordinates. The dot products of those vectors with r
  1508. // are recorded here. Note that the high words of ptqD are also 28.4
  1509. // device coordinates. The low words provide extra accuracy.
  1510. // THE STRUCTURE DIFFERS IN ORDERING FROM NT 3.51 VERSION OF THE STRUCTURE.
  1511. // ptqD has been moved to the bottom.
  1512. // This requires only recompile of all the drivers.
  1513. typedef struct _GLYPHDATA {
  1514. GLYPHDEF gdf; // pointer to GLYPHBITS or to PATHOBJ
  1515. HGLYPH hg; // glyhp handle
  1516. FIX fxD; // Character increment amount: D*r.
  1517. FIX fxA; // Prebearing amount: A*r.
  1518. FIX fxAB; // Advancing edge of character: (A+B)*r.
  1519. FIX fxInkTop; // Baseline to inkbox top along s.
  1520. FIX fxInkBottom; // Baseline to inkbox bottom along s.
  1521. RECTL rclInk; // Ink box with sides parallel to x,y axes
  1522. POINTQF ptqD; // Character increment vector: D=A+B+C.
  1523. } GLYPHDATA;
  1524. // flAccel flags for STROBJ
  1525. // SO_FLAG_DEFAULT_PLACEMENT // defult inc vectors used to position chars
  1526. // SO_HORIZONTAL // "left to right" or "right to left"
  1527. // SO_VERTICAL // "top to bottom" or "bottom to top"
  1528. // SO_REVERSED // set if horiz & "right to left" or if vert & "bottom to top"
  1529. // SO_ZERO_BEARINGS // all glyphs have zero a and c spaces
  1530. // SO_CHAR_INC_EQUAL_BM_BASE // base == cx for horiz, == cy for vert.
  1531. // SO_MAXEXT_EQUAL_BM_SIDE // side == cy for horiz, == cx for vert.
  1532. // do not substitute device font for tt font even if device font sub table
  1533. // tells the driver this should be done
  1534. // SO_DO_NOT_SUBSTITUTE_DEVICE_FONT
  1535. #define SO_FLAG_DEFAULT_PLACEMENT 0x00000001
  1536. #define SO_HORIZONTAL 0x00000002
  1537. #define SO_VERTICAL 0x00000004
  1538. #define SO_REVERSED 0x00000008
  1539. #define SO_ZERO_BEARINGS 0x00000010
  1540. #define SO_CHAR_INC_EQUAL_BM_BASE 0x00000020
  1541. #define SO_MAXEXT_EQUAL_BM_SIDE 0x00000040
  1542. #define SO_DO_NOT_SUBSTITUTE_DEVICE_FONT 0x00000080
  1543. #define SO_GLYPHINDEX_TEXTOUT 0x00000100
  1544. #define SO_ESC_NOT_ORIENT 0x00000200
  1545. #define SO_DXDY 0x00000400
  1546. #define SO_CHARACTER_EXTRA 0x00000800
  1547. #define SO_BREAK_EXTRA 0x00001000
  1548. typedef struct _STROBJ
  1549. {
  1550. ULONG cGlyphs; // # of glyphs to render
  1551. FLONG flAccel; // accel flags
  1552. ULONG ulCharInc; // non-zero only if fixed pitch font, equal to advanced width.
  1553. RECTL rclBkGround; // bk ground rect of the string in device coords
  1554. GLYPHPOS *pgp; // If non-NULL then has all glyphs.
  1555. LPWSTR pwszOrg; // pointer to original unicode string.
  1556. } STROBJ;
  1557. typedef struct _FONTINFO /* fi */
  1558. {
  1559. ULONG cjThis;
  1560. FLONG flCaps;
  1561. ULONG cGlyphsSupported;
  1562. ULONG cjMaxGlyph1;
  1563. ULONG cjMaxGlyph4;
  1564. ULONG cjMaxGlyph8;
  1565. ULONG cjMaxGlyph32;
  1566. } FONTINFO, *PFONTINFO;
  1567. ULONG APIENTRY FONTOBJ_cGetAllGlyphHandles(
  1568. FONTOBJ *pfo,
  1569. HGLYPH *phg
  1570. );
  1571. VOID APIENTRY FONTOBJ_vGetInfo(
  1572. FONTOBJ *pfo,
  1573. ULONG cjSize,
  1574. FONTINFO *pfi
  1575. );
  1576. ULONG APIENTRY FONTOBJ_cGetGlyphs(
  1577. FONTOBJ *pfo,
  1578. ULONG iMode,
  1579. ULONG cGlyph,
  1580. HGLYPH *phg,
  1581. PVOID *ppvGlyph
  1582. );
  1583. XFORMOBJ * APIENTRY FONTOBJ_pxoGetXform(
  1584. FONTOBJ *pfo
  1585. );
  1586. IFIMETRICS * APIENTRY FONTOBJ_pifi(
  1587. FONTOBJ *pfo
  1588. );
  1589. FD_GLYPHSET * APIENTRY FONTOBJ_pfdg(
  1590. FONTOBJ *pfo
  1591. );
  1592. PVOID APIENTRY FONTOBJ_pvTrueTypeFontFile(
  1593. FONTOBJ *pfo,
  1594. ULONG *pcjFile
  1595. );
  1596. PBYTE APIENTRY FONTOBJ_pjOpenTypeTablePointer (
  1597. FONTOBJ *pfo,
  1598. ULONG ulTag,
  1599. ULONG *pcjTable
  1600. );
  1601. LPWSTR APIENTRY FONTOBJ_pwszFontFilePaths (
  1602. FONTOBJ *pfo,
  1603. ULONG *pcwc
  1604. );
  1605. // for now only one mode is defined for glyph attributes
  1606. #define FO_ATTR_MODE_ROTATE 1
  1607. PFD_GLYPHATTR APIENTRY FONTOBJ_pQueryGlyphAttrs(
  1608. FONTOBJ *pfo,
  1609. ULONG iMode
  1610. );
  1611. /*
  1612. * PALOBJ callbacks
  1613. */
  1614. #define PAL_INDEXED 0x00000001
  1615. #define PAL_BITFIELDS 0x00000002
  1616. #define PAL_RGB 0x00000004
  1617. #define PAL_BGR 0x00000008
  1618. #define PAL_CMYK 0x00000010
  1619. ULONG APIENTRY PALOBJ_cGetColors(
  1620. PALOBJ *ppalo,
  1621. ULONG iStart,
  1622. ULONG cColors,
  1623. ULONG *pulColors
  1624. );
  1625. /*
  1626. * PATHOBJ callbacks
  1627. */
  1628. #define PO_BEZIERS 0x00000001
  1629. #define PO_ELLIPSE 0x00000002
  1630. #define PO_ALL_INTEGERS 0x00000004
  1631. #define PO_ENUM_AS_INTEGERS 0x00000008
  1632. #define PD_BEGINSUBPATH 0x00000001
  1633. #define PD_ENDSUBPATH 0x00000002
  1634. #define PD_RESETSTYLE 0x00000004
  1635. #define PD_CLOSEFIGURE 0x00000008
  1636. #define PD_BEZIERS 0x00000010
  1637. #define PD_ALL (PD_BEGINSUBPATH | \
  1638. PD_ENDSUBPATH | \
  1639. PD_RESETSTYLE | \
  1640. PD_CLOSEFIGURE | \
  1641. PD_BEZIERS)
  1642. typedef struct _PATHDATA
  1643. {
  1644. FLONG flags;
  1645. ULONG count;
  1646. POINTFIX *pptfx;
  1647. } PATHDATA, *PPATHDATA;
  1648. typedef struct _RUN
  1649. {
  1650. LONG iStart;
  1651. LONG iStop;
  1652. } RUN, *PRUN;
  1653. typedef struct _CLIPLINE
  1654. {
  1655. POINTFIX ptfxA;
  1656. POINTFIX ptfxB;
  1657. LONG lStyleState;
  1658. ULONG c;
  1659. RUN arun[1];
  1660. } CLIPLINE, *PCLIPLINE;
  1661. VOID APIENTRY PATHOBJ_vEnumStart(
  1662. PATHOBJ *ppo
  1663. );
  1664. BOOL APIENTRY PATHOBJ_bEnum(
  1665. PATHOBJ *ppo,
  1666. PATHDATA *ppd
  1667. );
  1668. VOID APIENTRY PATHOBJ_vEnumStartClipLines(
  1669. PATHOBJ *ppo,
  1670. CLIPOBJ *pco,
  1671. SURFOBJ *pso,
  1672. LINEATTRS *pla
  1673. );
  1674. BOOL APIENTRY PATHOBJ_bEnumClipLines(
  1675. PATHOBJ *ppo,
  1676. ULONG cb,
  1677. CLIPLINE *pcl
  1678. );
  1679. BOOL APIENTRY PATHOBJ_bMoveTo(
  1680. PATHOBJ *ppo,
  1681. POINTFIX ptfx
  1682. );
  1683. BOOL APIENTRY PATHOBJ_bPolyLineTo(
  1684. PATHOBJ *ppo,
  1685. POINTFIX *pptfx,
  1686. ULONG cptfx
  1687. );
  1688. BOOL APIENTRY PATHOBJ_bPolyBezierTo(
  1689. PATHOBJ *ppo,
  1690. POINTFIX *pptfx,
  1691. ULONG cptfx
  1692. );
  1693. BOOL APIENTRY PATHOBJ_bCloseFigure(
  1694. PATHOBJ *ppo
  1695. );
  1696. VOID APIENTRY PATHOBJ_vGetBounds(
  1697. PATHOBJ *ppo,
  1698. PRECTFX prectfx
  1699. );
  1700. /*
  1701. * STROBJ callbacks
  1702. */
  1703. VOID APIENTRY STROBJ_vEnumStart(
  1704. STROBJ *pstro
  1705. );
  1706. BOOL APIENTRY STROBJ_bEnum(
  1707. STROBJ *pstro,
  1708. ULONG *pc,
  1709. PGLYPHPOS *ppgpos
  1710. );
  1711. BOOL APIENTRY STROBJ_bEnumPositionsOnly(
  1712. STROBJ *pstro,
  1713. ULONG *pc,
  1714. PGLYPHPOS *ppgpos
  1715. );
  1716. DWORD APIENTRY STROBJ_dwGetCodePage(
  1717. STROBJ *pstro
  1718. );
  1719. FIX APIENTRY STROBJ_fxCharacterExtra(
  1720. STROBJ *pstro
  1721. );
  1722. FIX APIENTRY STROBJ_fxBreakExtra(
  1723. STROBJ *pstro
  1724. );
  1725. BOOL APIENTRY STROBJ_bGetAdvanceWidths(
  1726. STROBJ *pso,
  1727. ULONG iFirst,
  1728. ULONG c,
  1729. POINTQF *pptqD
  1730. );
  1731. #define SGI_EXTRASPACE 0
  1732. /*
  1733. * SURFOBJ callbacks
  1734. */
  1735. #define STYPE_BITMAP 0L
  1736. #define STYPE_DEVICE 1L
  1737. #define STYPE_DEVBITMAP 3L
  1738. #define BMF_1BPP 1L
  1739. #define BMF_4BPP 2L
  1740. #define BMF_8BPP 3L
  1741. #define BMF_16BPP 4L
  1742. #define BMF_24BPP 5L
  1743. #define BMF_32BPP 6L
  1744. #define BMF_4RLE 7L
  1745. #define BMF_8RLE 8L
  1746. #define BMF_JPEG 9L
  1747. #define BMF_PNG 10L
  1748. #define BMF_TOPDOWN 0x0001
  1749. #define BMF_NOZEROINIT 0x0002
  1750. #define BMF_DONTCACHE 0x0004
  1751. #define BMF_USERMEM 0x0008
  1752. #define BMF_KMSECTION 0x0010
  1753. #define BMF_NOTSYSMEM 0x0020
  1754. #define BMF_WINDOW_BLT 0x0040
  1755. #define BMF_UMPDMEM 0x0080
  1756. #define BMF_RESERVED 0xFF00
  1757. /*
  1758. * XFORMOBJ callbacks
  1759. */
  1760. #define GX_IDENTITY 0L
  1761. #define GX_OFFSET 1L
  1762. #define GX_SCALE 2L
  1763. #define GX_GENERAL 3L
  1764. #define XF_LTOL 0L
  1765. #define XF_INV_LTOL 1L
  1766. #define XF_LTOFX 2L
  1767. #define XF_INV_FXTOL 3L
  1768. ULONG APIENTRY XFORMOBJ_iGetXform(
  1769. XFORMOBJ *pxo,
  1770. XFORML *pxform
  1771. );
  1772. BOOL APIENTRY XFORMOBJ_bApplyXform(
  1773. XFORMOBJ *pxo,
  1774. ULONG iMode,
  1775. ULONG cPoints,
  1776. PVOID pvIn,
  1777. PVOID pvOut
  1778. );
  1779. DECLSPEC_DEPRECATED_DDK
  1780. HANDLE APIENTRY XFORMOBJ_cmGetTransform(
  1781. XFORMOBJ *pxo
  1782. );
  1783. /*
  1784. * XLATEOBJ callbacks
  1785. */
  1786. #define XO_TRIVIAL 0x00000001
  1787. #define XO_TABLE 0x00000002
  1788. #define XO_TO_MONO 0x00000004
  1789. #define XO_FROM_CMYK 0x00000008
  1790. #define XO_DEVICE_ICM 0x00000010 // ICM on Device
  1791. #define XO_HOST_ICM 0x00000020 // ICM on Engine/Apps
  1792. #define XO_SRCPALETTE 1
  1793. #define XO_DESTPALETTE 2
  1794. #define XO_DESTDCPALETTE 3
  1795. #define XO_SRCBITFIELDS 4
  1796. #define XO_DESTBITFIELDS 5
  1797. ULONG APIENTRY XLATEOBJ_iXlate(
  1798. XLATEOBJ *pxlo,
  1799. ULONG iColor
  1800. );
  1801. ULONG * APIENTRY XLATEOBJ_piVector(
  1802. XLATEOBJ *pxlo
  1803. );
  1804. ULONG APIENTRY XLATEOBJ_cGetPalette(
  1805. XLATEOBJ *pxlo,
  1806. ULONG iPal,
  1807. ULONG cPal,
  1808. ULONG *pPal
  1809. );
  1810. HANDLE APIENTRY XLATEOBJ_hGetColorTransform(
  1811. XLATEOBJ *pxlo
  1812. );
  1813. /*
  1814. * Engine callbacks - error logging
  1815. */
  1816. #ifdef USERMODE_DRIVER
  1817. #define EngGetLastError GetLastError
  1818. #define EngSetLastError SetLastError
  1819. #else // !USERMODE_DRIVER
  1820. VOID APIENTRY EngSetLastError(ULONG);
  1821. ULONG APIENTRY EngGetLastError();
  1822. #endif // !USERMODE_DRIVER
  1823. /*
  1824. * Engine callbacks - Surfaces
  1825. */
  1826. #define HOOK_BITBLT 0x00000001
  1827. #define HOOK_STRETCHBLT 0x00000002
  1828. #define HOOK_PLGBLT 0x00000004
  1829. #define HOOK_TEXTOUT 0x00000008
  1830. #define HOOK_PAINT 0x00000010 // Obsolete
  1831. #define HOOK_STROKEPATH 0x00000020
  1832. #define HOOK_FILLPATH 0x00000040
  1833. #define HOOK_STROKEANDFILLPATH 0x00000080
  1834. #define HOOK_LINETO 0x00000100
  1835. #define HOOK_COPYBITS 0x00000400
  1836. #define HOOK_MOVEPANNING 0x00000800 // Obsolete
  1837. #define HOOK_SYNCHRONIZE 0x00001000
  1838. #define HOOK_STRETCHBLTROP 0x00002000
  1839. #define HOOK_SYNCHRONIZEACCESS 0x00004000 // Obsolete
  1840. #define HOOK_TRANSPARENTBLT 0x00008000
  1841. #define HOOK_ALPHABLEND 0x00010000
  1842. #define HOOK_GRADIENTFILL 0x00020000
  1843. #define HOOK_FLAGS 0x0003b5ff
  1844. HBITMAP APIENTRY EngCreateBitmap(
  1845. SIZEL sizl,
  1846. LONG lWidth,
  1847. ULONG iFormat,
  1848. FLONG fl,
  1849. PVOID pvBits
  1850. );
  1851. HSURF APIENTRY EngCreateDeviceSurface(
  1852. DHSURF dhsurf,
  1853. SIZEL sizl,
  1854. ULONG iFormatCompat
  1855. );
  1856. HBITMAP APIENTRY EngCreateDeviceBitmap(
  1857. DHSURF dhsurf,
  1858. SIZEL sizl,
  1859. ULONG iFormatCompat
  1860. );
  1861. BOOL APIENTRY EngDeleteSurface(
  1862. HSURF hsurf
  1863. );
  1864. SURFOBJ * APIENTRY EngLockSurface(
  1865. HSURF hsurf
  1866. );
  1867. VOID APIENTRY EngUnlockSurface(
  1868. SURFOBJ *pso
  1869. );
  1870. BOOL APIENTRY EngEraseSurface(
  1871. SURFOBJ *pso,
  1872. RECTL *prcl,
  1873. ULONG iColor
  1874. );
  1875. BOOL APIENTRY EngAssociateSurface(
  1876. HSURF hsurf,
  1877. HDEV hdev,
  1878. FLONG flHooks
  1879. );
  1880. #define MS_NOTSYSTEMMEMORY 0x0001
  1881. #define MS_SHAREDACCESS 0x0002
  1882. BOOL APIENTRY EngModifySurface(
  1883. HSURF hsurf,
  1884. HDEV hdev,
  1885. FLONG flHooks,
  1886. FLONG flSurface,
  1887. DHSURF dhsurf,
  1888. VOID* pvScan0,
  1889. LONG lDelta,
  1890. VOID* pvReserved
  1891. );
  1892. BOOL APIENTRY EngMarkBandingSurface(
  1893. HSURF hsurf
  1894. );
  1895. BOOL APIENTRY EngCheckAbort(
  1896. SURFOBJ *pso
  1897. );
  1898. /*
  1899. * Engine callbacks - Paths
  1900. */
  1901. PATHOBJ * APIENTRY EngCreatePath();
  1902. VOID APIENTRY EngDeletePath(
  1903. PATHOBJ *ppo
  1904. );
  1905. /*
  1906. * Engine callbacks - Palettes
  1907. */
  1908. HPALETTE APIENTRY EngCreatePalette(
  1909. ULONG iMode,
  1910. ULONG cColors,
  1911. ULONG *pulColors,
  1912. FLONG flRed,
  1913. FLONG flGreen,
  1914. FLONG flBlue
  1915. );
  1916. ULONG APIENTRY EngQueryPalette(
  1917. HPALETTE hpal,
  1918. ULONG *piMode,
  1919. ULONG cColors,
  1920. ULONG *pulColors);
  1921. BOOL APIENTRY EngDeletePalette(
  1922. HPALETTE hpal
  1923. );
  1924. /*
  1925. * Engine callbacks - Clipping
  1926. */
  1927. CLIPOBJ * APIENTRY EngCreateClip();
  1928. VOID APIENTRY EngDeleteClip(
  1929. CLIPOBJ *pco
  1930. );
  1931. /*
  1932. * Function prototypes
  1933. */
  1934. //
  1935. // User-mode printer driver information-query entrypoint
  1936. //
  1937. BOOL APIENTRY
  1938. APIENTRY
  1939. DrvQueryDriverInfo(
  1940. DWORD dwMode,
  1941. PVOID pBuffer,
  1942. DWORD cbBuf,
  1943. PDWORD pcbNeeded
  1944. );
  1945. #define DRVQUERY_USERMODE 1
  1946. // These are the only EXPORTED functions for ANY driver
  1947. BOOL APIENTRY DrvEnableDriver(
  1948. ULONG iEngineVersion,
  1949. ULONG cj,
  1950. DRVENABLEDATA *pded
  1951. );
  1952. /*
  1953. * Driver functions
  1954. */
  1955. VOID APIENTRY DrvDisableDriver();
  1956. DHPDEV APIENTRY DrvEnablePDEV(
  1957. DEVMODEW *pdm,
  1958. LPWSTR pwszLogAddress,
  1959. ULONG cPat,
  1960. HSURF *phsurfPatterns,
  1961. ULONG cjCaps,
  1962. ULONG *pdevcaps,
  1963. ULONG cjDevInfo,
  1964. DEVINFO *pdi,
  1965. HDEV hdev,
  1966. LPWSTR pwszDeviceName,
  1967. HANDLE hDriver
  1968. );
  1969. #define HS_DDI_MAX 6
  1970. ULONG APIENTRY DrvResetDevice(
  1971. DHPDEV dhpdev,
  1972. PVOID Reserved
  1973. );
  1974. #define DRD_SUCCESS 0
  1975. #define DRD_ERROR 1
  1976. BOOL APIENTRY DrvResetPDEV(
  1977. DHPDEV dhpdevOld,
  1978. DHPDEV dhpdevNew
  1979. );
  1980. VOID APIENTRY DrvCompletePDEV(
  1981. DHPDEV dhpdev,
  1982. HDEV hdev
  1983. );
  1984. BOOL APIENTRY DrvOffset( // Obsolete
  1985. SURFOBJ* pso,
  1986. LONG x,
  1987. LONG y,
  1988. FLONG flReserved
  1989. );
  1990. HSURF APIENTRY DrvEnableSurface(
  1991. DHPDEV dhpdev
  1992. );
  1993. VOID APIENTRY DrvSynchronize(
  1994. DHPDEV dhpdev,
  1995. RECTL *prcl
  1996. );
  1997. VOID APIENTRY DrvDisableSurface(
  1998. DHPDEV dhpdev
  1999. );
  2000. VOID APIENTRY DrvDisablePDEV(
  2001. DHPDEV dhpdev
  2002. );
  2003. /* DrvSaveScreenBits - iMode definitions */
  2004. #define SS_SAVE 0
  2005. #define SS_RESTORE 1
  2006. #define SS_FREE 2
  2007. ULONG_PTR APIENTRY DrvSaveScreenBits(
  2008. SURFOBJ *pso,
  2009. ULONG iMode,
  2010. ULONG_PTR ident,
  2011. RECTL *prcl
  2012. );
  2013. /*
  2014. * Desktops
  2015. */
  2016. BOOL APIENTRY DrvAssertMode(
  2017. DHPDEV dhpdev,
  2018. BOOL bEnable
  2019. );
  2020. ULONG APIENTRY DrvGetModes(
  2021. HANDLE hDriver,
  2022. ULONG cjSize,
  2023. DEVMODEW *pdm
  2024. );
  2025. DECLSPEC_DEPRECATED_DDK
  2026. VOID APIENTRY DrvMovePanning(
  2027. LONG x,
  2028. LONG y,
  2029. FLONG fl
  2030. );
  2031. BOOL APIENTRY DrvPlgBlt(
  2032. SURFOBJ *psoTrg,
  2033. SURFOBJ *psoSrc,
  2034. SURFOBJ *psoMsk,
  2035. CLIPOBJ *pco,
  2036. XLATEOBJ *pxlo,
  2037. COLORADJUSTMENT *pca,
  2038. POINTL *pptlBrushOrg,
  2039. POINTFIX *pptfx,
  2040. RECTL *prcl,
  2041. POINTL *pptl,
  2042. ULONG iMode
  2043. );
  2044. /*
  2045. * Bitmaps
  2046. */
  2047. HBITMAP APIENTRY DrvCreateDeviceBitmap(
  2048. DHPDEV dhpdev,
  2049. SIZEL sizl,
  2050. ULONG iFormat
  2051. );
  2052. VOID APIENTRY DrvDeleteDeviceBitmap(
  2053. DHSURF dhsurf
  2054. );
  2055. /*
  2056. * Palettes
  2057. */
  2058. BOOL APIENTRY DrvSetPalette(
  2059. DHPDEV dhpdev,
  2060. PALOBJ *ppalo,
  2061. FLONG fl,
  2062. ULONG iStart,
  2063. ULONG cColors
  2064. );
  2065. /*
  2066. * Brushes
  2067. */
  2068. #define DM_DEFAULT 0x00000001
  2069. #define DM_MONOCHROME 0x00000002
  2070. #define DCR_SOLID 0
  2071. #define DCR_DRIVER 1
  2072. #define DCR_HALFTONE 2
  2073. ULONG APIENTRY DrvDitherColor(
  2074. DHPDEV dhpdev,
  2075. ULONG iMode,
  2076. ULONG rgb,
  2077. ULONG *pul
  2078. );
  2079. BOOL APIENTRY DrvRealizeBrush(
  2080. BRUSHOBJ *pbo,
  2081. SURFOBJ *psoTarget,
  2082. SURFOBJ *psoPattern,
  2083. SURFOBJ *psoMask,
  2084. XLATEOBJ *pxlo,
  2085. ULONG iHatch
  2086. );
  2087. #define RB_DITHERCOLOR 0x80000000L
  2088. /*
  2089. * Fonts
  2090. */
  2091. PIFIMETRICS APIENTRY DrvQueryFont(
  2092. DHPDEV dhpdev,
  2093. ULONG_PTR iFile,
  2094. ULONG iFace,
  2095. ULONG_PTR *pid
  2096. );
  2097. // #define QFT_UNICODE 0L
  2098. #define QFT_LIGATURES 1L
  2099. #define QFT_KERNPAIRS 2L
  2100. #define QFT_GLYPHSET 3L
  2101. PVOID APIENTRY DrvQueryFontTree(
  2102. DHPDEV dhpdev,
  2103. ULONG_PTR iFile,
  2104. ULONG iFace,
  2105. ULONG iMode,
  2106. ULONG_PTR *pid
  2107. );
  2108. #define QFD_GLYPHANDBITMAP 1L
  2109. #define QFD_GLYPHANDOUTLINE 2L
  2110. #define QFD_MAXEXTENTS 3L
  2111. #define QFD_TT_GLYPHANDBITMAP 4L
  2112. #define QFD_TT_GRAY1_BITMAP 5L
  2113. #define QFD_TT_GRAY2_BITMAP 6L
  2114. #define QFD_TT_GRAY4_BITMAP 8L
  2115. #define QFD_TT_GRAY8_BITMAP 9L
  2116. #define QFD_TT_MONO_BITMAP QFD_TT_GRAY1_BITMAP
  2117. LONG APIENTRY DrvQueryFontData(
  2118. DHPDEV dhpdev,
  2119. FONTOBJ *pfo,
  2120. ULONG iMode,
  2121. HGLYPH hg,
  2122. GLYPHDATA *pgd,
  2123. PVOID pv,
  2124. ULONG cjSize
  2125. );
  2126. VOID APIENTRY DrvFree(
  2127. PVOID pv,
  2128. ULONG_PTR id);
  2129. VOID APIENTRY DrvDestroyFont(
  2130. FONTOBJ *pfo);
  2131. // Capability flags for DrvQueryCaps.
  2132. #define QC_OUTLINES 0x00000001
  2133. #define QC_1BIT 0x00000002
  2134. #define QC_4BIT 0x00000004
  2135. //
  2136. // This is a mask of the capabilites of a font provider that can return more
  2137. // than just glyph metrics (i.e., bitmaps and/or outlines). If a driver has
  2138. // one or more of these capabilities, then it is FONT DRIVER.
  2139. //
  2140. // Drivers should only set individual bits. GDI will check if any are turned on
  2141. // using this define.
  2142. //
  2143. #define QC_FONTDRIVERCAPS ( QC_OUTLINES | QC_1BIT | QC_4BIT )
  2144. LONG APIENTRY DrvQueryFontCaps(
  2145. ULONG culCaps,
  2146. ULONG *pulCaps
  2147. );
  2148. // fStatus is a new flag NT 5.0
  2149. #define FF_SIGNATURE_VERIFIED 0x1
  2150. #define FF_IGNORED_SIGNATURE 0x2
  2151. ULONG_PTR APIENTRY DrvLoadFontFile(
  2152. ULONG cFiles, // number of font files associated with this font
  2153. ULONG_PTR *piFile, // handles for individual files, cFiles of them
  2154. PVOID *ppvView, // array of cFiles views
  2155. ULONG *pcjView, // array of their sizes
  2156. DESIGNVECTOR *pdv, // only non null for mm instances
  2157. ULONG ulLangID,
  2158. ULONG ulFastCheckSum
  2159. );
  2160. BOOL APIENTRY DrvUnloadFontFile(
  2161. ULONG_PTR iFile
  2162. );
  2163. LONG APIENTRY DrvQueryTrueTypeTable(
  2164. ULONG_PTR iFile,
  2165. ULONG ulFont,
  2166. ULONG ulTag,
  2167. PTRDIFF dpStart,
  2168. ULONG cjBuf,
  2169. BYTE *pjBuf,
  2170. PBYTE *ppjTable,
  2171. ULONG *pcjTable
  2172. );
  2173. BOOL APIENTRY DrvQueryAdvanceWidths(
  2174. DHPDEV dhpdev,
  2175. FONTOBJ *pfo,
  2176. ULONG iMode,
  2177. HGLYPH *phg,
  2178. PVOID pvWidths,
  2179. ULONG cGlyphs
  2180. );
  2181. // Values for iMode
  2182. #define QAW_GETWIDTHS 0
  2183. #define QAW_GETEASYWIDTHS 1
  2184. // values for bMetricsOnly. even though declared as BOOL
  2185. // by adding TTO_QUBICS, this is becoming a flag field.
  2186. // For versions of NT 4.0 and earlier, this value is always
  2187. // set to zero by GDI.
  2188. #define TTO_METRICS_ONLY 1
  2189. #define TTO_QUBICS 2
  2190. #define TTO_UNHINTED 4
  2191. LONG APIENTRY DrvQueryTrueTypeOutline(
  2192. DHPDEV dhpdev,
  2193. FONTOBJ *pfo,
  2194. HGLYPH hglyph,
  2195. BOOL bMetricsOnly,
  2196. GLYPHDATA *pgldt,
  2197. ULONG cjBuf,
  2198. TTPOLYGONHEADER *ppoly
  2199. );
  2200. PVOID APIENTRY DrvGetTrueTypeFile (
  2201. ULONG_PTR iFile,
  2202. ULONG *pcj
  2203. );
  2204. // values for ulMode:
  2205. #define QFF_DESCRIPTION 1L
  2206. #define QFF_NUMFACES 2L
  2207. LONG APIENTRY DrvQueryFontFile(
  2208. ULONG_PTR iFile,
  2209. ULONG ulMode,
  2210. ULONG cjBuf,
  2211. ULONG *pulBuf
  2212. );
  2213. /*
  2214. * BitBlt
  2215. */
  2216. BOOL APIENTRY DrvBitBlt(
  2217. SURFOBJ *psoTrg,
  2218. SURFOBJ *psoSrc,
  2219. SURFOBJ *psoMask,
  2220. CLIPOBJ *pco,
  2221. XLATEOBJ *pxlo,
  2222. RECTL *prclTrg,
  2223. POINTL *pptlSrc,
  2224. POINTL *pptlMask,
  2225. BRUSHOBJ *pbo,
  2226. POINTL *pptlBrush,
  2227. ROP4 rop4
  2228. );
  2229. BOOL APIENTRY DrvStretchBlt(
  2230. SURFOBJ *psoDest,
  2231. SURFOBJ *psoSrc,
  2232. SURFOBJ *psoMask,
  2233. CLIPOBJ *pco,
  2234. XLATEOBJ *pxlo,
  2235. COLORADJUSTMENT *pca,
  2236. POINTL *pptlHTOrg,
  2237. RECTL *prclDest,
  2238. RECTL *prclSrc,
  2239. POINTL *pptlMask,
  2240. ULONG iMode
  2241. );
  2242. BOOL APIENTRY DrvStretchBltROP(
  2243. SURFOBJ *psoDest,
  2244. SURFOBJ *psoSrc,
  2245. SURFOBJ *psoMask,
  2246. CLIPOBJ *pco,
  2247. XLATEOBJ *pxlo,
  2248. COLORADJUSTMENT *pca,
  2249. POINTL *pptlHTOrg,
  2250. RECTL *prclDest,
  2251. RECTL *prclSrc,
  2252. POINTL *pptlMask,
  2253. ULONG iMode,
  2254. BRUSHOBJ *pbo,
  2255. DWORD rop4
  2256. );
  2257. BOOL APIENTRY DrvAlphaBlend(
  2258. SURFOBJ *psoDest,
  2259. SURFOBJ *psoSrc,
  2260. CLIPOBJ *pco,
  2261. XLATEOBJ *pxlo,
  2262. RECTL *prclDest,
  2263. RECTL *prclSrc,
  2264. BLENDOBJ *pBlendObj
  2265. );
  2266. BOOL APIENTRY DrvGradientFill(
  2267. SURFOBJ *psoDest,
  2268. CLIPOBJ *pco,
  2269. XLATEOBJ *pxlo,
  2270. TRIVERTEX *pVertex,
  2271. ULONG nVertex,
  2272. PVOID pMesh,
  2273. ULONG nMesh,
  2274. RECTL *prclExtents,
  2275. POINTL *pptlDitherOrg,
  2276. ULONG ulMode
  2277. );
  2278. BOOL APIENTRY DrvTransparentBlt(
  2279. SURFOBJ *psoDst,
  2280. SURFOBJ *psoSrc,
  2281. CLIPOBJ *pco,
  2282. XLATEOBJ *pxlo,
  2283. RECTL *prclDst,
  2284. RECTL *prclSrc,
  2285. ULONG iTransColor,
  2286. ULONG ulReserved
  2287. );
  2288. BOOL APIENTRY DrvCopyBits(
  2289. SURFOBJ *psoDest,
  2290. SURFOBJ *psoSrc,
  2291. CLIPOBJ *pco,
  2292. XLATEOBJ *pxlo,
  2293. RECTL *prclDest,
  2294. POINTL *pptlSrc
  2295. );
  2296. /*
  2297. * Text Output
  2298. */
  2299. BOOL APIENTRY DrvTextOut(
  2300. SURFOBJ *pso,
  2301. STROBJ *pstro,
  2302. FONTOBJ *pfo,
  2303. CLIPOBJ *pco,
  2304. RECTL *prclExtra, // Obsolete, always NULL
  2305. RECTL *prclOpaque,
  2306. BRUSHOBJ *pboFore,
  2307. BRUSHOBJ *pboOpaque,
  2308. POINTL *pptlOrg,
  2309. MIX mix
  2310. );
  2311. /*
  2312. * Graphics Output
  2313. */
  2314. BOOL APIENTRY DrvLineTo(
  2315. SURFOBJ *pso,
  2316. CLIPOBJ *pco,
  2317. BRUSHOBJ *pbo,
  2318. LONG x1,
  2319. LONG y1,
  2320. LONG x2,
  2321. LONG y2,
  2322. RECTL *prclBounds,
  2323. MIX mix
  2324. );
  2325. BOOL APIENTRY DrvStrokePath(
  2326. SURFOBJ *pso,
  2327. PATHOBJ *ppo,
  2328. CLIPOBJ *pco,
  2329. XFORMOBJ *pxo,
  2330. BRUSHOBJ *pbo,
  2331. POINTL *pptlBrushOrg,
  2332. LINEATTRS *plineattrs,
  2333. MIX mix
  2334. );
  2335. #define FP_ALTERNATEMODE 1L
  2336. #define FP_WINDINGMODE 2L
  2337. BOOL APIENTRY DrvFillPath(
  2338. SURFOBJ *pso,
  2339. PATHOBJ *ppo,
  2340. CLIPOBJ *pco,
  2341. BRUSHOBJ *pbo,
  2342. POINTL *pptlBrushOrg,
  2343. MIX mix,
  2344. FLONG flOptions
  2345. );
  2346. BOOL APIENTRY DrvStrokeAndFillPath(
  2347. SURFOBJ *pso,
  2348. PATHOBJ *ppo,
  2349. CLIPOBJ *pco,
  2350. XFORMOBJ *pxo,
  2351. BRUSHOBJ *pboStroke,
  2352. LINEATTRS *plineattrs,
  2353. BRUSHOBJ *pboFill,
  2354. POINTL *pptlBrushOrg,
  2355. MIX mixFill,
  2356. FLONG flOptions
  2357. );
  2358. BOOL APIENTRY DrvPaint(
  2359. SURFOBJ *pso,
  2360. CLIPOBJ *pco,
  2361. BRUSHOBJ *pbo,
  2362. POINTL *pptlBrushOrg,
  2363. MIX mix
  2364. );
  2365. /*
  2366. * Pointers
  2367. */
  2368. #define SPS_ERROR 0
  2369. #define SPS_DECLINE 1
  2370. #define SPS_ACCEPT_NOEXCLUDE 2
  2371. #define SPS_ACCEPT_EXCLUDE 3 // Obsolete
  2372. #define SPS_ACCEPT_SYNCHRONOUS 4
  2373. #define SPS_CHANGE 0x00000001L
  2374. #define SPS_ASYNCCHANGE 0x00000002L // Obsolete
  2375. #define SPS_ANIMATESTART 0x00000004L
  2376. #define SPS_ANIMATEUPDATE 0x00000008L
  2377. #define SPS_ALPHA 0x00000010L
  2378. #define SPS_LENGTHMASK 0x00000F00L
  2379. #define SPS_FREQMASK 0x000FF000L
  2380. ULONG APIENTRY DrvSetPointerShape(
  2381. SURFOBJ *pso,
  2382. SURFOBJ *psoMask,
  2383. SURFOBJ *psoColor,
  2384. XLATEOBJ *pxlo,
  2385. LONG xHot,
  2386. LONG yHot,
  2387. LONG x,
  2388. LONG y,
  2389. RECTL *prcl,
  2390. FLONG fl
  2391. );
  2392. VOID APIENTRY DrvMovePointer(
  2393. SURFOBJ *pso,
  2394. LONG x,
  2395. LONG y,
  2396. RECTL *prcl
  2397. );
  2398. /*
  2399. * Printing
  2400. */
  2401. BOOL APIENTRY DrvSendPage(
  2402. SURFOBJ *pso
  2403. );
  2404. BOOL APIENTRY DrvStartPage(
  2405. SURFOBJ *pso
  2406. );
  2407. ULONG APIENTRY DrvEscape(
  2408. SURFOBJ *pso,
  2409. ULONG iEsc,
  2410. ULONG cjIn,
  2411. PVOID pvIn,
  2412. ULONG cjOut,
  2413. PVOID pvOut
  2414. );
  2415. BOOL APIENTRY DrvStartDoc(
  2416. SURFOBJ *pso,
  2417. LPWSTR pwszDocName,
  2418. DWORD dwJobId
  2419. );
  2420. #define ED_ABORTDOC 1
  2421. BOOL APIENTRY DrvEndDoc(
  2422. SURFOBJ *pso,
  2423. FLONG fl
  2424. );
  2425. DECLSPEC_DEPRECATED_DDK
  2426. BOOL APIENTRY DrvQuerySpoolType(
  2427. DHPDEV,
  2428. LPWSTR
  2429. );
  2430. ULONG APIENTRY DrvDrawEscape(
  2431. SURFOBJ *pso,
  2432. ULONG iEsc,
  2433. CLIPOBJ *pco,
  2434. RECTL *prcl,
  2435. ULONG cjIn,
  2436. PVOID pvIn
  2437. );
  2438. ULONG APIENTRY DrvGetGlyphMode(
  2439. DHPDEV,
  2440. FONTOBJ *
  2441. );
  2442. ULONG APIENTRY DrvFontManagement(
  2443. SURFOBJ *pso,
  2444. FONTOBJ *pfo,
  2445. ULONG iMode,
  2446. ULONG cjIn,
  2447. PVOID pvIn,
  2448. ULONG cjOut,
  2449. PVOID pvOut
  2450. );
  2451. BOOL APIENTRY DrvStartBanding(
  2452. SURFOBJ *pso,
  2453. POINTL *pptl
  2454. );
  2455. BOOL APIENTRY DrvNextBand(
  2456. SURFOBJ *pso,
  2457. POINTL *pptl
  2458. );
  2459. typedef struct _PERBANDINFO
  2460. {
  2461. BOOL bRepeatThisBand;
  2462. SIZEL szlBand;
  2463. ULONG ulHorzRes;
  2464. ULONG ulVertRes;
  2465. } PERBANDINFO, *PPERBANDINFO;
  2466. ULONG APIENTRY DrvQueryPerBandInfo(
  2467. SURFOBJ *pso,
  2468. PERBANDINFO *pbi
  2469. );
  2470. /*
  2471. * DirectDraw
  2472. */
  2473. BOOL APIENTRY DrvEnableDirectDraw(
  2474. DHPDEV dhpdev,
  2475. DD_CALLBACKS *pCallBacks,
  2476. DD_SURFACECALLBACKS *pSurfaceCallBacks,
  2477. DD_PALETTECALLBACKS *pPaletteCallBacks
  2478. );
  2479. VOID APIENTRY DrvDisableDirectDraw(
  2480. DHPDEV dhpdev
  2481. );
  2482. BOOL APIENTRY DrvGetDirectDrawInfo(
  2483. DHPDEV dhpdev,
  2484. DD_HALINFO *pHalInfo,
  2485. DWORD *pdwNumHeaps,
  2486. VIDEOMEMORY *pvmList,
  2487. DWORD *pdwNumFourCCCodes,
  2488. DWORD *pdwFourCC
  2489. );
  2490. HBITMAP APIENTRY DrvDeriveSurface(
  2491. DD_DIRECTDRAW_GLOBAL *pDirectDraw,
  2492. DD_SURFACE_LOCAL *pSurface
  2493. );
  2494. /*
  2495. * ICM (Image Color Matching)
  2496. */
  2497. HANDLE APIENTRY DrvIcmCreateColorTransform(
  2498. DHPDEV dhpdev,
  2499. LPLOGCOLORSPACEW pLogColorSpace,
  2500. PVOID pvSourceProfile,
  2501. ULONG cjSourceProfile,
  2502. PVOID pvDestProfile,
  2503. ULONG cjDestProfile,
  2504. PVOID pvTargetProfile,
  2505. ULONG cjTargetProfile,
  2506. DWORD dwReserved
  2507. );
  2508. BOOL APIENTRY DrvIcmDeleteColorTransform(
  2509. DHPDEV dhpdev,
  2510. HANDLE hcmXform
  2511. );
  2512. BOOL APIENTRY DrvIcmCheckBitmapBits(
  2513. DHPDEV dhpdev,
  2514. HANDLE hColorTransform,
  2515. SURFOBJ *pso,
  2516. PBYTE paResults
  2517. );
  2518. typedef struct _GAMMARAMP {
  2519. WORD Red[256];
  2520. WORD Green[256];
  2521. WORD Blue[256];
  2522. } GAMMARAMP, *PGAMMARAMP;
  2523. BOOL APIENTRY DrvIcmSetDeviceGammaRamp(
  2524. DHPDEV dhpdev,
  2525. ULONG iFormat,
  2526. LPVOID lpRamp
  2527. );
  2528. #define IGRF_RGB_256BYTES 0 /* Obsolate */
  2529. #define IGRF_RGB_256WORDS 1 /* Same GammaRampArray format as Win95/98 DDI */
  2530. /*
  2531. * Query miscellaneous driver support
  2532. */
  2533. BOOL APIENTRY DrvQueryDeviceSupport(
  2534. SURFOBJ *pso,
  2535. XLATEOBJ *pxlo,
  2536. XFORMOBJ *pxo,
  2537. ULONG iType,
  2538. ULONG cjIn,
  2539. PVOID pvIn,
  2540. ULONG cjOut,
  2541. PVOID pvOut);
  2542. #define QDS_CHECKJPEGFORMAT 0
  2543. #define QDS_CHECKPNGFORMAT 1
  2544. VOID APIENTRY DrvSynchronizeSurface(
  2545. SURFOBJ *pso,
  2546. RECTL *prcl,
  2547. FLONG fl
  2548. );
  2549. #define DSS_TIMER_EVENT 0x0001
  2550. #define DSS_FLUSH_EVENT 0x0002
  2551. VOID APIENTRY DrvNotify(
  2552. SURFOBJ *pso,
  2553. ULONG iType,
  2554. PVOID pvData);
  2555. #define DN_ACCELERATION_LEVEL 1
  2556. #define DN_DEVICE_ORIGIN 2
  2557. #define DN_SLEEP_MODE 3
  2558. #define DN_DRAWING_BEGIN 4
  2559. /*
  2560. * Engine callbacks - tracking clip region changes
  2561. */
  2562. #define WOC_RGN_CLIENT_DELTA 0x0001
  2563. #define WOC_RGN_CLIENT 0x0002
  2564. #define WOC_RGN_SURFACE_DELTA 0x0004
  2565. #define WOC_RGN_SURFACE 0x0008
  2566. #define WOC_CHANGED 0x0010
  2567. #define WOC_DELETE 0x0020
  2568. #define WOC_DRAWN 0x0040
  2569. #define WOC_SPRITE_OVERLAP 0x0080
  2570. #define WOC_SPRITE_NO_OVERLAP 0x0100
  2571. typedef VOID (CALLBACK * WNDOBJCHANGEPROC)(WNDOBJ *pwo, FLONG fl);
  2572. #define WO_RGN_CLIENT_DELTA 0x0001
  2573. #define WO_RGN_CLIENT 0x0002
  2574. #define WO_RGN_SURFACE_DELTA 0x0004
  2575. #define WO_RGN_SURFACE 0x0008
  2576. #define WO_RGN_UPDATE_ALL 0x0010
  2577. #define WO_RGN_WINDOW 0x0020
  2578. #define WO_DRAW_NOTIFY 0x0040
  2579. #define WO_SPRITE_NOTIFY 0x0080
  2580. #define WO_RGN_DESKTOP_COORD 0x0100
  2581. WNDOBJ * APIENTRY EngCreateWnd(
  2582. SURFOBJ *pso,
  2583. HWND hwnd,
  2584. WNDOBJCHANGEPROC pfn,
  2585. FLONG fl,
  2586. int iPixelFormat
  2587. );
  2588. VOID APIENTRY EngDeleteWnd(
  2589. WNDOBJ *pwo
  2590. );
  2591. ULONG APIENTRY WNDOBJ_cEnumStart(
  2592. WNDOBJ *pwo,
  2593. ULONG iType,
  2594. ULONG iDirection,
  2595. ULONG cLimit
  2596. );
  2597. BOOL APIENTRY WNDOBJ_bEnum(
  2598. WNDOBJ *pwo,
  2599. ULONG cj,
  2600. ULONG *pul
  2601. );
  2602. VOID APIENTRY WNDOBJ_vSetConsumer(
  2603. WNDOBJ *pwo,
  2604. PVOID pvConsumer
  2605. );
  2606. /*
  2607. * Engine callback - hung device notification
  2608. */
  2609. #define EHN_RESTORED 0
  2610. #define EHN_ERROR 1
  2611. ULONG APIENTRY EngHangNotification(
  2612. HDEV hdev,
  2613. PVOID Reserved
  2614. );
  2615. /*
  2616. * Engine callbacks - tracking driver managed resources
  2617. */
  2618. HDRVOBJ APIENTRY EngCreateDriverObj(
  2619. PVOID pvObj,
  2620. FREEOBJPROC pFreeObjProc,
  2621. HDEV hdev
  2622. );
  2623. BOOL APIENTRY EngDeleteDriverObj(
  2624. HDRVOBJ hdo,
  2625. BOOL bCallBack,
  2626. BOOL bLocked
  2627. );
  2628. DRIVEROBJ* APIENTRY EngLockDriverObj(
  2629. HDRVOBJ hdo
  2630. );
  2631. BOOL APIENTRY EngUnlockDriverObj(
  2632. HDRVOBJ hdo
  2633. );
  2634. /*
  2635. * Engine callback - return current process handle.
  2636. */
  2637. HANDLE APIENTRY EngGetProcessHandle();
  2638. /*
  2639. * Engine callback - return current thread id
  2640. */
  2641. HANDLE APIENTRY EngGetCurrentThreadId();
  2642. /*
  2643. * Engine callback - return current process id
  2644. */
  2645. HANDLE APIENTRY EngGetCurrentProcessId();
  2646. /*
  2647. * Pixel formats
  2648. */
  2649. BOOL APIENTRY DrvSetPixelFormat(
  2650. SURFOBJ *pso,
  2651. LONG iPixelFormat,
  2652. HWND hwnd
  2653. );
  2654. LONG APIENTRY DrvDescribePixelFormat(
  2655. DHPDEV dhpdev,
  2656. LONG iPixelFormat,
  2657. ULONG cjpfd,
  2658. PIXELFORMATDESCRIPTOR *ppfd
  2659. );
  2660. /*
  2661. * Swap buffers
  2662. */
  2663. BOOL APIENTRY DrvSwapBuffers(
  2664. SURFOBJ *pso,
  2665. WNDOBJ *pwo
  2666. );
  2667. /*
  2668. * Function prototypes - Engine Simulations
  2669. */
  2670. BOOL APIENTRY EngBitBlt(
  2671. SURFOBJ *psoTrg,
  2672. SURFOBJ *psoSrc,
  2673. SURFOBJ *psoMask,
  2674. CLIPOBJ *pco,
  2675. XLATEOBJ *pxlo,
  2676. RECTL *prclTrg,
  2677. POINTL *pptlSrc,
  2678. POINTL *pptlMask,
  2679. BRUSHOBJ *pbo,
  2680. POINTL *pptlBrush,
  2681. ROP4 rop4
  2682. );
  2683. BOOL APIENTRY EngLineTo(
  2684. SURFOBJ *pso,
  2685. CLIPOBJ *pco,
  2686. BRUSHOBJ *pbo,
  2687. LONG x1,
  2688. LONG y1,
  2689. LONG x2,
  2690. LONG y2,
  2691. RECTL *prclBounds,
  2692. MIX mix
  2693. );
  2694. BOOL APIENTRY EngStretchBlt(
  2695. SURFOBJ *psoDest,
  2696. SURFOBJ *psoSrc,
  2697. SURFOBJ *psoMask,
  2698. CLIPOBJ *pco,
  2699. XLATEOBJ *pxlo,
  2700. COLORADJUSTMENT *pca,
  2701. POINTL *pptlHTOrg,
  2702. RECTL *prclDest,
  2703. RECTL *prclSrc,
  2704. POINTL *pptlMask,
  2705. ULONG iMode
  2706. );
  2707. BOOL APIENTRY EngStretchBltROP(
  2708. SURFOBJ *psoDest,
  2709. SURFOBJ *psoSrc,
  2710. SURFOBJ *psoMask,
  2711. CLIPOBJ *pco,
  2712. XLATEOBJ *pxlo,
  2713. COLORADJUSTMENT *pca,
  2714. POINTL *pptlHTOrg,
  2715. RECTL *prclDest,
  2716. RECTL *prclSrc,
  2717. POINTL *pptlMask,
  2718. ULONG iMode,
  2719. BRUSHOBJ *pbo,
  2720. DWORD rop4
  2721. );
  2722. BOOL APIENTRY EngAlphaBlend(
  2723. SURFOBJ *psoDest,
  2724. SURFOBJ *psoSrc,
  2725. CLIPOBJ *pco,
  2726. XLATEOBJ *pxlo,
  2727. RECTL *prclDest,
  2728. RECTL *prclSrc,
  2729. BLENDOBJ *pBlendObj
  2730. );
  2731. BOOL APIENTRY EngGradientFill(
  2732. SURFOBJ *psoDest,
  2733. CLIPOBJ *pco,
  2734. XLATEOBJ *pxlo,
  2735. TRIVERTEX *pVertex,
  2736. ULONG nVertex,
  2737. PVOID pMesh,
  2738. ULONG nMesh,
  2739. RECTL *prclExtents,
  2740. POINTL *pptlDitherOrg,
  2741. ULONG ulMode
  2742. );
  2743. BOOL APIENTRY EngTransparentBlt(
  2744. SURFOBJ *psoDst,
  2745. SURFOBJ *psoSrc,
  2746. CLIPOBJ *pco,
  2747. XLATEOBJ *pxlo,
  2748. RECTL *prclDst,
  2749. RECTL *prclSrc,
  2750. ULONG iTransColor,
  2751. ULONG ulReserved
  2752. );
  2753. BOOL APIENTRY EngTextOut(
  2754. SURFOBJ *pso,
  2755. STROBJ *pstro,
  2756. FONTOBJ *pfo,
  2757. CLIPOBJ *pco,
  2758. RECTL *prclExtra,
  2759. RECTL *prclOpaque,
  2760. BRUSHOBJ *pboFore,
  2761. BRUSHOBJ *pboOpaque,
  2762. POINTL *pptlOrg,
  2763. MIX mix
  2764. );
  2765. BOOL APIENTRY EngStrokePath(
  2766. SURFOBJ *pso,
  2767. PATHOBJ *ppo,
  2768. CLIPOBJ *pco,
  2769. XFORMOBJ *pxo,
  2770. BRUSHOBJ *pbo,
  2771. POINTL *pptlBrushOrg,
  2772. LINEATTRS *plineattrs,
  2773. MIX mix
  2774. );
  2775. BOOL APIENTRY EngFillPath(
  2776. SURFOBJ *pso,
  2777. PATHOBJ *ppo,
  2778. CLIPOBJ *pco,
  2779. BRUSHOBJ *pbo,
  2780. POINTL *pptlBrushOrg,
  2781. MIX mix,
  2782. FLONG flOptions
  2783. );
  2784. BOOL APIENTRY EngStrokeAndFillPath(
  2785. SURFOBJ *pso,
  2786. PATHOBJ *ppo,
  2787. CLIPOBJ *pco,
  2788. XFORMOBJ *pxo,
  2789. BRUSHOBJ *pboStroke,
  2790. LINEATTRS *plineattrs,
  2791. BRUSHOBJ *pboFill,
  2792. POINTL *pptlBrushOrg,
  2793. MIX mixFill,
  2794. FLONG flOptions
  2795. );
  2796. BOOL APIENTRY EngPaint(
  2797. SURFOBJ *pso,
  2798. CLIPOBJ *pco,
  2799. BRUSHOBJ *pbo,
  2800. POINTL *pptlBrushOrg,
  2801. MIX mix
  2802. );
  2803. BOOL APIENTRY EngCopyBits(
  2804. SURFOBJ *psoDest,
  2805. SURFOBJ *psoSrc,
  2806. CLIPOBJ *pco,
  2807. XLATEOBJ *pxlo,
  2808. RECTL *prclDest,
  2809. POINTL *pptlSrc
  2810. );
  2811. ULONG APIENTRY EngSetPointerShape(
  2812. SURFOBJ *pso,
  2813. SURFOBJ *psoMask,
  2814. SURFOBJ *psoColor,
  2815. XLATEOBJ *pxlo,
  2816. LONG xHot,
  2817. LONG yHot,
  2818. LONG x,
  2819. LONG y,
  2820. RECTL *prcl,
  2821. FLONG fl
  2822. );
  2823. VOID APIENTRY EngMovePointer(
  2824. SURFOBJ *pso,
  2825. LONG x,
  2826. LONG y,
  2827. RECTL *prcl
  2828. );
  2829. BOOL APIENTRY EngPlgBlt(
  2830. SURFOBJ *psoTrg,
  2831. SURFOBJ *psoSrc,
  2832. SURFOBJ *psoMsk,
  2833. CLIPOBJ *pco,
  2834. XLATEOBJ *pxlo,
  2835. COLORADJUSTMENT *pca,
  2836. POINTL *pptlBrushOrg,
  2837. POINTFIX *pptfx,
  2838. RECTL *prcl,
  2839. POINTL *pptl,
  2840. ULONG iMode
  2841. );
  2842. ULONG APIENTRY EngDitherColor(
  2843. HDEV hdev,
  2844. ULONG iMode,
  2845. ULONG rgb,
  2846. ULONG *pul
  2847. );
  2848. //
  2849. // Sprite control
  2850. //
  2851. #define ECS_TEARDOWN 0x0001
  2852. #define ECS_REDRAW 0x0002
  2853. BOOL APIENTRY EngControlSprites(
  2854. WNDOBJ *pwo,
  2855. FLONG fl
  2856. );
  2857. //
  2858. // Halftone releated APIs
  2859. //
  2860. LONG APIENTRY HT_ComputeRGBGammaTable(
  2861. USHORT GammaTableEntries,
  2862. USHORT GammaTableType,
  2863. USHORT RedGamma,
  2864. USHORT GreenGamma,
  2865. USHORT BlueGamma,
  2866. LPBYTE pGammaTable
  2867. );
  2868. LONG APIENTRY HT_Get8BPPFormatPalette(
  2869. LPPALETTEENTRY pPaletteEntry,
  2870. USHORT RedGamma,
  2871. USHORT GreenGamma,
  2872. USHORT BlueGamma
  2873. );
  2874. LONG APIENTRY HT_Get8BPPMaskPalette(
  2875. LPPALETTEENTRY pPaletteEntry,
  2876. BOOL Use8BPPMaskPal,
  2877. BYTE CMYMask,
  2878. USHORT RedGamma,
  2879. USHORT GreenGamma,
  2880. USHORT BlueGamma
  2881. );
  2882. typedef struct _DEVHTINFO {
  2883. DWORD HTFlags;
  2884. DWORD HTPatternSize;
  2885. DWORD DevPelsDPI;
  2886. COLORINFO ColorInfo;
  2887. } DEVHTINFO, *PDEVHTINFO;
  2888. #define DEVHTADJF_COLOR_DEVICE 0x00000001
  2889. #define DEVHTADJF_ADDITIVE_DEVICE 0x00000002
  2890. typedef struct _DEVHTADJDATA {
  2891. DWORD DeviceFlags;
  2892. DWORD DeviceXDPI;
  2893. DWORD DeviceYDPI;
  2894. PDEVHTINFO pDefHTInfo;
  2895. PDEVHTINFO pAdjHTInfo;
  2896. } DEVHTADJDATA, *PDEVHTADJDATA;
  2897. LONG
  2898. APIENTRY
  2899. HTUI_DeviceColorAdjustment(
  2900. LPSTR pDeviceName,
  2901. PDEVHTADJDATA pDevHTAdjData
  2902. );
  2903. //
  2904. // General support APIS
  2905. //
  2906. VOID APIENTRY EngDebugBreak(
  2907. VOID
  2908. );
  2909. VOID APIENTRY EngBugCheckEx(
  2910. IN ULONG BugCheckCode,
  2911. IN ULONG_PTR P1,
  2912. IN ULONG_PTR P2,
  2913. IN ULONG_PTR P3,
  2914. IN ULONG_PTR P4
  2915. );
  2916. VOID APIENTRY EngDebugPrint(
  2917. PCHAR StandardPrefix,
  2918. PCHAR DebugMessage,
  2919. va_list ap
  2920. );
  2921. VOID APIENTRY EngQueryPerformanceCounter(
  2922. LONGLONG *pPerformanceCount
  2923. );
  2924. VOID APIENTRY EngQueryPerformanceFrequency(
  2925. LONGLONG *pFrequency
  2926. );
  2927. BOOL APIENTRY EngSetPointerTag(
  2928. HDEV hdev,
  2929. SURFOBJ *psoMask,
  2930. SURFOBJ *psoColor,
  2931. XLATEOBJ *pxlo,
  2932. FLONG fl
  2933. );
  2934. //
  2935. // Kernel mode memory operations
  2936. //
  2937. #define FL_ZERO_MEMORY 0x00000001
  2938. #define FL_NONPAGED_MEMORY 0x00000002
  2939. #ifdef USERMODE_DRIVER
  2940. #define EngAllocMem(flags, cj, tag) ((PVOID) GlobalAlloc(((flags) & FL_ZERO_MEMORY) ? GPTR : GMEM_FIXED, cj))
  2941. #define EngFreeMem(p) GlobalFree((HGLOBAL) (p))
  2942. #define EngAllocUserMem(cj, tag) ((PVOID) GlobalAlloc(GMEM_FIXED,cj))
  2943. #define EngFreeUserMem(p) GlobalFree((HGLOBAL) (p))
  2944. #define EngAllocPrivateUserMem( psl, cj, tag) ((PVOID) GlobalAlloc(GMEM_FIXED,cj))
  2945. #define EngFreePrivateUserMem( psl, p) GlobalFree((HGLOBAL) (p))
  2946. #define EngMulDiv MulDiv
  2947. #else // !USERMODE_DRIVER
  2948. PVOID APIENTRY EngAllocMem(
  2949. ULONG Flags,
  2950. ULONG MemSize,
  2951. ULONG Tag
  2952. );
  2953. VOID APIENTRY EngFreeMem(
  2954. PVOID Mem
  2955. );
  2956. PVOID APIENTRY EngAllocUserMem(
  2957. SIZE_T cj,
  2958. ULONG tag
  2959. );
  2960. VOID APIENTRY EngFreeUserMem(
  2961. PVOID pv
  2962. );
  2963. PVOID APIENTRY EngAllocPrivateUserMem(
  2964. PDD_SURFACE_LOCAL psl,
  2965. SIZE_T cj,
  2966. ULONG tag
  2967. );
  2968. VOID
  2969. EngFreePrivateUserMem(
  2970. PDD_SURFACE_LOCAL psl,
  2971. PVOID pv
  2972. );
  2973. HRESULT
  2974. EngDxIoctl(
  2975. ULONG ulIoctl,
  2976. PVOID pBuffer,
  2977. ULONG ulBufferSize
  2978. );
  2979. int APIENTRY EngMulDiv(
  2980. int a,
  2981. int b,
  2982. int c
  2983. );
  2984. #endif // !USERMODE_DRIVER
  2985. //
  2986. // User mode memory Operations
  2987. //
  2988. VOID APIENTRY EngProbeForRead(
  2989. PVOID Address,
  2990. ULONG Length,
  2991. ULONG Alignment
  2992. );
  2993. VOID APIENTRY EngProbeForReadAndWrite(
  2994. PVOID Address,
  2995. ULONG Length,
  2996. ULONG Alignment
  2997. );
  2998. HANDLE APIENTRY EngSecureMem(
  2999. PVOID Address,
  3000. ULONG Length
  3001. );
  3002. VOID APIENTRY EngUnsecureMem(
  3003. HANDLE hSecure
  3004. );
  3005. DWORD APIENTRY EngDeviceIoControl(
  3006. HANDLE hDevice,
  3007. DWORD dwIoControlCode,
  3008. LPVOID lpInBuffer,
  3009. DWORD nInBufferSize,
  3010. LPVOID lpOutBuffer,
  3011. DWORD nOutBufferSize,
  3012. LPDWORD lpBytesReturned
  3013. );
  3014. //
  3015. // Loading drivers and gettings entry points from them
  3016. //
  3017. #ifdef USERMODE_DRIVER
  3018. #define EngLoadImage(filename) ((HANDLE) LoadLibraryW(filename))
  3019. #define EngFindImageProcAddress(h, procname) ((PVOID) GetProcAddress(h, procname))
  3020. #define EngUnloadImage(h) FreeLibrary((HMODULE) (h))
  3021. #else // !USERMODE_DRIVER
  3022. HANDLE APIENTRY EngLoadImage(
  3023. LPWSTR pwszDriver
  3024. );
  3025. PVOID APIENTRY EngFindImageProcAddress(
  3026. HANDLE hModule,
  3027. LPSTR lpProcName
  3028. );
  3029. VOID APIENTRY EngUnloadImage(
  3030. HANDLE hModule
  3031. );
  3032. PVOID APIENTRY EngMapModule(
  3033. HANDLE h,
  3034. PULONG pSize
  3035. );
  3036. #endif // !USERMODE_DRIVER
  3037. //
  3038. // callback for extra PDEV information
  3039. //
  3040. LPWSTR APIENTRY EngGetPrinterDataFileName(
  3041. HDEV hdev
  3042. );
  3043. LPWSTR APIENTRY EngGetDriverName(
  3044. HDEV hdev
  3045. );
  3046. typedef struct _TYPE1_FONT
  3047. {
  3048. HANDLE hPFM;
  3049. HANDLE hPFB;
  3050. ULONG ulIdentifier;
  3051. } TYPE1_FONT;
  3052. BOOL APIENTRY EngGetType1FontList(
  3053. HDEV hdev,
  3054. TYPE1_FONT *pType1Buffer,
  3055. ULONG cjType1Buffer,
  3056. PULONG pulLocalFonts,
  3057. PULONG pulRemoteFonts,
  3058. LARGE_INTEGER *pLastModified
  3059. );
  3060. //
  3061. // Manipulating resource sections
  3062. //
  3063. HANDLE APIENTRY EngLoadModule(
  3064. LPWSTR pwsz
  3065. );
  3066. PVOID APIENTRY EngFindResource(
  3067. HANDLE h,
  3068. int iName,
  3069. int iType,
  3070. PULONG pulSize
  3071. );
  3072. VOID APIENTRY EngFreeModule(
  3073. HANDLE h
  3074. );
  3075. BOOL
  3076. APIENTRY
  3077. EngDeleteFile (
  3078. LPWSTR pwszFileName
  3079. );
  3080. PVOID
  3081. APIENTRY
  3082. EngMapFile(
  3083. LPWSTR pwsz,
  3084. ULONG cjSize,
  3085. ULONG_PTR *piFile
  3086. );
  3087. BOOL
  3088. APIENTRY
  3089. EngUnmapFile (
  3090. ULONG_PTR iFile
  3091. );
  3092. //
  3093. // FontFile Callbacks
  3094. //
  3095. VOID APIENTRY EngUnmapFontFile(
  3096. ULONG_PTR iFile
  3097. );
  3098. BOOL APIENTRY EngMapFontFile(
  3099. ULONG_PTR iFile,
  3100. PULONG *ppjBuf,
  3101. ULONG *pcjBuf
  3102. );
  3103. VOID APIENTRY EngUnmapFontFileFD(
  3104. ULONG_PTR iFile
  3105. );
  3106. BOOL APIENTRY EngMapFontFileFD(
  3107. ULONG_PTR iFile,
  3108. PULONG *ppjBuf,
  3109. ULONG *pcjBuf
  3110. );
  3111. BOOL APIENTRY EngLpkInstalled();
  3112. //
  3113. // Semaphores
  3114. //
  3115. DECLARE_HANDLE(HSEMAPHORE);
  3116. HSEMAPHORE APIENTRY EngCreateSemaphore(
  3117. VOID
  3118. );
  3119. VOID APIENTRY EngAcquireSemaphore(
  3120. HSEMAPHORE hsem
  3121. );
  3122. VOID APIENTRY EngReleaseSemaphore(
  3123. HSEMAPHORE hsem
  3124. );
  3125. VOID APIENTRY EngDeleteSemaphore(
  3126. HSEMAPHORE hsem
  3127. );
  3128. BOOL APIENTRY EngIsSemaphoreOwned(
  3129. HSEMAPHORE hsem
  3130. );
  3131. BOOL APIENTRY EngIsSemaphoreOwnedByCurrentThread(
  3132. HSEMAPHORE hsem
  3133. );
  3134. //
  3135. // Semaphore wrapper with a reference count for thread-safe creation and
  3136. // destruction. Data must be created zero-filled.
  3137. //
  3138. // Use EngAcquire/ReleaseSemaphore on hsem for access protection.
  3139. //
  3140. typedef struct _ENGSAFESEMAPHORE
  3141. {
  3142. HSEMAPHORE hsem;
  3143. LONG lCount;
  3144. } ENGSAFESEMAPHORE;
  3145. BOOL APIENTRY EngInitializeSafeSemaphore(
  3146. ENGSAFESEMAPHORE *pssem
  3147. );
  3148. VOID APIENTRY EngDeleteSafeSemaphore(
  3149. ENGSAFESEMAPHORE *pssem
  3150. );
  3151. VOID APIENTRY EngMultiByteToUnicodeN(
  3152. LPWSTR UnicodeString,
  3153. ULONG MaxBytesInUnicodeString,
  3154. PULONG BytesInUnicodeString,
  3155. PCHAR MultiByteString,
  3156. ULONG BytesInMultiByteString
  3157. );
  3158. VOID APIENTRY EngUnicodeToMultiByteN(
  3159. PCHAR MultiByteString,
  3160. ULONG MaxBytesInMultiByteString,
  3161. PULONG BytesInMultiByteString,
  3162. PWSTR UnicodeString,
  3163. ULONG BytesInUnicodeString
  3164. );
  3165. // for the spooler
  3166. #ifdef USERMODE_DRIVER
  3167. #define EngWritePrinter WritePrinter
  3168. #define EngGetPrinter GetPrinter
  3169. #define EngGetPrinterDriver GetPrinterDriver
  3170. #define EngGetPrinterData GetPrinterData
  3171. #define EngSetPrinterData SetPrinterData
  3172. #define EngEnumForms EnumForms
  3173. #define EngGetForm GetForm
  3174. #else // !USERMODE_DRIVER
  3175. BOOL APIENTRY EngGetPrinterDriver(
  3176. HANDLE hPrinter,
  3177. LPWSTR pEnvironment,
  3178. DWORD dwLevel,
  3179. BYTE *lpbDrvInfo,
  3180. DWORD cbBuf,
  3181. DWORD *pcbNeeded
  3182. );
  3183. DWORD APIENTRY EngGetPrinterData(
  3184. HANDLE hPrinter,
  3185. LPWSTR pValueName,
  3186. LPDWORD pType,
  3187. LPBYTE pData,
  3188. DWORD nSize,
  3189. LPDWORD pcbNeeded
  3190. );
  3191. DWORD APIENTRY EngSetPrinterData(
  3192. HANDLE hPrinter,
  3193. LPWSTR pType,
  3194. DWORD dwType,
  3195. LPBYTE lpbPrinterData,
  3196. DWORD cjPrinterData
  3197. );
  3198. BOOL APIENTRY EngGetForm(
  3199. HANDLE hPrinter,
  3200. LPWSTR pFormName,
  3201. DWORD Level,
  3202. LPBYTE pForm,
  3203. DWORD cbBuf,
  3204. LPDWORD pcbNeeded
  3205. );
  3206. BOOL APIENTRY EngWritePrinter(
  3207. HANDLE hPrinter,
  3208. LPVOID pBuf,
  3209. DWORD cbBuf,
  3210. LPDWORD pcWritten
  3211. );
  3212. BOOL APIENTRY EngGetPrinter(
  3213. HANDLE hPrinter,
  3214. DWORD dwLevel,
  3215. LPBYTE pPrinter,
  3216. DWORD cbBuf,
  3217. LPDWORD pcbNeeded
  3218. );
  3219. BOOL APIENTRY EngEnumForms(
  3220. HANDLE hPrinter,
  3221. DWORD Level,
  3222. LPBYTE pForm,
  3223. DWORD cbBuf,
  3224. LPDWORD pcbNeeded,
  3225. LPDWORD pcReturned
  3226. );
  3227. #endif // !USERMODE_DRIVER
  3228. #if defined(_X86_) && !defined(USERMODE_DRIVER)
  3229. typedef struct _FLOATOBJ
  3230. {
  3231. ULONG ul1;
  3232. ULONG ul2;
  3233. } FLOATOBJ, *PFLOATOBJ;
  3234. VOID APIENTRY FLOATOBJ_SetFloat(PFLOATOBJ,FLOATL);
  3235. VOID APIENTRY FLOATOBJ_SetLong(PFLOATOBJ,LONG);
  3236. LONG APIENTRY FLOATOBJ_GetFloat(PFLOATOBJ);
  3237. LONG APIENTRY FLOATOBJ_GetLong(PFLOATOBJ);
  3238. VOID APIENTRY FLOATOBJ_AddFloat(PFLOATOBJ,FLOATL);
  3239. VOID APIENTRY FLOATOBJ_AddLong(PFLOATOBJ,LONG);
  3240. VOID APIENTRY FLOATOBJ_Add(PFLOATOBJ,PFLOATOBJ);
  3241. VOID APIENTRY FLOATOBJ_SubFloat(PFLOATOBJ,FLOATL);
  3242. VOID APIENTRY FLOATOBJ_SubLong(PFLOATOBJ,LONG);
  3243. VOID APIENTRY FLOATOBJ_Sub(PFLOATOBJ,PFLOATOBJ);
  3244. VOID APIENTRY FLOATOBJ_MulFloat(PFLOATOBJ,FLOATL);
  3245. VOID APIENTRY FLOATOBJ_MulLong(PFLOATOBJ,LONG);
  3246. VOID APIENTRY FLOATOBJ_Mul(PFLOATOBJ,PFLOATOBJ);
  3247. VOID APIENTRY FLOATOBJ_DivFloat(PFLOATOBJ,FLOATL);
  3248. VOID APIENTRY FLOATOBJ_DivLong(PFLOATOBJ,LONG);
  3249. VOID APIENTRY FLOATOBJ_Div(PFLOATOBJ,PFLOATOBJ);
  3250. VOID APIENTRY FLOATOBJ_Neg(PFLOATOBJ);
  3251. BOOL APIENTRY FLOATOBJ_EqualLong(PFLOATOBJ,LONG);
  3252. BOOL APIENTRY FLOATOBJ_GreaterThanLong(PFLOATOBJ,LONG);
  3253. BOOL APIENTRY FLOATOBJ_LessThanLong(PFLOATOBJ,LONG);
  3254. BOOL APIENTRY FLOATOBJ_Equal(PFLOATOBJ,PFLOATOBJ);
  3255. BOOL APIENTRY FLOATOBJ_GreaterThan(PFLOATOBJ,PFLOATOBJ);
  3256. BOOL APIENTRY FLOATOBJ_LessThan(PFLOATOBJ,PFLOATOBJ);
  3257. #else
  3258. // any platform that has support for floats in the kernel
  3259. typedef FLOAT FLOATOBJ;
  3260. typedef FLOAT *PFLOATOBJ;
  3261. #define FLOATOBJ_SetFloat(pf,f) {*(pf) = (f); }
  3262. #define FLOATOBJ_SetLong(pf,l) {*(pf) = (FLOAT)(l); }
  3263. #define FLOATOBJ_GetFloat(pf) *((PULONG)pf)
  3264. #define FLOATOBJ_GetLong(pf) (LONG)*(pf)
  3265. #define FLOATOBJ_AddFloat(pf,f) {*(pf) += f; }
  3266. #define FLOATOBJ_AddLong(pf,l) {*(pf) += (LONG)(l); }
  3267. #define FLOATOBJ_Add(pf,pf1) {*(pf) += *(pf1); }
  3268. #define FLOATOBJ_SubFloat(pf,f) {*(pf) -= f; }
  3269. #define FLOATOBJ_SubLong(pf,l) {*(pf) -= (LONG)(l); }
  3270. #define FLOATOBJ_Sub(pf,pf1) {*(pf) -= *(pf1); }
  3271. #define FLOATOBJ_MulFloat(pf,f) {*(pf) *= f; }
  3272. #define FLOATOBJ_MulLong(pf,l) {*(pf) *= (LONG)(l); }
  3273. #define FLOATOBJ_Mul(pf,pf1) {*(pf) *= *(pf1); }
  3274. #define FLOATOBJ_DivFloat(pf,f) {*(pf) /= f; }
  3275. #define FLOATOBJ_DivLong(pf,l) {*(pf) /= (LONG)(l); }
  3276. #define FLOATOBJ_Div(pf,pf1) {*(pf) /= *(pf1); }
  3277. #define FLOATOBJ_Neg(pf) {*(pf) = -*(pf); }
  3278. #define FLOATOBJ_EqualLong(pf,l) (*(pf) == (FLOAT)(l))
  3279. #define FLOATOBJ_GreaterThanLong(pf,l) (*(pf) > (FLOAT)(l))
  3280. #define FLOATOBJ_LessThanLong(pf,l) (*(pf) < (FLOAT)(l))
  3281. #define FLOATOBJ_Equal(pf,pf1) (*(pf) == *(pf1))
  3282. #define FLOATOBJ_GreaterThan(pf,pf1) (*(pf) > *(pf1))
  3283. #define FLOATOBJ_LessThan(pf,pf1) (*(pf) < *(pf1))
  3284. #endif // _FLOATOBJ_
  3285. #if defined(USERMODE_DRIVER)
  3286. typedef XFORML FLOATOBJ_XFORM ;
  3287. typedef XFORML *PFLOATOBJ_XFORM;
  3288. typedef XFORML FAR *LPFLOATOBJ_XFORM;
  3289. #define XFORMOBJ_iGetFloatObjXform XFORMOBJ_iGetXform
  3290. #else
  3291. typedef struct tagFLOATOBJ_XFORM
  3292. {
  3293. FLOATOBJ eM11;
  3294. FLOATOBJ eM12;
  3295. FLOATOBJ eM21;
  3296. FLOATOBJ eM22;
  3297. FLOATOBJ eDx;
  3298. FLOATOBJ eDy;
  3299. } FLOATOBJ_XFORM, *PFLOATOBJ_XFORM, FAR *LPFLOATOBJ_XFORM;
  3300. ULONG APIENTRY XFORMOBJ_iGetFloatObjXform(
  3301. XFORMOBJ *pxo,
  3302. FLOATOBJ_XFORM * pfxo
  3303. );
  3304. #endif
  3305. // SORT specific defines
  3306. typedef int (__cdecl *SORTCOMP)(const void *pv1, const void *pv2);
  3307. VOID APIENTRY EngSort(
  3308. PBYTE pjBuf,
  3309. ULONG c,
  3310. ULONG cjElem,
  3311. SORTCOMP pfnComp
  3312. );
  3313. typedef struct _ENG_TIME_FIELDS {
  3314. USHORT usYear; // range [1601...]
  3315. USHORT usMonth; // range [1..12]
  3316. USHORT usDay; // range [1..31]
  3317. USHORT usHour; // range [0..23]
  3318. USHORT usMinute; // range [0..59]
  3319. USHORT usSecond; // range [0..59]
  3320. USHORT usMilliseconds;// range [0..999]
  3321. USHORT usWeekday; // range [0..6] == [Sunday..Saturday]
  3322. } ENG_TIME_FIELDS, *PENG_TIME_FIELDS;
  3323. VOID APIENTRY EngQueryLocalTime(
  3324. PENG_TIME_FIELDS
  3325. );
  3326. FD_GLYPHSET* APIENTRY EngComputeGlyphSet(
  3327. INT nCodePage,
  3328. INT nFirstChar,
  3329. INT cChars
  3330. );
  3331. INT APIENTRY EngMultiByteToWideChar(
  3332. UINT CodePage,
  3333. LPWSTR WideCharString,
  3334. INT BytesInWideCharString,
  3335. LPSTR MultiByteString,
  3336. INT BytesInMultiByteString
  3337. );
  3338. INT APIENTRY EngWideCharToMultiByte(
  3339. UINT CodePage,
  3340. LPWSTR WideCharString,
  3341. INT BytesInWideCharString,
  3342. LPSTR MultiByteString,
  3343. INT BytesInMultiByteString
  3344. );
  3345. VOID APIENTRY EngGetCurrentCodePage(
  3346. PUSHORT OemCodePage,
  3347. PUSHORT AnsiCodePage
  3348. );
  3349. HANDLE APIENTRY EngLoadModuleForWrite(
  3350. LPWSTR pwsz,
  3351. ULONG cjSizeOfModule
  3352. );
  3353. LARGE_INTEGER APIENTRY EngQueryFileTimeStamp (
  3354. LPWSTR pwsz
  3355. );
  3356. BOOL APIENTRY EngGetFileChangeTime(
  3357. HANDLE h,
  3358. LARGE_INTEGER *pChangeTime
  3359. );
  3360. BOOL APIENTRY EngGetFilePath(
  3361. IN HANDLE h ,
  3362. OUT WCHAR (*pDest)[MAX_PATH+1]
  3363. );
  3364. ULONG APIENTRY EngSaveFloatingPointState(
  3365. VOID *pBuffer,
  3366. ULONG cjBufferSize
  3367. );
  3368. BOOL APIENTRY EngRestoreFloatingPointState(
  3369. VOID *pBuffer
  3370. );
  3371. //
  3372. // DirectDraw surface locking
  3373. //
  3374. PDD_SURFACE_LOCAL APIENTRY EngLockDirectDrawSurface(
  3375. HANDLE hSurface
  3376. );
  3377. BOOL APIENTRY EngUnlockDirectDrawSurface(
  3378. PDD_SURFACE_LOCAL pSurface
  3379. );
  3380. //
  3381. // Engine Event support.
  3382. //
  3383. //
  3384. // Opaque type for event objects.
  3385. //
  3386. typedef struct _ENG_EVENT *PEVENT;
  3387. BOOL APIENTRY EngDeleteEvent(
  3388. IN PEVENT pEvent
  3389. );
  3390. BOOL APIENTRY EngCreateEvent(
  3391. OUT PEVENT *ppEvent
  3392. );
  3393. BOOL APIENTRY EngUnmapEvent(
  3394. IN PEVENT pEvent
  3395. );
  3396. PEVENT APIENTRY EngMapEvent(
  3397. IN HDEV hDev,
  3398. IN HANDLE hUserObject,
  3399. IN PVOID Reserved1,
  3400. IN PVOID Reserved2,
  3401. IN PVOID Reserved3
  3402. );
  3403. BOOL APIENTRY EngWaitForSingleObject(
  3404. IN PEVENT pEvent,
  3405. IN PLARGE_INTEGER pTimeOut
  3406. );
  3407. LONG APIENTRY EngSetEvent(
  3408. IN PEVENT pEvent
  3409. );
  3410. VOID APIENTRY
  3411. EngClearEvent (
  3412. IN PEVENT pEvent
  3413. );
  3414. LONG APIENTRY
  3415. EngReadStateEvent (
  3416. IN PEVENT pEvent
  3417. );
  3418. //
  3419. // Querying of system attributes.
  3420. //
  3421. typedef enum _ENG_SYSTEM_ATTRIBUTE {
  3422. EngProcessorFeature = 1,
  3423. EngNumberOfProcessors,
  3424. EngOptimumAvailableUserMemory,
  3425. EngOptimumAvailableSystemMemory,
  3426. } ENG_SYSTEM_ATTRIBUTE;
  3427. #define QSA_MMX 0x00000100 // MMX
  3428. #define QSA_SSE 0x00002000 // SIMD
  3429. #define QSA_3DNOW 0x00004000 // 3DNow
  3430. BOOL APIENTRY
  3431. EngQuerySystemAttribute(
  3432. ENG_SYSTEM_ATTRIBUTE CapNum,
  3433. PDWORD pCapability);
  3434. #define ENG_FNT_CACHE_READ_FAULT 0x1
  3435. #define ENG_FNT_CACHE_WRITE_FAULT 0x2
  3436. PVOID APIENTRY EngFntCacheLookUp(ULONG FastCheckSum, ULONG * pulSize);
  3437. PVOID APIENTRY EngFntCacheAlloc(ULONG FastCheckSum, ULONG ulSize);
  3438. VOID APIENTRY EngFntCacheFault(ULONG ulFastCheckSum, ULONG iFaultMode);
  3439. typedef enum _ENG_DEVICE_ATTRIBUTE {
  3440. QDA_RESERVED = 0,
  3441. QDA_ACCELERATION_LEVEL = 1
  3442. } ENG_DEVICE_ATTRIBUTE;
  3443. BOOL APIENTRY
  3444. EngQueryDeviceAttribute(
  3445. HDEV hdev,
  3446. ENG_DEVICE_ATTRIBUTE devAttr,
  3447. VOID * pvIn,
  3448. ULONG ulInSize,
  3449. VOID * pvOUt,
  3450. ULONG ulOutSize);
  3451. typedef struct
  3452. {
  3453. DWORD nSize;
  3454. HDC hdc;
  3455. PBYTE pvEMF;
  3456. PBYTE pvCurrentRecord;
  3457. } EMFINFO, *PEMFINFO;
  3458. DECLSPEC_DEPRECATED_DDK
  3459. BOOL APIENTRY
  3460. EngQueryEMFInfo(
  3461. HDEV hdev,
  3462. EMFINFO *pEMFInfo);
  3463. //
  3464. // EngProcessorFeature
  3465. //
  3466. //
  3467. // EngNumberOfProcessors
  3468. //
  3469. // Number of active processors in the machine.
  3470. //
  3471. //
  3472. // EngOptimumAvailableUserMemory
  3473. //
  3474. // Optimum amount of user-mode memory available to avoid paging.
  3475. // Returns the number of bytes for the optimum allocation size
  3476. // Memory is allocated via EngAllocUserMem.
  3477. //
  3478. //
  3479. // EngOptimumAvailableSystemMemory
  3480. //
  3481. // Optimum amount of system memory available to avoid paging.
  3482. // Returns the number of bytes for the optimum allocation size.
  3483. // Memory is allocated via EngAllocMem.
  3484. //
  3485. //
  3486. // DDI entrypoint function prototypes
  3487. //
  3488. typedef BOOL (APIENTRY *PFN_DrvEnableDriver)(ULONG,ULONG,PDRVENABLEDATA);
  3489. typedef DHPDEV (APIENTRY *PFN_DrvEnablePDEV) (PDEVMODEW,LPWSTR,ULONG,HSURF*,ULONG,GDIINFO*,ULONG,PDEVINFO,HDEV,LPWSTR,HANDLE);
  3490. typedef VOID (APIENTRY *PFN_DrvCompletePDEV)(DHPDEV,HDEV);
  3491. typedef ULONG (APIENTRY *PFN_DrvResetDevice)(DHPDEV,PVOID);
  3492. typedef VOID (APIENTRY *PFN_DrvDisablePDEV)(DHPDEV);
  3493. typedef VOID (APIENTRY *PFN_DrvSynchronize)(DHPDEV,RECTL *);
  3494. typedef HSURF (APIENTRY *PFN_DrvEnableSurface)(DHPDEV);
  3495. typedef VOID (APIENTRY *PFN_DrvDisableDriver)(VOID);
  3496. typedef VOID (APIENTRY *PFN_DrvDisableSurface)(DHPDEV);
  3497. typedef BOOL (APIENTRY *PFN_DrvAssertMode)(DHPDEV, BOOL);
  3498. typedef BOOL (APIENTRY *PFN_DrvTextOut)(SURFOBJ *,STROBJ *,FONTOBJ *,CLIPOBJ *,RECTL *,RECTL *,BRUSHOBJ *,BRUSHOBJ *,POINTL *,MIX);
  3499. typedef BOOL (APIENTRY *PFN_DrvStretchBlt)(SURFOBJ *,SURFOBJ *,SURFOBJ *,CLIPOBJ *,XLATEOBJ *,COLORADJUSTMENT *,POINTL *,RECTL *,RECTL *,POINTL *,ULONG);
  3500. typedef BOOL (APIENTRY *PFN_DrvStretchBltROP)(SURFOBJ *,SURFOBJ *,SURFOBJ *,CLIPOBJ *,XLATEOBJ *,COLORADJUSTMENT *,POINTL *,RECTL *,RECTL *,POINTL *,ULONG, BRUSHOBJ *,ROP4);
  3501. typedef BOOL (APIENTRY *PFN_DrvTransparentBlt)(SURFOBJ *, SURFOBJ *, CLIPOBJ *, XLATEOBJ *, RECTL *, RECTL *, ULONG, ULONG);
  3502. typedef BOOL (APIENTRY *PFN_DrvPlgBlt)(SURFOBJ *,SURFOBJ *,SURFOBJ *,CLIPOBJ *,XLATEOBJ *,COLORADJUSTMENT *,POINTL *,POINTFIX *,RECTL *,POINTL *,ULONG);
  3503. typedef BOOL (APIENTRY *PFN_DrvBitBlt)(SURFOBJ *,SURFOBJ *,SURFOBJ *,CLIPOBJ *,XLATEOBJ *,RECTL *,POINTL *,POINTL *,BRUSHOBJ *,POINTL *,ROP4);
  3504. typedef BOOL (APIENTRY *PFN_DrvRealizeBrush)(BRUSHOBJ *,SURFOBJ *,SURFOBJ *,SURFOBJ *,XLATEOBJ *,ULONG);
  3505. typedef BOOL (APIENTRY *PFN_DrvCopyBits)(SURFOBJ *,SURFOBJ *,CLIPOBJ *,XLATEOBJ *,RECTL *,POINTL *);
  3506. typedef ULONG (APIENTRY *PFN_DrvDitherColor)(DHPDEV, ULONG, ULONG, ULONG *);
  3507. typedef HBITMAP (APIENTRY *PFN_DrvCreateDeviceBitmap)(DHPDEV, SIZEL, ULONG);
  3508. typedef VOID (APIENTRY *PFN_DrvDeleteDeviceBitmap)(DHSURF);
  3509. typedef BOOL (APIENTRY *PFN_DrvSetPalette)(DHPDEV, PALOBJ *, FLONG, ULONG, ULONG);
  3510. typedef ULONG (APIENTRY *PFN_DrvEscape)(SURFOBJ *, ULONG, ULONG, PVOID, ULONG, PVOID);
  3511. typedef ULONG (APIENTRY *PFN_DrvDrawEscape)(SURFOBJ *, ULONG, CLIPOBJ *, RECTL *, ULONG, PVOID);
  3512. typedef PIFIMETRICS (APIENTRY *PFN_DrvQueryFont)(DHPDEV, ULONG_PTR, ULONG, ULONG_PTR *);
  3513. typedef PVOID (APIENTRY *PFN_DrvQueryFontTree)(DHPDEV, ULONG_PTR, ULONG, ULONG, ULONG_PTR *);
  3514. typedef LONG (APIENTRY *PFN_DrvQueryFontData)(DHPDEV, FONTOBJ *, ULONG, HGLYPH, GLYPHDATA *, PVOID, ULONG);
  3515. typedef VOID (APIENTRY *PFN_DrvFree)(PVOID, ULONG_PTR);
  3516. typedef VOID (APIENTRY *PFN_DrvDestroyFont)(FONTOBJ *);
  3517. typedef LONG (APIENTRY *PFN_DrvQueryFontCaps)(ULONG, ULONG *);
  3518. typedef HFF (APIENTRY *PFN_DrvLoadFontFile)(ULONG, ULONG_PTR *, PVOID *, ULONG *, DESIGNVECTOR *, ULONG, ULONG);
  3519. typedef BOOL (APIENTRY *PFN_DrvUnloadFontFile)(ULONG_PTR);
  3520. typedef ULONG (APIENTRY *PFN_DrvSetPointerShape)(SURFOBJ *, SURFOBJ *, SURFOBJ *,XLATEOBJ *,LONG,LONG,LONG,LONG,RECTL *,FLONG);
  3521. typedef VOID (APIENTRY *PFN_DrvMovePointer)(SURFOBJ *pso,LONG x,LONG y,RECTL *prcl);
  3522. typedef BOOL (APIENTRY *PFN_DrvSendPage)(SURFOBJ *);
  3523. typedef BOOL (APIENTRY *PFN_DrvStartPage)(SURFOBJ *pso);
  3524. typedef BOOL (APIENTRY *PFN_DrvStartDoc)(SURFOBJ *pso, LPWSTR pwszDocName, DWORD dwJobId);
  3525. typedef BOOL (APIENTRY *PFN_DrvEndDoc)(SURFOBJ *pso, FLONG fl);
  3526. typedef BOOL (APIENTRY *PFN_DrvQuerySpoolType)(DHPDEV dhpdev, LPWSTR pwchType);
  3527. typedef BOOL (APIENTRY *PFN_DrvLineTo)(SURFOBJ *,CLIPOBJ *,BRUSHOBJ *,LONG,LONG,LONG,LONG,RECTL *,MIX);
  3528. typedef BOOL (APIENTRY *PFN_DrvStrokePath)(SURFOBJ *,PATHOBJ *,CLIPOBJ *,XFORMOBJ *,BRUSHOBJ *,POINTL *,LINEATTRS *,MIX);
  3529. typedef BOOL (APIENTRY *PFN_DrvFillPath)(SURFOBJ *,PATHOBJ *,CLIPOBJ *,BRUSHOBJ *,POINTL *,MIX,FLONG);
  3530. typedef BOOL (APIENTRY *PFN_DrvStrokeAndFillPath)(SURFOBJ *,PATHOBJ *,CLIPOBJ *,XFORMOBJ *,BRUSHOBJ *,LINEATTRS *,BRUSHOBJ *,POINTL *,MIX,FLONG);
  3531. typedef BOOL (APIENTRY *PFN_DrvPaint)(SURFOBJ *,CLIPOBJ *,BRUSHOBJ *,POINTL *,MIX);
  3532. typedef ULONG (APIENTRY *PFN_DrvGetGlyphMode)(DHPDEV dhpdev,FONTOBJ *pfo);
  3533. typedef BOOL (APIENTRY *PFN_DrvResetPDEV)(DHPDEV dhpdevOld, DHPDEV dhpdevNew);
  3534. typedef ULONG_PTR (APIENTRY *PFN_DrvSaveScreenBits)(SURFOBJ *, ULONG, ULONG_PTR, RECTL *);
  3535. typedef ULONG (APIENTRY *PFN_DrvGetModes)(HANDLE, ULONG, DEVMODEW *);
  3536. typedef LONG (APIENTRY *PFN_DrvQueryTrueTypeTable)(ULONG_PTR, ULONG, ULONG, PTRDIFF, ULONG, BYTE *, PBYTE *, ULONG *);
  3537. typedef LONG (APIENTRY *PFN_DrvQueryTrueTypeSection)(ULONG, ULONG, ULONG, HANDLE *, PTRDIFF *);
  3538. typedef LONG (APIENTRY *PFN_DrvQueryTrueTypeOutline)(DHPDEV, FONTOBJ *, HGLYPH, BOOL, GLYPHDATA *, ULONG, TTPOLYGONHEADER *);
  3539. typedef PVOID (APIENTRY *PFN_DrvGetTrueTypeFile)(ULONG_PTR, ULONG *);
  3540. typedef LONG (APIENTRY *PFN_DrvQueryFontFile)(ULONG_PTR, ULONG, ULONG, ULONG *);
  3541. typedef PFD_GLYPHATTR (APIENTRY *PFN_DrvQueryGlyphAttrs)(FONTOBJ *, ULONG );
  3542. typedef BOOL (APIENTRY *PFN_DrvQueryAdvanceWidths)(DHPDEV,FONTOBJ *,ULONG,HGLYPH *,PVOID,ULONG);
  3543. typedef ULONG (APIENTRY *PFN_DrvFontManagement)(SURFOBJ *,FONTOBJ *,ULONG,ULONG,PVOID,ULONG,PVOID);
  3544. typedef BOOL (APIENTRY *PFN_DrvSetPixelFormat)(SURFOBJ *,LONG,HWND);
  3545. typedef LONG (APIENTRY *PFN_DrvDescribePixelFormat)(DHPDEV,LONG,ULONG,PIXELFORMATDESCRIPTOR *);
  3546. typedef BOOL (APIENTRY *PFN_DrvSwapBuffers)(SURFOBJ *, WNDOBJ *);
  3547. typedef BOOL (APIENTRY *PFN_DrvStartBanding)(SURFOBJ *, POINTL *ppointl);
  3548. typedef BOOL (APIENTRY *PFN_DrvNextBand)(SURFOBJ *, POINTL *ppointl);
  3549. typedef BOOL (APIENTRY *PFN_DrvQueryPerBandInfo)(SURFOBJ *,PERBANDINFO *);
  3550. typedef BOOL (APIENTRY *PFN_DrvEnableDirectDraw)(DHPDEV, DD_CALLBACKS *,DD_SURFACECALLBACKS *, DD_PALETTECALLBACKS *);
  3551. typedef VOID (APIENTRY *PFN_DrvDisableDirectDraw)(DHPDEV);
  3552. typedef BOOL (APIENTRY *PFN_DrvGetDirectDrawInfo)(DHPDEV, DD_HALINFO *, DWORD *, VIDEOMEMORY *, DWORD *, DWORD *);
  3553. typedef HANDLE (APIENTRY *PFN_DrvIcmCreateColorTransform)(DHPDEV,LPLOGCOLORSPACEW,LPVOID,ULONG,LPVOID,ULONG,LPVOID,ULONG,DWORD);
  3554. typedef BOOL (APIENTRY *PFN_DrvIcmDeleteColorTransform)(DHPDEV,HANDLE);
  3555. typedef BOOL (APIENTRY *PFN_DrvIcmCheckBitmapBits)(DHPDEV,HANDLE,SURFOBJ *,PBYTE);
  3556. typedef BOOL (APIENTRY *PFN_DrvIcmSetDeviceGammaRamp)(DHPDEV,ULONG,LPVOID);
  3557. typedef BOOL (APIENTRY *PFN_DrvAlphaBlend)(SURFOBJ*,SURFOBJ*,CLIPOBJ*,XLATEOBJ*,PRECTL,PRECTL,BLENDOBJ *);
  3558. typedef BOOL (APIENTRY *PFN_DrvGradientFill)(SURFOBJ*,CLIPOBJ*,XLATEOBJ*,TRIVERTEX*,ULONG,PVOID,ULONG,RECTL *,POINTL *,ULONG);
  3559. typedef BOOL (APIENTRY *PFN_DrvQueryDeviceSupport)(SURFOBJ*,XLATEOBJ*,XFORMOBJ*,ULONG,ULONG,PVOID,ULONG,PVOID);
  3560. typedef HBITMAP (APIENTRY *PFN_DrvDeriveSurface)(DD_DIRECTDRAW_GLOBAL*,DD_SURFACE_LOCAL*);
  3561. typedef VOID (APIENTRY *PFN_DrvSynchronizeSurface)(SURFOBJ*, RECTL*, FLONG);
  3562. typedef VOID (APIENTRY *PFN_DrvNotify)(SURFOBJ*, ULONG, PVOID);
  3563. #ifdef __cplusplus
  3564. } // extern "C"
  3565. #endif
  3566. #endif // _WINDDI_