home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / borhead.zip / PMORD.H < prev    next >
C/C++ Source or Header  |  1994-11-09  |  28KB  |  937 lines

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