home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ddkx86v1.zip / DDKX86 / H / PMORD.H < prev    next >
C/C++ Source or Header  |  1995-04-14  |  29KB  |  895 lines

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