home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / bpos13.zip / pmord.pas < prev    next >
Pascal/Delphi Source File  |  1993-11-24  |  30KB  |  932 lines

  1. {| Unit: pmord
  2.  | Version: 1.00
  3.  | translated from file pmord.H
  4.  | Original translation: Peter Sawatzki (ps)
  5.  | Contributing:
  6.  |   (fill in)
  7.  |
  8.  | change history:
  9.  | Date:    Ver: Author:
  10.  | 11/19/93 1.00 ps     original translation by ps
  11. }
  12. Unit pmord;
  13. Interface
  14. Uses
  15.   Os2Def,
  16.   PmGpi;
  17. {***************************** Module Header ******************************\
  18. *
  19. * This is the include file which defines all the structures and constants
  20. * that can be used to build or intepret GOCA orders for the GPI
  21. *
  22. * ==========================================================================
  23. *
  24. * The orders fall into 4 categories :-
  25. *
  26. * 1) 1-byte orders
  27. *
  28. * 2) 2-byte orders    - second byte contains the value
  29. *
  30. * 3) Long orders      - second byte gives the order length, subsequent bytes
  31. *                       contain the values
  32. *
  33. * 4) Very long orders - third and fourth bytes gives the order length,
  34. *                       subsequent bytes contain the values
  35. *
  36. \**************************************************************************}
  37.  
  38. {**************************************************************************\
  39. *
  40. * Miscellaneous structures used in this file
  41. *
  42. \**************************************************************************}
  43.  
  44. { form of RECTL with shorts instead of longs }
  45.  
  46. Type
  47.   RECT1S = Record                       { rcs }
  48.     xLeft,
  49.     yBottom,
  50.     xRight,
  51.     yTop: SHORT
  52.   End;
  53.  
  54. { form of POINTL with 1 byte offsets instead of longs }
  55.   ODPOINT = Record                      { odpt }
  56.     dx,
  57.     dy: Char
  58.   End;
  59.  
  60. { form of SIZEL with shorts instead of longs }
  61.   SIZES = Record                        { sizs }
  62.     cx,
  63.     cy: SHORT
  64.   End;
  65.  
  66. { unsigned two-byte swapped integer }
  67.   SWPUSHORT = Record                    { swpus }
  68.     HiByte,
  69.     LoByte: UCHAR
  70.   End;
  71.  
  72. {**************************************************************************\
  73. *
  74. * 1-byte orders
  75. *
  76. \**************************************************************************}
  77.  
  78. { macro to tell whether this is a 1-byte order }
  79. { UNSURE #define BYTE_ORDER(oc)   ((oc)==OCODE_GNOP1 || (oc)==OCODE_GESD) }
  80.  
  81. { 1-byte order codes }
  82.  
  83. Const
  84.   OCODE_GNOP1             =  $00;                  { No-operation                }
  85.   OCODE_GESD                       =  $FF;                  { End symbol definition       }
  86.  
  87. {**************************************************************************\
  88. *
  89. * 2-byte orders
  90. *
  91. \**************************************************************************}
  92.  
  93. { definitions to help determine whether an order code is a 2-byte order }
  94.   OCODE2_1                         =  $80;
  95.   OCODE2_2                         =  $88;
  96.  
  97. { UNSURE #define SHORT_ORDER(oc)  ((((oc)^OCODE2_1)&OCODE2_2)==OCODE2_2)}
  98.  
  99. { General 2-byte order structure }
  100.  
  101. Type
  102.   ORDER = Record                        { ord }
  103.     idCode,
  104.     uchData: UCHAR
  105.   End;
  106.  
  107. { 2-byte order codes }
  108.  
  109. Const
  110.   OCODE_GBAR              =  $68;                  { Begin area                  }
  111.   OCODE_GCFIG                      =  $7D;                  { Close figure                }
  112.   OCODE_GEEL                       =  $49;                  { End element                 }
  113.   OCODE_GEPTH                      =  $7F;                  { End path                    }
  114.   OCODE_GEPROL                     =  $3E;                  { End prologue                }
  115.   OCODE_GPOP                       =  $3F;                  { Pop                         }
  116.   OCODE_GSBMX                      =  $0D;                  { Set background mix          }
  117.   OCODE_GPSBMX                     =  $4D;                  { Push & set b/g mix          }
  118.   OCODE_GSCD                       =  $3A;                  { Set char direction          }
  119.   OCODE_GPSCD                      =  $7A;                  { Push & set char direction   }
  120.   OCODE_GSCR                       =  $39;                  { Set char precision          }
  121.   OCODE_GPSCR                      =  $79;                  { Push & set char precision   }
  122.   OCODE_GSCS                       =  $38;                  { Set char set                }
  123.   OCODE_GPSCS                      =  $78;                  { Push & set char set         }
  124.   OCODE_GSCOL                      =  $0A;                  { Set color                   }
  125.   OCODE_GPSCOL                     =  $4A;                  { Push & set color            }
  126.   OCODE_GSLE                       =  $1A;                  { Set line end                }
  127.   OCODE_GPSLE                      =  $5A;                  { Push & set line end         }
  128.   OCODE_GSLJ                       =  $1B;                  { Set line join               }
  129.   OCODE_GPSLJ                      =  $5B;                  { Push & set line join        }
  130.   OCODE_GSLT                       =  $18;                  { Set line type               }
  131.   OCODE_GPSLT                      =  $58;                  { Push & set line type        }
  132.   OCODE_GSLW                       =  $19;                  { Set line width              }
  133.   OCODE_GPSLW                      =  $59;                  { Push & set line width       }
  134.   OCODE_GSMP                       =  $3B;                  { Set marker precision        }
  135.   OCODE_GPSMP                      =  $7B;                  { Push & set marker precision }
  136.   OCODE_GSMS                       =  $3C;                  { Set marker set              }
  137.   OCODE_GPSMS                      =  $7C;                  { Push & set marker set       }
  138.   OCODE_GSMT                       =  $29;                  { Set marker symbol           }
  139.   OCODE_GPSMT                      =  $69;                  { Push & set marker symbol    }
  140.   OCODE_GSMX                       =  $0C;                  { Set mix                     }
  141.   OCODE_GPSMX                      =  $4C;                  { Push & set mix              }
  142.   OCODE_GSPS                       =  $08;                  { Set pattern set             }
  143.   OCODE_GPSPS                      =  $48;                  { Push & set pattern set      }
  144.   OCODE_GSPT                       =  $28;                  { Set pattern symbol          }
  145.   OCODE_GPSPT                      =  $09;                  { Push & set pattern symbol   }
  146.  
  147. { constants for 2-byte orders }
  148.  
  149. { Begin area }
  150.   GBAR_RESERVED                    =  $80;
  151.   GBAR_BOUNDARY                    =  $C0;
  152.   GBAR_NOBOUNDARY                  =  $80;
  153.   GBAR_WINDING                     =  $A0;
  154.   GBAR_ALTERNATE                   =  $80;
  155.  
  156. { Set Character Precision }
  157.   GSCR_PRECISION                   =  $0F;
  158.  
  159. {**************************************************************************\
  160. *
  161. * Long orders
  162. *
  163. \**************************************************************************}
  164.  
  165. { definitions to help determine whether an order code is a long order }
  166.  
  167.   OCODE_VLONG                      =  $FE;
  168.  
  169. { UNSURE #define LONG_ORDER(oc) (!((oc)==OCODE_VLONG||BYTE_ORDER(oc)||SHORT_ORDER(oc)))}
  170.  
  171. { long order structure }
  172.   LORDER_ML                        = 253;
  173.  
  174. Type
  175.   LORDER = Record                       { lord }
  176.     idCode,
  177.     uchLength: UCHAR;
  178.     uchData: Array [0..LORDER_ML-1] Of UCHAR
  179.   End;
  180.  
  181. { Long orders for which the length of data is normally zero }
  182.  
  183. Const
  184.   OCODE_GEAR              =  $60;                  { End Area                    }
  185.   OCODE_GEIMG                      =  $93;                  { End Image                   }
  186.  
  187. { Long orders for which the data is contained in a type already defined }
  188.  
  189. { Character String }
  190.   OCODE_GCCHST                     = $83;                   { char string at curr posn    }
  191.   GCCHST_MC                        = 255;                   { Max len of string in bytes  }
  192.  
  193.   OCODE_GCHST                      = $C3;                   { char string at given pos    }
  194.   GCHST_SMC                        = 251;                   { Max len of string (S)       }
  195.   GCHST_LMC                        = 247;                   { Max len of string (L)       }
  196.  
  197. { Character String Move }
  198.   OCODE_GCCHSTM                    =  $B1;                  { char string move at c.p.    }
  199.   GCCHSTM_MC                       = 255;                   { Max len of string in byte   }
  200.  
  201.   OCODE_GCHSTM                     =  $F1;                  { char string move at g.p.    }
  202.   GCHSTM_SMC                       = 251;                   { Max len of string (S)       }
  203.   GCHSTM_LMC                       = 247;                   { Max len of string (L)       }
  204.  
  205. { Comment }
  206.   OCODE_GCOMT                      =  $01;                  { Comment                     }
  207.   GCOMT_ML                         = 255;                   { Maximum len of comment data }
  208.  
  209. { Image }
  210.   OCODE_GIMD                       =  $92;                  { Image data                  }
  211.   GIMD_ML                          = 255;                   { Maximum len of image data   }
  212.  
  213. { Full Arc }
  214.   OCODE_GCFARC                     =  $87;                  { full arc at current posn    }
  215.   OCODE_GFARC                      =  $C7;                  { full arc at given posn      }
  216.  
  217. { Label }
  218.   OCODE_GLABL                      =  $D3;                  { Label                       }
  219.  
  220. { Set Current Position }
  221.   OCODE_GSCP                       =  $21;                  { Set current position        }
  222.   OCODE_GPSCP                      =  $61;                  { Push and set curr posn      }
  223.  
  224. { Bezier spline }
  225.   OCODE_GCBEZ                      =  $A5;                  { Bezier spline at curr pos   }
  226.   GCBEZ_SMB                        = 21;                    { Max number of splines (S)   }
  227.   GCBEZ_LMB                        = 10;                    { Max number of splines (L)   }
  228.  
  229.   OCODE_GBEZ                       =  $E5;                  { Bezier spline at given pos  }
  230.   GBEZ_SMB                         = 20;                    { Max number of splines (S)   }
  231.   GBEZ_LMB                         = 10;                    { Max number of splines (L)   }
  232.  
  233. { Fillet }
  234.   OCODE_GCFLT                      =  $85;                  { fillet at current posn      }
  235.   GCFLT_SMP                        = 63;                    { Max number of points (S)    }
  236.   GCFLT_LMP                        = 31;                    { Max number of points (L)    }
  237.  
  238.   OCODE_GFLT                       =  $C5;                  { fillet at given position    }
  239.   GFLT_SMP                         = 62;                    { Max number of points (S)    }
  240.   GFLT_LMP                         = 30;                    { Max number of points (L)    }
  241.  
  242. { Polyline }
  243.   OCODE_GCLINE                     =  $81;                  { polyline at current posn    }
  244.   GCLINE_SMP                       = 63;                    { Max number of points (S)    }
  245.   GCLINE_LMP                       = 31;                    { Max number of points (L)    }
  246.  
  247.   OCODE_GLINE                      =  $C1;                  { polyline at given posn      }
  248.   GLINE_SMP                        = 62;                    { Max number of points (S)    }
  249.   GLINE_LMP                        = 30;                    { Max number of points (L)    }
  250.  
  251. { Polymarker }
  252.   OCODE_GCMRK                      =  $82;                  { marker at current posn      }
  253.   GCMRK_SMP                        = 63;                    { Max number of points (S)    }
  254.   GCMRK_LMP                        = 31;                    { Max number of points (L)    }
  255.  
  256.   OCODE_GMRK                       =  $C2;                  { marker at given posn        }
  257.   GMRK_SMP                         = 62;                    { Max number of points (S)    }
  258.   GMRK_LMP                         = 30;                    { Max number of points (L)    }
  259.  
  260. { Relative Line }
  261.   OCODE_GCRLINE                    =  $A1;                  { Relative line at curr pos   }
  262.   GCRLINE_MP                       = 127;                   { Max number of points        }
  263.  
  264.   OCODE_GRLINE                     =  $E1;                  { Relative line at givn pos   }
  265.   GRLINE_SMP                       = 125;                   { Max number of points (S)    }
  266.   GRLINE_LMP                       = 123;                   { Max number of points (L)    }
  267.  
  268. { Set Background Color }
  269.   OCODE_GSBCOL                     =  $25;                  { Set background color        }
  270.   OCODE_GPSBCOL                    =  $65;                  { Push and set b/g color      }
  271.  
  272. { Set Extended Color }
  273.   OCODE_GSECOL                     =  $26;                  { Set extended color          }
  274.   OCODE_GPSECOL                    =  $66;                  { Push and set ext color      }
  275.  
  276. { Extended Color values }
  277.   SECOL_DEFAULT0                   =  $0000;
  278.   SECOL_DEFAULT1                   =  $FF00;
  279.   SECOL_NEUTRAL                    =  $FF07;
  280.   SECOL_RESET                      =  $FF08;
  281.  
  282. { Set Character Angle }
  283.   OCODE_GSCA                       =  $34;                  { Set character angle         }
  284.   OCODE_GPSCA                      =  $74;                  { Push and set char angle     }
  285.  
  286. { Set Character Shear }
  287.   OCODE_GSCH                       =  $35;                  { Set character shear         }
  288.   OCODE_GPSCH                      =  $75;                  { Push and set char shear     }
  289.  
  290. { Set Fractional Line Width }
  291.   OCODE_GSFLW                      =  $11;                  { Set fractional line width   }
  292.   OCODE_GPSFLW                     =  $51;                  { Push and set frac l width   }
  293.  
  294. { Set Pick Identifier }
  295.   OCODE_GSPIK                      =  $43;                  { Set pick identifier         }
  296.   OCODE_GPSPIK                     =  $23;                  { Push and set pick id        }
  297.  
  298.  
  299. { Long Orders for which a structure can be defined for the data }
  300.  
  301. { Arc }
  302.   OCODE_GCARC                      =  $86;                  { Arc at Current Position     }
  303.   OCODE_GARC                       =  $C6;                  { Arc at Given Position       }
  304.  
  305.  
  306. Type
  307.   ORDERS_GCARC = Record                 { osgcarc }
  308.     ptInter,
  309.     ptEnd: POINTS
  310.   End;
  311.  
  312.   ORDERL_GCARC = Record                 { olgcarc }
  313.     ptInter,
  314.     ptEnd: POINTL
  315.   End;
  316.  
  317. { Begin Element }
  318.  
  319. Const
  320.   OCODE_GBEL              =  $D2;                  { Begin Element               }
  321.  
  322.   GBEL_DL                          = 251;
  323.  
  324. Type
  325.   ORDER_GBEL = Record                   { ogbel }
  326.     lElementType: LongInt;
  327.     achDesc: Array[0..GBEL_DL-1] Of Char
  328.   End;
  329.  
  330. { Begin Image }
  331.  
  332. Const
  333.   OCODE_GCBIMG            =  $91;                  { Begin Image at curr posn    }
  334.   OCODE_GBIMG                      =  $D1;                  { Begin Image at given posn   }
  335.  
  336.  
  337. Type
  338.   ORDER_GCBIMG = Record                 { ogbimg }
  339.     uchFormat,
  340.     uchReserved: UCHAR;
  341.     cx,
  342.     cy: SWPUSHORT
  343.   End;
  344.  
  345. { Begin Path }
  346.  
  347. Const
  348.   OCODE_GBPTH             =  $D0;                  { Begin Path                  }
  349.  
  350.  
  351. Type
  352.   ORDER_GBPTH = Record                  { ogbpth }
  353.     usReserved: USHORT;
  354.     idPath: LongInt
  355.   End;
  356.  
  357. { Box }
  358.  
  359. Const
  360.   OCODE_GCBOX             =  $80;                  { Box at current position     }
  361.   OCODE_GBOX                       =  $C0;                  { Box at given position       }
  362.  
  363.  
  364. Type
  365.   ORDERS_GCBOX = Record                 { osgcbox }
  366.     fbFlags,
  367.     uchReserved: UCHAR;
  368.     ptCorner: POINTS;
  369.     hAxis,
  370.     vAxis: SHORT
  371.   End;
  372.  
  373.   ORDERL_GCBOX = Record                 { olgcbox }
  374.     fbFlags,
  375.     uchReserved: UCHAR;
  376.     ptCorner: POINTL;
  377.     hAxis,
  378.     vAxis: LongInt
  379.   End;
  380.  
  381.  
  382. Const
  383.   GCBOX_FILL              =  $40;
  384.   GCBOX_BOUNDARY                   =  $20;
  385.  
  386. { Call Segment }
  387.   OCODE_GCALLS                     =  $07;                  { call segment                }
  388.  
  389.  
  390. Type
  391.   ORDER_GCALLS = Record                 { ogcalls }
  392.     sReserved: USHORT;
  393.     idSegment: LongInt
  394.   End;
  395.  
  396. { Fill Path }
  397.  
  398. Const
  399.   OCODE_GFPTH             =  $D7;                  { Fill path                   }
  400.  
  401. Type
  402.   ORDER_GFPTH = Record                  { ogfpth }
  403.     fbFlags,
  404.     uchReserved: UCHAR;
  405.     idPath: LongInt
  406.   End;
  407.  
  408.  
  409. Const
  410.   GFPTH_ALTERNATE         =  $00;
  411.   GFPTH_WINDING                    =  $40;
  412.   GFPTH_MODIFY                     =  $20;
  413.  
  414. { Outline Path }
  415.   OCODE_GOPTH                      =  $D4;                  { Outline Path                }
  416.  
  417. Type
  418.   ORDER_GOPTH = Record                  { ogopth }
  419.     fbFlags,
  420.     uchReserved: UCHAR;
  421.     idPath: LongInt
  422.   End;
  423.  
  424. { Modify Path }
  425.  
  426. Const
  427.   OCODE_GMPTH             =  $D8;                  { modify path                 }
  428.  
  429.  
  430. Type
  431.   ORDER_GMPTH = Record                  { ogmpth }
  432.     uchMode,
  433.     uchReserved: UCHAR;
  434.     idPath: LongInt
  435.   End;
  436.  
  437.  
  438. Const
  439.   GMPTH_STROKE            =  $06;
  440.  
  441. { Partial Arc }
  442.   OCODE_GCPARC                     =  $A3;                  { Partial arc at curr posn    }
  443.   OCODE_GPARC                      =  $E3;                  { Partial arc at given posn   }
  444.  
  445.  
  446. Type
  447.   ORDERS_GCPARC = Record                { osgcparc }
  448.     ptCenter: POINTS;
  449.     ufx88Multiplier: FIXED88;
  450.     usStartAngle,
  451.     usSweepAngle: LongInt
  452.   End;
  453.  
  454.   ORDERL_GCPARC = Record                { olgcparc }
  455.     ptCenter: POINTL;
  456.     ufxMultiplier: FIXED;
  457.     usStartAngle,
  458.     usSweepAngle: LongInt
  459.   End;
  460.  
  461. { Set Clip Path }
  462.  
  463. Const
  464.   OCODE_GSCPTH            =  $B4;                  { Set clip path               }
  465.  
  466.  
  467. Type
  468.   ORDER_GSCPTH = Record                 { ogscpth }
  469.     fbFlags,
  470.     uchReserved: UCHAR;
  471.     idPath: LongInt
  472.   End;
  473.  
  474.  
  475. Const
  476.   GSCPTH_ALTERNATE        =  $00;
  477.   GSCPTH_WINDING                   =  $40;
  478.   GSCPTH_RESET                     =  $00;
  479.   GSCPTH_INTERSECT                 =  $20;
  480.  
  481. { Set Arc Parameters }
  482.   OCODE_GSAP                       =  $22;                  { Set arc parameters          }
  483.   OCODE_GPSAP                      =  $62;                  { Push and set arc params     }
  484.  
  485.  
  486. Type
  487.   ORDERS_GSAP = Record                  { osgsap }
  488.     p,
  489.     q,
  490.     r,
  491.     s: SHORT
  492.   End;
  493.  
  494.   ORDERL_GSAP = Record                  { olgsap }
  495.     p,
  496.     q,
  497.     r,
  498.     s: LongInt
  499.   End;
  500.  
  501. { Set Background Indexed Color }
  502.  
  503. Const
  504.   OCODE_GSBICOL           =  $A7;                  { Set b/g indexed color       }
  505.   OCODE_GPSBICOL                   =  $E7;                  { Push and set b/g ind color  }
  506.   OCODE_GSICOL                     =  $A6;                  { Set indexed color           }
  507.   OCODE_GPSICOL                    =  $E6;                  { Push and set indexd color   }
  508.  
  509.  
  510. Type
  511.   ORDER_GSBICOL = Record                { ogbicol }
  512.     fbFlags: UCHAR;
  513.     auchColor: Array[0..2] Of UCHAR
  514.   End;
  515.  
  516.  
  517. Const
  518.   SICOL_SPECIFY           =  $00;
  519.   SICOL_SPECIAL                    =  $40;
  520.   SICOL_DEFAULT                    =  $80;
  521.   SICOL_BLACK                      = 1;
  522.   SICOL_WHITE                      = 2;
  523.   SICOL_ONES                       = 4;
  524.   SICOL_ZEROES                     = 5;
  525.  
  526. { Set Character Cell }
  527.   OCODE_GSCC                       =  $33;                  { Set character cell          }
  528.   OCODE_GPSCC                      =  $03;                  { Push and set char cell      }
  529.  
  530.  
  531. Type
  532.   ORDERS_GSCC = Record                  { osgscc }
  533.     cxInt,
  534.     cyInt: SHORT;
  535.     cxFract,
  536.     cyFract: USHORT;
  537.     fbFlags,
  538.     uchReserved: UCHAR
  539.   End;
  540.  
  541.   ORDERL_GSCC = Record                  { olgscc }
  542.     cxInt,
  543.     cyInt: LongInt;
  544.     cxFract,
  545.     cyFract: USHORT;
  546.     fbFlags,
  547.     uchReserved: UCHAR
  548.   End;
  549.  
  550.  
  551. Const
  552.   GSCC_ZERODEF            =  $00;
  553.   GSCC_ZEROZERO                    =  $80;
  554.  
  555. { Set Marker Cell }
  556.   OCODE_GSMC                       =  $37;                  { Set marker cell             }
  557.   OCODE_GPSMC                      =  $77;                  { Push and set marker cell    }
  558.  
  559.  
  560. Type
  561.   ORDERS_GSMC = Record                  { osgsmc }
  562.     cx,
  563.     cy: SHORT;
  564.     fbFlags,
  565.     uchReserved: UCHAR
  566.   End;
  567.  
  568.   ORDERL_GSMC = Record                  { olgsmc }
  569.     cx,
  570.     cy: LongInt;
  571.     fbFlags,
  572.     uchReserved: UCHAR
  573.   End;
  574.  
  575.  
  576. Const
  577.   GSMC_ZERODEF            =  $00;
  578.   GSMC_ZEROZERO                    =  $80;
  579.  
  580. { Set Pattern Reference Point }
  581.   OCODE_GSPRP                      =  $A0;                  { Set pattern ref point       }
  582.   OCODE_GPSPRP                     =  $E0;                  { Push and set patt ref pt    }
  583.  
  584.  
  585. Type
  586.   ORDERS_GSPRP = Record                 { osgsprp }
  587.     fbFlags,
  588.     uchReserved: UCHAR;
  589.     ptPos: POINTS
  590.   End;
  591.  
  592.   ORDERL_GSPRP = Record                 { olgsprp }
  593.     fbFlags,
  594.     uchReserved: UCHAR;
  595.     ptPos: POINTL
  596.   End;
  597.  
  598.  
  599. Const
  600.   GSPRP_DEFAULT           =  $80;
  601.   GSPRP_SPECIFY                    =  $00;
  602.  
  603.  
  604. { Set Individual Attribute }
  605.   OCODE_GSIA                       =  $14;                  { Set individual attribute    }
  606.   OCODE_GPSIA                      =  $54;                  { Push and set ind attr       }
  607.  
  608.   GSIA_VL                          = 3;
  609.  
  610. Type
  611.   ORDER_GSIA = Record                   { ogsia }
  612.     uchAttrType,
  613.     uchPrimType,
  614.     fbFlags: UCHAR;
  615.     auchValue: Array[0..GSIA_VL-1] Of UCHAR
  616.   End;
  617.  
  618.  
  619. Const
  620.   GSIA_COLOR              =  $01;
  621.   GSIA_BCOLOR                      =  $02;
  622.   GSIA_MIX                         =  $03;
  623.   GSIA_BMIX                        =  $04;
  624.   GSIA_LINE                        =  $01;
  625.   GSIA_CHAR                        =  $02;
  626.   GSIA_MARKER                      =  $03;
  627.   GSIA_PATTERN                     =  $04;
  628.   GSIA_IMAGE                       =  $05;
  629.   GSIA_SPECIFY                     =  $00;
  630.   GSIA_SPECIAL                     =  $40;
  631.   GSIA_DEFAULT                     =  $80;
  632.   GSIA_BLACK                       = 1;
  633.   GSIA_WHITE                       = 2;
  634.   GSIA_ONES                        = 4;
  635.   GSIA_ZEROES                      = 5;
  636.  
  637.  
  638. { Set Model /Viewing Transform }
  639.   OCODE_GSTM                       =  $24;                  { Set model transform         }
  640.   OCODE_GPSTM                      =  $64;                  { Push and set model tfm      }
  641.  
  642.   OCODE_GSTV                       =  $31;                  { Set Viewing Transform       }
  643.  
  644.   GSTM_ML                          = 16;
  645.  
  646. Type
  647.   ORDERS_GSTM = Record                  { osgstm }
  648.     uchReserved,
  649.     fbFlags: UCHAR;
  650.     fsMask: USHORT;
  651.     asMatrix: Array[0..GSTM_ML-1] Of SHORT
  652.   End;
  653.  
  654.   ORDERL_GSTM = Record                  { olgstm }
  655.     uchReserved,
  656.     fbFlags: UCHAR;
  657.     fsMask: USHORT;
  658.     alMatrix: Array[0..GSTM_ML-1] Of LongInt
  659.   End;
  660.  
  661.  
  662. Const
  663.   GSTM_M11                =  $8000;
  664.   GSTM_M12                         =  $4000;
  665.   GSTM_M13                         =  $2000;
  666.   GSTM_M14                         =  $1000;
  667.   GSTM_M21                         =  $0800;
  668.   GSTM_M22                         =  $0400;
  669.   GSTM_M23                         =  $0200;
  670.   GSTM_M24                         =  $0100;
  671.   GSTM_M31                         =  $0080;
  672.   GSTM_M32                         =  $0040;
  673.   GSTM_M33                         =  $0020;
  674.   GSTM_M34                         =  $0010;
  675.   GSTM_M41                         =  $0008;
  676.   GSTM_M42                         =  $0004;
  677.   GSTM_M43                         =  $0002;
  678.   GSTM_M44                         =  $0001;
  679.  
  680.   GSTM_UNITY                       =  $00;
  681.   GSTM_AFTER                       =  $01;
  682.   GSTM_BEFORE                      =  $02;
  683.   GSTM_OVERWRITE                   =  $03;
  684.  
  685.   GSTV_OVERWRITE                   =  $00;
  686.   GSTV_AFTER                       =  $04;
  687.  
  688. { Set Segment Boundary, Viewing Window }
  689.  
  690.   OCODE_GSSB                       =  $32;                  { Set segment boundary        }
  691.   OCODE_GSVW                       =  $27;                  { Set viewing window          }
  692.   OCODE_GPSVW                      =  $67;                  { Push and set view window    }
  693.  
  694.   GSSB_ML                          = 4;
  695.  
  696. Type
  697.   ORDERS_GSSB = Record                  { osgssb }
  698.     fbFlags,
  699.     fbMask: UCHAR;
  700.     alMatrix: Array[0..GSSB_ML-1] Of SHORT
  701.   End;
  702.  
  703.   ORDERL_GSSB = Record                  { olgssb }
  704.     fbFLags,
  705.     fbMask: UCHAR;
  706.     alMatrix: Array[0..GSSB_ML-1] Of LongInt
  707.   End;
  708.  
  709.  
  710. Const
  711.   GSSB_XLEFT              =  $20;
  712.   GSSB_XRIGHT                      =  $10;
  713.   GSSB_YBOTTOM                     =  $08;
  714.   GSSB_YTOP                        =  $04;
  715.  
  716.   GSVW_INTERSECT                   =  $00;
  717.   GSVW_REPLACE                     =  $80;
  718.  
  719. { Set Segment Characteristics }
  720.   OCODE_GSGCH                      =  $04;                  { Set segment characteristics }
  721.  
  722.   GSGCH_ML                         = 254;
  723.  
  724. Type
  725.   ORDER_GSGCH = Record                  { ogsgch }
  726.     uchIdent: UCHAR;
  727.     auchData: Array[0..GSGCH_ML-1] Of UCHAR
  728.   End;
  729.  
  730. { Set Stroke Line Width }
  731.  
  732. Const
  733.   OCODE_GSSLW             =  $15;                  { Set stroke line width       }
  734.   OCODE_GPSSLW                     =  $55;                  { Push and set strk l width   }
  735.  
  736.  
  737. Type
  738.   ORDERS_GSSLW = Record                 { osgsslw }
  739.     fbFlags,
  740.     uchReserved: UCHAR;
  741.     LineWidth: SHORT
  742.   End;
  743.  
  744.   ORDERL_GSSLW = Record                 { olgsslw }
  745.     fbFlags,
  746.     uchReserved: UCHAR;
  747.     LineWidth: LongInt
  748.   End;
  749.  
  750.  
  751. Const
  752.   GSSLW_DEFAULT           =  $80;
  753.   GSSLW_SPECIFY                    =  $00;
  754.  
  755. { Sharp Fillet at Current Position }
  756.   OCODE_GCSFLT                     =  $A4;                  { Sharp fillet at curr pos    }
  757.   OCODE_GSFLT                      =  $E4;                  { Sharp fillet at given pos   }
  758.  
  759.   GCSFLT_SMF                       = 21;
  760.   GSFLT_SMF                        = 20;
  761.  
  762.  
  763. Type
  764.   ORDERS_GCSFLT = Record                { osgcsflt }
  765.     apt: Array[0..2*GCSFLT_SMF-1] Of POINTS;
  766.     afxSharpness: Array[0..GCSFLT_SMF-1] Of FIXED
  767.   End;
  768.  
  769.  
  770. Const
  771.   GCSFLT_LMF              = 12;
  772.   GSFLT_LMF               = 12;
  773.  
  774.  
  775. Type
  776.   ORDERL_GCSFLT = Record                { olgcsflt }
  777.     apt: Array[0..2*GCSFLT_SMF-1] Of POINTS;
  778.     afxSharpness: Array[0..GCSFLT_SMF-1] Of FIXED
  779.   End;
  780.  
  781. { Bitblt }
  782.  
  783. Const
  784.   OCODE_GBBLT             =  $D6;                  { Bitblt                      }
  785.  
  786.  
  787. Type
  788.   ORDERS_GBBLT = Record                 { osgbblt }
  789.     fsFlags,
  790.     usMix: USHORT;
  791.     hbmSrc: HBITMAP;
  792.     lOptions: LongInt;
  793.     rcsTargetRect: RECT1S;
  794.     rclSourceRect: RECTL
  795.   End;
  796.  
  797.   ORDERL_GBBLT = Record                 { olgbblt }
  798.     fsFlags,
  799.     usMix: USHORT;
  800.     hbmSrc: HBITMAP;
  801.     lOptions: LongInt;
  802.     rclTargetRect,
  803.     rclSourceRect: RECTL
  804.   End;
  805.  
  806. { Escape }
  807.  
  808. Const
  809.   OCODE_GESCP             =  $D5;                  { Escape                      }
  810.  
  811. {
  812.  * type describes type of escape order, identifier gives the escape
  813.  * order if the type is registered
  814.  }
  815.   GESCP_ML                         = 253;
  816.  
  817. Type
  818.   ORDER_GESCP = Record                  { ogescp }
  819.     uchType,
  820.     uchIdent: UCHAR;
  821.     auchData: Array[0..GESCP_ML-1] Of UCHAR           { Escape data }
  822.   End;
  823.  
  824.  
  825. Const
  826.   GESCP_REG               =  $80;                  { identifier is registered    }
  827.  
  828. { Escape}
  829.   GEBB_REGID                       =  $02;                  { uchIdent - Bitblt           }
  830.  
  831.   ETYPE_GEBB                       =  $800200D5 ;
  832.  
  833.   GEBB_LMP                         = 29;
  834.  
  835. Type
  836.   ORDERL_GEBB = Record                  { olgebb }
  837.     fbFlags: UCHAR;
  838.     usMix: USHORT;
  839.     cPoints: UCHAR;
  840.     hbmSrc: HBITMAP;
  841.     lReserved,
  842.     lOptions: LongInt;
  843.     aptPoints: Array[0..GEBB_LMP-1] Of POINTL
  844.   End;
  845.  
  846. { Escape }
  847.  
  848. Const
  849.   GEPEL_REGID             =  $01;                  { uchIdent - Set Pel          }
  850.  
  851.   ETYPE_GEPEL                      =  $800100D5 ;
  852.  
  853. { Element Types for attribute bundles }
  854.   ETYPE_LINEBUNDLE                 =  $0000FD01 ;
  855.   ETYPE_CHARBUNDLE                 =  $0000FD02 ;
  856.   ETYPE_MARKERBUNDLE               =  $0000FD03 ;
  857.   ETYPE_AREABUNDLE                 =  $0000FD04 ;
  858.   ETYPE_IMAGEBUNDLE                =  $0000FD05 ;
  859.  
  860. {**************************************************************************\
  861. *
  862. * Very long orders
  863. *
  864. \**************************************************************************}
  865.  
  866. { macro to tell whether this is a very long order }
  867. { UNSURE #define VLONG_ORDER(oc)  ((oc)==OCODE_VLONG)}
  868.  
  869. { Very long order structure }
  870.   VORDER_ML                        = 65531;
  871.  
  872. Type
  873.   VORDER = Record                       { vord }
  874.     idCode,
  875.     uchQualifier: UCHAR;
  876.     uchLength: SWPUSHORT;
  877.     uchData: Array[0..VORDER_ML-1] Of UCHAR
  878.   End;
  879.  
  880. { Character String Extended }
  881.  
  882. Const
  883.   OCODEQ_GCCHSTE          =  $B0;                  { Qualifier - current posn    }
  884.   OCODEQ_GCHSTE                    =  $F0;                  { Qualifier - given position  }
  885.  
  886.   ETYPE_GCCHSTE                    =  $0000FEB0 ;
  887.   ETYPE_GCHSTE                     =  $0000FEF0 ;
  888.  
  889.  
  890. Type
  891.   ORDERS_GCCHSTE = Record               { osgcchste }
  892.     fbFlags,
  893.     uchReserved: UCHAR;
  894.     ptRect: Array[0..1] Of POINTS;
  895.     cchString: SWPUSHORT;
  896.     achString: Array[0..0] Of Char;
  897.     adx: Array[0..0] Of SHORT
  898.   End;
  899.  
  900.   ORDERL_GCCHSTE = Record               { olgcchste }
  901.     fbFlags,
  902.     uchReserved: UCHAR;
  903.     ptRect: Array[0..1] Of POINTL;
  904.     cchString: SWPUSHORT;
  905.     achString: Array[0..0] Of Char;
  906.     adx: Array[0..0] Of LongInt
  907.   End;
  908.  
  909. Const
  910.   GCCHSTE_DRAWRECT        =  $80;
  911.   GCCHSTE_NORECT                   =  $00;
  912.   GCCHSTE_CLIP                     =  $40;
  913.   GCCHSTE_NOCLIP                   =  $00;
  914.   GCCHSTE_DEEMPHASIZE              =  $20;
  915.   GCCHSTE_NODEEMPHASIZE            =  $00;
  916.   GCCHSTE_LEAVEPOS                 =  $10;
  917.   GCCHSTE_MOVEPOS                  =  $00;
  918.  
  919. { Extended Escape }
  920.   OCODEQ_GEESCP                    =  $D5;                  { Qualifier - extended escape }
  921.  
  922.   GEESCP_ML                        = 65533;
  923.  
  924. Type
  925.   ORDER_GEESCP = Record                 { ogeescp }
  926.     uchType,
  927.     uchIdent: UCHAR;
  928.     auchData: Array[0..GEESCP_ML-1] Of UCHAR
  929.   End;
  930. Implementation
  931. End.
  932.