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