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.

286 lines
5.7 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. xlpdev.h
  5. Abstract:
  6. PCL XL module PDEV header file
  7. Environment:
  8. Windows Whistler
  9. Revision History:
  10. 03/23/00
  11. Created it.
  12. --*/
  13. #ifndef _XLPDEV_H_
  14. #define _XLPDEV_H_
  15. #include "lib.h"
  16. #include "winnls.h"
  17. #include "unilib.h"
  18. #include "prntfont.h"
  19. #include "gpd.h"
  20. #include "mini.h"
  21. #include "winres.h"
  22. #include "pdev.h"
  23. #include "cmnhdr.h"
  24. //
  25. // Debug text.
  26. //
  27. #if DBG
  28. #define ERRORTEXT(s) __TEXT("ERROR ") DLLTEXT(s)
  29. #define XL_DBGMSG(level, prefix, msg) { \
  30. if (this->m_dbglevel <= (level)) { \
  31. DbgPrint("%s %s (%d): ", prefix, __FILE__, __LINE__); \
  32. DbgPrint msg; \
  33. } \
  34. }
  35. #define XL_DBGPRINT(level, msg) { \
  36. if (this->m_dbglevel <= (level)) { \
  37. DbgPrint msg; \
  38. } \
  39. }
  40. #define XL_VERBOSE(msg) XL_DBGPRINT(DBG_VERBOSE, msg)
  41. #define XL_TERSE(msg) XL_DBGPRINT(DBG_TERSE, msg)
  42. #define XL_WARNING(msg) XL_DBGMSG(DBG_WARNING, "WRN", msg)
  43. #define XL_ERR(msg) XL_DBGMSG(DBG_ERROR, "ERR", msg)
  44. #else
  45. #define XL_VERBOSE(msg)
  46. #define XL_TERSE(msg)
  47. #define XL_WARNING(msg)
  48. #define XL_ERR(msg)
  49. #endif
  50. typedef ULONG ROP3;
  51. typedef struct tag_OEMUD_EXTRADATA {
  52. OEM_DMEXTRAHEADER dmExtraHdr;
  53. } OEMUD_EXTRADATA, *POEMUD_EXTRADATA;
  54. //
  55. // OEM Signature and version.
  56. //
  57. #define OEM_SIGNATURE 'PCLX' // Declaser series dll
  58. #define DLLTEXT(s) __TEXT("PCLXL: ") __TEXT(s)
  59. #define OEM_VERSION 0x00010000L
  60. //
  61. // Master Unit
  62. //
  63. #define MASTER_UNIT 1200
  64. //
  65. // Device font resolution
  66. //
  67. #define DEVICEFONT_UNIT 600
  68. //
  69. // Buffer macros
  70. //
  71. #define INIT_CHAR_NUM 256
  72. //
  73. // Memory allocation
  74. //
  75. #define MemAlloc(size) ((PVOID) LocalAlloc(LMEM_FIXED, (size)))
  76. #define MemAllocZ(size) ((PVOID) LocalAlloc(LPTR, (size)))
  77. #define MemFree(p) { if (p) LocalFree((HLOCAL) (p)); }
  78. //
  79. // Others
  80. //
  81. #define GET_COLOR_TABLE(pxlo) \
  82. (pxlo ?\
  83. (((pxlo)->flXlate & XO_TABLE) ?\
  84. ((pxlo)->pulXlate ? (pxlo)->pulXlate : XLATEOBJ_piVector(pxlo)) :\
  85. NULL) :\
  86. NULL)
  87. //
  88. // OEM UD Type Defines
  89. ////////////////////////////////////////////////////////
  90. //
  91. // Warning: the following enum order must match the order in OEMHookFuncs[].
  92. //
  93. enum {
  94. UD_DrvRealizeBrush,
  95. UD_DrvDitherColor,
  96. UD_DrvCopyBits,
  97. UD_DrvBitBlt,
  98. UD_DrvStretchBlt,
  99. UD_DrvStretchBltROP,
  100. UD_DrvPlgBlt,
  101. UD_DrvTransparentBlt,
  102. UD_DrvAlphaBlend,
  103. UD_DrvGradientFill,
  104. UD_DrvTextOut,
  105. UD_DrvStrokePath,
  106. UD_DrvFillPath,
  107. UD_DrvStrokeAndFillPath,
  108. UD_DrvPaint,
  109. UD_DrvLineTo,
  110. UD_DrvStartPage,
  111. UD_DrvSendPage,
  112. UD_DrvEscape,
  113. UD_DrvStartDoc,
  114. UD_DrvEndDoc,
  115. UD_DrvNextBand,
  116. UD_DrvStartBanding,
  117. UD_DrvQueryFont,
  118. UD_DrvQueryFontTree,
  119. UD_DrvQueryFontData,
  120. UD_DrvQueryAdvanceWidths,
  121. UD_DrvFontManagement,
  122. UD_DrvGetGlyphMode,
  123. MAX_DDI_HOOKS,
  124. };
  125. struct IPrintOemDriverUni;
  126. extern const DWORD dw1BPPPal[];
  127. extern const DWORD dw4BPPPal[];
  128. #define XLBRUSH_SIG 'rblx'
  129. typedef struct _XLBRUSH {
  130. DWORD dwSig;
  131. DWORD dwHatch;
  132. DWORD dwOutputFormat;
  133. DWORD dwPatternID; // Pattern ID. 0 if it's not a pattern.
  134. DWORD dwCEntries;
  135. DWORD dwColor;
  136. DWORD adwColor[1];
  137. } XLBRUSH, *PXLBRUSH;
  138. class XLOutput;
  139. class XLTrueType;
  140. class XLFont;
  141. class XLGlyphCache;
  142. #define XLPDEV_SIG 'dplx'
  143. typedef struct _XLPDEV {
  144. DWORD dwSig;
  145. //
  146. // define whatever needed, such as working buffers, tracking information,
  147. // etc.
  148. //
  149. // UNIDRV PDEV
  150. //
  151. PPDEV pPDev;
  152. //
  153. // General flags
  154. //
  155. DWORD dwFlags;
  156. #define XLPDEV_FLAGS_RESET_FONT 0x00000001
  157. #define XLPDEV_FLAGS_FIRSTPAGE 0x00000002
  158. #define XLPDEV_FLAGS_CHARDOWNLOAD_ON 0x00000004
  159. #define XLPDEV_FLAGS_ENDDOC_CALLED 0x00000008
  160. #define XLPDEV_FLAGS_RESETPDEV_CALLED 0x00000010
  161. #define XLPDEV_FLAGS_STARTPAGE_CALLED 0x00000020
  162. #define XLPDEV_FLAGS_SUBST_TRNCOLOR_WITH_WHITE 0x00000040 //Used in CommonRopBlt when rendering DrvTransparentBlt
  163. //
  164. // Device font data structures
  165. //
  166. DWORD dwcbTransSize;
  167. PTRANSDATA pTransOrg;
  168. DWORD dwcbWidthSize;
  169. PLONG plWidth;
  170. //
  171. // Device font string cache
  172. //
  173. DWORD dwCharCount;
  174. DWORD dwMaxCharCount;
  175. PPOINTL pptlCharAdvance;
  176. PWORD pawChar;
  177. LONG lStartX;
  178. LONG lStartY;
  179. LONG lPrevX;
  180. LONG lPrevY;
  181. #define PCLXL_FONTNAME_SIZE 16
  182. CHAR ubFontName[PCLXL_FONTNAME_SIZE+1];
  183. //
  184. // TrueType font width
  185. //
  186. DWORD dwFixedTTWidth;
  187. //
  188. // Cursor position cache
  189. //
  190. LONG lX;
  191. LONG lY;
  192. //
  193. // Scaled IFIMETRICS.fwdUnitsPerEm.
  194. // IFIMETRICS.fwdMaxCharWidth
  195. //
  196. FWORD fwdUnitsPerEm;
  197. FWORD fwdMaxCharWidth;
  198. //
  199. // Text rotation
  200. //
  201. DWORD dwTextAngle;
  202. //
  203. //
  204. // Brush
  205. //
  206. DWORD dwLastBrushID;
  207. DWORD dwFontHeight;
  208. DWORD dwFontWidth;
  209. DWORD dwTextRes;
  210. //
  211. // TrueType
  212. //
  213. DWORD dwNumOfTTFont;
  214. XLTrueType *pTTFile;
  215. //
  216. // Output
  217. //
  218. XLOutput *pOutput;
  219. //
  220. // Reset font cache
  221. //
  222. XLFont *pXLFont;
  223. //
  224. // Glyph cache
  225. //
  226. XLGlyphCache *pXLGlyph;
  227. //
  228. // Transparent Color
  229. //
  230. ULONG ulTransColor; //Index for palette. Actual for RGB. Used in conjunction with XLPDEV_FLAGS_SUBST_TRNCOLOR_WITH_WHITE
  231. } XLPDEV, *PXLPDEV;
  232. #endif // _XLPDEV_H_