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.

539 lines
8.4 KiB

  1. /*+++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. xlgstate.h
  5. Abstract:
  6. Header file for vector graphics state management.
  7. Environment:
  8. Windows Whistler
  9. Revision History:
  10. 03/23/00
  11. Created it.
  12. Note:
  13. 1. Line
  14. Store Windows NT DDI LINEATTRS sturcture information
  15. 2. Brush
  16. Brush type (pattern/solid/hatch)
  17. Hatch brush type
  18. Pattern brush ID
  19. Solid brush color
  20. 3. Clip
  21. Tracks the type of clipping (rectangle/complex).
  22. Clip rectangle
  23. 4. ROP3 or Transparent/Opaque
  24. if a printer supports quaternary raster operation,
  25. ---*/
  26. #ifndef _XLGSTATE_H_
  27. #define _XLGSTATE_H_
  28. //
  29. // LINE
  30. //
  31. #ifdef __cplusplus
  32. typedef enum {
  33. kXLLineJoin_Round = JOIN_ROUND,
  34. kXLLineJoin_Bevel = JOIN_BEVEL,
  35. kXLLineJoin_Miter = JOIN_MITER
  36. } XLLineJoin;
  37. typedef enum {
  38. kXLLineType_LA_GEOMETRIC = LA_GEOMETRIC,
  39. kXLLineType_LA_ALTERNATE = LA_ALTERNATE,
  40. kXLLineType_LA_STARTGAP = LA_STARTGAP,
  41. kXLLineType_LA_STYLED = LA_STYLED
  42. } XLLineType;
  43. typedef enum {
  44. kXLLineEndCapRound = ENDCAP_ROUND,
  45. kXLLineEndCapSquare = ENDCAP_SQUARE,
  46. kXLLineEndCapButt = ENDCAP_BUTT
  47. } XLLineEndCap;
  48. class XLLine
  49. #if DBG
  50. : public XLDebug
  51. #endif
  52. {
  53. SIGNATURE( 'line' )
  54. public:
  55. //
  56. // Constructure/Destructure
  57. //
  58. XLLine::
  59. XLLine( VOID );
  60. XLLine::
  61. XLLine( IN LINEATTRS *plineattrs );
  62. XLLine::
  63. ~XLLine( VOID );
  64. // typedef struct {
  65. // {
  66. // FLONG fl;
  67. // ULONG iJoin;
  68. // ULONG iEndCap;
  69. // FLOAT_LONG elWidth;
  70. // FLOATL eMiterLimit;
  71. // ULONG cstyle;
  72. // PFLOAT_LONG pstyle;
  73. // FLOAT_LONG elStyleState;
  74. // } LINEATTRS, *PLINEATTRS;
  75. #define XLLINE_NONE 0x00000000
  76. #define XLLINE_LINETYPE 0x00000001
  77. #define XLLINE_JOIN 0x00000002
  78. #define XLLINE_ENDCAP 0x00000004
  79. #define XLLINE_WIDTH 0x00000008
  80. #define XLLINE_MITERLIMIT 0x00000010
  81. #define XLLINE_STYLE 0x00000020
  82. DWORD GetDifferentAttribute( IN LINEATTRS* plineattrs );
  83. //
  84. // Reset line
  85. //
  86. VOID ResetLine(VOID);
  87. //
  88. // Attributes set functions
  89. //
  90. //
  91. // Line type
  92. //
  93. HRESULT SetLineType(IN XLLineType LineType );
  94. //
  95. // Line Join
  96. //
  97. HRESULT SetLineJoin( IN XLLineJoin LineJoin );
  98. //
  99. // Line Join
  100. //
  101. HRESULT SetLineEndCap( IN XLLineEndCap LineEndCap );
  102. //
  103. // Line width
  104. //
  105. HRESULT SetLineWidth( IN FLOAT_LONG elWidth );
  106. //
  107. // Line Miter Limit
  108. //
  109. HRESULT SetMiterLimit( IN FLOATL eMiterLimit );
  110. //
  111. // Line style
  112. //
  113. HRESULT SetLineStyle( IN ULONG ulCStyle,
  114. IN PFLOAT_LONG pStyle,
  115. IN FLOAT_LONG elStyleState );
  116. #if DBG
  117. VOID
  118. SetDbgLevel(DWORD dwLevel);
  119. #endif
  120. private:
  121. DWORD m_dwGenFlags;
  122. LINEATTRS m_LineAttrs;
  123. };
  124. #endif
  125. //
  126. // Brush
  127. //
  128. #define BRUSH_SIGNATURE 0x48425658 // XBRH
  129. typedef enum {
  130. kNotInitialized,
  131. kNoBrush,
  132. kBrushTypeSolid,
  133. kBrushTypeHatch,
  134. kBrushTypePattern
  135. } BrushType;
  136. typedef struct {
  137. DWORD dwSig; // Signature BRUSH_SIGNATURE
  138. BrushType BrushType; // Brush type
  139. ULONG ulSolidColor; // BRUSHOBJ.iSolidColor
  140. ULONG ulHatch; // Hatch pattern ID
  141. DWORD dwCEntries; // the number of palette
  142. DWORD dwColor; // RGB from BRUSHOBJ_ulGetBrushColor
  143. DWORD dwPatternBrushID; // Pattern brush ID
  144. } CMNBRUSH, *PCMNBRUSH;
  145. #ifdef __cplusplus
  146. class Brush
  147. #if DBG
  148. : public XLDebug
  149. #endif
  150. {
  151. public:
  152. Brush::
  153. Brush(VOID);
  154. Brush::
  155. ~Brush(VOID);
  156. //
  157. // Current brush interface
  158. //
  159. HRESULT
  160. CheckCurrentBrush( IN BRUSHOBJ *pbo);
  161. //
  162. // Reset Brush
  163. //
  164. VOID ResetBrush(VOID);
  165. HRESULT
  166. SetBrush( IN CMNBRUSH *pbrush);
  167. #if DBG
  168. VOID
  169. SetDbgLevel(DWORD dwLevel);
  170. #endif
  171. private:
  172. //
  173. // Current selected brush
  174. //
  175. CMNBRUSH m_Brush;
  176. };
  177. class XLBrush : public Brush
  178. {
  179. SIGNATURE( 'brsh' )
  180. public:
  181. XLBrush::
  182. XLBrush(VOID){};
  183. XLBrush::
  184. ~XLBrush(VOID){};
  185. };
  186. #endif
  187. //
  188. // XLPen
  189. //
  190. #ifdef __cplusplus
  191. class XLPen : public Brush
  192. {
  193. SIGNATURE( 'pen ' )
  194. public:
  195. XLPen::
  196. XLPen(VOID){};
  197. XLPen::
  198. ~XLPen(VOID){};
  199. };
  200. #endif
  201. //
  202. // XLClip
  203. //
  204. typedef enum {
  205. kNoClip = 0,
  206. kClipTypeRectangle,
  207. kClipTypeComplex
  208. } ClipType;
  209. #define CLIP_SIGNATURE 0x50494c43 // CLIP
  210. typedef struct {
  211. DWORD dwSig; // Signature CLIP_SIGNATURE
  212. RECTL rclClipRect;
  213. ULONG ulUniq;
  214. } UNICLIP, *PUNICLIP;
  215. #ifdef __cplusplus
  216. class XLClip
  217. #if DBG
  218. : public XLDebug
  219. #endif
  220. {
  221. SIGNATURE( 'clip' )
  222. public:
  223. XLClip::
  224. XLClip(VOID);
  225. XLClip::
  226. ~XLClip(VOID);
  227. HRESULT ClearClip(VOID);
  228. HRESULT CheckClip( IN CLIPOBJ *pco );
  229. HRESULT SetClip( IN CLIPOBJ *pco );
  230. #if DBG
  231. VOID
  232. SetDbgLevel(DWORD dwLevel);
  233. #endif
  234. private:
  235. ClipType m_ClipType;
  236. UNICLIP m_XLClip;
  237. };
  238. #endif
  239. //
  240. // XLRop
  241. //
  242. #ifdef __cplusplus
  243. class XLRop
  244. #if DBG
  245. : public XLDebug
  246. #endif
  247. {
  248. SIGNATURE( 'rop ' )
  249. public:
  250. XLRop::
  251. XLRop(VOID);
  252. XLRop::
  253. ~XLRop(VOID);
  254. HRESULT CheckROP3( IN ROP3 rop3 );
  255. HRESULT SetROP3( IN ROP3 rop3 );
  256. #if DBG
  257. VOID
  258. SetDbgLevel(DWORD dwLevel);
  259. #endif
  260. private:
  261. ROP3 m_rop3;
  262. };
  263. #endif
  264. //
  265. // XLFont
  266. //
  267. #ifndef PCLXL_FONTNAME_SIZE
  268. #define PCLXL_FONTNAME_SIZE 16
  269. #endif
  270. #ifdef __cplusplus
  271. typedef enum _FontType {
  272. kFontNone,
  273. kFontTypeDevice,
  274. kFontTypeTTBitmap,
  275. kFontTypeTTOutline
  276. } FontType;
  277. class XLFont
  278. #if DBG
  279. : public XLDebug
  280. #endif
  281. {
  282. SIGNATURE( 'font' )
  283. public:
  284. //
  285. // Constructure/Destructure
  286. //
  287. XLFont::
  288. XLFont( VOID );
  289. XLFont::
  290. ~XLFont( VOID );
  291. //
  292. // font interface
  293. //
  294. HRESULT
  295. CheckCurrentFont(
  296. FontType XLFontType,
  297. PBYTE pPCLXLFontName,
  298. DWORD dwFontHeight,
  299. DWORD dwFontWidth,
  300. DWORD dwFontSymbolSet,
  301. DWORD dwFontSimulation);
  302. HRESULT
  303. SetFont(
  304. FontType XLFontType,
  305. PBYTE pPCLXLFontName,
  306. DWORD dwFontHeight,
  307. DWORD dwFontWidth,
  308. DWORD dwFontSymbolSet,
  309. DWORD dwFontSimulation);
  310. VOID
  311. ResetFont(VOID);
  312. HRESULT
  313. GetFontName(
  314. PBYTE paubFontName);
  315. DWORD
  316. GetFontHeight(VOID);
  317. DWORD
  318. GetFontWidth(VOID);
  319. DWORD
  320. GetFontSymbolSet(VOID);
  321. FontType
  322. GetFontType(VOID);
  323. DWORD
  324. GetFontSimulation(VOID);
  325. #if DBG
  326. VOID
  327. SetDbgLevel(DWORD dwLevel);
  328. #endif
  329. private:
  330. FontType m_XLFontType;
  331. BYTE m_aubFontName[PCLXL_FONTNAME_SIZE+1]; // PCL XL font name
  332. DWORD m_dwFontHeight;
  333. DWORD m_dwFontWidth;
  334. DWORD m_dwFontSymbolSet;
  335. DWORD m_dwFontSimulation;
  336. };
  337. #endif
  338. //
  339. // XLTxMode
  340. //
  341. class XLTxMode
  342. #if DBG
  343. : public XLDebug
  344. #endif
  345. {
  346. SIGNATURE( 'txmd' )
  347. public:
  348. //
  349. // Constructure/Destructure
  350. //
  351. XLTxMode::
  352. XLTxMode( VOID );
  353. XLTxMode::
  354. ~XLTxMode( VOID );
  355. //
  356. // txmode interface
  357. //
  358. HRESULT SetSourceTxMode(TxMode SrcTxMode);
  359. HRESULT SetPaintTxMode(TxMode SrcTxMode);
  360. TxMode GetSourceTxMode();
  361. TxMode GetPaintTxMode();
  362. #if DBG
  363. VOID
  364. SetDbgLevel(DWORD dwLevel);
  365. #endif
  366. private:
  367. TxMode m_SourceTxMode;
  368. TxMode m_PaintTxMode;
  369. };
  370. //
  371. // XLGState
  372. //
  373. typedef enum _PenBrush
  374. {
  375. kPen,
  376. kBrush
  377. } PenBrush;
  378. #ifdef __cplusplus
  379. class XLGState : public XLLine,
  380. public XLBrush,
  381. public XLPen,
  382. public XLClip,
  383. public XLRop,
  384. public XLFont,
  385. public XLTxMode
  386. {
  387. SIGNATURE( 'xlgs' )
  388. public:
  389. XLGState::
  390. XLGState( VOID ){};
  391. XLGState::
  392. ~XLGState( VOID ){};
  393. VOID
  394. ResetGState(VOID);
  395. #if DBG
  396. VOID
  397. SetAllDbgLevel(DWORD dwLevel);
  398. #endif
  399. };
  400. #endif
  401. #endif // _XLGSTATE_H_