home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Interactive Guide
/
c-cplusplus-interactive-guide.iso
/
c_ref
/
csource1
/
program3
/
pmord.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-11-23
|
30KB
|
932 lines
{| Unit: pmord
| Version: 1.00
| translated from file pmord.H
| Original translation: Peter Sawatzki (ps)
| Contributing:
| (fill in)
|
| change history:
| Date: Ver: Author:
| 11/19/93 1.00 ps original translation by ps
}
Unit pmord;
Interface
Uses
Os2Def,
PmGpi;
{***************************** Module Header ******************************\
*
* This is the include file which defines all the structures and constants
* that can be used to build or intepret GOCA orders for the GPI
*
* ==========================================================================
*
* The orders fall into 4 categories :-
*
* 1) 1-byte orders
*
* 2) 2-byte orders - second byte contains the value
*
* 3) Long orders - second byte gives the order length, subsequent bytes
* contain the values
*
* 4) Very long orders - third and fourth bytes gives the order length,
* subsequent bytes contain the values
*
\**************************************************************************}
{**************************************************************************\
*
* Miscellaneous structures used in this file
*
\**************************************************************************}
{ form of RECTL with shorts instead of longs }
Type
RECT1S = Record { rcs }
xLeft,
yBottom,
xRight,
yTop: SHORT
End;
{ form of POINTL with 1 byte offsets instead of longs }
ODPOINT = Record { odpt }
dx,
dy: Char
End;
{ form of SIZEL with shorts instead of longs }
SIZES = Record { sizs }
cx,
cy: SHORT
End;
{ unsigned two-byte swapped integer }
SWPUSHORT = Record { swpus }
HiByte,
LoByte: UCHAR
End;
{**************************************************************************\
*
* 1-byte orders
*
\**************************************************************************}
{ macro to tell whether this is a 1-byte order }
{ UNSURE #define BYTE_ORDER(oc) ((oc)==OCODE_GNOP1 || (oc)==OCODE_GESD) }
{ 1-byte order codes }
Const
OCODE_GNOP1 = $00; { No-operation }
OCODE_GESD = $FF; { End symbol definition }
{**************************************************************************\
*
* 2-byte orders
*
\**************************************************************************}
{ definitions to help determine whether an order code is a 2-byte order }
OCODE2_1 = $80;
OCODE2_2 = $88;
{ UNSURE #define SHORT_ORDER(oc) ((((oc)^OCODE2_1)&OCODE2_2)==OCODE2_2)}
{ General 2-byte order structure }
Type
ORDER = Record { ord }
idCode,
uchData: UCHAR
End;
{ 2-byte order codes }
Const
OCODE_GBAR = $68; { Begin area }
OCODE_GCFIG = $7D; { Close figure }
OCODE_GEEL = $49; { End element }
OCODE_GEPTH = $7F; { End path }
OCODE_GEPROL = $3E; { End prologue }
OCODE_GPOP = $3F; { Pop }
OCODE_GSBMX = $0D; { Set background mix }
OCODE_GPSBMX = $4D; { Push & set b/g mix }
OCODE_GSCD = $3A; { Set char direction }
OCODE_GPSCD = $7A; { Push & set char direction }
OCODE_GSCR = $39; { Set char precision }
OCODE_GPSCR = $79; { Push & set char precision }
OCODE_GSCS = $38; { Set char set }
OCODE_GPSCS = $78; { Push & set char set }
OCODE_GSCOL = $0A; { Set color }
OCODE_GPSCOL = $4A; { Push & set color }
OCODE_GSLE = $1A; { Set line end }
OCODE_GPSLE = $5A; { Push & set line end }
OCODE_GSLJ = $1B; { Set line join }
OCODE_GPSLJ = $5B; { Push & set line join }
OCODE_GSLT = $18; { Set line type }
OCODE_GPSLT = $58; { Push & set line type }
OCODE_GSLW = $19; { Set line width }
OCODE_GPSLW = $59; { Push & set line width }
OCODE_GSMP = $3B; { Set marker precision }
OCODE_GPSMP = $7B; { Push & set marker precision }
OCODE_GSMS = $3C; { Set marker set }
OCODE_GPSMS = $7C; { Push & set marker set }
OCODE_GSMT = $29; { Set marker symbol }
OCODE_GPSMT = $69; { Push & set marker symbol }
OCODE_GSMX = $0C; { Set mix }
OCODE_GPSMX = $4C; { Push & set mix }
OCODE_GSPS = $08; { Set pattern set }
OCODE_GPSPS = $48; { Push & set pattern set }
OCODE_GSPT = $28; { Set pattern symbol }
OCODE_GPSPT = $09; { Push & set pattern symbol }
{ constants for 2-byte orders }
{ Begin area }
GBAR_RESERVED = $80;
GBAR_BOUNDARY = $C0;
GBAR_NOBOUNDARY = $80;
GBAR_WINDING = $A0;
GBAR_ALTERNATE = $80;
{ Set Character Precision }
GSCR_PRECISION = $0F;
{**************************************************************************\
*
* Long orders
*
\**************************************************************************}
{ definitions to help determine whether an order code is a long order }
OCODE_VLONG = $FE;
{ UNSURE #define LONG_ORDER(oc) (!((oc)==OCODE_VLONG||BYTE_ORDER(oc)||SHORT_ORDER(oc)))}
{ long order structure }
LORDER_ML = 253;
Type
LORDER = Record { lord }
idCode,
uchLength: UCHAR;
uchData: Array [0..LORDER_ML-1] Of UCHAR
End;
{ Long orders for which the length of data is normally zero }
Const
OCODE_GEAR = $60; { End Area }
OCODE_GEIMG = $93; { End Image }
{ Long orders for which the data is contained in a type already defined }
{ Character String }
OCODE_GCCHST = $83; { char string at curr posn }
GCCHST_MC = 255; { Max len of string in bytes }
OCODE_GCHST = $C3; { char string at given pos }
GCHST_SMC = 251; { Max len of string (S) }
GCHST_LMC = 247; { Max len of string (L) }
{ Character String Move }
OCODE_GCCHSTM = $B1; { char string