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