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.

748 lines
26 KiB

  1. /****************************************************************************/
  2. // aordprot.h
  3. //
  4. // Generic order transmission protocol structures
  5. //
  6. // Copyright(c) Microsoft, PictureTel 1993-1996
  7. // Copyright(c) Microsoft 1997-1999
  8. /****************************************************************************/
  9. #ifndef _H_AORDPROT
  10. #define _H_AORDPROT
  11. /****************************************************************************/
  12. /* All rectangles are inclusive of start and end points. */
  13. /* */
  14. /* All points are in screen coordinates, with (0,0) at top left. */
  15. /* */
  16. /* Interpretation of individual field values is as in Windows */
  17. /* in particular pens, brushes and font are as defined for Windows 3.1 */
  18. /****************************************************************************/
  19. /****************************************************************************/
  20. // NUM_XXX_FIELDS is a constant used to determine the number of bytes used
  21. // for field flags. Must not exceed (TS_MAX_ENC_FIELDS - 1) -- one is added
  22. // to the constant before dividing by 8 for historical reasons.
  23. //
  24. // MAX_XXX_FIELD_SIZE is a constant used to estimate order-heap-to-
  25. // network-buffer translation size. It is the maximum size of all the fields
  26. // of the order as defined in its translation table in oe2data.c.
  27. /****************************************************************************/
  28. #define ORD_LEVEL_1_ORDERS 1
  29. /****************************************************************************/
  30. // Maximum-sized intermediate order representation.
  31. /****************************************************************************/
  32. #define MAX_ORDER_INTFMT_SIZE sizeof(MULTI_PATBLT_ORDER)
  33. /****************************************************************************/
  34. /* */
  35. /* Support for Multiple Clipping Rectangles in one Order */
  36. /* */
  37. /****************************************************************************/
  38. /* The maximum number of clipping rectangles we encode. */
  39. /****************************************************************************/
  40. #define ORD_MAX_ENCODED_CLIP_RECTS 45
  41. /****************************************************************************/
  42. /* Max # of bytes needed to encode the max # of points, which is */
  43. /* - 2 bytes per co-ord */
  44. /* - 4 coords per rectangle */
  45. /****************************************************************************/
  46. #define ORD_MAX_CLIP_RECTS_CODEDDELTAS_LEN \
  47. (ORD_MAX_ENCODED_CLIP_RECTS * 2 * 4)
  48. /****************************************************************************/
  49. /* Max # of bytes used to encode zero flags for the number of entries */
  50. /* above. In caclulating this number we allow for */
  51. /* - one bit for each coordinate to signal that the corresponding entry is */
  52. /* absent and zero */
  53. /* - four coordinates per rectangle */
  54. /* - rounding up to a whole number of bytes */
  55. /****************************************************************************/
  56. #define ORD_MAX_CLIP_RECTS_ZERO_FLAGS_BYTES \
  57. (((ORD_MAX_ENCODED_CLIP_RECTS * 4) + 7) / 8)
  58. // Maximum size of wire-format encoding for a delta list. Includes the
  59. // 2-byte length count and max size of max number of rects and zero flags.
  60. #define MAX_CLIPRECTS_FIELD_SIZE (sizeof(UINT16) + \
  61. ORD_MAX_CLIP_RECTS_CODEDDELTAS_LEN + \
  62. ORD_MAX_CLIP_RECTS_ZERO_FLAGS_BYTES)
  63. // Flags used in encode/decode.
  64. #define ORD_CLIP_RECTS_LONG_DELTA 0x80
  65. #define ORD_CLIP_RECTS_XLDELTA_ZERO 0x80
  66. #define ORD_CLIP_RECTS_YTDELTA_ZERO 0x40
  67. #define ORD_CLIP_RECTS_XRDELTA_ZERO 0x20
  68. #define ORD_CLIP_RECTS_YBDELTA_ZERO 0x10
  69. typedef struct _CLIP_RECT_VARIABLE_CODEDDELTALIST
  70. {
  71. UINT32 len; // Byte count of encoded deltas.
  72. /************************************************************************/
  73. /* Leave enough space for the encoded points and the associated */
  74. /* zero-flags. */
  75. /************************************************************************/
  76. BYTE Deltas[ORD_MAX_CLIP_RECTS_CODEDDELTAS_LEN +
  77. ORD_MAX_CLIP_RECTS_ZERO_FLAGS_BYTES];
  78. } CLIP_RECT_VARIABLE_CODEDDELTALIST, *PCLIP_RECT_VARIABLE_CODEDDELTALIST;
  79. /****************************************************************************/
  80. /* DstBlt (Destination only Screen Blt) */
  81. /****************************************************************************/
  82. #define NUM_DSTBLT_FIELDS 5
  83. #define MAX_DSTBLT_FIELD_SIZE 9
  84. typedef struct _DSTBLT_ORDER
  85. {
  86. INT32 nLeftRect; /* x upper left */
  87. INT32 nTopRect; /* y upper left */
  88. INT32 nWidth; /* dest width */
  89. INT32 nHeight; /* dest height */
  90. BYTE bRop; /* ROP */
  91. char pad2[3];
  92. } DSTBLT_ORDER, * LPDSTBLT_ORDER;
  93. /****************************************************************************/
  94. /* MultiDstBlt (DstBlt with multiple clipping rectangles) */
  95. /****************************************************************************/
  96. #define NUM_MULTI_DSTBLT_FIELDS 7
  97. #define MAX_MULTI_DSTBLT_FIELD_SIZE (MAX_DSTBLT_FIELD_SIZE + 1 + \
  98. MAX_CLIPRECTS_FIELD_SIZE)
  99. #define MAX_MULTI_DSTBLT_FIELD_SIZE_NCLIP(_NumClipRects) \
  100. (MAX_DSTBLT_FIELD_SIZE + 1 + (((_NumClipRects) + 1) / 2) + \
  101. (8 * (_NumClipRects)))
  102. typedef struct _MULTI_DSTBLT_ORDER
  103. {
  104. INT32 nLeftRect; /* x upper left */
  105. INT32 nTopRect; /* y upper left */
  106. INT32 nWidth; /* dest width */
  107. INT32 nHeight; /* dest height */
  108. BYTE bRop; /* ROP */
  109. char pad2[3];
  110. UINT32 nDeltaEntries; /* Sized to contain max num of entries */
  111. CLIP_RECT_VARIABLE_CODEDDELTALIST
  112. codedDeltaList; /* Contains encoded points */
  113. } MULTI_DSTBLT_ORDER, * LPMULTI_DSTBLT_ORDER;
  114. /****************************************************************************/
  115. /* PatBlt (Pattern to Screen Blt) */
  116. /****************************************************************************/
  117. #define NUM_PATBLT_FIELDS 12
  118. #define MAX_PATBLT_FIELD_SIZE 26
  119. typedef struct _PATBLT_ORDER
  120. {
  121. INT32 nLeftRect; /* x upper left */
  122. INT32 nTopRect; /* y upper left */
  123. INT32 nWidth; /* dest width */
  124. INT32 nHeight; /* dest height */
  125. UINT32 bRop; /* ROP */
  126. DCCOLOR BackColor;
  127. char pad2;
  128. DCCOLOR ForeColor;
  129. char pad3;
  130. INT32 BrushOrgX;
  131. INT32 BrushOrgY;
  132. UINT32 BrushStyle;
  133. UINT32 BrushHatch;
  134. BYTE BrushExtra[7];
  135. char pad4;
  136. } PATBLT_ORDER, *LPPATBLT_ORDER;
  137. /****************************************************************************/
  138. /* MultiPatBlt (Pattern to Screen Blt with multiple clipping rectangles) */
  139. /****************************************************************************/
  140. #define NUM_MULTI_PATBLT_FIELDS 14
  141. #define MAX_MULTI_PATBLT_FIELD_SIZE (MAX_PATBLT_FIELD_SIZE + 1 + \
  142. MAX_CLIPRECTS_FIELD_SIZE)
  143. #define MAX_MULTI_PATBLT_FIELD_SIZE_NCLIP(_NumClipRects) \
  144. (MAX_PATBLT_FIELD_SIZE + 1 + (((_NumClipRects) + 1) / 2) + \
  145. (8 * (_NumClipRects)))
  146. typedef struct _MULTI_PATBLT_ORDER
  147. {
  148. INT32 nLeftRect; /* x upper left */
  149. INT32 nTopRect; /* y upper left */
  150. INT32 nWidth; /* dest width */
  151. INT32 nHeight; /* dest height */
  152. UINT32 bRop; /* ROP */
  153. DCCOLOR BackColor;
  154. char pad2;
  155. DCCOLOR ForeColor;
  156. char pad3;
  157. INT32 BrushOrgX;
  158. INT32 BrushOrgY;
  159. UINT32 BrushStyle;
  160. UINT32 BrushHatch;
  161. BYTE BrushExtra[7];
  162. char pad4;
  163. UINT32 nDeltaEntries; /* Sized to contain max num of entries */
  164. CLIP_RECT_VARIABLE_CODEDDELTALIST
  165. codedDeltaList; /* Contains encoded points */
  166. } MULTI_PATBLT_ORDER, * LPMULTI_PATBLT_ORDER;
  167. /****************************************************************************/
  168. /* ScrBlt (Screen to Screen Blt) */
  169. /****************************************************************************/
  170. #define NUM_SCRBLT_FIELDS 7
  171. #define MAX_SCRBLT_FIELD_SIZE 13
  172. typedef struct _SCRBLT_ORDER
  173. {
  174. INT32 nLeftRect; /* x upper left */
  175. INT32 nTopRect; /* y upper left */
  176. INT32 nWidth; /* dest width */
  177. INT32 nHeight; /* dest height */
  178. UINT32 bRop; /* ROP */
  179. INT32 nXSrc;
  180. INT32 nYSrc;
  181. } SCRBLT_ORDER, *LPSCRBLT_ORDER;
  182. /****************************************************************************/
  183. /* MultiScrBlt (Screen to Screen Blt with multiple clipping rectangles) */
  184. /****************************************************************************/
  185. #define NUM_MULTI_SCRBLT_FIELDS 9
  186. #define MAX_MULTI_SCRBLT_FIELD_SIZE (MAX_SCRBLT_FIELD_SIZE + 1 + \
  187. MAX_CLIPRECTS_FIELD_SIZE)
  188. #define MAX_MULTI_SCRBLT_FIELD_SIZE_NCLIP(_NumClipRects) \
  189. (MAX_SCRBLT_FIELD_SIZE + 1 + (((_NumClipRects) + 1) / 2) + \
  190. (8 * (_NumClipRects)))
  191. typedef struct _MULTI_SCRBLT_ORDER
  192. {
  193. INT32 nLeftRect; /* x upper left */
  194. INT32 nTopRect; /* y upper left */
  195. INT32 nWidth; /* dest width */
  196. INT32 nHeight; /* dest height */
  197. UINT32 bRop; /* ROP */
  198. INT32 nXSrc;
  199. INT32 nYSrc;
  200. UINT32 nDeltaEntries; /* Sized to contain max num of entries */
  201. CLIP_RECT_VARIABLE_CODEDDELTALIST
  202. codedDeltaList; /* Contains encoded points */
  203. } MULTI_SCRBLT_ORDER, * LPMULTI_SCRBLT_ORDER;
  204. /****************************************************************************/
  205. /* LineTo */
  206. /****************************************************************************/
  207. #define NUM_LINETO_FIELDS 10
  208. #define MAX_LINETO_FIELD_SIZE 19
  209. typedef struct _LINETO_ORDER
  210. {
  211. INT32 BackMode; /* background mix mode */
  212. INT32 nXStart; /* x line start */
  213. INT32 nYStart; /* y line start */
  214. INT32 nXEnd; /* x line end */
  215. INT32 nYEnd; /* y line end */
  216. DCCOLOR BackColor; /* background color */
  217. char pad2;
  218. UINT32 ROP2; /* drawing mode */
  219. UINT32 PenStyle;
  220. UINT32 PenWidth; /* always 1 - field retained for */
  221. /* backwards compatibility */
  222. DCCOLOR PenColor;
  223. char pad3;
  224. } LINETO_ORDER, *LPLINETO_ORDER;
  225. /****************************************************************************/
  226. /* OpaqueRect */
  227. /****************************************************************************/
  228. #define NUM_OPAQUERECT_FIELDS 7
  229. #define MAX_OPAQUERECT_FIELD_SIZE 11
  230. typedef struct _OPAQUE_RECT
  231. {
  232. INT32 nLeftRect; /* x upper left */
  233. INT32 nTopRect; /* y upper left */
  234. INT32 nWidth; /* dest width */
  235. INT32 nHeight; /* dest height */
  236. DCCOLOR Color; /* opaque color */
  237. char pad2;
  238. } OPAQUERECT_ORDER, * LPOPAQUERECT_ORDER;
  239. /****************************************************************************/
  240. // MultiOpaqueRect (OpaqueRect with multiple clipping rectangles).
  241. /****************************************************************************/
  242. #define NUM_MULTI_OPAQUERECT_FIELDS 9
  243. #define MAX_MULTI_OPAQUERECT_FIELD_SIZE (MAX_OPAQUERECT_FIELD_SIZE + 1 + \
  244. MAX_CLIPRECTS_FIELD_SIZE)
  245. #define MAX_MULTI_OPAQUERECT_FIELD_SIZE_NCLIP(_NumClipRects) \
  246. (MAX_OPAQUERECT_FIELD_SIZE + 1 + (((_NumClipRects) + 1) / 2) + \
  247. (8 * (_NumClipRects)))
  248. typedef struct _MULTI_OPAQUE_RECT
  249. {
  250. INT32 nLeftRect; /* x upper left */
  251. INT32 nTopRect; /* y upper left */
  252. INT32 nWidth; /* dest width */
  253. INT32 nHeight; /* dest height */
  254. DCCOLOR Color; /* opaque color */
  255. char pad2;
  256. UINT32 nDeltaEntries; /* Sized to contain max num of entries */
  257. CLIP_RECT_VARIABLE_CODEDDELTALIST
  258. codedDeltaList; /* Contains encoded points */
  259. } MULTI_OPAQUERECT_ORDER, * LPMULTI_OPAQUERECT_ORDER;
  260. /****************************************************************************/
  261. /* SaveBitmap (incorporating RestoreBitmap) */
  262. /****************************************************************************/
  263. #define SV_SAVEBITS 0
  264. #define SV_RESTOREBITS 1
  265. #define NUM_SAVEBITMAP_FIELDS 6
  266. #define MAX_SAVEBITMAP_FIELD_SIZE 13
  267. typedef struct _SAVEBITMAP_ORDER
  268. {
  269. UINT32 SavedBitmapPosition;
  270. INT32 nLeftRect; /* x left */
  271. INT32 nTopRect; /* y top */
  272. INT32 nRightRect; /* x right */
  273. INT32 nBottomRect; /* y bottom */
  274. UINT32 Operation; /* SV_xxxxxxxx */
  275. } SAVEBITMAP_ORDER, * LPSAVEBITMAP_ORDER;
  276. /****************************************************************************/
  277. /* Common fields for MEMBLT and MEM3BLT (R2 only - R1 is unused). */
  278. /****************************************************************************/
  279. typedef struct _MEMBLT_COMMON
  280. {
  281. UINT16 cacheId;
  282. UINT16 cacheIndex;
  283. INT32 nLeftRect; /* x upper left */
  284. INT32 nTopRect; /* y upper left */
  285. INT32 nWidth; /* dest width */
  286. INT32 nHeight; /* dest height */
  287. UINT32 bRop; /* ROP */
  288. INT32 nXSrc;
  289. INT32 nYSrc;
  290. } MEMBLT_COMMON, *PMEMBLT_COMMON;
  291. /****************************************************************************/
  292. /* MemBlt (Memory to Screen Blt). "R2" is historical, the rev 1 version was */
  293. /* from an old DCL product, never used in RDP. */
  294. /****************************************************************************/
  295. #define NUM_MEMBLT_FIELDS 9
  296. #define MAX_MEMBLT_FIELD_SIZE 17
  297. typedef struct _MEMBLT_R2_ORDER
  298. {
  299. // This structure needs to be at the same offset as in Mem3Blt_R2.
  300. MEMBLT_COMMON Common;
  301. } MEMBLT_R2_ORDER, *PMEMBLT_R2_ORDER;
  302. /****************************************************************************/
  303. /* Mem3Blt (Memory to Screen Blt with ROP3). "R2" is historical, the rev 1 */
  304. /* version was from an old DCL product, never used in RDP. */
  305. /****************************************************************************/
  306. #define NUM_MEM3BLT_FIELDS 16
  307. #define MAX_MEM3BLT_FIELD_SIZE (MAX_MEMBLT_FIELD_SIZE + 19)
  308. typedef struct _MEM3BLT_R2_ORDER
  309. {
  310. // This structure needs to be at the same offset as in MemBlt_R2.
  311. MEMBLT_COMMON Common;
  312. DCCOLOR BackColor;
  313. char pad1;
  314. DCCOLOR ForeColor;
  315. char pad2;
  316. INT32 BrushOrgX;
  317. INT32 BrushOrgY;
  318. UINT32 BrushStyle;
  319. UINT32 BrushHatch;
  320. BYTE BrushExtra[7];
  321. char pad3;
  322. } MEM3BLT_R2_ORDER, *PMEM3BLT_R2_ORDER;
  323. /****************************************************************************/
  324. // PolyLine - designed to handle sets of connected width-1 cosmetic lines.
  325. /****************************************************************************/
  326. // The maximum number of delta points we encode.
  327. #define ORD_MAX_POLYLINE_ENCODED_POINTS 32
  328. // Max # of bytes needed to encode the max # of points, which is 4 bytes
  329. // each.
  330. #define ORD_MAX_POLYLINE_CODEDDELTAS_LEN (ORD_MAX_POLYLINE_ENCODED_POINTS * 4)
  331. // Max # of bytes used to encode zero flags for the number of entries
  332. // above. Each new point has two bits -- one for each coordinate -- to
  333. // signal that the corresponding entry is absent and zero. Note we must
  334. // round up if max points is not a multiple of 4.
  335. #define ORD_MAX_POLYLINE_ZERO_FLAGS_BYTES \
  336. ((ORD_MAX_POLYLINE_ENCODED_POINTS + 3) / 4)
  337. // This is the equivent set of macros as polyline above, the only difference
  338. // is that we can encode 56 points instead of 32.
  339. #define ORD_MAX_POLYGON_ENCODED_POINTS 56
  340. #define ORD_MAX_POLYGON_CODEDDELTAS_LEN (ORD_MAX_POLYGON_ENCODED_POINTS * 4)
  341. #define ORD_MAX_POLYGON_ZERO_FLAGS_BYTES \
  342. ((ORD_MAX_POLYGON_ENCODED_POINTS + 3) / 4)
  343. // Flags used in encode/decode.
  344. #define ORD_POLYLINE_LONG_DELTA 0x80
  345. #define ORD_POLYLINE_XDELTA_ZERO 0x80
  346. #define ORD_POLYLINE_YDELTA_ZERO 0x40
  347. typedef struct _VARIABLE_CODEDDELTALIST
  348. {
  349. UINT32 len; // Byte count of encoded deltas.
  350. // Leave enough space for the encoded points and the associated
  351. // zero-flags.
  352. BYTE Deltas[ORD_MAX_POLYLINE_CODEDDELTAS_LEN +
  353. ORD_MAX_POLYLINE_ZERO_FLAGS_BYTES];
  354. } VARIABLE_CODEDDELTALIST, *PVARIABLE_CODEDDELTALIST;
  355. #define NUM_POLYLINE_FIELDS 7
  356. #define MAX_POLYLINE_BASE_FIELDS_SIZE 11
  357. #define MAX_POLYLINE_FIELD_SIZE (11 + 1 + ORD_MAX_POLYLINE_CODEDDELTAS_LEN + \
  358. ORD_MAX_POLYLINE_ZERO_FLAGS_BYTES)
  359. typedef struct _POLYLINE_ORDER
  360. {
  361. INT32 XStart; /* x line start */
  362. INT32 YStart; /* y line start */
  363. UINT32 ROP2; /* drawing mode */
  364. UINT32 BrushCacheEntry;
  365. DCCOLOR PenColor;
  366. char pad2;
  367. UINT32 NumDeltaEntries; // Sized to contain max num of entries.
  368. VARIABLE_CODEDDELTALIST CodedDeltaList; // Filled in with encoded points.
  369. } POLYLINE_ORDER, *PPOLYLINE_ORDER;
  370. //
  371. // PolyGon Orders
  372. //
  373. typedef struct _POLYGON_CODEDDELTALIST
  374. {
  375. UINT32 len; // Byte count of encoded deltas.
  376. // Leave enough space for the encoded points and the associated
  377. // zero-flags.
  378. BYTE Deltas[ORD_MAX_POLYGON_CODEDDELTAS_LEN +
  379. ORD_MAX_POLYGON_ZERO_FLAGS_BYTES];
  380. } POLYGON_CODEDDELTALIST, *PPOLYGON_CODEDDELTALIST;
  381. #define NUM_POLYGON_CB_FIELDS 13
  382. #define MAX_POLYGON_CB_FIELD_SIZE (24 + 1 + ORD_MAX_POLYGON_CODEDDELTAS_LEN + \
  383. ORD_MAX_POLYGON_ZERO_FLAGS_BYTES)
  384. #define MAX_POLYGON_CB_BASE_FIELDS_SIZE 24
  385. // polygon order with solid color brush
  386. typedef struct _POLYGON_CB_ORDER
  387. {
  388. INT32 XStart; /* x start point */
  389. INT32 YStart; /* y start point */
  390. UINT32 ROP2; /* drawing mode */
  391. UINT32 FillMode; /* either winding mode or alternate mode */
  392. DCCOLOR BackColor;
  393. char pad2;
  394. DCCOLOR ForeColor;
  395. char pad3;
  396. INT32 BrushOrgX;
  397. INT32 BrushOrgY;
  398. UINT32 BrushStyle;
  399. UINT32 BrushHatch;
  400. BYTE BrushExtra[7];
  401. char pad4;
  402. UINT32 NumDeltaEntries; // Sized to contain max num of entries.
  403. POLYGON_CODEDDELTALIST CodedDeltaList; // Filled in with encoded points.
  404. } POLYGON_CB_ORDER, *PPOLYGON_CB_ORDER;
  405. #define NUM_POLYGON_SC_FIELDS 7
  406. #define MAX_POLYGON_SC_FIELD_SIZE (10 + 1 + ORD_MAX_POLYGON_CODEDDELTAS_LEN + \
  407. ORD_MAX_POLYGON_ZERO_FLAGS_BYTES)
  408. #define MAX_POLYGON_SC_BASE_FIELDS_SIZE 10
  409. // polygon order with color pattern brush
  410. typedef struct _POLYGON_SC_ORDER
  411. {
  412. INT32 XStart; /* x start point */
  413. INT32 YStart; /* y start point */
  414. UINT32 ROP2; /* drawing mode */
  415. UINT32 FillMode; /* either winding mode or alternate mode */
  416. DCCOLOR BrushColor;
  417. char pad2;
  418. UINT32 NumDeltaEntries; // Sized to contain max num of entries.
  419. POLYGON_CODEDDELTALIST CodedDeltaList; // Filled in with encoded points.
  420. } POLYGON_SC_ORDER, *PPOLYGON_SC_ORDER;
  421. //
  422. // Ellipse orders
  423. //
  424. #define NUM_ELLIPSE_SC_FIELDS 7
  425. #define MAX_ELLIPSE_SC_FIELD_SIZE 13
  426. // ellipse order with solid color brush or pen
  427. typedef struct _ELLIPSE_SC_ORDER
  428. {
  429. INT32 LeftRect; // bounding rect
  430. INT32 TopRect;
  431. INT32 RightRect;
  432. INT32 BottomRect;
  433. UINT32 ROP2; // drawing mode
  434. UINT32 FillMode;
  435. DCCOLOR Color; // pen or brush color
  436. char pad1;
  437. } ELLIPSE_SC_ORDER, *PELLIPSE_SC_ORDER;
  438. #define NUM_ELLIPSE_CB_FIELDS 13
  439. #define MAX_ELLIPSE_CB_FIELD_SIZE 27
  440. // ellipse order with color pattern brush
  441. typedef struct _ELLIPSE_CB_ORDER
  442. {
  443. INT32 LeftRect; // bounding rect
  444. INT32 TopRect;
  445. INT32 RightRect;
  446. INT32 BottomRect;
  447. UINT32 ROP2; // drawing mode
  448. UINT32 FillMode;
  449. DCCOLOR BackColor; // pattern brush
  450. char pad2;
  451. DCCOLOR ForeColor;
  452. char pad3;
  453. INT32 BrushOrgX;
  454. INT32 BrushOrgY;
  455. UINT32 BrushStyle;
  456. UINT32 BrushHatch;
  457. BYTE BrushExtra[7];
  458. char pad4;
  459. } ELLIPSE_CB_ORDER, *PELLIPSE_CB_ORDER;
  460. /****************************************************************************/
  461. // Glyph index.
  462. /****************************************************************************/
  463. // Index order fragment add/use encoding values.
  464. #define ORD_INDEX_FRAGMENT_ADD 0xff
  465. #define ORD_INDEX_FRAGMENT_USE 0xfe
  466. // Variable length array used by Glyph indexes.
  467. typedef struct tagVARIABLE_INDEXREC
  468. {
  469. BYTE byte;
  470. } VARIABLE_INDEXREC, * LPVARIABLE_INDEXREC;
  471. // Variable length array used by Glyph indexes.
  472. typedef struct tagVARIABLE_INDEXBYTES
  473. {
  474. UINT32 len; /* array count */
  475. VARIABLE_INDEXREC arecs[255];
  476. } VARIABLE_INDEXBYTES, * LPVARIABLE_INDEXBYTES;
  477. #define NUM_INDEX_FIELDS 22
  478. #define MAX_INDEX_FIELD_SIZE (41 + 1 + 255)
  479. #define MAX_INDEX_FIELD_SIZE_DATASIZE(_DataSize) (41 + 1 + (_DataSize))
  480. typedef struct _INDEX_ORDER
  481. {
  482. BYTE cacheId;
  483. char pad1;
  484. BYTE flAccel;
  485. BYTE ulCharInc;
  486. DCCOLOR BackColor;
  487. char pad2;
  488. DCCOLOR ForeColor;
  489. char pad3;
  490. INT32 BkLeft;
  491. INT32 BkTop;
  492. INT32 BkRight;
  493. INT32 BkBottom;
  494. INT32 OpLeft;
  495. INT32 OpTop;
  496. INT32 OpRight;
  497. INT32 OpBottom;
  498. INT32 x;
  499. INT32 y;
  500. INT32 BrushOrgX;
  501. INT32 BrushOrgY;
  502. UINT32 BrushStyle;
  503. UINT32 BrushHatch;
  504. BYTE BrushExtra[7];
  505. BYTE fOpRedundant;
  506. VARIABLE_INDEXBYTES variableBytes;
  507. } INDEX_ORDER, *LPINDEX_ORDER;
  508. #define NUM_FAST_INDEX_FIELDS 15
  509. #define MAX_FAST_INDEX_FIELD_SIZE (29 + 1 + 255)
  510. #define MAX_FAST_INDEX_FIELD_SIZE_DATASIZE(_DataSize) (29 + 1 + (_DataSize))
  511. typedef struct _FAST_INDEX_ORDER
  512. {
  513. BYTE cacheId;
  514. char pad1;
  515. UINT16 fDrawing;
  516. DCCOLOR BackColor;
  517. char pad2;
  518. DCCOLOR ForeColor;
  519. char pad3;
  520. INT32 BkLeft;
  521. INT32 BkTop;
  522. INT32 BkRight;
  523. INT32 BkBottom;
  524. INT32 OpLeft;
  525. INT32 OpTop;
  526. INT32 OpRight;
  527. INT32 OpBottom;
  528. INT32 x;
  529. INT32 y;
  530. VARIABLE_INDEXBYTES variableBytes;
  531. } FAST_INDEX_ORDER, *LPFAST_INDEX_ORDER;
  532. // Variable length array used by Glyph data.
  533. typedef struct tagVARIABLE_GLYPHBYTES
  534. {
  535. UINT32 len; /* array count */
  536. BYTE glyphData[255];
  537. } VARIABLE_GLYPHBYTES, * LPVARIABLE_GLYPHBYTES;
  538. #define NUM_FAST_GLYPH_FIELDS 15
  539. #define MAX_FAST_GLYPH_FIELD_SIZE (29 + 1 + 255)
  540. #define MAX_FAST_GLYPH_FIELD_SIZE_DATASIZE(_DataSize) (29 + 1 + (_DataSize))
  541. typedef struct _FAST_GLYPH_ORDER
  542. {
  543. BYTE cacheId;
  544. char pad1;
  545. UINT16 fDrawing;
  546. DCCOLOR BackColor;
  547. char pad2;
  548. DCCOLOR ForeColor;
  549. char pad3;
  550. INT32 BkLeft;
  551. INT32 BkTop;
  552. INT32 BkRight;
  553. INT32 BkBottom;
  554. INT32 OpLeft;
  555. INT32 OpTop;
  556. INT32 OpRight;
  557. INT32 OpBottom;
  558. INT32 x;
  559. INT32 y;
  560. VARIABLE_GLYPHBYTES variableBytes;
  561. } FAST_GLYPH_ORDER, *LPFAST_GLYPH_ORDER;
  562. #ifdef DRAW_NINEGRID
  563. /****************************************************************************/
  564. // DrawNineGrid
  565. /****************************************************************************/
  566. #define NUM_DRAWNINEGRID_FIELDS 5
  567. #define MAX_DRAWNINEGRID_FIELD_SIZE 10
  568. typedef struct _DRAWNINEGRID
  569. {
  570. INT32 srcLeft;
  571. INT32 srcTop;
  572. INT32 srcRight;
  573. INT32 srcBottom;
  574. UINT16 bitmapId;
  575. UINT16 pad1;
  576. } DRAWNINEGRID_ORDER, * LPDRAWNINEGRID_ORDER;
  577. /****************************************************************************/
  578. // MultiDrawNineGrid (DrawNineGrid with multiple clipping rectangles).
  579. /****************************************************************************/
  580. #define NUM_MULTI_DRAWNINEGRID_FIELDS 7
  581. #define MAX_MULTI_DRAWNINEGRID_FIELD_SIZE (MAX_DRAWNINEGRID_FIELD_SIZE + 1 + \
  582. MAX_CLIPRECTS_FIELD_SIZE)
  583. #define MAX_MULTI_DRAWNINEGRID_FIELD_SIZE_NCLIP(_NumClipRects) \
  584. (MAX_DRAWNINEGRID_FIELD_SIZE + 1 + (((_NumClipRects) + 1) / 2) + \
  585. (8 * (_NumClipRects)))
  586. typedef struct _MULTI_DRAWNINEGRID_RECT
  587. {
  588. INT32 srcLeft;
  589. INT32 srcTop;
  590. INT32 srcRight;
  591. INT32 srcBottom;
  592. UINT16 bitmapId;
  593. UINT16 pad1;
  594. UINT32 nDeltaEntries; /* Sized to contain max num of entries */
  595. CLIP_RECT_VARIABLE_CODEDDELTALIST
  596. codedDeltaList; /* Contains encoded points */
  597. } MULTI_DRAWNINEGRID_ORDER, * LPMULTI_DRAWNINEGRID_ORDER;
  598. #endif
  599. #endif /* _H_AORDPROT */