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

2836 lines
64 KiB

  1. /*++
  2. Copyright (c) 1985-1995, Microsoft Corporation
  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. #include <ddrawint.h>
  12. //
  13. // drivers and other components that include this should NOT include
  14. // windows.h They should be system conponents that only use GDI internals
  15. // and therefore only include wingdi.h
  16. //
  17. typedef ptrdiff_t PTRDIFF;
  18. typedef PTRDIFF *PPTRDIFF;
  19. typedef LONG FIX;
  20. typedef FIX *PFIX;
  21. typedef ULONG ROP4;
  22. typedef ULONG MIX;
  23. typedef ULONG HGLYPH;
  24. typedef HGLYPH *PHGLYPH;
  25. #define HGLYPH_INVALID ((HGLYPH)-1)
  26. typedef ULONG IDENT;
  27. //
  28. // handles for font file and font context objects
  29. //
  30. typedef ULONG HFF;
  31. typedef ULONG HFC;
  32. #define HFF_INVALID ((HFF) 0)
  33. #define HFC_INVALID ((HFC) 0)
  34. #define FD_ERROR 0xFFFFFFFF
  35. #define DDI_ERROR 0xFFFFFFFF
  36. typedef struct _POINTE /* pte */
  37. {
  38. FLOAT x;
  39. FLOAT y;
  40. } POINTE, *PPOINTE;
  41. typedef union _FLOAT_LONG
  42. {
  43. FLOAT e;
  44. LONG l;
  45. } FLOAT_LONG, *PFLOAT_LONG;
  46. typedef struct _POINTFIX
  47. {
  48. FIX x;
  49. FIX y;
  50. } POINTFIX, *PPOINTFIX;
  51. typedef struct _RECTFX
  52. {
  53. FIX xLeft;
  54. FIX yTop;
  55. FIX xRight;
  56. FIX yBottom;
  57. } RECTFX, *PRECTFX;
  58. DECLARE_HANDLE(HBM);
  59. DECLARE_HANDLE(HDEV);
  60. DECLARE_HANDLE(HSURF);
  61. DECLARE_HANDLE(DHSURF);
  62. DECLARE_HANDLE(DHPDEV);
  63. DECLARE_HANDLE(HDRVOBJ);
  64. #define LTOFX(x) ((x)<<4)
  65. #define FXTOL(x) ((x)>>4)
  66. #define FXTOLFLOOR(x) ((x)>>4)
  67. #define FXTOLCEILING(x) ((x + 0x0F)>>4)
  68. #define FXTOLROUND(x) ((((x) >> 3) + 1) >> 1)
  69. // context information
  70. typedef struct _FD_XFORM {
  71. FLOAT eXX;
  72. FLOAT eXY;
  73. FLOAT eYX;
  74. FLOAT eYY;
  75. } FD_XFORM, *PFD_XFORM;
  76. typedef struct _FD_DEVICEMETRICS { // devm
  77. FLONG flRealizedType;
  78. POINTE pteBase;
  79. POINTE pteSide;
  80. LONG lD;
  81. FIX fxMaxAscender;
  82. FIX fxMaxDescender;
  83. POINTL ptlUnderline1;
  84. POINTL ptlStrikeOut;
  85. POINTL ptlULThickness;
  86. POINTL ptlSOThickness;
  87. ULONG cxMax; // max pel width of bitmaps
  88. // the fields formerly in REALIZE_EXTRA as well as some new fields:
  89. ULONG cyMax; // did not use to be here
  90. ULONG cjGlyphMax; // (cxMax + 7)/8 * cyMax, or at least it should be
  91. FD_XFORM fdxQuantized;
  92. LONG lNonLinearExtLeading;
  93. LONG lNonLinearIntLeading;
  94. LONG lNonLinearMaxCharWidth;
  95. LONG lNonLinearAvgCharWidth;
  96. // some new fields
  97. LONG lMinA;
  98. LONG lMinC;
  99. LONG lMinD;
  100. LONG alReserved[1]; // just in case we need it.
  101. } FD_DEVICEMETRICS, *PFD_DEVICEMETRICS;
  102. typedef struct _LIGATURE { /* lig */
  103. ULONG culSize;
  104. LPWSTR pwsz;
  105. ULONG chglyph;
  106. HGLYPH ahglyph[1];
  107. } LIGATURE, *PLIGATURE;
  108. typedef struct _FD_LIGATURE {
  109. ULONG culThis;
  110. ULONG ulType;
  111. ULONG cLigatures;
  112. LIGATURE alig[1];
  113. } FD_LIGATURE;
  114. // glyph handle must be 32 bit
  115. // signed 16 bit integer type denoting number of FUnit's
  116. typedef SHORT FWORD;
  117. // point in the 32.32 bit precission
  118. typedef struct _POINTQF // ptq
  119. {
  120. LARGE_INTEGER x;
  121. LARGE_INTEGER y;
  122. } POINTQF, *PPOINTQF;
  123. //. Structures
  124. // devm.flRealizedType flags
  125. // FDM_TYPE_ZERO_BEARINGS // all glyphs have zero a and c spaces
  126. // the following two features refer to all glyphs in this font realization
  127. // FDM_TYPE_CHAR_INC_EQUAL_BM_BASE // base width == cx for horiz, == cy for vert.
  128. // FDM_TYPE_MAXEXT_EQUAL_BM_SIDE // side width == cy for horiz, == cx for vert.
  129. #define FDM_TYPE_BM_SIDE_CONST 0x00000001
  130. #define FDM_TYPE_MAXEXT_EQUAL_BM_SIDE 0x00000002
  131. #define FDM_TYPE_CHAR_INC_EQUAL_BM_BASE 0x00000004
  132. #define FDM_TYPE_ZERO_BEARINGS 0x00000008
  133. #define FDM_TYPE_CONST_BEARINGS 0x00000010
  134. // structures for describing a supported set of glyphs in a font
  135. typedef struct _WCRUN {
  136. WCHAR wcLow; // lowest character in run inclusive
  137. USHORT cGlyphs; // wcHighInclusive = wcLow + cGlyphs - 1;
  138. HGLYPH *phg; // pointer to an array of cGlyphs HGLYPH's
  139. } WCRUN, *PWCRUN;
  140. // If phg is set to (HGLYPH *)NULL, for all wc's in this particular run
  141. // the handle can be computed as simple zero extension:
  142. // HGLYPH hg = (HGLYPH) wc;
  143. //
  144. // If phg is not NULL, memory pointed to by phg, allocated by the driver,
  145. // WILL NOT MOVE.
  146. typedef struct _FD_GLYPHSET {
  147. ULONG cjThis; // size of this structure in butes
  148. FLONG flAccel; // accel flags, bits to be explained below
  149. ULONG cGlyphsSupported; // sum over all wcrun's of wcrun.cGlyphs
  150. ULONG cRuns;
  151. WCRUN awcrun[1]; // an array of cRun WCRUN structures
  152. } FD_GLYPHSET, *PFD_GLYPHSET;
  153. // If GS_UNICODE_HANDLES bit is set,
  154. // for ALL WCRUNS in this FD_GLYPHSET the handles are
  155. // obtained by zero extending unicode code points of
  156. // the corresponding supported glyphs, i.e. all gs.phg's are NULL
  157. #define GS_UNICODE_HANDLES 0x00000001
  158. // If GS_8BIT_HANDLES bit is set, all handles are in 0-255 range.
  159. // This is just an ansi font then and we are really making up all
  160. // the unicode stuff about this font.
  161. #define GS_8BIT_HANDLES 0x00000002
  162. // all handles fit in 16 bits.
  163. // to 8 bit handles as it should.
  164. #define GS_16BIT_HANDLES 0x00000004
  165. // ligatures
  166. typedef struct _FD_KERNINGPAIR {
  167. WCHAR wcFirst;
  168. WCHAR wcSecond;
  169. FWORD fwdKern;
  170. } FD_KERNINGPAIR;
  171. // IFIMETRICS constants
  172. #define FM_VERSION_NUMBER 0x0
  173. //
  174. // IFIMETRICS::fsType flags
  175. //
  176. #define FM_TYPE_LICENSED 0x2
  177. #define FM_READONLY_EMBED 0x4
  178. #define FM_EDITABLE_EMBED 0x8
  179. #define FM_NO_EMBEDDING FM_TYPE_LICENSED
  180. //
  181. // IFIMETRICS::flInfo flags
  182. //
  183. #define FM_INFO_TECH_TRUETYPE 0x00000001
  184. #define FM_INFO_TECH_BITMAP 0x00000002
  185. #define FM_INFO_TECH_STROKE 0x00000004
  186. #define FM_INFO_TECH_OUTLINE_NOT_TRUETYPE 0x00000008
  187. #define FM_INFO_ARB_XFORMS 0x00000010
  188. #define FM_INFO_1BPP 0x00000020
  189. #define FM_INFO_4BPP 0x00000040
  190. #define FM_INFO_8BPP 0x00000080
  191. #define FM_INFO_16BPP 0x00000100
  192. #define FM_INFO_24BPP 0x00000200
  193. #define FM_INFO_32BPP 0x00000400
  194. #define FM_INFO_INTEGER_WIDTH 0x00000800
  195. #define FM_INFO_CONSTANT_WIDTH 0x00001000
  196. #define FM_INFO_NOT_CONTIGUOUS 0x00002000
  197. #define FM_INFO_PID_EMBEDDED 0x00004000
  198. #define FM_INFO_RETURNS_OUTLINES 0x00008000
  199. #define FM_INFO_RETURNS_STROKES 0x00010000
  200. #define FM_INFO_RETURNS_BITMAPS 0x00020000
  201. #define FM_INFO_UNICODE_COMPLIANT 0x00040000
  202. #define FM_INFO_RIGHT_HANDED 0x00080000
  203. #define FM_INFO_INTEGRAL_SCALING 0x00100000
  204. #define FM_INFO_90DEGREE_ROTATIONS 0x00200000
  205. #define FM_INFO_OPTICALLY_FIXED_PITCH 0x00400000
  206. #define FM_INFO_DO_NOT_ENUMERATE 0x00800000
  207. #define FM_INFO_ISOTROPIC_SCALING_ONLY 0x01000000
  208. #define FM_INFO_ANISOTROPIC_SCALING_ONLY 0x02000000
  209. #define FM_INFO_TID_EMBEDDED 0x04000000
  210. #define FM_INFO_FAMILY_EQUIV 0x08000000
  211. #define FM_INFO_DBCS_FIXED_PITCH 0x10000000
  212. #define FM_INFO_NONNEGATIVE_AC 0x20000000
  213. #define FM_INFO_IGNORE_TC_RA_ABLE 0x40000000
  214. #define FM_INFO_TECH_TYPE1 0x80000000
  215. // max number of charsets supported in a tt font, 16 according to win95 guys
  216. #define MAXCHARSETS 16
  217. //
  218. // IFIMETRICS::ulPanoseCulture
  219. //
  220. #define FM_PANOSE_CULTURE_LATIN 0x0
  221. //
  222. // IFMETRICS::fsSelection flags
  223. //
  224. #define FM_SEL_ITALIC 0x0001
  225. #define FM_SEL_UNDERSCORE 0x0002
  226. #define FM_SEL_NEGATIVE 0x0004
  227. #define FM_SEL_OUTLINED 0x0008
  228. #define FM_SEL_STRIKEOUT 0x0010
  229. #define FM_SEL_BOLD 0x0020
  230. #define FM_SEL_REGULAR 0x0040
  231. //
  232. // The FONTDIFF structure contains all of the fields that could
  233. // possibly change under simulation
  234. //
  235. typedef struct _FONTDIFF {
  236. BYTE jReserved1; // 0x0
  237. BYTE jReserved2; // 0x1
  238. BYTE jReserved3; // 0x2
  239. BYTE bWeight; // 0x3 Panose Weight
  240. USHORT usWinWeight; // 0x4
  241. FSHORT fsSelection; // 0x6
  242. FWORD fwdAveCharWidth; // 0x8
  243. FWORD fwdMaxCharInc; // 0xA
  244. POINTL ptlCaret; // 0xC
  245. } FONTDIFF;
  246. typedef struct _FONTSIM {
  247. PTRDIFF dpBold; // offset from beginning of FONTSIM to FONTDIFF
  248. PTRDIFF dpItalic; // offset from beginning of FONTSIM to FONTDIFF
  249. PTRDIFF dpBoldItalic; // offset from beginning of FONTSIM to FONTDIFF
  250. } FONTSIM;
  251. typedef struct _IFIMETRICS {
  252. ULONG cjThis; // includes attached information
  253. ULONG cjIfiExtra; // sizeof IFIEXTRA if any, formerly ulVersion
  254. PTRDIFF dpwszFamilyName;
  255. PTRDIFF dpwszStyleName;
  256. PTRDIFF dpwszFaceName;
  257. PTRDIFF dpwszUniqueName;
  258. PTRDIFF dpFontSim;
  259. LONG lEmbedId;
  260. LONG lItalicAngle;
  261. LONG lCharBias;
  262. // dpCharSet field replaced alReserved[0].
  263. // If the 3.51 pcl minidrivers are still to work on NT 4.0 this field must not
  264. // move because they will have 0 at this position.
  265. PTRDIFF dpCharSets;
  266. BYTE jWinCharSet; // as in LOGFONT::lfCharSet
  267. BYTE jWinPitchAndFamily; // as in LOGFONT::lfPitchAndFamily
  268. USHORT usWinWeight; // as in LOGFONT::lfWeight
  269. ULONG flInfo; // see above
  270. USHORT fsSelection; // see above
  271. USHORT fsType; // see above
  272. FWORD fwdUnitsPerEm; // em height
  273. FWORD fwdLowestPPEm; // readable limit
  274. FWORD fwdWinAscender;
  275. FWORD fwdWinDescender;
  276. FWORD fwdMacAscender;
  277. FWORD fwdMacDescender;
  278. FWORD fwdMacLineGap;
  279. FWORD fwdTypoAscender;
  280. FWORD fwdTypoDescender;
  281. FWORD fwdTypoLineGap;
  282. FWORD fwdAveCharWidth;
  283. FWORD fwdMaxCharInc;
  284. FWORD fwdCapHeight;
  285. FWORD fwdXHeight;
  286. FWORD fwdSubscriptXSize;
  287. FWORD fwdSubscriptYSize;
  288. FWORD fwdSubscriptXOffset;
  289. FWORD fwdSubscriptYOffset;
  290. FWORD fwdSuperscriptXSize;
  291. FWORD fwdSuperscriptYSize;
  292. FWORD fwdSuperscriptXOffset;
  293. FWORD fwdSuperscriptYOffset;
  294. FWORD fwdUnderscoreSize;
  295. FWORD fwdUnderscorePosition;
  296. FWORD fwdStrikeoutSize;
  297. FWORD fwdStrikeoutPosition;
  298. BYTE chFirstChar; // for win 3.1 compatibility
  299. BYTE chLastChar; // for win 3.1 compatibility
  300. BYTE chDefaultChar; // for win 3.1 compatibility
  301. BYTE chBreakChar; // for win 3.1 compatibility
  302. WCHAR wcFirstChar; // lowest supported code in Unicode set
  303. WCHAR wcLastChar; // highest supported code in Unicode set
  304. WCHAR wcDefaultChar;
  305. WCHAR wcBreakChar;
  306. POINTL ptlBaseline; //
  307. POINTL ptlAspect; // designed aspect ratio (bitmaps)
  308. POINTL ptlCaret; // points along caret
  309. RECTL rclFontBox; // bounding box for all glyphs (font space)
  310. BYTE achVendId[4]; // as per TrueType
  311. ULONG cKerningPairs;
  312. ULONG ulPanoseCulture;
  313. PANOSE panose;
  314. } IFIMETRICS, *PIFIMETRICS;
  315. // rather than adding the fields of IFIEXTRA to IFIMETRICS itself
  316. // we add them as a separate structure. This structure, if present at all,
  317. // lies below IFIMETRICS in memory.
  318. // If IFIEXTRA is present at all, ifi.cjIfiExtra (formerly ulVersion)
  319. // will contain size of IFIEXTRA including any reserved fields.
  320. // That way ulVersion = 0 (NT 3.51 or less) printer minidrivers
  321. // will work with NT 4.0.
  322. typedef struct _IFIEXTRA
  323. {
  324. ULONG ulIdentifier; // used for Type 1 fonts only
  325. PTRDIFF dpFontSig; // nontrivial for tt only, at least for now.
  326. ULONG cig; // maxp->numGlyphs, # of distinct glyph indicies
  327. ULONG aulReserved[1]; // in case we need even more stuff in the future
  328. } IFIEXTRA, *PIFIEXTRA;
  329. /**************************************************************************\
  330. *
  331. \**************************************************************************/
  332. /* OpenGL DDI ExtEscape escape numbers (4352 - 4607) */
  333. #define OPENGL_CMD 4352 /* for OpenGL ExtEscape */
  334. #define OPENGL_GETINFO 4353 /* for OpenGL ExtEscape */
  335. #define WNDOBJ_SETUP 4354 /* for live video ExtEscape */
  336. #define DDI_DRIVER_VERSION 0x00020000
  337. #define DDI_DRIVER_VERSION_SP3 0x00020003
  338. #define DDI_DRIVER_VERSION_NT5 0x00030000
  339. #define GDI_DRIVER_VERSION 0x4000 /* for NT version 4.0.00 */
  340. typedef int (*PFN)();
  341. typedef struct _DRVFN /* drvfn */
  342. {
  343. ULONG iFunc;
  344. PFN pfn;
  345. } DRVFN, *PDRVFN;
  346. /* Required functions */
  347. #define INDEX_DrvEnablePDEV 0L
  348. #define INDEX_DrvCompletePDEV 1L
  349. #define INDEX_DrvDisablePDEV 2L
  350. #define INDEX_DrvEnableSurface 3L
  351. #define INDEX_DrvDisableSurface 4L
  352. /* Other functions */
  353. #define INDEX_DrvAssertMode 5L
  354. #define INDEX_DrvOffset 6L // Obsolete
  355. #define INDEX_DrvResetPDEV 7L
  356. #define INDEX_DrvDisableDriver 8L
  357. #define INDEX_DrvCreateDeviceBitmap 10L
  358. #define INDEX_DrvDeleteDeviceBitmap 11L
  359. #define INDEX_DrvRealizeBrush 12L
  360. #define INDEX_DrvDitherColor 13L
  361. #define INDEX_DrvStrokePath 14L
  362. #define INDEX_DrvFillPath 15L
  363. #define INDEX_DrvStrokeAndFillPath 16L
  364. #define INDEX_DrvPaint 17L
  365. #define INDEX_DrvBitBlt 18L
  366. #define INDEX_DrvCopyBits 19L
  367. #define INDEX_DrvStretchBlt 20L
  368. #define INDEX_DrvSetPalette 22L
  369. #define INDEX_DrvTextOut 23L
  370. #define INDEX_DrvEscape 24L
  371. #define INDEX_DrvDrawEscape 25L
  372. #define INDEX_DrvQueryFont 26L
  373. #define INDEX_DrvQueryFontTree 27L
  374. #define INDEX_DrvQueryFontData 28L
  375. #define INDEX_DrvSetPointerShape 29L
  376. #define INDEX_DrvMovePointer 30L
  377. #define INDEX_DrvLineTo 31L
  378. #define INDEX_DrvSendPage 32L
  379. #define INDEX_DrvStartPage 33L
  380. #define INDEX_DrvEndDoc 34L
  381. #define INDEX_DrvStartDoc 35L
  382. #define INDEX_DrvGetGlyphMode 37L
  383. #define INDEX_DrvSynchronize 38L
  384. #define INDEX_DrvSaveScreenBits 40L
  385. #define INDEX_DrvGetModes 41L
  386. #define INDEX_DrvFree 42L
  387. #define INDEX_DrvDestroyFont 43L
  388. #define INDEX_DrvQueryFontCaps 44L
  389. #define INDEX_DrvLoadFontFile 45L
  390. #define INDEX_DrvUnloadFontFile 46L
  391. #define INDEX_DrvFontManagement 47L
  392. #define INDEX_DrvQueryTrueTypeTable 48L
  393. #define INDEX_DrvQueryTrueTypeOutline 49L
  394. #define INDEX_DrvGetTrueTypeFile 50L
  395. #define INDEX_DrvQueryFontFile 51L
  396. #define INDEX_DrvMovePanning 52L
  397. #define INDEX_DrvQueryAdvanceWidths 53L
  398. #define INDEX_DrvSetPixelFormat 54L
  399. #define INDEX_DrvDescribePixelFormat 55L
  400. #define INDEX_DrvSwapBuffers 56L
  401. #define INDEX_DrvStartBanding 57L
  402. #define INDEX_DrvNextBand 58L
  403. #define INDEX_DrvGetDirectDrawInfo 59L
  404. #define INDEX_DrvEnableDirectDraw 60L
  405. #define INDEX_DrvDisableDirectDraw 61L
  406. #define INDEX_DrvQuerySpoolType 62L
  407. //
  408. // NEW FOR NT5
  409. //
  410. #define INDEX_DrvIcmCreateColorTransform 64L
  411. #define INDEX_DrvIcmDeleteColorTransform 65L
  412. #define INDEX_DrvIcmCheckBitmapBits 66L
  413. #define INDEX_DrvIcmSetDeviceGammaRamp 67L
  414. #define INDEX_DrvGradientFill 68L
  415. #define INDEX_DrvStretchBltROP 69L
  416. #define INDEX_DrvPlgBlt 70L
  417. #define INDEX_DrvAlphaBlend 71L
  418. #define INDEX_DrvSynthesizeFont 72L
  419. #define INDEX_DrvGetSynthesizedFontFiles 73L
  420. #define INDEX_DrvTransparentBlt 74L
  421. #define INDEX_DrvQueryPerBandInfo 75L
  422. #define INDEX_DrvQueryDeviceSupport 76L
  423. #define INDEX_DrvConnect 77L
  424. #define INDEX_DrvDisconnect 78L
  425. #define INDEX_DrvReconnect 79L
  426. #define INDEX_DrvShadowConnect 80L
  427. #define INDEX_DrvShadowDisconnect 81L
  428. #define INDEX_DrvInvalidateRect 82L
  429. #define INDEX_DrvSetPointerPos 83L
  430. #define INDEX_DrvDisplayIOCtl 84L
  431. #define INDEX_DrvDeriveSurface 85L
  432. #define INDEX_DrvQueryGlyphAttrs 86L
  433. /* The total number of dispatched functions */
  434. #define INDEX_LAST 87L
  435. typedef struct tagDRVENABLEDATA
  436. {
  437. ULONG iDriverVersion;
  438. ULONG c;
  439. DRVFN *pdrvfn;
  440. } DRVENABLEDATA, *PDRVENABLEDATA;
  441. typedef struct tagDEVINFO
  442. {
  443. FLONG flGraphicsCaps;
  444. LOGFONTW lfDefaultFont;
  445. LOGFONTW lfAnsiVarFont;
  446. LOGFONTW lfAnsiFixFont;
  447. ULONG cFonts;
  448. ULONG iDitherFormat;
  449. USHORT cxDither;
  450. USHORT cyDither;
  451. HPALETTE hpalDefault;
  452. } DEVINFO, *PDEVINFO;
  453. #define GCAPS_BEZIERS 0x00000001
  454. #define GCAPS_GEOMETRICWIDE 0x00000002
  455. #define GCAPS_ALTERNATEFILL 0x00000004
  456. #define GCAPS_WINDINGFILL 0x00000008
  457. #define GCAPS_HALFTONE 0x00000010
  458. #define GCAPS_COLOR_DITHER 0x00000020
  459. #define GCAPS_HORIZSTRIKE 0x00000040
  460. #define GCAPS_VERTSTRIKE 0x00000080
  461. #define GCAPS_OPAQUERECT 0x00000100
  462. #define GCAPS_VECTORFONT 0x00000200
  463. #define GCAPS_MONO_DITHER 0x00000400
  464. #define GCAPS_ASYNCCHANGE 0x00000800
  465. #define GCAPS_ASYNCMOVE 0x00001000
  466. #define GCAPS_DONTJOURNAL 0x00002000
  467. #define GCAPS_DIRECTDRAW 0x00004000
  468. #define GCAPS_ARBRUSHOPAQUE 0x00008000
  469. #define GCAPS_PANNING 0x00010000
  470. #define GCAPS_HIGHRESTEXT 0x00040000
  471. #define GCAPS_PALMANAGED 0x00080000
  472. #define GCAPS_DITHERONREALIZE 0x00200000
  473. #define GCAPS_NO64BITMEMACCESS 0x00400000
  474. #define GCAPS_FORCEDITHER 0x00800000
  475. #define GCAPS_GRAY16 0x01000000
  476. #define GCAPS_LAYERED 0x08000000
  477. #define GCAPS_ARBRUSHTEXT 0x10000000
  478. typedef struct _LINEATTRS
  479. {
  480. FLONG fl;
  481. ULONG iJoin;
  482. ULONG iEndCap;
  483. FLOAT_LONG elWidth;
  484. FLOAT eMiterLimit;
  485. ULONG cstyle;
  486. PFLOAT_LONG pstyle;
  487. FLOAT_LONG elStyleState;
  488. } LINEATTRS, *PLINEATTRS;
  489. #define LA_GEOMETRIC 0x00000001
  490. #define LA_ALTERNATE 0x00000002
  491. #define LA_STARTGAP 0x00000004
  492. #define LA_STYLED 0x00000008
  493. #define JOIN_ROUND 0L
  494. #define JOIN_BEVEL 1L
  495. #define JOIN_MITER 2L
  496. #define ENDCAP_ROUND 0L
  497. #define ENDCAP_SQUARE 1L
  498. #define ENDCAP_BUTT 2L
  499. typedef LONG LDECI4;
  500. typedef struct _CIECHROMA
  501. {
  502. LDECI4 x;
  503. LDECI4 y;
  504. LDECI4 Y;
  505. }CIECHROMA;
  506. typedef struct _COLORINFO
  507. {
  508. CIECHROMA Red;
  509. CIECHROMA Green;
  510. CIECHROMA Blue;
  511. CIECHROMA Cyan;
  512. CIECHROMA Magenta;
  513. CIECHROMA Yellow;
  514. CIECHROMA AlignmentWhite;
  515. LDECI4 RedGamma;
  516. LDECI4 GreenGamma;
  517. LDECI4 BlueGamma;
  518. LDECI4 MagentaInCyanDye;
  519. LDECI4 YellowInCyanDye;
  520. LDECI4 CyanInMagentaDye;
  521. LDECI4 YellowInMagentaDye;
  522. LDECI4 CyanInYellowDye;
  523. LDECI4 MagentaInYellowDye;
  524. }COLORINFO, *PCOLORINFO;
  525. // Allowed values for GDIINFO.ulPrimaryOrder.
  526. #define PRIMARY_ORDER_ABC 0
  527. #define PRIMARY_ORDER_ACB 1
  528. #define PRIMARY_ORDER_BAC 2
  529. #define PRIMARY_ORDER_BCA 3
  530. #define PRIMARY_ORDER_CBA 4
  531. #define PRIMARY_ORDER_CAB 5
  532. // Allowed values for GDIINFO.ulHTPatternSize.
  533. #define HT_PATSIZE_2x2 0
  534. #define HT_PATSIZE_2x2_M 1
  535. #define HT_PATSIZE_4x4 2
  536. #define HT_PATSIZE_4x4_M 3
  537. #define HT_PATSIZE_6x6 4
  538. #define HT_PATSIZE_6x6_M 5
  539. #define HT_PATSIZE_8x8 6
  540. #define HT_PATSIZE_8x8_M 7
  541. #define HT_PATSIZE_10x10 8
  542. #define HT_PATSIZE_10x10_M 9
  543. #define HT_PATSIZE_12x12 10
  544. #define HT_PATSIZE_12x12_M 11
  545. #define HT_PATSIZE_14x14 12
  546. #define HT_PATSIZE_14x14_M 13
  547. #define HT_PATSIZE_16x16 14
  548. #define HT_PATSIZE_16x16_M 15
  549. #define HT_PATSIZE_MAX_INDEX HT_PATSIZE_16x16_M
  550. #define HT_PATSIZE_DEFAULT HT_PATSIZE_4x4_M
  551. // Allowed values for GDIINFO.ulHTOutputFormat.
  552. #define HT_FORMAT_1BPP 0
  553. #define HT_FORMAT_4BPP 2
  554. #define HT_FORMAT_4BPP_IRGB 3
  555. #define HT_FORMAT_8BPP 4
  556. #define HT_FORMAT_16BPP 5
  557. #define HT_FORMAT_24BPP 6
  558. #define HT_FORMAT_32BPP 7
  559. // Allowed values for GDIINFO.flHTFlags.
  560. #define HT_FLAG_SQUARE_DEVICE_PEL 0x00000001
  561. #define HT_FLAG_HAS_BLACK_DYE 0x00000002
  562. #define HT_FLAG_ADDITIVE_PRIMS 0x00000004
  563. #define HT_FLAG_OUTPUT_CMY 0x00000100
  564. typedef struct _GDIINFO
  565. {
  566. ULONG ulVersion;
  567. ULONG ulTechnology;
  568. ULONG ulHorzSize;
  569. ULONG ulVertSize;
  570. ULONG ulHorzRes;
  571. ULONG ulVertRes;
  572. ULONG cBitsPixel;
  573. ULONG cPlanes;
  574. ULONG ulNumColors;
  575. ULONG flRaster;
  576. ULONG ulLogPixelsX;
  577. ULONG ulLogPixelsY;
  578. ULONG flTextCaps;
  579. ULONG ulDACRed;
  580. ULONG ulDACGreen;
  581. ULONG ulDACBlue;
  582. ULONG ulAspectX;
  583. ULONG ulAspectY;
  584. ULONG ulAspectXY;
  585. LONG xStyleStep;
  586. LONG yStyleStep;
  587. LONG denStyleStep;
  588. POINTL ptlPhysOffset;
  589. SIZEL szlPhysSize;
  590. ULONG ulNumPalReg;
  591. // These fields are for halftone initialization.
  592. COLORINFO ciDevice;
  593. ULONG ulDevicePelsDPI;
  594. ULONG ulPrimaryOrder;
  595. ULONG ulHTPatternSize;
  596. ULONG ulHTOutputFormat;
  597. ULONG flHTFlags;
  598. ULONG ulVRefresh;
  599. ULONG ulBltAlignment;
  600. ULONG ulPanningHorzRes;
  601. ULONG ulPanningVertRes;
  602. } GDIINFO, *PGDIINFO;
  603. /*
  604. * User objects
  605. */
  606. typedef struct _BRUSHOBJ
  607. {
  608. ULONG iSolidColor;
  609. PVOID pvRbrush;
  610. } BRUSHOBJ;
  611. typedef struct _CLIPOBJ
  612. {
  613. ULONG iUniq;
  614. RECTL rclBounds;
  615. BYTE iDComplexity;
  616. BYTE iFComplexity;
  617. BYTE iMode;
  618. BYTE fjOptions;
  619. } CLIPOBJ;
  620. typedef struct _DRIVEROBJ DRIVEROBJ;
  621. typedef BOOL (CALLBACK * FREEOBJPROC)(DRIVEROBJ *pDriverObj);
  622. typedef struct _DRIVEROBJ
  623. {
  624. PVOID pvObj;
  625. FREEOBJPROC pFreeProc;
  626. HDEV hdev;
  627. DHPDEV dhpdev;
  628. } DRIVEROBJ;
  629. typedef struct _FONTOBJ
  630. {
  631. ULONG iUniq;
  632. ULONG iFace;
  633. ULONG cxMax;
  634. FLONG flFontType;
  635. ULONG iTTUniq;
  636. ULONG iFile;
  637. SIZE sizLogResPpi;
  638. ULONG ulStyleSize;
  639. PVOID pvConsumer;
  640. PVOID pvProducer;
  641. } FONTOBJ;
  642. typedef struct _BLENDOBJ
  643. {
  644. BLENDFUNCTION BlendFunction;
  645. }BLENDOBJ,*PBLENDOBJ;
  646. typedef BYTE GAMMA_TABLES[2][256];
  647. //
  648. // FONTOBJ::flFontType
  649. //
  650. #define FO_TYPE_RASTER RASTER_FONTTYPE /* 0x1 */
  651. #define FO_TYPE_DEVICE DEVICE_FONTTYPE /* 0x2 */
  652. #define FO_TYPE_TRUETYPE TRUETYPE_FONTTYPE /* 0x4 */
  653. #define FO_SIM_BOLD 0x00002000
  654. #define FO_SIM_ITALIC 0x00004000
  655. #define FO_EM_HEIGHT 0x00008000
  656. #define FO_GRAY16 0x00010000 /* [1] */
  657. #define FO_NOGRAY16 0x00020000 /* [1] */
  658. #define FO_NOHINTS 0x00040000 /* [3] */
  659. #define FO_NO_CHOICE 0x00080000 /* [3] */
  660. /**************************************************************************\
  661. *
  662. * [1]
  663. *
  664. * If the FO_GRAY16 flag is set then the bitmaps of the font
  665. * are 4-bit per pixel blending (alpha) values. A value of zero
  666. * means that the the resulting pixel should be equal to the
  667. * background color. If the value of the alpha value is k != 0
  668. * then the resulting pixel must be:
  669. *
  670. * c0 = background color
  671. * c1 = foreground color
  672. * b = blending value = (k+1)/16 // {k = 1,2,..,15}
  673. * b = 0 (k = 0)
  674. * d0 = gamma[c0], d1 = gamma[c1] // luminance components
  675. * d = (1 - b)*d0 + b*d1 // blended luminance
  676. * c = lambda[d] // blended device voltage
  677. *
  678. * where gamma[] takes a color component from application space
  679. * to CIE space and labmda[] takes a color from CIE space to
  680. * device color space
  681. *
  682. * GDI will set this bit if it request a font be gray scaled
  683. * to 16 values then GDI will set FO_GRAY16 upon entry to
  684. * DrvQueryFontData(). If the font driver cannot (or will
  685. * not) grayscale a particular realization of a font then the
  686. * font provider will zero out FO_GRAY16 and set FO_NOGRAY16
  687. * to inform GDI that
  688. * the gray scaling request cannot (or should not) be
  689. * satisfied.
  690. *
  691. * [2]
  692. *
  693. * The FO_NOHINTS indicates that hints were not used in the formation
  694. * of the glyph images. GDI will set this bit to request that hinting
  695. * be supressed. The font provider will set this bit accroding to the
  696. * rendering scheme that it used in generating the glyph image.
  697. *
  698. * [3]
  699. *
  700. * The FO_NO_CHOICE flag indicates that the flags FO_GRAY16 and
  701. * FO_NOHINTS must be obeyed if at all possible.
  702. *
  703. \**************************************************************************/
  704. typedef struct _PALOBJ
  705. {
  706. ULONG ulReserved;
  707. } PALOBJ;
  708. typedef struct _PATHOBJ
  709. {
  710. FLONG fl;
  711. ULONG cCurves;
  712. } PATHOBJ;
  713. typedef struct _SURFOBJ
  714. {
  715. DHSURF dhsurf;
  716. HSURF hsurf;
  717. DHPDEV dhpdev;
  718. HDEV hdev;
  719. SIZEL sizlBitmap;
  720. ULONG cjBits;
  721. PVOID pvBits;
  722. PVOID pvScan0;
  723. LONG lDelta;
  724. ULONG iUniq;
  725. ULONG iBitmapFormat;
  726. USHORT iType;
  727. USHORT fjBitmap;
  728. } SURFOBJ;
  729. typedef struct _WNDOBJ
  730. {
  731. CLIPOBJ coClient;
  732. PVOID pvConsumer;
  733. RECTL rclClient;
  734. SURFOBJ *psoOwner;
  735. } WNDOBJ, *PWNDOBJ;
  736. typedef struct _XFORMOBJ
  737. {
  738. ULONG ulReserved;
  739. } XFORMOBJ;
  740. typedef struct _XLATEOBJ
  741. {
  742. ULONG iUniq;
  743. FLONG flXlate;
  744. USHORT iSrcType;
  745. USHORT iDstType;
  746. ULONG cEntries;
  747. ULONG *pulXlate;
  748. } XLATEOBJ;
  749. /*
  750. * BRUSHOBJ callbacks
  751. */
  752. PVOID APIENTRY BRUSHOBJ_pvAllocRbrush(
  753. BRUSHOBJ *pbo,
  754. ULONG cj);
  755. PVOID APIENTRY BRUSHOBJ_pvGetRbrush(BRUSHOBJ *pbo);
  756. ULONG APIENTRY BRUSHOBJ_ulGetBrushColor(BRUSHOBJ *pbo);
  757. /*
  758. * CLIPOBJ callbacks
  759. */
  760. #define DC_TRIVIAL 0
  761. #define DC_RECT 1
  762. #define DC_COMPLEX 3
  763. #define FC_RECT 1
  764. #define FC_RECT4 2
  765. #define FC_COMPLEX 3
  766. #define TC_RECTANGLES 0
  767. #define TC_PATHOBJ 2
  768. #define OC_BANK_CLIP 1
  769. #define CT_RECTANGLES 0L
  770. #define CD_RIGHTDOWN 0L
  771. #define CD_LEFTDOWN 1L
  772. #define CD_RIGHTUP 2L
  773. #define CD_LEFTUP 3L
  774. #define CD_ANY 4L
  775. #define CD_LEFTWARDS 1L
  776. #define CD_UPWARDS 2L
  777. typedef struct _ENUMRECTS
  778. {
  779. ULONG c;
  780. RECTL arcl[1];
  781. } ENUMRECTS;
  782. ULONG APIENTRY CLIPOBJ_cEnumStart(
  783. CLIPOBJ *pco,
  784. BOOL bAll,
  785. ULONG iType,
  786. ULONG iDirection,
  787. ULONG cLimit);
  788. BOOL APIENTRY CLIPOBJ_bEnum(
  789. CLIPOBJ *pco,
  790. ULONG cj,
  791. ULONG *pul);
  792. PATHOBJ * APIENTRY CLIPOBJ_ppoGetPath(CLIPOBJ* pco);
  793. /*
  794. * FONTOBJ callbacks
  795. */
  796. typedef struct _GLYPHBITS
  797. {
  798. POINTL ptlOrigin;
  799. SIZEL sizlBitmap;
  800. BYTE aj[1];
  801. } GLYPHBITS;
  802. #define FO_HGLYPHS 0L
  803. #define FO_GLYPHBITS 1L
  804. #define FO_PATHOBJ 2L
  805. #define FD_NEGATIVE_FONT 1L
  806. #define FO_DEVICE_FONT 1L
  807. #define FO_OUTLINE_CAPABLE 2L
  808. typedef union _GLYPHDEF
  809. {
  810. GLYPHBITS *pgb;
  811. PATHOBJ *ppo;
  812. } GLYPHDEF;
  813. typedef struct _GLYPHPOS /* gp */
  814. {
  815. HGLYPH hg;
  816. GLYPHDEF *pgdf;
  817. POINTL ptl;
  818. } GLYPHPOS,*PGLYPHPOS;
  819. // individual glyph data
  820. // r is a unit vector along the baseline in device coordinates.
  821. // s is a unit vector in the ascent direction in device coordinates.
  822. // A, B, and C, are simple tranforms of the notional space versions into
  823. // (28.4) device coordinates. The dot products of those vectors with r
  824. // are recorded here. Note that the high words of ptqD are also 28.4
  825. // device coordinates. The low words provide extra accuracy.
  826. // THE STRUCTURE DIFFERS IN ORDERING FROM NT 3.51 VERSION OF THE STRUCTURE.
  827. // ptqD has been moved to the bottom.
  828. // This requires only recompile of all the drivers.
  829. typedef struct _GLYPHDATA {
  830. GLYPHDEF gdf; // pointer to GLYPHBITS or to PATHOBJ
  831. HGLYPH hg; // glyhp handle
  832. FIX fxD; // Character increment amount: D*r.
  833. FIX fxA; // Prebearing amount: A*r.
  834. FIX fxAB; // Advancing edge of character: (A+B)*r.
  835. FIX fxInkTop; // Baseline to inkbox top along s.
  836. FIX fxInkBottom; // Baseline to inkbox bottom along s.
  837. RECTL rclInk; // Ink box with sides parallel to x,y axes
  838. POINTQF ptqD; // Character increment vector: D=A+B+C.
  839. } GLYPHDATA;
  840. // flAccel flags for STROBJ
  841. // SO_FLAG_DEFAULT_PLACEMENT // defult inc vectors used to position chars
  842. // SO_HORIZONTAL // "left to right" or "right to left"
  843. // SO_VERTICAL // "top to bottom" or "bottom to top"
  844. // SO_REVERSED // set if horiz & "right to left" or if vert & "bottom to top"
  845. // SO_ZERO_BEARINGS // all glyphs have zero a and c spaces
  846. // SO_CHAR_INC_EQUAL_BM_BASE // base == cx for horiz, == cy for vert.
  847. // SO_MAXEXT_EQUAL_BM_SIDE // side == cy for horiz, == cx for vert.
  848. // do not substitute device font for tt font even if device font sub table
  849. // tells the driver this should be done
  850. // SO_DO_NOT_SUBSTITUTE_DEVICE_FONT
  851. #define SO_FLAG_DEFAULT_PLACEMENT 0x00000001
  852. #define SO_HORIZONTAL 0x00000002
  853. #define SO_VERTICAL 0x00000004
  854. #define SO_REVERSED 0x00000008
  855. #define SO_ZERO_BEARINGS 0x00000010
  856. #define SO_CHAR_INC_EQUAL_BM_BASE 0x00000020
  857. #define SO_MAXEXT_EQUAL_BM_SIDE 0x00000040
  858. #define SO_DO_NOT_SUBSTITUTE_DEVICE_FONT 0x00000080
  859. #define SO_GLYPHINDEX_TEXTOUT 0x00000100
  860. #define SO_ESC_NOT_ORIENT 0x00000200
  861. typedef struct _STROBJ
  862. {
  863. ULONG cGlyphs; // # of glyphs to render
  864. FLONG flAccel; // accel flags
  865. ULONG ulCharInc; // non-zero only if fixed pitch font, equal to advanced width.
  866. RECTL rclBkGround; // bk ground rect of the string in device coords
  867. GLYPHPOS *pgp; // If non-NULL then has all glyphs.
  868. LPWSTR pwszOrg; // pointer to original unicode string.
  869. } STROBJ;
  870. typedef struct _FONTINFO /* fi */
  871. {
  872. ULONG cjThis;
  873. FLONG flCaps;
  874. ULONG cGlyphsSupported;
  875. ULONG cjMaxGlyph1;
  876. ULONG cjMaxGlyph4;
  877. ULONG cjMaxGlyph8;
  878. ULONG cjMaxGlyph32;
  879. } FONTINFO, *PFONTINFO;
  880. ULONG APIENTRY FONTOBJ_cGetAllGlyphHandles(
  881. FONTOBJ *pfo,
  882. HGLYPH *phg);
  883. VOID APIENTRY FONTOBJ_vGetInfo(
  884. FONTOBJ *pfo,
  885. ULONG cjSize,
  886. FONTINFO *pfi);
  887. ULONG APIENTRY FONTOBJ_cGetGlyphs(
  888. FONTOBJ *pfo,
  889. ULONG iMode,
  890. ULONG cGlyph,
  891. HGLYPH *phg,
  892. PVOID *ppvGlyph);
  893. GAMMA_TABLES* APIENTRY FONTOBJ_pGetGammaTables(FONTOBJ *pfo);
  894. XFORMOBJ * APIENTRY FONTOBJ_pxoGetXform(FONTOBJ *pfo);
  895. IFIMETRICS * APIENTRY FONTOBJ_pifi(FONTOBJ *pfo);
  896. PVOID FONTOBJ_pvTrueTypeFontFile(
  897. FONTOBJ *pfo,
  898. ULONG *pcjFile);
  899. // possible values that iMode can take:
  900. /*
  901. * PALOBJ callbacks
  902. */
  903. #define PAL_INDEXED 0x00000001
  904. #define PAL_BITFIELDS 0x00000002
  905. #define PAL_RGB 0x00000004
  906. #define PAL_BGR 0x00000008
  907. ULONG APIENTRY PALOBJ_cGetColors(
  908. PALOBJ *ppalo,
  909. ULONG iStart,
  910. ULONG cColors,
  911. ULONG *pulColors);
  912. /*
  913. * PATHOBJ callbacks
  914. */
  915. #define PO_BEZIERS 0x00000001
  916. #define PO_ELLIPSE 0x00000002
  917. #define PO_ALL_INTEGERS 0x00000004
  918. #define PO_ENUM_AS_INTEGERS 0x00000008
  919. #define PD_BEGINSUBPATH 0x00000001
  920. #define PD_ENDSUBPATH 0x00000002
  921. #define PD_RESETSTYLE 0x00000004
  922. #define PD_CLOSEFIGURE 0x00000008
  923. #define PD_BEZIERS 0x00000010
  924. #define PD_ALL (PD_BEGINSUBPATH | \
  925. PD_ENDSUBPATH | \
  926. PD_RESETSTYLE | \
  927. PD_CLOSEFIGURE | \
  928. PD_BEZIERS)
  929. typedef struct _PATHDATA
  930. {
  931. FLONG flags;
  932. ULONG count;
  933. POINTFIX *pptfx;
  934. } PATHDATA, *PPATHDATA;
  935. typedef struct _RUN
  936. {
  937. LONG iStart;
  938. LONG iStop;
  939. } RUN, *PRUN;
  940. typedef struct _CLIPLINE
  941. {
  942. POINTFIX ptfxA;
  943. POINTFIX ptfxB;
  944. LONG lStyleState;
  945. ULONG c;
  946. RUN arun[1];
  947. } CLIPLINE, *PCLIPLINE;
  948. VOID APIENTRY PATHOBJ_vEnumStart(PATHOBJ *ppo);
  949. BOOL APIENTRY PATHOBJ_bEnum(
  950. PATHOBJ *ppo,
  951. PATHDATA *ppd);
  952. VOID APIENTRY PATHOBJ_vEnumStartClipLines(
  953. PATHOBJ *ppo,
  954. CLIPOBJ *pco,
  955. SURFOBJ *pso,
  956. LINEATTRS *pla);
  957. BOOL APIENTRY PATHOBJ_bEnumClipLines(
  958. PATHOBJ *ppo,
  959. ULONG cb,
  960. CLIPLINE *pcl);
  961. BOOL APIENTRY PATHOBJ_bMoveTo(
  962. PATHOBJ *ppo,
  963. POINTFIX ptfx);
  964. BOOL APIENTRY PATHOBJ_bPolyLineTo(
  965. PATHOBJ *ppo,
  966. POINTFIX *pptfx,
  967. ULONG cptfx);
  968. BOOL APIENTRY PATHOBJ_bPolyBezierTo(
  969. PATHOBJ *ppo,
  970. POINTFIX *pptfx,
  971. ULONG cptfx);
  972. BOOL APIENTRY PATHOBJ_bCloseFigure(PATHOBJ *ppo);
  973. VOID APIENTRY PATHOBJ_vGetBounds(
  974. PATHOBJ *ppo,
  975. PRECTFX prectfx);
  976. /*
  977. * STROBJ callbacks
  978. */
  979. VOID APIENTRY STROBJ_vEnumStart(
  980. STROBJ *pstro);
  981. BOOL APIENTRY STROBJ_bEnum(
  982. STROBJ *pstro,
  983. ULONG *pc,
  984. PGLYPHPOS *ppgpos);
  985. DWORD APIENTRY STROBJ_dwGetCodePage(
  986. STROBJ *pstro);
  987. #define SGI_EXTRASPACE 0
  988. /*
  989. * SURFOBJ callbacks
  990. */
  991. #define STYPE_BITMAP 0L
  992. #define STYPE_DEVICE 1L
  993. #define STYPE_DEVBITMAP 3L
  994. #define BMF_1BPP 1L
  995. #define BMF_4BPP 2L
  996. #define BMF_8BPP 3L
  997. #define BMF_16BPP 4L
  998. #define BMF_24BPP 5L
  999. #define BMF_32BPP 6L
  1000. #define BMF_4RLE 7L
  1001. #define BMF_8RLE 8L
  1002. #define BMF_TOPDOWN 0x0001
  1003. #define BMF_NOZEROINIT 0x0002
  1004. #define BMF_DONTCACHE 0x0004
  1005. #define BMF_USERMEM 0x0008
  1006. #define BMF_KMSECTION 0x0010
  1007. /*
  1008. * XFORMOBJ callbacks
  1009. */
  1010. #define GX_IDENTITY 0L
  1011. #define GX_OFFSET 1L
  1012. #define GX_SCALE 2L
  1013. #define GX_GENERAL 3L
  1014. #define XF_LTOL 0L
  1015. #define XF_INV_LTOL 1L
  1016. #define XF_LTOFX 2L
  1017. #define XF_INV_FXTOL 3L
  1018. ULONG APIENTRY XFORMOBJ_iGetXform(
  1019. XFORMOBJ *pxo,
  1020. XFORM *pxform);
  1021. BOOL APIENTRY XFORMOBJ_bApplyXform(
  1022. XFORMOBJ *pxo,
  1023. ULONG iMode,
  1024. ULONG cPoints,
  1025. PVOID pvIn,
  1026. PVOID pvOut);
  1027. /*
  1028. * XLATEOBJ callbacks
  1029. */
  1030. #define XO_TRIVIAL 0x00000001
  1031. #define XO_TABLE 0x00000002
  1032. #define XO_TO_MONO 0x00000004
  1033. #define XO_SRCPALETTE 1
  1034. #define XO_DESTPALETTE 2
  1035. #define XO_DESTDCPALETTE 3
  1036. #define XO_SRCBITFIELDS 4
  1037. #define XO_DESTBITFIELDS 5
  1038. ULONG APIENTRY XLATEOBJ_iXlate(XLATEOBJ *pxlo, ULONG iColor);
  1039. ULONG * APIENTRY XLATEOBJ_piVector(XLATEOBJ *pxlo);
  1040. ULONG APIENTRY XLATEOBJ_cGetPalette(
  1041. XLATEOBJ *pxlo,
  1042. ULONG iPal,
  1043. ULONG cPal,
  1044. ULONG *pPal);
  1045. /*
  1046. * Engine callbacks - error logging
  1047. */
  1048. VOID APIENTRY EngSetLastError(ULONG);
  1049. ULONG APIENTRY EngGetLastError();
  1050. /*
  1051. * Engine callbacks - Surfaces
  1052. */
  1053. #define HOOK_BITBLT 0x00000001
  1054. #define HOOK_STRETCHBLT 0x00000002
  1055. #define HOOK_PLGBLT 0x00000004
  1056. #define HOOK_TEXTOUT 0x00000008
  1057. #define HOOK_PAINT 0x00000010 // Obsolete
  1058. #define HOOK_STROKEPATH 0x00000020
  1059. #define HOOK_FILLPATH 0x00000040
  1060. #define HOOK_STROKEANDFILLPATH 0x00000080
  1061. #define HOOK_LINETO 0x00000100
  1062. #define HOOK_COPYBITS 0x00000400
  1063. #define HOOK_MOVEPANNING 0x00000800 // Obsolete
  1064. #define HOOK_SYNCHRONIZE 0x00001000
  1065. #define HOOK_SYNCHRONIZEACCESS 0x00004000 // Obsolete
  1066. //
  1067. // NEW FOR NT5
  1068. //
  1069. #define HOOK_STRETCHBLTROP 0x00002000
  1070. #define HOOK_TRANSPARENTBLT 0x00008000
  1071. #define HOOK_ALPHABLEND 0x00010000
  1072. #define HOOK_GRADIENTFILL 0x00020000
  1073. #define HOOK_FLAGS 0x0003b7ff
  1074. HBITMAP APIENTRY EngCreateBitmap(
  1075. SIZEL sizl,
  1076. LONG lWidth,
  1077. ULONG iFormat,
  1078. FLONG fl,
  1079. PVOID pvBits);
  1080. HSURF APIENTRY EngCreateDeviceSurface(DHSURF dhsurf, SIZEL sizl, ULONG iFormatCompat);
  1081. HBITMAP APIENTRY EngCreateDeviceBitmap(DHSURF dhsurf, SIZEL sizl, ULONG iFormatCompat);
  1082. BOOL APIENTRY EngDeleteSurface(HSURF hsurf);
  1083. SURFOBJ * APIENTRY EngLockSurface(HSURF hsurf);
  1084. VOID APIENTRY EngUnlockSurface(SURFOBJ *pso);
  1085. BOOL APIENTRY EngEraseSurface(
  1086. SURFOBJ *pso,
  1087. RECTL *prcl,
  1088. ULONG iColor);
  1089. BOOL APIENTRY EngAssociateSurface(
  1090. HSURF hsurf,
  1091. HDEV hdev,
  1092. FLONG flHooks);
  1093. BOOL APIENTRY EngMarkBandingSurface( HSURF hsurf );
  1094. BOOL APIENTRY EngCheckAbort(SURFOBJ *pso);
  1095. /*
  1096. * Engine callbacks - Paths
  1097. */
  1098. PATHOBJ * APIENTRY EngCreatePath();
  1099. VOID APIENTRY EngDeletePath(PATHOBJ *ppo);
  1100. /*
  1101. * Engine callbacks - Palettes
  1102. */
  1103. HPALETTE APIENTRY EngCreatePalette(
  1104. ULONG iMode,
  1105. ULONG cColors,
  1106. ULONG *pulColors,
  1107. FLONG flRed,
  1108. FLONG flGreen,
  1109. FLONG flBlue);
  1110. ULONG APIENTRY EngQueryPalette(
  1111. HPALETTE hpal,
  1112. ULONG *piMode,
  1113. ULONG cColors,
  1114. ULONG *pulColors);
  1115. BOOL APIENTRY EngDeletePalette(HPALETTE hpal);
  1116. /*
  1117. * Engine callbacks - Clipping
  1118. */
  1119. CLIPOBJ * APIENTRY EngCreateClip();
  1120. VOID APIENTRY EngDeleteClip(CLIPOBJ *pco);
  1121. /*
  1122. * Function prototypes
  1123. */
  1124. // These are the only EXPORTED functions for ANY driver
  1125. BOOL APIENTRY DrvEnableDriver(
  1126. ULONG iEngineVersion,
  1127. ULONG cj,
  1128. DRVENABLEDATA *pded);
  1129. /*
  1130. * Driver functions
  1131. */
  1132. DHPDEV APIENTRY DrvEnablePDEV(
  1133. DEVMODEW *pdm,
  1134. LPWSTR pwszLogAddress,
  1135. ULONG cPat,
  1136. HSURF *phsurfPatterns,
  1137. ULONG cjCaps,
  1138. ULONG *pdevcaps,
  1139. ULONG cjDevInfo,
  1140. DEVINFO *pdi,
  1141. HDEV hdev,
  1142. LPWSTR pwszDeviceName,
  1143. HANDLE hDriver);
  1144. #define HS_DDI_MAX 6
  1145. BOOL APIENTRY DrvResetPDEV(DHPDEV dhpdevOld, DHPDEV dhpdevNew);
  1146. VOID APIENTRY DrvCompletePDEV(DHPDEV dhpdev,HDEV hdev);
  1147. HSURF APIENTRY DrvEnableSurface(DHPDEV dhpdev);
  1148. VOID APIENTRY DrvSynchronize(DHPDEV dhpdev,RECTL *prcl);
  1149. VOID APIENTRY DrvDisableSurface(DHPDEV dhpdev);
  1150. VOID APIENTRY DrvDisablePDEV(DHPDEV dhpdev);
  1151. BOOL APIENTRY DrvStartBanding(SURFOBJ *pso, POINTL *pptl);
  1152. BOOL APIENTRY DrvNextBand(SURFOBJ *pso, POINTL *pptl);
  1153. /* DrvSaveScreenBits - iMode definitions */
  1154. #define SS_SAVE 0
  1155. #define SS_RESTORE 1
  1156. #define SS_FREE 2
  1157. ULONG APIENTRY DrvSaveScreenBits(SURFOBJ *pso,ULONG iMode,ULONG ident,RECTL *prcl);
  1158. /*
  1159. * Desktops
  1160. */
  1161. BOOL APIENTRY DrvAssertMode(
  1162. DHPDEV dhpdev,
  1163. BOOL bEnable);
  1164. ULONG APIENTRY DrvGetModes(
  1165. HANDLE hDriver,
  1166. ULONG cjSize,
  1167. DEVMODEW *pdm);
  1168. BOOL APIENTRY DrvPlgBlt(
  1169. SURFOBJ *psoTrg,
  1170. SURFOBJ *psoSrc,
  1171. SURFOBJ *psoMsk,
  1172. CLIPOBJ *pco,
  1173. XLATEOBJ *pxlo,
  1174. COLORADJUSTMENT *pca,
  1175. POINTL *pptlBrushOrg,
  1176. POINTFIX *pptfx,
  1177. RECTL *prcl,
  1178. POINTL *pptl,
  1179. ULONG iMode
  1180. );
  1181. /*
  1182. * Bitmaps
  1183. */
  1184. HBITMAP APIENTRY DrvCreateDeviceBitmap (
  1185. DHPDEV dhpdev,
  1186. SIZEL sizl,
  1187. ULONG iFormat);
  1188. VOID APIENTRY DrvDeleteDeviceBitmap(DHSURF dhsurf);
  1189. /*
  1190. * Palettes
  1191. */
  1192. BOOL APIENTRY DrvSetPalette(
  1193. DHPDEV dhpdev,
  1194. PALOBJ *ppalo,
  1195. FLONG fl,
  1196. ULONG iStart,
  1197. ULONG cColors);
  1198. /*
  1199. * Brushes
  1200. */
  1201. #define DM_DEFAULT 0x00000001
  1202. #define DM_MONOCHROME 0x00000002
  1203. #define DCR_SOLID 0
  1204. #define DCR_DRIVER 1
  1205. #define DCR_HALFTONE 2
  1206. ULONG APIENTRY DrvDitherColor(
  1207. DHPDEV dhpdev,
  1208. ULONG iMode,
  1209. ULONG rgb,
  1210. ULONG *pul);
  1211. BOOL APIENTRY DrvRealizeBrush(
  1212. BRUSHOBJ *pbo,
  1213. SURFOBJ *psoTarget,
  1214. SURFOBJ *psoPattern,
  1215. SURFOBJ *psoMask,
  1216. XLATEOBJ *pxlo,
  1217. ULONG iHatch);
  1218. #define RB_DITHERCOLOR 0x80000000L
  1219. /*
  1220. * Fonts
  1221. */
  1222. PIFIMETRICS APIENTRY DrvQueryFont(
  1223. DHPDEV dhpdev,
  1224. ULONG iFile,
  1225. ULONG iFace,
  1226. ULONG *pid);
  1227. // #define QFT_UNICODE 0L
  1228. #define QFT_LIGATURES 1L
  1229. #define QFT_KERNPAIRS 2L
  1230. #define QFT_GLYPHSET 3L
  1231. PVOID APIENTRY DrvQueryFontTree(
  1232. DHPDEV dhpdev,
  1233. ULONG iFile,
  1234. ULONG iFace,
  1235. ULONG iMode,
  1236. ULONG *pid);
  1237. #define QFD_GLYPHANDBITMAP 1L
  1238. #define QFD_GLYPHANDOUTLINE 2L
  1239. #define QFD_MAXEXTENTS 3L
  1240. #define QFD_TT_GLYPHANDBITMAP 4L
  1241. #define QFD_TT_GRAY1_BITMAP 5L
  1242. #define QFD_TT_GRAY2_BITMAP 6L
  1243. #define QFD_TT_GRAY4_BITMAP 8L
  1244. #define QFD_TT_GRAY8_BITMAP 9L
  1245. #define QFD_TT_MONO_BITMAP QFD_TT_GRAY1_BITMAP
  1246. LONG APIENTRY DrvQueryFontData(
  1247. DHPDEV dhpdev,
  1248. FONTOBJ *pfo,
  1249. ULONG iMode,
  1250. HGLYPH hg,
  1251. GLYPHDATA *pgd,
  1252. PVOID pv,
  1253. ULONG cjSize);
  1254. VOID APIENTRY DrvFree(
  1255. PVOID pv,
  1256. ULONG id);
  1257. VOID APIENTRY DrvDestroyFont(
  1258. FONTOBJ *pfo);
  1259. // Capability flags for DrvQueryCaps.
  1260. #define QC_OUTLINES 0x00000001
  1261. #define QC_1BIT 0x00000002
  1262. #define QC_4BIT 0x00000004
  1263. //
  1264. // This is a mask of the capabilites of a font provider that can return more
  1265. // than just glyph metrics (i.e., bitmaps and/or outlines). If a driver has
  1266. // one or more of these capabilities, then it is FONT DRIVER.
  1267. //
  1268. // Drivers should only set individual bits. GDI will check if any are turned on
  1269. // using this define.
  1270. //
  1271. #define QC_FONTDRIVERCAPS ( QC_OUTLINES | QC_1BIT | QC_4BIT )
  1272. LONG APIENTRY DrvQueryFontCaps(
  1273. ULONG culCaps,
  1274. ULONG *pulCaps);
  1275. ULONG APIENTRY DrvLoadFontFile(
  1276. ULONG cFiles, // number of font files associated with this font
  1277. ULONG *piFile, // handles for individual files, cFiles of them
  1278. PVOID *ppvView, // array of cFiles views
  1279. ULONG *pcjView, // array of their sizes
  1280. ULONG ulLangID);
  1281. BOOL APIENTRY DrvUnloadFontFile(
  1282. ULONG iFile);
  1283. LONG APIENTRY DrvQueryTrueTypeTable(
  1284. ULONG iFile,
  1285. ULONG ulFont,
  1286. ULONG ulTag,
  1287. PTRDIFF dpStart,
  1288. ULONG cjBuf,
  1289. BYTE *pjBuf);
  1290. BOOL APIENTRY DrvQueryAdvanceWidths(
  1291. DHPDEV dhpdev,
  1292. FONTOBJ *pfo,
  1293. ULONG iMode,
  1294. HGLYPH *phg,
  1295. PVOID pvWidths,
  1296. ULONG cGlyphs);
  1297. // Values for iMode
  1298. #define QAW_GETWIDTHS 0
  1299. #define QAW_GETEASYWIDTHS 1
  1300. LONG APIENTRY DrvQueryTrueTypeOutline(
  1301. DHPDEV dhpdev,
  1302. FONTOBJ *pfo,
  1303. HGLYPH hglyph,
  1304. BOOL bMetricsOnly,
  1305. GLYPHDATA *pgldt,
  1306. ULONG cjBuf,
  1307. TTPOLYGONHEADER *ppoly);
  1308. PVOID APIENTRY DrvGetTrueTypeFile (
  1309. ULONG iFile,
  1310. ULONG *pcj);
  1311. // values for ulMode:
  1312. #define QFF_DESCRIPTION 1L
  1313. #define QFF_NUMFACES 2L
  1314. LONG APIENTRY DrvQueryFontFile(
  1315. ULONG iFile,
  1316. ULONG ulMode,
  1317. ULONG cjBuf,
  1318. ULONG *pulBuf);
  1319. /*
  1320. * BitBlt
  1321. */
  1322. BOOL APIENTRY DrvBitBlt(
  1323. SURFOBJ *psoTrg,
  1324. SURFOBJ *psoSrc,
  1325. SURFOBJ *psoMask,
  1326. CLIPOBJ *pco,
  1327. XLATEOBJ *pxlo,
  1328. RECTL *prclTrg,
  1329. POINTL *pptlSrc,
  1330. POINTL *pptlMask,
  1331. BRUSHOBJ *pbo,
  1332. POINTL *pptlBrush,
  1333. ROP4 rop4);
  1334. BOOL APIENTRY DrvStretchBlt(
  1335. SURFOBJ *psoDest,
  1336. SURFOBJ *psoSrc,
  1337. SURFOBJ *psoMask,
  1338. CLIPOBJ *pco,
  1339. XLATEOBJ *pxlo,
  1340. COLORADJUSTMENT *pca,
  1341. POINTL *pptlHTOrg,
  1342. RECTL *prclDest,
  1343. RECTL *prclSrc,
  1344. POINTL *pptlMask,
  1345. ULONG iMode);
  1346. BOOL APIENTRY DrvStretchBltROP(
  1347. SURFOBJ *psoDest,
  1348. SURFOBJ *psoSrc,
  1349. SURFOBJ *psoMask,
  1350. CLIPOBJ *pco,
  1351. XLATEOBJ *pxlo,
  1352. COLORADJUSTMENT *pca,
  1353. POINTL *pptlHTOrg,
  1354. RECTL *prclDest,
  1355. RECTL *prclSrc,
  1356. POINTL *pptlMask,
  1357. ULONG iMode,
  1358. BRUSHOBJ *pbo,
  1359. DWORD rop4
  1360. );
  1361. BOOL APIENTRY DrvAlphaBlend(
  1362. SURFOBJ *psoDest,
  1363. SURFOBJ *psoSrc,
  1364. CLIPOBJ *pco,
  1365. XLATEOBJ *pxlo,
  1366. RECTL *prclDest,
  1367. RECTL *prclSrc,
  1368. BLENDOBJ *pBlendObj
  1369. );
  1370. BOOL APIENTRY DrvGradientFill(
  1371. SURFOBJ *psoDest,
  1372. CLIPOBJ *pco,
  1373. XLATEOBJ *pxlo,
  1374. TRIVERTEX *pVertex,
  1375. ULONG nVertex,
  1376. PVOID pMesh,
  1377. ULONG nMesh,
  1378. RECTL *prclExtents,
  1379. POINTL *pptlDitherOrg,
  1380. ULONG ulMode
  1381. );
  1382. BOOL APIENTRY DrvTransparentBlt(
  1383. SURFOBJ *psoDst,
  1384. SURFOBJ *psoSrc,
  1385. CLIPOBJ *pco,
  1386. XLATEOBJ *pxlo,
  1387. RECTL *prclDst,
  1388. RECTL *prclSrc,
  1389. ULONG iTransColor,
  1390. ULONG ulReserved
  1391. );
  1392. BOOL APIENTRY DrvCopyBits(
  1393. SURFOBJ *psoDest,
  1394. SURFOBJ *psoSrc,
  1395. CLIPOBJ *pco,
  1396. XLATEOBJ *pxlo,
  1397. RECTL *prclDest,
  1398. POINTL *pptlSrc);
  1399. /*
  1400. * Text Output
  1401. */
  1402. BOOL APIENTRY DrvTextOut(
  1403. SURFOBJ *pso,
  1404. STROBJ *pstro,
  1405. FONTOBJ *pfo,
  1406. CLIPOBJ *pco,
  1407. RECTL *prclExtra,
  1408. RECTL *prclOpaque,
  1409. BRUSHOBJ *pboFore,
  1410. BRUSHOBJ *pboOpaque,
  1411. POINTL *pptlOrg,
  1412. MIX mix);
  1413. /*
  1414. * Graphics Output
  1415. */
  1416. BOOL APIENTRY DrvLineTo(
  1417. SURFOBJ *pso,
  1418. CLIPOBJ *pco,
  1419. BRUSHOBJ *pbo,
  1420. LONG x1,
  1421. LONG y1,
  1422. LONG x2,
  1423. LONG y2,
  1424. RECTL *prclBounds,
  1425. MIX mix);
  1426. BOOL APIENTRY DrvStrokePath(
  1427. SURFOBJ *pso,
  1428. PATHOBJ *ppo,
  1429. CLIPOBJ *pco,
  1430. XFORMOBJ *pxo,
  1431. BRUSHOBJ *pbo,
  1432. POINTL *pptlBrushOrg,
  1433. LINEATTRS *plineattrs,
  1434. MIX mix);
  1435. #define FP_ALTERNATEMODE 1L
  1436. #define FP_WINDINGMODE 2L
  1437. BOOL APIENTRY DrvFillPath(
  1438. SURFOBJ *pso,
  1439. PATHOBJ *ppo,
  1440. CLIPOBJ *pco,
  1441. BRUSHOBJ *pbo,
  1442. POINTL *pptlBrushOrg,
  1443. MIX mix,
  1444. FLONG flOptions);
  1445. BOOL APIENTRY DrvStrokeAndFillPath(
  1446. SURFOBJ *pso,
  1447. PATHOBJ *ppo,
  1448. CLIPOBJ *pco,
  1449. XFORMOBJ *pxo,
  1450. BRUSHOBJ *pboStroke,
  1451. LINEATTRS *plineattrs,
  1452. BRUSHOBJ *pboFill,
  1453. POINTL *pptlBrushOrg,
  1454. MIX mixFill,
  1455. FLONG flOptions);
  1456. BOOL APIENTRY DrvPaint(
  1457. SURFOBJ *pso,
  1458. CLIPOBJ *pco,
  1459. BRUSHOBJ *pbo,
  1460. POINTL *pptlBrushOrg,
  1461. MIX mix);
  1462. /*
  1463. * Pointers
  1464. */
  1465. #define SPS_ERROR 0
  1466. #define SPS_DECLINE 1
  1467. #define SPS_ACCEPT_NOEXCLUDE 2
  1468. #define SPS_ACCEPT_EXCLUDE 3
  1469. #define SPS_CHANGE 0x00000001L
  1470. #define SPS_ASYNCCHANGE 0x00000002L
  1471. #define SPS_ANIMATESTART 0x00000004L
  1472. #define SPS_ANIMATEUPDATE 0x00000008L
  1473. ULONG APIENTRY DrvSetPointerShape(
  1474. SURFOBJ *pso,
  1475. SURFOBJ *psoMask,
  1476. SURFOBJ *psoColor,
  1477. XLATEOBJ *pxlo,
  1478. LONG xHot,
  1479. LONG yHot,
  1480. LONG x,
  1481. LONG y,
  1482. RECTL *prcl,
  1483. FLONG fl);
  1484. VOID APIENTRY DrvMovePointer(SURFOBJ *pso,LONG x,LONG y,RECTL *prcl);
  1485. /*
  1486. * Printing
  1487. */
  1488. BOOL APIENTRY DrvSendPage(SURFOBJ *pso);
  1489. BOOL APIENTRY DrvStartPage(SURFOBJ *pso);
  1490. ULONG APIENTRY DrvEscape(
  1491. SURFOBJ *pso,
  1492. ULONG iEsc,
  1493. ULONG cjIn,
  1494. PVOID pvIn,
  1495. ULONG cjOut,
  1496. PVOID pvOut);
  1497. BOOL APIENTRY DrvStartDoc(
  1498. SURFOBJ *pso,
  1499. LPWSTR pwszDocName,
  1500. DWORD dwJobId);
  1501. #define ED_ABORTDOC 1
  1502. BOOL APIENTRY DrvEndDoc(SURFOBJ *pso, FLONG fl);
  1503. BOOL APIENTRY DrvQuerySpoolType(DHPDEV, LPWSTR);
  1504. ULONG APIENTRY DrvDrawEscape(
  1505. SURFOBJ *pso,
  1506. ULONG iEsc,
  1507. CLIPOBJ *pco,
  1508. RECTL *prcl,
  1509. ULONG cjIn,
  1510. PVOID pvIn);
  1511. ULONG APIENTRY DrvGetGlyphMode(DHPDEV, FONTOBJ *);
  1512. ULONG APIENTRY DrvFontManagement(
  1513. SURFOBJ *pso,
  1514. FONTOBJ *pfo,
  1515. ULONG iMode,
  1516. ULONG cjIn,
  1517. PVOID pvIn,
  1518. ULONG cjOut,
  1519. PVOID pvOut);
  1520. /*
  1521. * DirectDraw
  1522. */
  1523. BOOL DrvEnableDirectDraw(
  1524. DHPDEV dhpdev,
  1525. DD_CALLBACKS *pCallBacks,
  1526. DD_SURFACECALLBACKS *pSurfaceCallBacks,
  1527. DD_PALETTECALLBACKS *pPaletteCallBacks);
  1528. VOID DrvDisableDirectDraw(
  1529. DHPDEV dhpdev);
  1530. BOOL DrvGetDirectDrawInfo(
  1531. DHPDEV dhpdev,
  1532. DD_HALINFO *pHalInfo,
  1533. DWORD *pdwNumHeaps,
  1534. VIDEOMEMORY *pvmList,
  1535. DWORD *pdwNumFourCCCodes,
  1536. DWORD *pdwFourCC);
  1537. /*
  1538. * Engine callbacks - tracking clip region changes
  1539. */
  1540. #define WOC_RGN_CLIENT_DELTA 0x0001
  1541. #define WOC_RGN_CLIENT 0x0002
  1542. #define WOC_RGN_SURFACE_DELTA 0x0004
  1543. #define WOC_RGN_SURFACE 0x0008
  1544. #define WOC_CHANGED 0x0010
  1545. #define WOC_DELETE 0x0020
  1546. typedef VOID (CALLBACK * WNDOBJCHANGEPROC)(WNDOBJ *pwo, FLONG fl);
  1547. #define WO_RGN_CLIENT_DELTA 0x0001
  1548. #define WO_RGN_CLIENT 0x0002
  1549. #define WO_RGN_SURFACE_DELTA 0x0004
  1550. #define WO_RGN_SURFACE 0x0008
  1551. #define WO_RGN_UPDATE_ALL 0x0010
  1552. #define WO_RGN_WINDOW 0x0020
  1553. WNDOBJ * APIENTRY EngCreateWnd(
  1554. SURFOBJ *pso,
  1555. HWND hwnd,
  1556. WNDOBJCHANGEPROC pfn,
  1557. FLONG fl,
  1558. int iPixelFormat);
  1559. VOID EngDeleteWnd(
  1560. WNDOBJ *pwo);
  1561. ULONG APIENTRY WNDOBJ_cEnumStart(
  1562. WNDOBJ *pwo,
  1563. ULONG iType,
  1564. ULONG iDirection,
  1565. ULONG cLimit);
  1566. BOOL APIENTRY WNDOBJ_bEnum(
  1567. WNDOBJ *pwo,
  1568. ULONG cj,
  1569. ULONG *pul);
  1570. VOID APIENTRY WNDOBJ_vSetConsumer(
  1571. WNDOBJ *pwo,
  1572. PVOID pvConsumer);
  1573. /*
  1574. * Engine callbacks - tracking driver managed resources
  1575. */
  1576. HDRVOBJ APIENTRY EngCreateDriverObj(
  1577. PVOID pvObj,
  1578. FREEOBJPROC pFreeObjProc,
  1579. HDEV hdev);
  1580. BOOL APIENTRY EngDeleteDriverObj(
  1581. HDRVOBJ hdo,
  1582. BOOL bCallBack,
  1583. BOOL bLocked);
  1584. DRIVEROBJ * APIENTRY EngLockDriverObj(HDRVOBJ hdo);
  1585. BOOL APIENTRY EngUnlockDriverObj(HDRVOBJ hdo);
  1586. /*
  1587. * Engine callback - return current process handle.
  1588. */
  1589. HANDLE APIENTRY EngGetProcessHandle();
  1590. /*
  1591. * Pixel formats
  1592. */
  1593. BOOL APIENTRY DrvSetPixelFormat(
  1594. SURFOBJ *pso,
  1595. LONG iPixelFormat,
  1596. HWND hwnd);
  1597. LONG APIENTRY DrvDescribePixelFormat(
  1598. DHPDEV dhpdev,
  1599. LONG iPixelFormat,
  1600. ULONG cjpfd,
  1601. PIXELFORMATDESCRIPTOR *ppfd);
  1602. /*
  1603. * Swap buffers
  1604. */
  1605. BOOL APIENTRY DrvSwapBuffers(
  1606. SURFOBJ *pso,
  1607. WNDOBJ *pwo);
  1608. /*
  1609. * Function prototypes - Engine Simulations
  1610. */
  1611. BOOL APIENTRY EngBitBlt(
  1612. SURFOBJ *psoTrg,
  1613. SURFOBJ *psoSrc,
  1614. SURFOBJ *psoMask,
  1615. CLIPOBJ *pco,
  1616. XLATEOBJ *pxlo,
  1617. RECTL *prclTrg,
  1618. POINTL *pptlSrc,
  1619. POINTL *pptlMask,
  1620. BRUSHOBJ *pbo,
  1621. POINTL *pptlBrush,
  1622. ROP4 rop4);
  1623. BOOL APIENTRY EngLineTo(
  1624. SURFOBJ *pso,
  1625. CLIPOBJ *pco,
  1626. BRUSHOBJ *pbo,
  1627. LONG x1,
  1628. LONG y1,
  1629. LONG x2,
  1630. LONG y2,
  1631. RECTL *prclBounds,
  1632. MIX mix);
  1633. BOOL APIENTRY EngStretchBlt(
  1634. SURFOBJ *psoDest,
  1635. SURFOBJ *psoSrc,
  1636. SURFOBJ *psoMask,
  1637. CLIPOBJ *pco,
  1638. XLATEOBJ *pxlo,
  1639. COLORADJUSTMENT *pca,
  1640. POINTL *pptlHTOrg,
  1641. RECTL *prclDest,
  1642. RECTL *prclSrc,
  1643. POINTL *pptlMask,
  1644. ULONG iMode);
  1645. BOOL APIENTRY EngTextOut(
  1646. SURFOBJ *pso,
  1647. STROBJ *pstro,
  1648. FONTOBJ *pfo,
  1649. CLIPOBJ *pco,
  1650. RECTL *prclExtra,
  1651. RECTL *prclOpaque,
  1652. BRUSHOBJ *pboFore,
  1653. BRUSHOBJ *pboOpaque,
  1654. POINTL *pptlOrg,
  1655. MIX mix);
  1656. BOOL APIENTRY EngStrokePath(
  1657. SURFOBJ *pso,
  1658. PATHOBJ *ppo,
  1659. CLIPOBJ *pco,
  1660. XFORMOBJ *pxo,
  1661. BRUSHOBJ *pbo,
  1662. POINTL *pptlBrushOrg,
  1663. LINEATTRS *plineattrs,
  1664. MIX mix);
  1665. BOOL APIENTRY EngFillPath(
  1666. SURFOBJ *pso,
  1667. PATHOBJ *ppo,
  1668. CLIPOBJ *pco,
  1669. BRUSHOBJ *pbo,
  1670. POINTL *pptlBrushOrg,
  1671. MIX mix,
  1672. FLONG flOptions);
  1673. BOOL APIENTRY EngStrokeAndFillPath(
  1674. SURFOBJ *pso,
  1675. PATHOBJ *ppo,
  1676. CLIPOBJ *pco,
  1677. XFORMOBJ *pxo,
  1678. BRUSHOBJ *pboStroke,
  1679. LINEATTRS *plineattrs,
  1680. BRUSHOBJ *pboFill,
  1681. POINTL *pptlBrushOrg,
  1682. MIX mixFill,
  1683. FLONG flOptions);
  1684. BOOL APIENTRY EngPaint(
  1685. SURFOBJ *pso,
  1686. CLIPOBJ *pco,
  1687. BRUSHOBJ *pbo,
  1688. POINTL *pptlBrushOrg,
  1689. MIX mix);
  1690. BOOL APIENTRY EngCopyBits(
  1691. SURFOBJ *psoDest,
  1692. SURFOBJ *psoSrc,
  1693. CLIPOBJ *pco,
  1694. XLATEOBJ *pxlo,
  1695. RECTL *prclDest,
  1696. POINTL *pptlSrc);
  1697. ULONG APIENTRY EngSetPointerShape(
  1698. SURFOBJ *pso,
  1699. SURFOBJ *psoMask,
  1700. SURFOBJ *psoColor,
  1701. XLATEOBJ *pxlo,
  1702. LONG xHot,
  1703. LONG yHot,
  1704. LONG x,
  1705. LONG y,
  1706. RECTL *prcl,
  1707. FLONG fl);
  1708. VOID APIENTRY EngMovePointer(
  1709. SURFOBJ *pso,
  1710. LONG x,
  1711. LONG y,
  1712. RECTL *prcl);
  1713. //
  1714. // Halftone releated APIs
  1715. //
  1716. LONG
  1717. APIENTRY
  1718. HT_ComputeRGBGammaTable(
  1719. USHORT GammaTableEntries,
  1720. USHORT GammaTableType,
  1721. USHORT RedGamma,
  1722. USHORT GreenGamma,
  1723. USHORT BlueGamma,
  1724. LPBYTE pGammaTable
  1725. );
  1726. LONG
  1727. APIENTRY
  1728. HT_Get8BPPFormatPalette(
  1729. LPPALETTEENTRY pPaletteEntry,
  1730. USHORT RedGamma,
  1731. USHORT GreenGamma,
  1732. USHORT BlueGamma
  1733. );
  1734. typedef struct _DEVHTINFO {
  1735. DWORD HTFlags;
  1736. DWORD HTPatternSize;
  1737. DWORD DevPelsDPI;
  1738. COLORINFO ColorInfo;
  1739. } DEVHTINFO, *PDEVHTINFO;
  1740. #define DEVHTADJF_COLOR_DEVICE 0x00000001
  1741. #define DEVHTADJF_ADDITIVE_DEVICE 0x00000002
  1742. typedef struct _DEVHTADJDATA {
  1743. DWORD DeviceFlags;
  1744. DWORD DeviceXDPI;
  1745. DWORD DeviceYDPI;
  1746. PDEVHTINFO pDefHTInfo;
  1747. PDEVHTINFO pAdjHTInfo;
  1748. } DEVHTADJDATA, *PDEVHTADJDATA;
  1749. LONG
  1750. APIENTRY
  1751. HTUI_DeviceColorAdjustment(
  1752. LPSTR pDeviceName,
  1753. PDEVHTADJDATA pDevHTAdjData
  1754. );
  1755. //
  1756. // General support APIS
  1757. //
  1758. VOID
  1759. APIENTRY
  1760. EngDebugBreak(
  1761. VOID
  1762. );
  1763. VOID
  1764. APIENTRY
  1765. EngDebugPrint(
  1766. PCHAR StandardPrefix,
  1767. PCHAR DebugMessage,
  1768. va_list ap
  1769. );
  1770. VOID
  1771. APIENTRY
  1772. EngQueryPerformanceCounter(
  1773. LONGLONG *pPerformanceCount
  1774. );
  1775. VOID
  1776. APIENTRY
  1777. EngQueryPerformanceFrequency(
  1778. LONGLONG *pFrequency
  1779. );
  1780. BOOL
  1781. APIENTRY
  1782. EngSetPointerTag(
  1783. HDEV hdev,
  1784. SURFOBJ *psoMask,
  1785. SURFOBJ *psoColor,
  1786. XLATEOBJ *pxlo,
  1787. FLONG fl
  1788. );
  1789. //
  1790. // Kernel mode memory operations
  1791. //
  1792. #define FL_ZERO_MEMORY 0x00000001
  1793. PVOID
  1794. APIENTRY
  1795. EngAllocMem(
  1796. ULONG Flags,
  1797. ULONG MemSize,
  1798. ULONG Tag
  1799. );
  1800. VOID
  1801. APIENTRY
  1802. EngFreeMem(
  1803. PVOID Mem
  1804. );
  1805. //
  1806. // User mode memory Operations
  1807. //
  1808. VOID
  1809. APIENTRY
  1810. EngProbeForRead(
  1811. PVOID Address,
  1812. ULONG Length,
  1813. ULONG Alignment
  1814. );
  1815. VOID
  1816. APIENTRY
  1817. EngProbeForReadAndWrite(
  1818. PVOID Address,
  1819. ULONG Length,
  1820. ULONG Alignment
  1821. );
  1822. PVOID
  1823. APIENTRY
  1824. EngAllocUserMem(
  1825. ULONG cj,
  1826. ULONG tag
  1827. );
  1828. HANDLE
  1829. APIENTRY
  1830. EngSecureMem(
  1831. PVOID Address,
  1832. ULONG Length
  1833. );
  1834. VOID
  1835. APIENTRY
  1836. EngUnsecureMem(
  1837. HANDLE hSecure
  1838. );
  1839. VOID
  1840. APIENTRY
  1841. EngFreeUserMem(
  1842. PVOID pv
  1843. );
  1844. DWORD
  1845. APIENTRY
  1846. EngDeviceIoControl(
  1847. HANDLE hDevice,
  1848. DWORD dwIoControlCode,
  1849. LPVOID lpInBuffer,
  1850. DWORD nInBufferSize,
  1851. LPVOID lpOutBuffer,
  1852. DWORD nOutBufferSize,
  1853. LPDWORD lpBytesReturned
  1854. );
  1855. int
  1856. APIENTRY
  1857. EngMulDiv(
  1858. int a,
  1859. int b,
  1860. int c);
  1861. //
  1862. // Loading drivers and gettings entry points from them
  1863. //
  1864. HANDLE
  1865. APIENTRY
  1866. EngLoadImage(
  1867. LPWSTR pwszDriver
  1868. );
  1869. PVOID
  1870. APIENTRY
  1871. EngFindImageProcAddress(
  1872. HANDLE hModule,
  1873. LPSTR lpProcName
  1874. );
  1875. VOID
  1876. APIENTRY
  1877. EngUnloadImage(
  1878. HANDLE hModule
  1879. );
  1880. //
  1881. // callback for extra PDEV information
  1882. //
  1883. LPWSTR
  1884. APIENTRY
  1885. EngGetPrinterDataFileName(
  1886. HDEV hdev
  1887. );
  1888. LPWSTR
  1889. APIENTRY
  1890. EngGetDriverName(
  1891. HDEV hdev
  1892. );
  1893. typedef struct _TYPE1_FONT
  1894. {
  1895. HANDLE hPFM;
  1896. HANDLE hPFB;
  1897. ULONG ulIdentifier;
  1898. } TYPE1_FONT;
  1899. BOOL
  1900. APIENTRY
  1901. EngGetType1FontList(
  1902. HDEV hdev,
  1903. TYPE1_FONT *pType1Buffer,
  1904. ULONG cjType1Buffer,
  1905. PULONG pulLocalFonts,
  1906. PULONG pulRemoteFonts,
  1907. LARGE_INTEGER *pLastModified
  1908. );
  1909. //
  1910. // Manipulating resource sections
  1911. //
  1912. HANDLE
  1913. APIENTRY
  1914. EngLoadModule(
  1915. LPWSTR pwsz
  1916. );
  1917. PVOID
  1918. APIENTRY
  1919. EngMapModule(
  1920. HANDLE h,
  1921. PULONG pSize
  1922. );
  1923. PVOID
  1924. APIENTRY
  1925. EngFindResource(
  1926. HANDLE h,
  1927. int iName,
  1928. int iType,
  1929. PULONG pulSize
  1930. );
  1931. VOID
  1932. APIENTRY
  1933. EngFreeModule(
  1934. HANDLE h
  1935. );
  1936. //
  1937. // FontFile Callbacks
  1938. //
  1939. VOID
  1940. APIENTRY
  1941. EngUnmapFontFile(
  1942. ULONG iFile
  1943. );
  1944. BOOL
  1945. APIENTRY
  1946. EngMapFontFile(
  1947. ULONG iFile,
  1948. PULONG *ppjBuf,
  1949. ULONG *pcjBuf
  1950. );
  1951. //
  1952. // Semaphores
  1953. //
  1954. DECLARE_HANDLE(HSEMAPHORE);
  1955. HSEMAPHORE
  1956. APIENTRY
  1957. EngCreateSemaphore(
  1958. VOID
  1959. );
  1960. VOID
  1961. APIENTRY
  1962. EngAcquireSemaphore(
  1963. HSEMAPHORE hsem
  1964. );
  1965. VOID
  1966. APIENTRY
  1967. EngReleaseSemaphore(
  1968. HSEMAPHORE hsem
  1969. );
  1970. VOID
  1971. APIENTRY
  1972. EngDeleteSemaphore(
  1973. HSEMAPHORE hsem
  1974. );
  1975. VOID
  1976. APIENTRY
  1977. EngMultiByteToUnicodeN(
  1978. LPWSTR UnicodeString,
  1979. ULONG MaxBytesInUnicodeString,
  1980. PULONG BytesInUnicodeString,
  1981. PCHAR MultiByteString,
  1982. ULONG BytesInMultiByteString
  1983. );
  1984. VOID
  1985. APIENTRY
  1986. EngUnicodeToMultiByteN(
  1987. PCHAR MultiByteString,
  1988. ULONG MaxBytesInMultiByteString,
  1989. PULONG BytesInMultiByteString,
  1990. PWSTR UnicodeString,
  1991. ULONG BytesInUnicodeString
  1992. );
  1993. // for the spooler
  1994. DWORD
  1995. APIENTRY
  1996. EngGetPrinterData(
  1997. HANDLE hPrinter,
  1998. LPWSTR pValueName,
  1999. LPDWORD pType,
  2000. LPBYTE pData,
  2001. DWORD nSize,
  2002. LPDWORD pcbNeeded
  2003. );
  2004. DWORD
  2005. APIENTRY
  2006. EngSetPrinterData(
  2007. HANDLE hPrinter,
  2008. LPWSTR pType,
  2009. DWORD dwType,
  2010. LPBYTE lpbPrinterData,
  2011. DWORD cjPrinterData
  2012. );
  2013. BOOL
  2014. APIENTRY
  2015. EngGetForm(
  2016. HANDLE hPrinter,
  2017. LPWSTR pFormName,
  2018. DWORD Level,
  2019. LPBYTE pForm,
  2020. DWORD cbBuf,
  2021. LPDWORD pcbNeeded
  2022. );
  2023. BOOL
  2024. APIENTRY
  2025. EngWritePrinter(
  2026. HANDLE hPrinter,
  2027. LPVOID pBuf,
  2028. DWORD cbBuf,
  2029. LPDWORD pcWritten
  2030. );
  2031. BOOL
  2032. APIENTRY
  2033. EngGetPrinter(
  2034. HANDLE hPrinter,
  2035. DWORD dwLevel,
  2036. LPBYTE pPrinter,
  2037. DWORD cbBuf,
  2038. LPDWORD pcbNeeded
  2039. );
  2040. BOOL
  2041. APIENTRY
  2042. EngEnumForms(
  2043. HANDLE hPrinter,
  2044. DWORD Level,
  2045. LPBYTE pForm,
  2046. DWORD cbBuf,
  2047. LPDWORD pcbNeeded,
  2048. LPDWORD pcReturned
  2049. );
  2050. ULONG
  2051. APIENTRY
  2052. EngEscape(
  2053. HANDLE hPrinter,
  2054. ULONG iEsc,
  2055. ULONG cjIn,
  2056. PVOID pvIn,
  2057. ULONG cjOut,
  2058. PVOID pvOut
  2059. );
  2060. #ifdef _X86_
  2061. typedef struct _FLOATOBJ
  2062. {
  2063. ULONG ul1;
  2064. ULONG ul2;
  2065. } FLOATOBJ, *PFLOATOBJ;
  2066. VOID FLOATOBJ_SetFloat(PFLOATOBJ,FLOAT);
  2067. VOID FLOATOBJ_SetLong(PFLOATOBJ,LONG);
  2068. LONG FLOATOBJ_GetFloat(PFLOATOBJ);
  2069. LONG FLOATOBJ_GetLong(PFLOATOBJ);
  2070. VOID FLOATOBJ_AddFloat(PFLOATOBJ,FLOAT);
  2071. VOID FLOATOBJ_AddLong(PFLOATOBJ,LONG);
  2072. VOID FLOATOBJ_Add(PFLOATOBJ,PFLOATOBJ);
  2073. VOID FLOATOBJ_SubFloat(PFLOATOBJ,FLOAT);
  2074. VOID FLOATOBJ_SubLong(PFLOATOBJ,LONG);
  2075. VOID FLOATOBJ_Sub(PFLOATOBJ,PFLOATOBJ);
  2076. VOID FLOATOBJ_MulFloat(PFLOATOBJ,FLOAT);
  2077. VOID FLOATOBJ_MulLong(PFLOATOBJ,LONG);
  2078. VOID FLOATOBJ_Mul(PFLOATOBJ,PFLOATOBJ);
  2079. VOID FLOATOBJ_DivFloat(PFLOATOBJ,FLOAT);
  2080. VOID FLOATOBJ_DivLong(PFLOATOBJ,LONG);
  2081. VOID FLOATOBJ_Div(PFLOATOBJ,PFLOATOBJ);
  2082. VOID FLOATOBJ_Neg(PFLOATOBJ);
  2083. BOOL FLOATOBJ_EqualLong(PFLOATOBJ,LONG);
  2084. BOOL FLOATOBJ_GreaterThanLong(PFLOATOBJ,LONG);
  2085. BOOL FLOATOBJ_LessThanLong(PFLOATOBJ,LONG);
  2086. BOOL FLOATOBJ_Equal(PFLOATOBJ,PFLOATOBJ);
  2087. BOOL FLOATOBJ_GreaterThan(PFLOATOBJ,PFLOATOBJ);
  2088. BOOL FLOATOBJ_LessThan(PFLOATOBJ,PFLOATOBJ);
  2089. #else
  2090. // any platform that has support for floats in the kernel
  2091. typedef FLOAT FLOATOBJ;
  2092. typedef FLOAT *PFLOATOBJ;
  2093. #define FLOATOBJ_SetFloat(pf,f) {*(pf) = (f); }
  2094. #define FLOATOBJ_SetLong(pf,l) {*(pf) = (FLOAT)(l); }
  2095. #define FLOATOBJ_GetFloat(pf) *((PULONG)pf)
  2096. #define FLOATOBJ_GetLong(pf) (LONG)*(pf)
  2097. #define FLOATOBJ_AddFloat(pf,f) {*(pf) += f; }
  2098. #define FLOATOBJ_AddLong(pf,l) {*(pf) += (LONG)(l); }
  2099. #define FLOATOBJ_Add(pf,pf1) {*(pf) += *(pf1); }
  2100. #define FLOATOBJ_SubFloat(pf,f) {*(pf) -= f; }
  2101. #define FLOATOBJ_SubLong(pf,l) {*(pf) -= (LONG)(l); }
  2102. #define FLOATOBJ_Sub(pf,pf1) {*(pf) -= *(pf1); }
  2103. #define FLOATOBJ_MulFloat(pf,f) {*(pf) *= f; }
  2104. #define FLOATOBJ_MulLong(pf,l) {*(pf) *= (LONG)(l); }
  2105. #define FLOATOBJ_Mul(pf,pf1) {*(pf) *= *(pf1); }
  2106. #define FLOATOBJ_DivFloat(pf,f) {*(pf) /= f; }
  2107. #define FLOATOBJ_DivLong(pf,l) {*(pf) /= (LONG)(l); }
  2108. #define FLOATOBJ_Div(pf,pf1) {*(pf) /= *(pf1); }
  2109. #define FLOATOBJ_Neg(pf) {*(pf) = -*(pf); }
  2110. #define FLOATOBJ_EqualLong(pf,l) (*(pf) == (FLOAT)(l))
  2111. #define FLOATOBJ_GreaterThanLong(pf,l) (*(pf) > (FLOAT)(l))
  2112. #define FLOATOBJ_LessThanLong(pf,l) (*(pf) < (FLOAT)(l))
  2113. #define FLOATOBJ_Equal(pf,pf1) (*(pf) == *(pf1))
  2114. #define FLOATOBJ_GreaterThan(pf,pf1) (*(pf) > *(pf1))
  2115. #define FLOATOBJ_LessThan(pf,pf1) (*(pf) < *(pf1))
  2116. #endif // _FLOATOBJ_
  2117. typedef struct tagFLOATOBJ_XFORM
  2118. {
  2119. FLOATOBJ eM11;
  2120. FLOATOBJ eM12;
  2121. FLOATOBJ eM21;
  2122. FLOATOBJ eM22;
  2123. FLOATOBJ eDx;
  2124. FLOATOBJ eDy;
  2125. } FLOATOBJ_XFORM, *PFLOATOBJ_XFORM, FAR *LPFLOATOBJ_XFORM;
  2126. ULONG
  2127. APIENTRY
  2128. XFORMOBJ_iGetFloatObjXform(
  2129. XFORMOBJ *pxo,
  2130. FLOATOBJ_XFORM * pfxo);
  2131. // SORT specific defines
  2132. typedef int (__cdecl *SORTCOMP)(const void *pv1, const void *pv2);
  2133. VOID
  2134. APIENTRY
  2135. EngSort(
  2136. PBYTE pjBuf,
  2137. ULONG c,
  2138. ULONG cjElem,
  2139. SORTCOMP pfnComp);
  2140. typedef struct _ENG_TIME_FIELDS {
  2141. USHORT usYear; // range [1601...]
  2142. USHORT usMonth; // range [1..12]
  2143. USHORT usDay; // range [1..31]
  2144. USHORT usHour; // range [0..23]
  2145. USHORT usMinute; // range [0..59]
  2146. USHORT usSecond; // range [0..59]
  2147. USHORT usMilliseconds;// range [0..999]
  2148. USHORT usWeekday; // range [0..6] == [Sunday..Saturday]
  2149. } ENG_TIME_FIELDS, *PENG_TIME_FIELDS;
  2150. VOID EngQueryLocalTime(
  2151. PENG_TIME_FIELDS);
  2152. FD_GLYPHSET *
  2153. APIENTRY
  2154. EngComputeGlyphSet(
  2155. INT nCodePage,
  2156. INT nFirstChar,
  2157. INT cChars
  2158. );
  2159. INT
  2160. APIENTRY
  2161. EngMultiByteToWideChar(
  2162. UINT CodePage,
  2163. LPWSTR WideCharString,
  2164. INT BytesInWideCharString,
  2165. LPSTR MultiByteString,
  2166. INT BytesInMultiByteString
  2167. );
  2168. INT
  2169. APIENTRY
  2170. EngWideCharToMultiByte(
  2171. UINT CodePage,
  2172. LPWSTR WideCharString,
  2173. INT BytesInWideCharString,
  2174. LPSTR MultiByteString,
  2175. INT BytesInMultiByteString
  2176. );
  2177. VOID
  2178. APIENTRY
  2179. EngGetCurrentCodePage(
  2180. PUSHORT OemCodePage,
  2181. PUSHORT AnsiCodePage
  2182. );
  2183. HANDLE
  2184. APIENTRY
  2185. EngLoadModuleForWrite(
  2186. LPWSTR pwsz,
  2187. ULONG cjSizeOfModule
  2188. );
  2189. BOOL
  2190. APIENTRY
  2191. EngGetFileChangeTime(
  2192. HANDLE h,
  2193. LARGE_INTEGER *pChangeTime
  2194. );
  2195. LPWSTR
  2196. APIENTRY
  2197. EngGetFilePath(
  2198. HANDLE h
  2199. );
  2200. ULONG
  2201. APIENTRY
  2202. EngSaveFloatingPointState(
  2203. VOID *pBuffer,
  2204. ULONG cjBufferSize
  2205. );
  2206. BOOL
  2207. APIENTRY
  2208. EngRestoreFloatingPointState(
  2209. VOID *pBuffer
  2210. );
  2211. //
  2212. // DirectDraw surface locking
  2213. //
  2214. PDD_SURFACE_LOCAL
  2215. APIENTRY
  2216. EngLockDirectDrawSurface(
  2217. HANDLE hSurface
  2218. );
  2219. BOOL
  2220. APIENTRY
  2221. EngUnlockDirectDrawSurface(
  2222. PDD_SURFACE_LOCAL pSurface
  2223. );
  2224. //
  2225. // Engine Event support.
  2226. //
  2227. //
  2228. // Opaque type for event objects.
  2229. //
  2230. typedef struct _PENG_EVENT * PEVENT;
  2231. //
  2232. // This routine can only be called on PEVENTS returned from EngCreateEvent()
  2233. // and must not be called on PEVENTs returned from EngMapEvent().
  2234. //
  2235. BOOL
  2236. EngDeleteEvent(
  2237. IN PEVENT pEngEvent
  2238. );
  2239. BOOL
  2240. EngCreateEvent(
  2241. OUT PEVENT * ppEngEvent
  2242. );
  2243. //
  2244. // This routine must be called by Display driver process terminate. This routine can only
  2245. // be called on pEvent PEVENTs returned by EngMapEvent(). It must not be called on
  2246. // pEvents returned via EngCreateEvent(). It must not be called in the PDRVCLEANPROC typed
  2247. // below
  2248. //
  2249. BOOL
  2250. EngUnmapEvent(
  2251. IN HDRVOBJ pDrvObj
  2252. );
  2253. //
  2254. // PDRVCLEANPROC pDrvCleanProc - Pointer to function to be called
  2255. // when the process in whose context this event was mapped
  2256. // terminates. It is a requirement that EngUnmapEvent not be called
  2257. // in this routine.
  2258. //
  2259. typedef
  2260. BOOLEAN
  2261. (*PDRVCLEANPROC)(
  2262. PVOID pDriverCleanupContext
  2263. );
  2264. //
  2265. // Can be called by Display driver. This routine returns a valid HDRVOBJ if
  2266. // successful, NULL otherwise.
  2267. //
  2268. // Arguments:
  2269. // HDEV hDev - Device handle.
  2270. // HANDLE hUserObject - user mode HANDLE to event.
  2271. // PEVENT * ppEvent - Pointer to ENG_EVENT to be filled.
  2272. // No waiting is allowed on mapped events.
  2273. // PDRVCLEANPROC pDrvCleanProc - Pointer to function to be called
  2274. // when the process in whose context this event was mapped
  2275. // terminates. It is a requirement that EngUnmapEvent not be called
  2276. // in this routine.
  2277. // PVOID pCleanupContext - Pointer to driver managed resource
  2278. // passed to pEventDeleteProc at process termination.
  2279. //
  2280. // Returns:
  2281. // HDRVOBJ - a handle to a DRVOBJ. Important: if the driver wishes to do
  2282. // cleanup itself, it must call EngUnmapEvent on the HDRVOBJ returned
  2283. // from this routine.
  2284. //
  2285. HDRVOBJ
  2286. EngMapEvent(
  2287. IN HDEV hDev,
  2288. IN HANDLE hUserObject,
  2289. OUT PEVENT * ppEvent,
  2290. IN PDRVCLEANPROC pDrvUnmapProc,
  2291. IN PVOID pDrvUnmapContext
  2292. );
  2293. //
  2294. // May be called by Display driver. Can only be called on events created by
  2295. // the Display driver, not on mapped events. Returns TRUE if successful,
  2296. // FALSE otherwise. FALSE indicates an invalid parameter, which must not
  2297. // be used again.
  2298. //
  2299. BOOL
  2300. EngWaitForSingleObject(
  2301. IN PEVENT pEngEvent,
  2302. IN PLARGE_INTEGER pTimeOut
  2303. );
  2304. //
  2305. // PUBLIC, called by Display driver.
  2306. // Private info: Basically a wrapper for KeSetEvent(). Can be called on
  2307. // created or mapped events. Returns TRUE if successful, FALSE otherwise.
  2308. // FALSE indicates an invalid parameter, which must not be used again.
  2309. //
  2310. BOOL
  2311. EngSetEvent(
  2312. IN PEVENT pEngEvent
  2313. );
  2314. #endif // _WINDDI_