home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c034 / 7.ddi / INCLUDE / PMORD.H$ / PMORD.bin
Encoding:
Text File  |  1989-11-06  |  22.6 KB  |  795 lines

  1. /****************************** Module Header ******************************\
  2. *
  3. * Module Name: PMORD.H
  4. *
  5. * This is the include file which defines all the structures and constants
  6. * that can be used to build or intepret GOCA orders for the GPI
  7. *
  8. * Copyright (c) 1989-1990, Microsoft Corporation.  All rights reserved.
  9. *
  10. * ==========================================================================
  11. *
  12. * The orders fall into 4 categories :-
  13. *
  14. * 1) 1-byte orders
  15. *
  16. * 2) 2-byte orders    - second byte contains the value
  17. *
  18. * 3) Long orders      - second byte gives the order length, subsequent bytes
  19. *            contain the values (up to 256 bytes long)
  20. *
  21. * 4) Very long orders - third and fourth bytes gives the order length,
  22. *            subsequent bytes contain the values (up to 64K long)
  23. *
  24. \***************************************************************************/
  25.  
  26. /***************************************************************************\
  27. *
  28. * Miscellaneous structures used in this file
  29. *
  30. \***************************************************************************/
  31.  
  32. #define PMORD_INCLUDED
  33.  
  34. /* form of RECTL with shorts instead of longs */
  35. typedef struct _RECT1S {    /* rcs */
  36.     SHORT xLeft;
  37.     SHORT yBottom;
  38.     SHORT xRight;
  39.     SHORT yTop;
  40. } RECT1S;
  41.  
  42. /* form of POINTL with 1 byte offsets instead of longs */
  43. typedef struct _ODPOINT {    /* odpt */
  44.     CHAR dx;
  45.     CHAR dy;
  46. } ODPOINT;
  47.  
  48. /* form of SIZEL with shorts instead of longs */
  49. typedef struct _SIZES {     /* sizs */
  50.     SHORT cx;
  51.     SHORT cy;
  52. } SIZES;
  53.  
  54. /* unsigned two-byte swapped integer */
  55. typedef struct _SWPUSHORT {    /* swpus */
  56.     UCHAR HiByte;
  57.     UCHAR LoByte;
  58. } SWPUSHORT;
  59.  
  60. /***************************************************************************\
  61. *
  62. * 1-byte orders
  63. *
  64. \***************************************************************************/
  65.  
  66. /* macro to tell whether this is a 1-byte order */
  67. #define BYTE_ORDER(oc)    ((oc)==OCODE_GNOP1 || (oc)==OCODE_GESD)
  68.  
  69. /* 1-byte order codes */
  70. #define OCODE_GNOP1    0x00        /* No-operation      */
  71. #define OCODE_GESD    0xFF        /* End symbol definition */
  72.  
  73. /***************************************************************************\
  74. *
  75. * 2-byte orders
  76. *
  77. \***************************************************************************/
  78.  
  79. /* definitions to help determine whether an order code is a 2-byte order */
  80. #define OCODE2_1    0x80
  81. #define OCODE2_2    0x88
  82.  
  83. #define SHORT_ORDER(oc) ((((oc)^OCODE2_1)&OCODE2_2)==OCODE2_2)
  84.  
  85. /* General 2-byte order structure */
  86. typedef struct _ORDER {     /* ord */
  87.     UCHAR idCode;
  88.     UCHAR uchData;
  89. } ORDER;
  90.  
  91. /* 2-byte order codes */
  92. #define OCODE_GBAR    0x68        /* Begin area               */
  93. #define OCODE_GCFIG    0x7D        /* Close figure            */
  94. #define OCODE_GEEL    0x49        /* End element               */
  95. #define OCODE_GEPTH    0x7F        /* End path               */
  96. #define OCODE_GEPROL    0x3E        /* End prologue            */
  97. #define OCODE_GPOP    0x3F        /* Pop                   */
  98. #define OCODE_GSBMX    0x0D        /* Set background mix           */
  99. #define OCODE_GPSBMX    0x4D        /* Push & set b/g mix           */
  100. #define OCODE_GSCD    0x3A        /* Set char direction           */
  101. #define OCODE_GPSCD    0x7A        /* Push & set char direction   */
  102. #define OCODE_GSCR    0x39        /* Set char precision           */
  103. #define OCODE_GPSCR    0x79        /* Push & set char precision   */
  104. #define OCODE_GSCS    0x38        /* Set char set            */
  105. #define OCODE_GPSCS    0x78        /* Push & set char set           */
  106. #define OCODE_GSCOL    0x0A        /* Set color               */
  107. #define OCODE_GPSCOL    0x4A        /* Push & set color           */
  108. #define OCODE_GSLE    0x1A        /* Set line end            */
  109. #define OCODE_GPSLE    0x5A        /* Push & set line end           */
  110. #define OCODE_GSLJ    0x1B        /* Set line join           */
  111. #define OCODE_GPSLJ    0x5B        /* Push & set line join        */
  112. #define OCODE_GSLT    0x18        /* Set line type           */
  113. #define OCODE_GPSLT    0x58        /* Push & set line type        */
  114. #define OCODE_GSLW    0x19        /* Set line width           */
  115. #define OCODE_GPSLW    0x59        /* Push & set line width       */
  116. #define OCODE_GSMP    0x3B        /* Set marker precision        */
  117. #define OCODE_GPSMP    0x7B        /* Push & set marker precision */
  118. #define OCODE_GSMS    0x3C        /* Set marker set           */
  119. #define OCODE_GPSMS    0x7C        /* Push & set marker set       */
  120. #define OCODE_GSMT    0x29        /* Set marker symbol           */
  121. #define OCODE_GPSMT    0x69        /* Push & set marker symbol    */
  122. #define OCODE_GSMX    0x0C        /* Set mix               */
  123. #define OCODE_GPSMX    0x4C        /* Push & set mix           */
  124. #define OCODE_GSPS    0x08        /* Set pattern set           */
  125. #define OCODE_GPSPS    0x48        /* Push & set pattern set      */
  126. #define OCODE_GSPT    0x28        /* Set pattern symbol           */
  127. #define OCODE_GPSPT    0x09        /* Push & set pattern symbol   */
  128.  
  129. /* constants for 2-byte orders */
  130.  
  131. /* Begin area */
  132. #define GBAR_RESERVED    0x80
  133. #define GBAR_BOUNDARY    0xC0
  134. #define GBAR_NOBOUNDARY 0x80
  135. #define GBAR_WINDING    0xA0
  136. #define GBAR_ALTERNATE    0x80
  137.  
  138. /* Set Character Precision */
  139. #define GSCR_PRECISION    0x0F
  140.  
  141. /***************************************************************************\
  142. *
  143. * Long orders
  144. *
  145. \***************************************************************************/
  146.  
  147. /* definitions to help determine whether an order code is a long order */
  148.  
  149. #define OCODE_VLONG    0xFE
  150.  
  151. #define LONG_ORDER(oc) (!((oc)==OCODE_VLONG||BYTE_ORDER(oc)||SHORT_ORDER(oc)))
  152.  
  153. /* long order structure */
  154. #define LORDER_ML 253
  155. typedef struct _LORDER {    /* lord */
  156.     UCHAR idCode;
  157.     UCHAR uchLength;
  158.     UCHAR uchData[LORDER_ML];
  159. } LORDER;
  160.  
  161. /* Long orders for which the length of data is normally zero */
  162. #define OCODE_GEAR    0x60        /* End Area               */
  163. #define OCODE_GEIMG    0x93        /* End Image               */
  164.  
  165. /* Long orders for which the data is contained in a type already defined */
  166.  
  167. /* Character String */
  168. #define OCODE_GCCHST    0x83        /* char string at curr posn    */
  169. #define GCCHST_MC    255        /* Max len of string in bytes  */
  170.  
  171. #define OCODE_GCHST    0xC3        /* char string at given pos    */
  172. #define GCHST_SMC    251        /* Max len of string (S)       */
  173. #define GCHST_LMC    247        /* Max len of string (L)       */
  174.  
  175. /* Character String Move */
  176. #define OCODE_GCCHSTM    0xB1        /* char string move at c.p.    */
  177. #define GCCHSTM_MC    255        /* Max len of string in byte   */
  178.  
  179. #define OCODE_GCHSTM    0xF1        /* char string move at g.p.    */
  180. #define GCHSTM_SMC    251        /* Max len of string (S)       */
  181. #define GCHSTM_LMC    247        /* Max len of string (L)       */
  182.  
  183. /* Comment */
  184. #define OCODE_GCOMT    0x01        /* Comment               */
  185. #define GCOMT_ML    255        /* Maximum len of comment data */
  186.  
  187. /* Image */
  188. #define OCODE_GIMD    0x92        /* Image data               */
  189. #define GIMD_ML     255        /* Maximum len of image data   */
  190.  
  191. /* Full Arc */
  192. #define OCODE_GCFARC    0x87        /* full arc at current posn    */
  193. #define OCODE_GFARC    0xC7        /* full arc at given posn      */
  194.  
  195. /* Label */
  196. #define OCODE_GLABL    0xD3        /* Label               */
  197.  
  198. /* Set Current Position */
  199. #define OCODE_GSCP    0x21        /* Set current position        */
  200. #define OCODE_GPSCP    0x61        /* Push and set curr posn      */
  201.  
  202. /* Bezier spline */
  203. #define OCODE_GCBEZ    0xA5        /* Bezier spline at curr pos   */
  204. #define GCBEZ_SMB    21        /* Max number of splines (S)   */
  205. #define GCBEZ_LMB    10        /* Max number of splines (L)   */
  206.  
  207. #define OCODE_GBEZ    0xE5        /* Bezier spline at given pos  */
  208. #define GBEZ_SMB    20        /* Max number of splines (S)   */
  209. #define GBEZ_LMB    10        /* Max number of splines (L)   */
  210.  
  211. /* Fillet */
  212. #define OCODE_GCFLT    0x85        /* fillet at current posn      */
  213. #define GCFLT_SMP    63        /* Max number of points (S)    */
  214. #define GCFLT_LMP    31        /* Max number of points (L)    */
  215.  
  216. #define OCODE_GFLT    0xC5        /* fillet at given position    */
  217. #define GFLT_SMP    62        /* Max number of points (S)    */
  218. #define GFLT_LMP    30        /* Max number of points (L)    */
  219.  
  220. /* Polyline */
  221. #define OCODE_GCLINE    0x81        /* polyline at current posn    */
  222. #define GCLINE_SMP    63        /* Max number of points (S)    */
  223. #define GCLINE_LMP    31        /* Max number of points (L)    */
  224.  
  225. #define OCODE_GLINE    0xC1        /* polyline at given posn      */
  226. #define GLINE_SMP    62        /* Max number of points (S)    */
  227. #define GLINE_LMP    30        /* Max number of points (L)    */
  228.  
  229. /* Polymarker */
  230. #define OCODE_GCMRK    0x82        /* marker at current posn      */
  231. #define GCMRK_SMP    63        /* Max number of points (S)    */
  232. #define GCMRK_LMP    31        /* Max number of points (L)    */
  233.  
  234. #define OCODE_GMRK    0xC2        /* marker at given posn        */
  235. #define GMRK_SMP    62        /* Max number of points (S)    */
  236. #define GMRK_LMP    30        /* Max number of points (L)    */
  237.  
  238. /* Relative Line */
  239. #define OCODE_GCRLINE    0xA1        /* Relative line at curr pos   */
  240. #define GCRLINE_MP    127        /* Max number of points        */
  241.  
  242. #define OCODE_GRLINE    0xE1        /* Relative line at givn pos   */
  243. #define GRLINE_SMP    125        /* Max number of points (S)    */
  244. #define GRLINE_LMP    123        /* Max number of points (L)    */
  245.  
  246. /* Set Background Color */
  247. #define OCODE_GSBCOL    0x25        /* Set background color        */
  248. #define OCODE_GPSBCOL    0x65        /* Push and set b/g color      */
  249.  
  250. /* Set Extended Color */
  251. #define OCODE_GSECOL    0x26        /* Set extended color           */
  252. #define OCODE_GPSECOL    0x66        /* Push and set ext color      */
  253.  
  254. /* Extended Color values */
  255. #define SECOL_DEFAULT0    0x0000
  256. #define SECOL_DEFAULT1    0xFF00
  257. #define SECOL_NEUTRAL    0xFF07
  258. #define SECOL_RESET    0xFF08
  259.  
  260. /* Set Character Angle */
  261. #define OCODE_GSCA    0x34        /* Set character angle           */
  262. #define OCODE_GPSCA    0x74        /* Push and set char angle     */
  263.  
  264. /* Set Character Shear */
  265. #define OCODE_GSCH    0x35        /* Set character shear           */
  266. #define OCODE_GPSCH    0x75        /* Push and set char shear     */
  267.  
  268. /* Set Fractional Line Width */
  269. #define OCODE_GSFLW    0x11        /* Set fractional line width   */
  270. #define OCODE_GPSFLW    0x51        /* Push and set frac l width   */
  271.  
  272. /* Set Pick Identifier */
  273. #define OCODE_GSPIK    0x43        /* Set pick identifier           */
  274. #define OCODE_GPSPIK    0x23        /* Push and set pick id        */
  275.  
  276.  
  277. /* Long Orders for which a structure can be defined for the data */
  278.  
  279. /* Arc */
  280. #define OCODE_GCARC    0x86        /* Arc at Current Position     */
  281. #define OCODE_GARC    0xC6        /* Arc at Given Position       */
  282.  
  283. typedef struct _ORDERS_GCARC {    /* osgcarc */
  284.     POINTS ptInter;
  285.     POINTS ptEnd;
  286. } ORDERS_GCARC;
  287.  
  288. typedef struct _ORDERL_GCARC {    /* olgcarc */
  289.     POINTL ptInter;
  290.     POINTL ptEnd;
  291. } ORDERL_GCARC;
  292.  
  293. /* Begin Element */
  294. #define OCODE_GBEL    0xD2    /* Begin Element           */
  295.  
  296. #define GBEL_DL     251
  297. typedef struct _ORDER_GBEL {    /* ogbel */
  298.     LONG lElementType;
  299.     CHAR achDesc[GBEL_DL];
  300. } ORDER_GBEL;
  301.  
  302. /* Begin Image */
  303. #define OCODE_GCBIMG    0x91        /* Begin Image at curr posn    */
  304. #define OCODE_GBIMG    0xD1        /* Begin Image at given posn   */
  305.  
  306. typedef struct _ORDER_GCBIMG {    /* ogbimg */
  307.     UCHAR      uchFormat;
  308.     UCHAR      uchReserved;
  309.     SWPUSHORT cx;
  310.     SWPUSHORT cy;
  311. } ORDER_GCBIMG;
  312.  
  313. /* Begin Path */
  314. #define OCODE_GBPTH    0xD0        /* Begin Path               */
  315.  
  316. typedef struct _ORDER_GBPTH {    /* ogbpth */
  317.     USHORT usReserved;
  318.     LONG   idPath;
  319. } ORDER_GBPTH;
  320.  
  321. /* Box */
  322. #define OCODE_GCBOX    0x80        /* Box at current position     */
  323. #define OCODE_GBOX    0xC0        /* Box at given position       */
  324.  
  325. typedef struct _ORDERS_GCBOX {    /* osgcbox */
  326.     UCHAR  fbFlags;
  327.     UCHAR  uchReserved;
  328.     POINTS ptCorner;
  329.     SHORT  hAxis;
  330.     SHORT  vAxis;
  331. } ORDERS_GCBOX;
  332.  
  333. typedef struct _ORDERL_GCBOX {  /* olgcbox */
  334.     UCHAR  fbFlags;
  335.     UCHAR  uchReserved;
  336.     POINTL ptCorner;
  337.     LONG   hAxis;
  338.     LONG   vAxis;
  339. } ORDERL_GCBOX;
  340.  
  341. #define GCBOX_FILL    0x40
  342. #define GCBOX_BOUNDARY    0x20
  343.  
  344. /* Call Segment */
  345. #define OCODE_GCALLS    0x07        /* call segment            */
  346.  
  347. typedef struct _ORDER_GCALLS {  /* ogcalls */
  348.     USHORT sReserved;
  349.     LONG   idSegment;
  350. } ORDER_GCALLS;
  351.  
  352. /* Fill Path */
  353. #define OCODE_GFPTH    0xD7        /* Fill path               */
  354. typedef struct _ORDER_GFPTH {  /* ogfpth */
  355.     UCHAR  fbFlags;
  356.     UCHAR  uchReserved;
  357.     LONG   idPath;
  358. } ORDER_GFPTH;
  359.  
  360. #define GFPTH_ALTERNATE 0x00
  361. #define GFPTH_WINDING   0x40
  362. #define GFPTH_MODIFY    0x20
  363.  
  364. /* Outline Path */
  365. #define OCODE_GOPTH    0xD4            /* Outline Path                */
  366. typedef struct _ORDER_GOPTH {  /* ogopth */
  367.     UCHAR  fbFlags;
  368.     UCHAR  uchReserved;
  369.     LONG   idPath;
  370. } ORDER_GOPTH;
  371.  
  372. /* Modify Path */
  373. #define OCODE_GMPTH 0xD8               /* modify path                 */
  374.  
  375. typedef struct _ORDER_GMPTH {   /* ogmpth */
  376.     UCHAR  uchMode;
  377.     UCHAR  uchReserved;
  378.     LONG   idPath;
  379. } ORDER_GMPTH;
  380.  
  381. #define GMPTH_STROKE    0x06
  382.  
  383. /* Partial Arc */
  384. #define OCODE_GCPARC   0xA3            /* Partial arc at curr posn    */
  385. #define OCODE_GPARC    0xE3            /* Partial arc at given posn   */
  386.  
  387. typedef struct _ORDERS_GCPARC { /* osgcparc */
  388.     POINTS     ptCenter;
  389.     FIXED88  ufx88Multiplier;
  390.     LONG     usStartAngle;
  391.     LONG     usSweepAngle;
  392. } ORDERS_GCPARC;
  393.  
  394. typedef struct _ORDERL_GCPARC { /* olgcparc */
  395.     POINTL     ptCenter;
  396.     FIXED     ufxMultiplier;
  397.     LONG     usStartAngle;
  398.     LONG     usSweepAngle;
  399. } ORDERL_GCPARC;
  400.  
  401. /* Set Clip Path */
  402. #define OCODE_GSCPTH   0xB4            /* Set clip path               */
  403.  
  404. typedef struct _ORDER_GSCPTH {  /* ogscpth */
  405.     UCHAR  fbFlags;
  406.     UCHAR  uchReserved;
  407.     LONG   idPath;
  408. } ORDER_GSCPTH;
  409.  
  410. #define GSCPTH_ALTERNATE 0x00
  411. #define GSCPTH_WINDING   0x40
  412. #define GSCPTH_RESET     0x00
  413. #define GSCPTH_INTERSECT 0x20
  414.  
  415. /* Set Arc Parameters */
  416. #define OCODE_GSAP     0x22            /* Set arc parameters          */
  417. #define OCODE_GPSAP    0x62            /* Push and set arc params     */
  418.  
  419. typedef struct _ORDERS_GSAP {   /* osgsap */
  420.     SHORT  p;
  421.     SHORT  q;
  422.     SHORT  r;
  423.     SHORT  s;
  424. } ORDERS_GSAP;
  425.  
  426. typedef struct _ORDERL_GSAP {   /* olgsap */
  427.     LONG   p;
  428.     LONG   q;
  429.     LONG   r;
  430.     LONG   s;
  431. } ORDERL_GSAP;
  432.  
  433. /* Set Background Indexed Color */
  434. #define OCODE_GSBICOL  0xA7            /* Set b/g indexed color       */
  435. #define OCODE_GPSBICOL 0xE7            /* Push and set b/g ind color  */
  436. #define OCODE_GSICOL   0xA6            /* Set indexed color           */
  437. #define OCODE_GPSICOL  0xE6            /* Push and set indexd color   */
  438.  
  439. typedef struct _ORDER_GSBICOL { /* ogbicol */
  440.     UCHAR  fbFlags;
  441.     UCHAR  auchColor[3];
  442. } ORDER_GSBICOL;
  443.  
  444. #define SICOL_SPECIFY  0x00
  445. #define SICOL_SPECIAL  0x40
  446. #define SICOL_DEFAULT  0x80
  447. #define SICOL_BLACK    1
  448. #define SICOL_WHITE    2
  449. #define SICOL_ONES     4
  450. #define SICOL_ZEROES   5
  451.  
  452. /* Set Character Cell */
  453. #define OCODE_GSCC     0x33            /* Set character cell          */
  454. #define OCODE_GPSCC    0x03            /* Push and set char cell      */
  455.  
  456. typedef struct _ORDERS_GSCC {   /* osgscc */
  457.     SHORT  cxInt;
  458.     SHORT  cyInt;
  459.     USHORT cxFract;
  460.     USHORT cyFract;
  461.     UCHAR  fbFlags;
  462.     UCHAR  uchReserved;
  463. } ORDERS_GSCC;
  464.  
  465. typedef struct _ORDERL_GSCC {   /* olgscc */
  466.     LONG   cxInt;
  467.     LONG   cyInt;
  468.     USHORT cxFract;
  469.     USHORT cyFract;
  470.     UCHAR  fbFlags;
  471.     UCHAR  uchReserved;
  472. } ORDERL_GSCC;
  473.  
  474. #define GSCC_ZERODEF   0x00
  475. #define GSCC_ZEROZERO  0x80
  476.  
  477. /* Set Marker Cell */
  478. #define OCODE_GSMC     0x37            /* Set marker cell             */
  479. #define OCODE_GPSMC    0x77            /* Push and set marker cell    */
  480.  
  481. typedef struct _ORDERS_GSMC {   /* osgsmc */
  482.     SHORT  cx;
  483.     SHORT  cy;
  484.     UCHAR  fbFlags;
  485.     UCHAR  uchReserved;
  486. } ORDERS_GSMC;
  487.  
  488. typedef struct _ORDERL_GSMC {   /* olgsmc */
  489.     LONG   cx;
  490.     LONG   cy;
  491.     UCHAR  fbFlags;
  492.     UCHAR  uchReserved;
  493. } ORDERL_GSMC;
  494.  
  495. #define GSMC_ZERODEF   0x00
  496. #define GSMC_ZEROZERO  0x80
  497.  
  498. /* Set Pattern Reference Point */
  499. #define OCODE_GSPRP    0xA0            /* Set pattern ref point       */
  500. #define OCODE_GPSPRP   0xE0            /* Push and set patt ref pt    */
  501.  
  502. typedef struct _ORDERS_GSPRP {  /* osgsprp */
  503.     UCHAR fbFlags;
  504.     UCHAR uchReserved;
  505.     POINTS ptPos;
  506. } ORDERS_GSPRP;
  507.  
  508. typedef struct _ORDERL_GSPRP {  /* olgsprp */
  509.     UCHAR fbFlags;
  510.     UCHAR uchReserved;
  511.     POINTL ptPos;
  512. } ORDERL_GSPRP;
  513.  
  514. #define GSPRP_DEFAULT  0x80
  515. #define GSPRP_SPECIFY  0x00
  516.  
  517.  
  518. /* Set Individual Attribute */
  519. #define OCODE_GSIA     0x14            /* Set individual attribute    */
  520. #define OCODE_GPSIA    0x54            /* Push and set ind attr       */
  521.  
  522. #define GSIA_VL 3
  523. typedef struct _ORDER_GSIA {    /* ogsia */
  524.     UCHAR  uchAttrType;
  525.     UCHAR  uchPrimType;
  526.     UCHAR  fbFlags;
  527.     UCHAR  auchValue[GSIA_VL];
  528. } ORDER_GSIA;
  529.  
  530. #define GSIA_COLOR     0x01
  531. #define GSIA_BCOLOR    0x02
  532. #define GSIA_MIX       0x03
  533. #define GSIA_BMIX      0x04
  534. #define GSIA_LINE      0x01
  535. #define GSIA_CHAR      0x02
  536. #define GSIA_MARKER    0x03
  537. #define GSIA_PATTERN   0x04
  538. #define GSIA_IMAGE     0x05
  539. #define GSIA_SPECIFY   0x00
  540. #define GSIA_SPECIAL   0x40
  541. #define GSIA_DEFAULT   0x80
  542. #define GSIA_BLACK     1
  543. #define GSIA_WHITE     2
  544. #define GSIA_ONES      4
  545. #define GSIA_ZEROES    5
  546.  
  547.  
  548. /* Set Model /Viewing Transform */
  549. #define OCODE_GSTM     0x24            /* Set model transform         */
  550. #define OCODE_GPSTM    0x64            /* Push and set model tfm      */
  551.  
  552. #define OCODE_GSTV     0x31            /* Set Viewing Transform       */
  553.  
  554. #define GSTM_ML        16
  555. typedef struct _ORDERS_GSTM {    /* osgstm */
  556.     UCHAR  uchReserved;
  557.     UCHAR  fbFlags;
  558.     USHORT fsMask;
  559.     SHORT  asMatrix[GSTM_ML];
  560. } ORDERS_GSTM;
  561.  
  562. typedef struct _ORDERL_GSTM {    /* olgstm */
  563.     UCHAR  uchReserved;
  564.     UCHAR  fbFlags;
  565.     USHORT fsMask;
  566.     LONG   alMatrix[GSTM_ML];
  567. } ORDERL_GSTM;
  568.  
  569. #define GSTM_M11     0x8000
  570. #define GSTM_M12     0x4000
  571. #define GSTM_M13     0x2000
  572. #define GSTM_M14     0x1000
  573. #define GSTM_M21     0x0800
  574. #define GSTM_M22     0x0400
  575. #define GSTM_M23     0x0200
  576. #define GSTM_M24     0x0100
  577. #define GSTM_M31     0x0080
  578. #define GSTM_M32     0x0040
  579. #define GSTM_M33     0x0020
  580. #define GSTM_M34     0x0010
  581. #define GSTM_M41     0x0008
  582. #define GSTM_M42     0x0004
  583. #define GSTM_M43     0x0002
  584. #define GSTM_M44     0x0001
  585.  
  586. #define GSTM_UNITY     0x00
  587. #define GSTM_AFTER     0x01
  588. #define GSTM_BEFORE    0x02
  589. #define GSTM_OVERWRITE 0x03
  590.  
  591. #define GSTV_OVERWRITE 0x00
  592. #define GSTV_AFTER     0x04
  593.  
  594. /* Set Segment Boundary, Viewing Window */
  595.  
  596. #define OCODE_GSSB     0x32            /* Set segment boundary        */
  597. #define OCODE_GSVW     0x27            /* Set viewing window          */
  598. #define OCODE_GPSVW    0x67            /* Push and set view window    */
  599.  
  600. #define GSSB_ML        4
  601. typedef struct _ORDERS_GSSB {   /* osgssb */
  602.     UCHAR  fbFlags;
  603.     UCHAR  fbMask;
  604.     SHORT  alMatrix[GSSB_ML];
  605. } ORDERS_GSSB;
  606.  
  607. typedef struct _ORDERL_GSSB {   /* olgssb */
  608.     UCHAR  fbFLags;
  609.     UCHAR  fbMask;
  610.     LONG   alMatrix[GSSB_ML];
  611. } ORDERL_GSSB;
  612.  
  613. #define GSSB_XLEFT     0x20
  614. #define GSSB_XRIGHT    0x10
  615. #define GSSB_YBOTTOM   0x08
  616. #define GSSB_YTOP      0x04
  617.  
  618. #define GSVW_INTERSECT 0x00
  619. #define GSVW_REPLACE   0x80
  620.  
  621. /* Set Segment Characteristics */
  622. #define OCODE_GSGCH    0x04            /* Set segment characteristics */
  623.  
  624. #define GSGCH_ML       254
  625. typedef struct _ORDER_GSGCH {   /* ogsgch */
  626.     UCHAR  uchIdent;
  627.     UCHAR  auchData[GSGCH_ML];
  628. } ORDER_GSGCH;
  629.  
  630. /* Set Stroke Line Width */
  631. #define OCODE_GSSLW    0x15            /* Set stroke line width       */
  632. #define OCODE_GPSSLW   0x55            /* Push and set strk l width   */
  633.  
  634. typedef struct _ORDERS_GSSLW {  /* osgsslw */
  635.     UCHAR  fbFlags;
  636.     UCHAR  uchReserved;
  637.     SHORT  LineWidth;
  638. } ORDERS_GSSLW;
  639.  
  640. typedef struct _ORDERL_GSSLW {  /* olgsslw */
  641.     UCHAR  fbFlags;
  642.     UCHAR  uchReserved;
  643.     LONG   LineWidth;
  644. } ORDERL_GSSLW;
  645.  
  646. #define GSSLW_DEFAULT  0x80
  647. #define GSSLW_SPECIFY  0x00
  648.  
  649. /* Sharp Fillet at Current Position */
  650. #define OCODE_GCSFLT   0xA4            /* Sharp fillet at curr pos    */
  651. #define OCODE_GSFLT    0xE4            /* Sharp fillet at given pos   */
  652.  
  653. #define GCSFLT_SMF     21
  654. #define GSFLT_SMF      20
  655.  
  656. typedef struct _ORDERS_GCSFLT { /* osgcsflt */
  657.     POINTS apt[2*GCSFLT_SMF];
  658.     FIXED  afxSharpness[GCSFLT_SMF];
  659. } ORDERS_GCSFLT;
  660.  
  661. #define GCSFLT_LMF     12
  662. #define GSFLT_LMF      12
  663.  
  664. typedef struct _ORDERL_GCSFLT { /* olgcsflt */
  665.     POINTL apt[2*GCSFLT_SMF];
  666.     FIXED  afxSharpness[GCSFLT_SMF];
  667. } ORDERL_GCSFLT;
  668.  
  669. /* Bitblt */
  670. #define OCODE_GBBLT    0xD6            /* Bitblt                      */
  671.  
  672. typedef struct _ORDERS_GBBLT {   /* osgbblt */
  673.     USHORT    fsFlags;
  674.     USHORT    usMix;
  675.     HBITMAP hbmSrc;
  676.     LONG    lOptions;
  677.     RECT1S    rcsTargetRect;
  678.     RECTL    rclSourceRect;
  679. } ORDERS_GBBLT;
  680.  
  681. typedef struct _ORDERL_GBBLT {   /* olgbblt */
  682.     USHORT    fsFlags;
  683.     USHORT    usMix;
  684.     HBITMAP hbmSrc;
  685.     LONG    lOptions;
  686.     RECTL    rclTargetRect;
  687.     RECTL    rclSourceRect;
  688. } ORDERL_GBBLT;
  689.  
  690. /* Escape */
  691. #define OCODE_GESCP    0xD5            /* Escape                      */
  692.  
  693. /*
  694.  * type describes type of escape order, identifier gives the escape
  695.  * order if the type is registered
  696.  */
  697. #define GESCP_ML       253
  698. typedef struct _ORDER_GESCP {   /* ogescp */
  699.     UCHAR  uchType;
  700.     UCHAR  uchIdent;
  701.     UCHAR  auchData[GESCP_ML];         /* Escape data            */
  702. } ORDER_GESCP;
  703.  
  704. #define GESCP_REG      0x80            /* identifier is registered    */
  705.  
  706. /* Escape (Bitblt) */
  707. #define GEBB_REGID     0x02            /* uchIdent - Bitblt           */
  708.  
  709. #define ETYPE_GEBB          0x800200D5L
  710.  
  711. #define GEBB_LMP       29
  712. typedef struct _ORDERL_GEBB {   /* olgebb */
  713.     UCHAR    fbFlags;
  714.     USHORT    usMix;
  715.     UCHAR    cPoints;
  716.     HBITMAP hbmSrc;
  717.     LONG    lReserved;
  718.     LONG    lOptions;
  719.     POINTL    aptPoints[GEBB_LMP];
  720. } ORDERL_GEBB;
  721.  
  722. /* Escape (Set Pel) */
  723. #define GEPEL_REGID    0x01            /* uchIdent - Set Pel          */
  724.  
  725. #define ETYPE_GEPEL         0x800100D5L
  726.  
  727. /* Element Types for attribute bundles */
  728. #define ETYPE_LINEBUNDLE    0x0000FD01L
  729. #define ETYPE_CHARBUNDLE    0x0000FD02L
  730. #define ETYPE_MARKERBUNDLE  0x0000FD03L
  731. #define ETYPE_AREABUNDLE    0x0000FD04L
  732. #define ETYPE_IMAGEBUNDLE   0x0000FD05L
  733.  
  734. /***************************************************************************\
  735. *
  736. * Very long orders
  737. *
  738. \***************************************************************************/
  739.  
  740. /* macro to tell whether this is a very long order */
  741. #define VLONG_ORDER(oc)  ((oc)==OCODE_VLONG)
  742.  
  743. /* Very long order structure */
  744. #define VORDER_ML 65531
  745. typedef struct _VORDER {        /* vord */
  746.     UCHAR      idCode;
  747.     UCHAR      uchQualifier;
  748.     SWPUSHORT uchLength;
  749.     UCHAR      uchData[VORDER_ML];
  750. } VORDER;
  751.  
  752. /* Character String Extended */
  753. #define OCODEQ_GCCHSTE    0xB0    /* Qualifier - current posn    */
  754. #define OCODEQ_GCHSTE    0xF0    /* Qualifier - given position  */
  755.  
  756. #define ETYPE_GCCHSTE    0x0000FEB0L
  757. #define ETYPE_GCHSTE    0x0000FEF0L
  758.  
  759. typedef struct _ORDERS_GCCHSTE { /* osgcchste */
  760.     UCHAR      fbFlags;
  761.     UCHAR      uchReserved;
  762.     POINTS      ptRect[2];
  763.     SWPUSHORT cchString;
  764.     CHAR      achString[1];
  765.     SHORT      adx[1];
  766. } ORDERS_GCCHSTE;
  767.  
  768. typedef struct _ORDERL_GCCHSTE { /* olgcchste */
  769.   UCHAR     fbFlags;
  770.   UCHAR     uchReserved;
  771.   POINTL    ptRect[2];
  772.   SWPUSHORT cchString;
  773.   CHAR      achString[1];
  774.   LONG      adx[1];
  775. } ORDERL_GCCHSTE;
  776.  
  777. #define GCCHSTE_DRAWRECT    0x80
  778. #define GCCHSTE_NORECT        0x00
  779. #define GCCHSTE_CLIP        0x40
  780. #define GCCHSTE_NOCLIP        0x00
  781. #define GCCHSTE_DEEMPHASIZE    0x20
  782. #define GCCHSTE_NODEEMPHASIZE    0x00
  783. #define GCCHSTE_LEAVEPOS    0x10
  784. #define GCCHSTE_MOVEPOS     0x00
  785.  
  786. /* Extended Escape */
  787. #define OCODEQ_GEESCP     0xD5        /* Qualifier - extended escape */
  788.  
  789. #define GEESCP_ML      65533
  790. typedef struct _ORDER_GEESCP {  /* ogeescp */
  791.     UCHAR  uchType;
  792.     UCHAR  uchIdent;
  793.     UCHAR  auchData[GEESCP_ML];
  794. } ORDER_GEESCP;
  795.