699
701
PPolyset=^Polyset;
700
702
TPolyset=Polyset;
704
// ===========================================================================
706
//* The orders fall into 4 categories :-
710
//* 2) 2-byte orders - second byte contains the value
712
//* 3) Long orders - second byte gives the order length, subsequent bytes
713
//* contain the values (up to 256 bytes long)
715
//* 4) Very long orders - third and fourth bytes gives the order length,
716
//* subsequent bytes contain the values (up to 64K long)
718
//* ===========================================================================
720
//#pragma pack(1) /* pack on byte boundary */
722
//***************************************************************************\
724
//* Miscellaneous structures used in this file
726
//***************************************************************************/
728
// form of RECTL with shorts instead of longs
737
// form of POINTL with 1 byte offsets instead of longs
738
ODPOINT=record // odpt
743
// form of SIZEL with shorts instead of longs
749
// unsigned two-byte swapped integer
750
SWPUSHORT=record // swpus
755
//***************************************************************************\
759
//***************************************************************************/
761
// macro to tell whether this is a 1-byte order
762
{$define BYTE_ORDER(oc):=((oc)=OCODE_GNOP1 or (oc)=OCODE_GESD)}
764
// 1-byte order codes
766
OCODE_GNOP1 =$00; // No-operation
767
OCODE_GESD =$FF; // End symbol definition
769
//***************************************************************************\
773
//***************************************************************************/
775
// definitions to help determine whether an order code is a 2-byte order
780
{$define SHORT_ORDER(oc):=((((oc) xor OCODE2_1) and OCODE2_2)=OCODE2_2)}
782
// General 2-byte order structure
789
// 2-byte order codes
791
OCODE_GBAR =$68; // Begin area
792
OCODE_GCFIG =$7D; // Close figure
793
OCODE_GEEL =$49; // End element
794
OCODE_GEPTH =$7F; // End path
795
OCODE_GEPROL =$3E; // End prologue
796
OCODE_GPOP =$3F; // Pop
797
OCODE_GSBMX =$0D; // Set background mix
798
OCODE_GPSBMX =$4D; // Push & set b/g mix
799
OCODE_GSCD =$3A; // Set char direction
800
OCODE_GPSCD =$7A; // Push & set char direction
801
OCODE_GSCR =$39; // Set char precision
802
OCODE_GPSCR =$79; // Push & set char precision
803
OCODE_GSCS =$38; // Set char set
804
OCODE_GPSCS =$78; // Push & set char set
805
OCODE_GSCOL =$0A; // Set color
806
OCODE_GPSCOL =$4A; // Push & set color
807
OCODE_GSLE =$1A; // Set line end
808
OCODE_GPSLE =$5A; // Push & set line end
809
OCODE_GSLJ =$1B; // Set line join
810
OCODE_GPSLJ =$5B; // Push & set line join
811
OCODE_GSLT =$18; // Set line type
812
OCODE_GPSLT =$58; // Push & set line type
813
OCODE_GSLW =$19; // Set line width
814
OCODE_GPSLW =$59; // Push & set line width
815
OCODE_GSMP =$3B; // Set marker precision
816
OCODE_GPSMP =$7B; // Push & set marker precision
817
OCODE_GSMS =$3C; // Set marker set
818
OCODE_GPSMS =$7C; // Push & set marker set
819
OCODE_GSMT =$29; // Set marker symbol
820
OCODE_GPSMT =$69; // Push & set marker symbol
821
OCODE_GSMX =$0C; // Set mix
822
OCODE_GPSMX =$4C; // Push & set mix
823
OCODE_GSPS =$08; // Set pattern set
824
OCODE_GPSPS =$48; // Push & set pattern set
825
OCODE_GSPT =$28; // Set pattern symbol
826
OCODE_GPSPT =$09; // Push & set pattern symbol
828
// constants for 2-byte orders
834
GBAR_NOBOUNDARY =$80;
838
// Set Character Precision
842
//***************************************************************************\
846
//***************************************************************************/
848
// definitions to help determine whether an order code is a long order
852
{$define LONG_ORDER(oc):=(not((oc)=OCODE_VLONG or BYTE_ORDER(oc) or SHORT_ORDER(oc)))}
854
// long order structure
859
LORDER=record // lord
862
uchData: Array[0..LORDER_ML-1] of Byte;
865
// Long orders for which the length of data is normally zero
867
OCODE_GEAR =$60; // End Area
868
OCODE_GEIMG =$93; // End Image
870
// Long orders for which the data is contained in a type already defined
874
OCODE_GCCHST = $83; // char string at curr posn
875
GCCHST_MC = 255; // Max len of string in bytes
877
OCODE_GCHST = $C3; // char string at given pos
878
GCHST_SMC = 251; // Max len of string (S)
879
GCHST_LMC = 247; // Max len of string (L)
881
// Character String Move
882
OCODE_GCCHSTM = $B1; // char string move at c.p.
883
GCCHSTM_MC = 255; // Max len of string in byte
885
OCODE_GCHSTM = $F1; // char string move at g.p.
886
GCHSTM_SMC = 251; // Max len of string (S)
887
GCHSTM_LMC = 247; // Max len of string (L)
890
OCODE_GCOMT = $01; // Comment
891
GCOMT_ML = 255; // Maximum len of comment data
894
OCODE_GIMD = $92; // Image data
895
GIMD_ML = 255; // Maximum len of image data
898
OCODE_GCFARC = $87; // full arc at current posn
899
OCODE_GFARC = $C7; // full arc at given posn
902
OCODE_GLABL = $D3; // Label
904
// Set Current Position
905
OCODE_GSCP = $21; // Set current position
906
OCODE_GPSCP = $61; // Push and set curr posn
909
OCODE_GCBEZ = $A5; // Bezier spline at curr pos
910
GCBEZ_SMB = 21; // Max number of splines (S)
911
GCBEZ_LMB = 10; // Max number of splines (L)
913
OCODE_GBEZ = $E5; // Bezier spline at given pos
914
GBEZ_SMB = 20; // Max number of splines (S)
915
GBEZ_LMB = 10; // Max number of splines (L)
918
OCODE_GCFLT = $85; // fillet at current posn
919
GCFLT_SMP = 63; // Max number of points (S)
920
GCFLT_LMP = 31; // Max number of points (L)
922
OCODE_GFLT = $C5; // fillet at given position
923
GFLT_SMP = 62; // Max number of points (S)
924
GFLT_LMP = 30; // Max number of points (L)
927
OCODE_GCLINE = $81; // polyline at current posn
928
GCLINE_SMP = 63; // Max number of points (S)
929
GCLINE_LMP = 31; // Max number of points (L)
931
OCODE_GLINE = $C1; // polyline at given posn
932
GLINE_SMP = 62; // Max number of points (S)
933
GLINE_LMP = 30; // Max number of points (L)
936
OCODE_GCMRK = $82; // marker at current posn
937
GCMRK_SMP = 63; // Max number of points (S)
938
GCMRK_LMP = 31; // Max number of points (L)
940
OCODE_GMRK = $C2; // marker at given posn
941
GMRK_SMP = 62; // Max number of points (S)
942
GMRK_LMP = 30; // Max number of points (L)
945
OCODE_GCRLINE =$A1; // Relative line at curr pos
946
GCRLINE_MP =127; // Max number of points
948
OCODE_GRLINE = $E1; // Relative line at givn pos
949
GRLINE_SMP = 125; // Max number of points (S)
950
GRLINE_LMP = 123; // Max number of points (L)
952
// Set Background Color
953
OCODE_GSBCOL = $25; // Set background color
954
OCODE_GPSBCOL = $65; // Push and set b/g color
956
// Set Extended Color
957
OCODE_GSECOL = $26; // Set extended color
958
OCODE_GPSECOL = $66; // Push and set ext color
960
// Extended Color values
961
SECOL_DEFAULT0 =$0000;
962
SECOL_DEFAULT1 =$FF00;
963
SECOL_NEUTRAL =$FF07;
966
// Set Character Angle
967
OCODE_GSCA = $34; // Set character angle
968
OCODE_GPSCA = $74; // Push and set char angle
970
// Set Character Shear
971
OCODE_GSCH = $35; // Set character shear
972
OCODE_GPSCH = $75; // Push and set char shear
974
// Set Fractional Line Width
975
OCODE_GSFLW = $11; // Set fractional line width
976
OCODE_GPSFLW = $51; // Push and set frac l width
978
// Set Pick Identifier
979
OCODE_GSPIK = $43; // Set pick identifier
980
OCODE_GPSPIK = $23; // Push and set pick id
983
// Long Orders for which a structure can be defined for the data
986
OCODE_GCARC = $86; // Arc at Current Position
987
OCODE_GARC = $C6; // Arc at Given Position
990
ORDERS_GCARC=record // osgcarc
995
ORDERL_GCARC=record // olgcarc
1002
OCODE_GBEL = $D2; // Begin Element
1007
ORDER_GBEL=record // ogbel
1008
lElementType: Longint;
1009
achDesc: Array[0..GBEL_DL-1] of Char;
1014
OCODE_GCBIMG = $91; // Begin Image at curr posn
1015
OCODE_GBIMG = $D1; // Begin Image at given posn
1018
ORDER_GCBIMG=record // ogbimg
1027
OCODE_GBPTH = $D0; // Begin Path
1030
ORDER_GBPTH=record // ogbpth
1037
OCODE_GCBOX =$80; // Box at current position
1038
OCODE_GBOX =$C0; // Box at given position
1041
ORDERS_GCBOX=record // osgcbox
1049
ORDERL_GCBOX=record // olgcbox
1059
GCBOX_BOUNDARY =$20;
1062
OCODE_GCALLS =$07; // call segment
1065
ORDER_GCALLS=record // ogcalls
1072
OCODE_GFPTH =$D7; // Fill path
1075
ORDER_GFPTH=record // ogfpth
1082
GFPTH_ALTERNATE =$00;
1087
OCODE_GOPTH =$D4; // Outline Path
1090
ORDER_GOPTH=record // ogopth
1098
OCODE_GMPTH =$D8; // modify path
1101
ORDER_GMPTH=record // ogmpth
1111
OCODE_GCPARC =$A3; // Partial arc at curr posn
1112
OCODE_GPARC =$E3; // Partial arc at given posn
1115
ORDERS_GCPARC=record // osgcparc
1117
ufx88Multiplier: FIXED88;
1118
usStartAngle: Longint;
1119
usSweepAngle: Longint;
1122
ORDERL_GCPARC=record // olgcparc
1124
ufxMultiplier: FIXED;
1125
usStartAngle: Longint;
1126
usSweepAngle: Longint;
1131
OCODE_GSCPTH =$B4; // Set clip path
1134
ORDER_GSCPTH=record // ogscpth
1141
GSCPTH_ALTERNATE =$00;
1142
GSCPTH_WINDING =$40;
1144
GSCPTH_INTERSECT =$20;
1146
// Set Arc Parameters
1147
OCODE_GSAP =$22; // Set arc parameters
1148
OCODE_GPSAP =$62; // Push and set arc params
1151
ORDERS_GSAP=record // osgsap
1158
ORDERL_GSAP=record // olgsap
1165
// Set Background Indexed Color
1167
OCODE_GSBICOL =$A7; // Set b/g indexed color
1168
OCODE_GPSBICOL =$E7; // Push and set b/g ind color
1169
OCODE_GSICOL =$A6; // Set indexed color
1170
OCODE_GPSICOL =$E6; // Push and set indexd color
1174
ORDER_GSBICOL=record // ogbicol
1176
auchColor: Array[0..3-1] of Byte;
1188
// Set Character Cell
1189
OCODE_GSCC =$33; // Set character cell
1190
OCODE_GPSCC =$03; // Push and set char cell
1193
ORDERS_GSCC=record // osgscc
1202
ORDERL_GSCC=record // olgscc
1216
OCODE_GSMC =$37; // Set marker cell
1217
OCODE_GPSMC =$77; // Push and set marker cell
1220
ORDERS_GSMC=record // osgsmc
1227
ORDERL_GSMC=record // olgsmc
1238
// Set Pattern Reference Point
1239
OCODE_GSPRP =$A0; // Set pattern ref point
1240
OCODE_GPSPRP =$E0; // Push and set patt ref pt
1243
ORDERS_GSPRP=record // osgsprp
1249
ORDERL_GSPRP=record // olgsprp
1260
// Set Individual Attribute
1261
OCODE_GSIA =$14; // Set individual attribute
1262
OCODE_GPSIA =$54; // Push and set ind attr
1267
ORDER_GSIA=record // ogsia
1271
auchValue: Array[0..GSIA_VL-1] of Byte;
1293
// Set Model /Viewing Transform
1294
OCODE_GSTM =$24; // Set model transform
1295
OCODE_GPSTM =$64; // Push and set model tfm
1297
OCODE_GSTV =$31; // Set Viewing Transform
1302
ORDERS_GSTM=record // osgstm
1306
asMatrix: Array[0..GSTM_ML-1] of Integer;
1309
ORDERL_GSTM=record // olgstm
1313
alMatrix: Array[0..GSTM_ML-1] of Longint;
1337
GSTM_OVERWRITE =$03;
1339
GSTV_OVERWRITE =$00;
1342
// Set Segment Boundary, Viewing Window
1343
OCODE_GSSB =$32; // Set segment boundary
1344
OCODE_GSVW =$27; // Set viewing window
1345
OCODE_GPSVW =$67; // Push and set view window
1350
ORDERS_GSSB=record // osgssb
1353
alMatrix: Array[0..GSSB_ML-1] of Integer;
1356
ORDERL_GSSB=record // olgssb
1359
alMatrix: Array[0..GSSB_ML-1] of Longint;
1368
GSVW_INTERSECT =$00;
1371
// Set Segment Characteristics
1372
OCODE_GSGCH =$04; // Set segment characteristics
1377
ORDER_GSGCH=record // ogsgch
1379
auchData: Array[0..GSGCH_ML-1] of Byte;
1382
// Set Stroke Line Width
1384
OCODE_GSSLW =$15; // Set stroke line width
1385
OCODE_GPSSLW =$55; // Push and set strk l width
1388
ORDERS_GSSLW=record // osgsslw
1395
ORDERL_GSSLW=record // olgsslw
1405
// Sharp Fillet at Current Position
1406
OCODE_GCSFLT =$A4; // Sharp fillet at curr pos
1407
OCODE_GSFLT =$E4; // Sharp fillet at given pos
1413
ORDERS_GCSFLT=record // osgcsflt
1414
apt: Array[0..2*GCSFLT_SMF-1] of POINTS;
1415
afxSharpness: Array[0..GCSFLT_SMF-1] of FIXED;
1423
ORDERL_GCSFLT=record // olgcsflt
1424
apt: Array[0..2*GCSFLT_SMF-1] of POINTL;
1425
afxSharpness: Array[0..GCSFLT_SMF-1] of FIXED;
1430
OCODE_GBBLT =$D6; // Bitblt
1433
ORDERS_GBBLT=record // osgbblt
1438
rcsTargetRect: RECT1S;
1439
rclSourceRect: RECTL;
1442
ORDERL_GBBLT=record // olgbblt
1447
rclTargetRect: RECTL;
1448
rclSourceRect: RECTL;
1451
// Char & break extra
1453
OCODE_GSCE =$17; // Set char extra
1454
OCODE_GPSCE =$57; // Push and set char extra
1455
OCODE_GSCBE =$05; // Set char break extra
1456
OCODE_GPSCBE =$45; // Push and set char break extra
1459
ORDER_GSCBE=record // osgsce
1464
ORDER_GSCE=ORDER_GSCBE;
1465
ORDER_GPSCE=ORDER_GSCBE;
1466
ORDER_GPSCBE=ORDER_GSCBE;
1470
OCODE_GESCP =$D5; // Escape
1473
//* type describes type of escape order, identifier gives the escape
1474
//* order if the type is registered
1479
ORDER_GESCP=record // ogescp
1482
auchData: Array[0..GESCP_ML-1] of Byte; // Escape data
1486
GESCP_REG =$80; // identifier is registered
1490
GEBB_REGID =$02; // uchIdent - Bitblt
1492
ETYPE_GEBB =$800200D5;
1497
ORDERL_GEBB=record // olgebb
1504
aptPoints: Array[0..GEBB_LMP-1] of POINTL;
1509
GEPEL_REGID =$01; // uchIdent - Set Pel
1511
ETYPE_GEPEL =$800100D5;
1513
// Escape (DrawBits)
1514
GEDB_REGID =$04; // uchIdent - DrawBits
1516
ETYPE_GEDB =$800400D5;
1519
ORDERL_GEDB=record // olgedb
1525
rclTargetRect: RECTL;
1526
rclSourceRect: RECTL;
1529
// Escape (FloodFill)
1531
GEFF_REGID =$03; // uchIdent - FloodFill
1533
ETYPE_GEFF =$800300D5;
1536
ORDERL_GEFF=record // olgeff
1538
auchColor: Array[0..3-1] of Byte;
1541
// Element Types for attribute bundles
1543
ETYPE_LINEBUNDLE =$0000FD01;
1544
ETYPE_CHARBUNDLE =$0000FD02;
1545
ETYPE_MARKERBUNDLE =$0000FD03;
1546
ETYPE_AREABUNDLE =$0000FD04;
1547
ETYPE_IMAGEBUNDLE =$0000FD05;
1549
//***************************************************************************\
1551
//* Very long orders
1553
//***************************************************************************/
1555
// macro to tell whether this is a very long order
1556
{$define VLONG_ORDER(oc):=((oc)=OCODE_VLONG)}
1558
// Very long order structure
1563
VORDER=record // vord
1566
uchLength: SWPUSHORT;
1567
uchData: Array[0..VORDER_ML-1] of Byte;
1570
// Character String Extended
1572
OCODEQ_GCCHSTE =$B0; // Qualifier - current posn
1573
OCODEQ_GCHSTE =$F0; // Qualifier - given position
1574
OCODEQ_GTCHSPA =$F4; // Tabbed Char String At
1576
ETYPE_GCCHSTE =$0000FEB0;
1577
ETYPE_GCHSTE =$0000FEF0;
1580
ORDERS_GCCHSTE=record // osgcchste
1583
ptRect: Array[0..2-1] of POINTS;
1584
cchString: SWPUSHORT;
1585
achString: Array[0..1-1] of Char;
1586
adx: Array[0..1-1] of Integer;
1589
ORDERL_GCCHSTE=record // olgcchste
1592
ptRect: Array[0..2-1] of POINTL;
1593
cchString: SWPUSHORT;
1594
achString: Array[0..1-1] of Char;
1595
adx: Array[0..1-1] of Longint;
1598
ORDERL_GTCHSPA=record // olgcchspa
1601
ptRect: Array[0..2-1] of POINTL;
1602
cchString: SWPUSHORT;
1603
achString: Array[0..1-1] of Char;
1604
adx: Array[0..2-1] of Longint;
1605
tabs: Array[0..1-1] of Longint;
1609
GCCHSTE_DRAWRECT =$80;
1610
GCCHSTE_NORECT =$00;
1612
GCCHSTE_NOCLIP =$00;
1613
GCCHSTE_DEEMPHASIZE =$20; // Reserved
1614
GCCHSTE_NODEEMPHASIZE =$00;
1615
GCCHSTE_LEAVEPOS =$10;
1616
GCCHSTE_MOVEPOS =$00;
1617
GCCHSTE_UNDERSCORE =$08;
1618
GCCHSTE_NOUNDERSCORE =$00;
1619
GCCHSTE_STRIKEOUT =$04;
1620
GCCHSTE_NOSTRIKEOUT =$00;
1621
GTCHSPA_STARTPOS =$02;
1622
GTCHSPA_NOSTARTPOS =$00;
1625
OCODEQ_GEESCP =$D5; // Qualifier - extended escape
1630
ORDER_GEESCP=record // ogeescp
1633
auchData: Array[0..GEESCP_ML-1] of Byte;
1636
//#pragma pack() /* reset to default packing */
702
1640
function GpiCreatePS(hab,hdc : cardinal;var psizlSize : SIZEL;flOptions : cardinal) : cardinal;cdecl;
703
1641
function GpiDestroyPS(hps : cardinal) : longbool;cdecl;
704
1642
function GpiAssociate(hps,hdc : cardinal) : longbool;cdecl;