~ubuntu-branches/ubuntu/dapper/fpc/dapper

« back to all changes in this revision

Viewing changes to rtl/os2/pmgpi.pas

  • Committer: Bazaar Package Importer
  • Author(s): Carlos Laviola
  • Date: 2004-08-12 16:29:37 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20040812162937-moo8ulvysp1ln771
Tags: 1.9.4-5
fp-compiler: needs ld, adding dependency on binutils.  (Closes: #265265)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
{****************************************************************************
2
2
 
3
 
    $Id: pmgpi.pas,v 1.1 2000/07/13 06:31:06 michael Exp $
 
3
    $Id: pmgpi.pas,v 1.5 2003/03/27 18:11:23 yuri Exp $
4
4
 
5
5
                            PMGPI interface unit
6
6
                     FPC Pascal Runtime Library for OS/2
7
 
                   Copyright (c) 1999-2000 by Florian Kl�mpfl
 
7
                   Copyright (c) 1999-2000 by Florian Klaempfl
8
8
                    Copyright (c) 1999-2000 by Ramon Bosque
9
9
 
10
10
 The Free Pascal runtime library is distributed under the Library GNU Public
39
39
 
40
40
interface
41
41
 
 
42
{$MACRO ON}
 
43
 
42
44
uses    os2def,pmbitmap;
43
45
 
44
46
const   GPI_ERROR                           =       0;
699
701
        PPolyset=^Polyset;
700
702
        TPolyset=Polyset;
701
703
 
 
704
// ===========================================================================
 
705
//*
 
706
//* The orders fall into 4 categories :-
 
707
//*
 
708
//* 1) 1-byte orders
 
709
//*
 
710
//* 2) 2-byte orders    - second byte contains the value
 
711
//*
 
712
//* 3) Long orders      - second byte gives the order length, subsequent bytes
 
713
//*                       contain the values (up to 256 bytes long)
 
714
//*
 
715
//* 4) Very long orders - third and fourth bytes gives the order length,
 
716
//*                       subsequent bytes contain the values (up to 64K long)
 
717
//*
 
718
//* ===========================================================================
 
719
 
 
720
//#pragma pack(1)      /* pack on byte boundary */
 
721
 
 
722
//***************************************************************************\
 
723
//*
 
724
//* Miscellaneous structures used in this file
 
725
//*
 
726
//***************************************************************************/
 
727
 
 
728
// form of RECTL with shorts instead of longs
 
729
type
 
730
  RECT1S=record        // rcs
 
731
    xLeft: Integer;
 
732
    yBottom: Integer;
 
733
    xRight: Integer;
 
734
    yTop: Integer;
 
735
  end;
 
736
 
 
737
// form of POINTL with 1 byte offsets instead of longs
 
738
  ODPOINT=record          // odpt
 
739
    dx: Char;
 
740
    dy: Char;
 
741
  end;
 
742
 
 
743
// form of SIZEL with shorts instead of longs
 
744
  SIZES=record            // sizs
 
745
    cx: Integer;
 
746
    cy: Integer;
 
747
  end;
 
748
 
 
749
// unsigned two-byte swapped integer
 
750
  SWPUSHORT=record        // swpus
 
751
    HiByte: Byte;
 
752
    LoByte: Byte;
 
753
  end;
 
754
 
 
755
//***************************************************************************\
 
756
//*
 
757
//* 1-byte orders
 
758
//*
 
759
//***************************************************************************/
 
760
 
 
761
// macro to tell whether this is a 1-byte order
 
762
{$define BYTE_ORDER(oc):=((oc)=OCODE_GNOP1 or (oc)=OCODE_GESD)}
 
763
 
 
764
// 1-byte order codes
 
765
const
 
766
  OCODE_GNOP1    =$00;            // No-operation
 
767
  OCODE_GESD     =$FF;            // End symbol definition
 
768
 
 
769
//***************************************************************************\
 
770
//
 
771
// 2-byte orders
 
772
//
 
773
//***************************************************************************/
 
774
 
 
775
// definitions to help determine whether an order code is a 2-byte order
 
776
const
 
777
  OCODE2_1       =$80;
 
778
  OCODE2_2       =$88;
 
779
 
 
780
{$define SHORT_ORDER(oc):=((((oc) xor OCODE2_1) and OCODE2_2)=OCODE2_2)}
 
781
 
 
782
// General 2-byte order structure
 
783
type
 
784
  ORDER=record        // ord
 
785
    idCode: Byte;
 
786
    uchData: Byte;
 
787
  end;
 
788
 
 
789
// 2-byte order codes
 
790
const
 
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
 
827
 
 
828
// constants for 2-byte orders
 
829
 
 
830
// Begin area
 
831
const
 
832
  GBAR_RESERVED   =$80;
 
833
  GBAR_BOUNDARY   =$C0;
 
834
  GBAR_NOBOUNDARY =$80;
 
835
  GBAR_WINDING    =$A0;
 
836
  GBAR_ALTERNATE  =$80;
 
837
 
 
838
// Set Character Precision
 
839
const
 
840
  GSCR_PRECISION  =$0F;
 
841
 
 
842
//***************************************************************************\
 
843
//*
 
844
//* Long orders
 
845
//*
 
846
//***************************************************************************/
 
847
 
 
848
// definitions to help determine whether an order code is a long order
 
849
const
 
850
  OCODE_VLONG    =$FE;
 
851
 
 
852
{$define LONG_ORDER(oc):=(not((oc)=OCODE_VLONG or BYTE_ORDER(oc) or SHORT_ORDER(oc)))}
 
853
 
 
854
// long order structure
 
855
const
 
856
  LORDER_ML=253;
 
857
 
 
858
type
 
859
  LORDER=record           // lord
 
860
    idCode: Byte;
 
861
    uchLength: Byte;
 
862
    uchData: Array[0..LORDER_ML-1] of Byte;
 
863
  end;
 
864
 
 
865
// Long orders for which the length of data is normally zero
 
866
const
 
867
  OCODE_GEAR     =$60;            // End Area
 
868
  OCODE_GEIMG    =$93;            // End Image
 
869
 
 
870
// Long orders for which the data is contained in a type already defined
 
871
 
 
872
// Character String
 
873
const
 
874
  OCODE_GCCHST  = $83;            // char string at curr posn
 
875
  GCCHST_MC     = 255;            // Max len of string in bytes
 
876
 
 
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)
 
880
 
 
881
// Character String Move
 
882
  OCODE_GCCHSTM = $B1;            // char string move at c.p.
 
883
  GCCHSTM_MC    = 255;             // Max len of string in byte
 
884
 
 
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)
 
888
 
 
889
// Comment
 
890
  OCODE_GCOMT   = $01;            // Comment
 
891
  GCOMT_ML      = 255;             // Maximum len of comment data
 
892
 
 
893
// Image
 
894
  OCODE_GIMD    = $92;            // Image data
 
895
  GIMD_ML       = 255;             // Maximum len of image data
 
896
 
 
897
// Full Arc
 
898
  OCODE_GCFARC  = $87;            // full arc at current posn
 
899
  OCODE_GFARC   = $C7;            // full arc at given posn
 
900
 
 
901
// Label
 
902
  OCODE_GLABL   = $D3;            // Label
 
903
 
 
904
// Set Current Position
 
905
  OCODE_GSCP    = $21;            // Set current position
 
906
  OCODE_GPSCP   = $61;            // Push and set curr posn
 
907
 
 
908
// Bezier spline
 
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)
 
912
 
 
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)
 
916
 
 
917
// Fillet
 
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)
 
921
 
 
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)
 
925
 
 
926
// Polyline
 
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)
 
930
 
 
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)
 
934
 
 
935
// Polymarker
 
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)
 
939
 
 
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)
 
943
 
 
944
// Relative Line
 
945
  OCODE_GCRLINE  =$A1;            // Relative line at curr pos
 
946
  GCRLINE_MP     =127;             // Max number of points
 
947
 
 
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)
 
951
 
 
952
// Set Background Color
 
953
  OCODE_GSBCOL  = $25;            // Set background color
 
954
  OCODE_GPSBCOL = $65;            // Push and set b/g color
 
955
 
 
956
// Set Extended Color
 
957
  OCODE_GSECOL  = $26;            // Set extended color
 
958
  OCODE_GPSECOL = $66;            // Push and set ext color
 
959
 
 
960
// Extended Color values
 
961
  SECOL_DEFAULT0  =$0000;
 
962
  SECOL_DEFAULT1  =$FF00;
 
963
  SECOL_NEUTRAL   =$FF07;
 
964
  SECOL_RESET     =$FF08;
 
965
 
 
966
// Set Character Angle
 
967
  OCODE_GSCA    = $34;            // Set character angle
 
968
  OCODE_GPSCA   = $74;            // Push and set char angle
 
969
 
 
970
// Set Character Shear
 
971
  OCODE_GSCH    = $35;            // Set character shear
 
972
  OCODE_GPSCH   = $75;            // Push and set char shear
 
973
 
 
974
// Set Fractional Line Width
 
975
  OCODE_GSFLW   = $11;            // Set fractional line width
 
976
  OCODE_GPSFLW  = $51;            // Push and set frac l width
 
977
 
 
978
// Set Pick Identifier
 
979
  OCODE_GSPIK   = $43;            // Set pick identifier
 
980
  OCODE_GPSPIK  = $23;            // Push and set pick id
 
981
 
 
982
 
 
983
// Long Orders for which a structure can be defined for the data
 
984
 
 
985
// Arc
 
986
  OCODE_GCARC   = $86;            // Arc at Current Position
 
987
  OCODE_GARC    = $C6;            // Arc at Given Position
 
988
 
 
989
type
 
990
  ORDERS_GCARC=record     // osgcarc
 
991
    ptInter: POINTS;
 
992
    ptEnd: POINTS;
 
993
  end;
 
994
 
 
995
  ORDERL_GCARC=record     // olgcarc
 
996
    ptInter: POINTL;
 
997
    ptEnd: POINTL;
 
998
  end;
 
999
 
 
1000
// Begin Element
 
1001
const
 
1002
  OCODE_GBEL    = $D2;            // Begin Element
 
1003
 
 
1004
  GBEL_DL       = 251;
 
1005
 
 
1006
type
 
1007
  ORDER_GBEL=record       // ogbel
 
1008
    lElementType: Longint;
 
1009
    achDesc: Array[0..GBEL_DL-1] of Char;
 
1010
  end;
 
1011
 
 
1012
// Begin Image
 
1013
const
 
1014
  OCODE_GCBIMG  = $91;            // Begin Image at curr posn
 
1015
  OCODE_GBIMG   = $D1;            // Begin Image at given posn
 
1016
 
 
1017
type
 
1018
  ORDER_GCBIMG=record     // ogbimg
 
1019
    uchFormat: Byte;
 
1020
    uchReserved: Byte;
 
1021
    cx: SWPUSHORT;
 
1022
    cy: SWPUSHORT;
 
1023
  end;
 
1024
 
 
1025
// Begin Path
 
1026
const
 
1027
  OCODE_GBPTH   = $D0;            // Begin Path
 
1028
 
 
1029
type
 
1030
  ORDER_GBPTH=record      // ogbpth
 
1031
    usReserved: Word;
 
1032
    idPath: Longint;
 
1033
  end;
 
1034
 
 
1035
// Box
 
1036
const
 
1037
  OCODE_GCBOX    =$80;            // Box at current position
 
1038
  OCODE_GBOX     =$C0;            // Box at given position
 
1039
 
 
1040
type
 
1041
  ORDERS_GCBOX=record     // osgcbox
 
1042
    fbFlags: Byte;
 
1043
    uchReserved: Byte;
 
1044
    ptCorner: POINTS;
 
1045
    hAxis: Integer;
 
1046
    vAxis: Integer;
 
1047
  end;
 
1048
 
 
1049
  ORDERL_GCBOX=record     // olgcbox
 
1050
    fbFlags: Byte;
 
1051
    uchReserved: Byte;
 
1052
    ptCorner: POINTL;
 
1053
    hAxis: Longint;
 
1054
    vAxis: Longint;
 
1055
  end;
 
1056
 
 
1057
const
 
1058
  GCBOX_FILL     =$40;
 
1059
  GCBOX_BOUNDARY =$20;
 
1060
 
 
1061
// Call Segment
 
1062
  OCODE_GCALLS   =$07;            // call segment
 
1063
 
 
1064
type
 
1065
  ORDER_GCALLS=record     // ogcalls
 
1066
    sReserved: Word;
 
1067
    idSegment: Longint;
 
1068
  end;
 
1069
 
 
1070
// Fill Path
 
1071
const
 
1072
  OCODE_GFPTH   =$D7;            // Fill path
 
1073
 
 
1074
type
 
1075
  ORDER_GFPTH=record     // ogfpth
 
1076
    fbFlags: Byte;
 
1077
    uchReserved: Byte;
 
1078
    idPath: Longint;
 
1079
  end;
 
1080
 
 
1081
const
 
1082
  GFPTH_ALTERNATE =$00;
 
1083
  GFPTH_WINDING   =$40;
 
1084
  GFPTH_MODIFY    =$20;
 
1085
 
 
1086
// Outline Path
 
1087
  OCODE_GOPTH    =$D4;            // Outline Path
 
1088
 
 
1089
type
 
1090
  ORDER_GOPTH=record     // ogopth
 
1091
    fbFlags: Byte;
 
1092
    uchReserved: Byte;
 
1093
    idPath: Longint;
 
1094
  end;
 
1095
 
 
1096
// Modify Path
 
1097
const
 
1098
  OCODE_GMPTH =$D8;               // modify path
 
1099
 
 
1100
type
 
1101
  ORDER_GMPTH=record      // ogmpth
 
1102
    uchMode: Byte;
 
1103
    uchReserved: Byte;
 
1104
    idPath: Longint;
 
1105
  end;
 
1106
 
 
1107
const
 
1108
  GMPTH_STROKE   =$06;
 
1109
 
 
1110
// Partial Arc
 
1111
  OCODE_GCPARC   =$A3;            // Partial arc at curr posn
 
1112
  OCODE_GPARC    =$E3;            // Partial arc at given posn
 
1113
 
 
1114
type
 
1115
  ORDERS_GCPARC=record    // osgcparc
 
1116
    ptCenter: POINTS;
 
1117
    ufx88Multiplier: FIXED88;
 
1118
    usStartAngle: Longint;
 
1119
    usSweepAngle: Longint;
 
1120
  end;
 
1121
 
 
1122
  ORDERL_GCPARC=record    // olgcparc
 
1123
    ptCenter: POINTL;
 
1124
    ufxMultiplier: FIXED;
 
1125
    usStartAngle: Longint;
 
1126
    usSweepAngle: Longint;
 
1127
  end;
 
1128
 
 
1129
// Set Clip Path
 
1130
const
 
1131
  OCODE_GSCPTH   =$B4;            // Set clip path
 
1132
 
 
1133
type
 
1134
  ORDER_GSCPTH=record     // ogscpth
 
1135
    fbFlags: Byte;
 
1136
    uchReserved: Byte;
 
1137
    idPath: Longint;
 
1138
  end;
 
1139
 
 
1140
const
 
1141
  GSCPTH_ALTERNATE =$00;
 
1142
  GSCPTH_WINDING   =$40;
 
1143
  GSCPTH_RESET     =$00;
 
1144
  GSCPTH_INTERSECT =$20;
 
1145
 
 
1146
// Set Arc Parameters
 
1147
  OCODE_GSAP     =$22;            // Set arc parameters
 
1148
  OCODE_GPSAP    =$62;            // Push and set arc params
 
1149
 
 
1150
type
 
1151
  ORDERS_GSAP=record      // osgsap
 
1152
    p: Integer;
 
1153
    q: Integer;
 
1154
    r: Integer;
 
1155
    s: Integer;
 
1156
  end;
 
1157
 
 
1158
  ORDERL_GSAP=record      // olgsap
 
1159
    p: Longint;
 
1160
    q: Longint;
 
1161
    r: Longint;
 
1162
    s: Longint;
 
1163
  end;
 
1164
 
 
1165
// Set Background Indexed Color
 
1166
const
 
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
 
1171
 
 
1172
 
 
1173
type
 
1174
  ORDER_GSBICOL=record    // ogbicol
 
1175
    fbFlags: Byte;
 
1176
    auchColor: Array[0..3-1] of Byte;
 
1177
  end;
 
1178
 
 
1179
const
 
1180
  SICOL_SPECIFY  =$00;
 
1181
  SICOL_SPECIAL  =$40;
 
1182
  SICOL_DEFAULT  =$80;
 
1183
  SICOL_BLACK    =1;
 
1184
  SICOL_WHITE    =2;
 
1185
  SICOL_ONES     =4;
 
1186
  SICOL_ZEROES   =5;
 
1187
 
 
1188
// Set Character Cell
 
1189
  OCODE_GSCC     =$33;            // Set character cell
 
1190
  OCODE_GPSCC    =$03;            // Push and set char cell
 
1191
 
 
1192
type
 
1193
  ORDERS_GSCC=record      // osgscc
 
1194
    cxInt: Integer;
 
1195
    cyInt: Integer;
 
1196
    cxFract: Word;
 
1197
    cyFract: Word;
 
1198
    fbFlags: Byte;
 
1199
    uchReserved: Byte;
 
1200
  end;
 
1201
 
 
1202
  ORDERL_GSCC=record      // olgscc
 
1203
    cxInt: Longint;
 
1204
    cyInt: Longint;
 
1205
    cxFract: Word;
 
1206
    cyFract: Word;
 
1207
    fbFlags: Byte;
 
1208
    uchReserved: Byte;
 
1209
  end;
 
1210
 
 
1211
const
 
1212
  GSCC_ZERODEF   =$00;
 
1213
  GSCC_ZEROZERO  =$80;
 
1214
 
 
1215
// Set Marker Cell
 
1216
  OCODE_GSMC     =$37;            // Set marker cell
 
1217
  OCODE_GPSMC    =$77;            // Push and set marker cell
 
1218
 
 
1219
type
 
1220
  ORDERS_GSMC=record      // osgsmc
 
1221
    cx: Integer;
 
1222
    cy: Integer;
 
1223
    fbFlags: Byte;
 
1224
    uchReserved: Byte;
 
1225
  end;
 
1226
 
 
1227
  ORDERL_GSMC=record      // olgsmc
 
1228
    cx: Longint;
 
1229
    cy: Longint;
 
1230
    fbFlags: Byte;
 
1231
    uchReserved: Byte;
 
1232
  end;
 
1233
 
 
1234
const
 
1235
  GSMC_ZERODEF   =$00;
 
1236
  GSMC_ZEROZERO  =$80;
 
1237
 
 
1238
// Set Pattern Reference Point
 
1239
  OCODE_GSPRP    =$A0;            // Set pattern ref point
 
1240
  OCODE_GPSPRP   =$E0;            // Push and set patt ref pt
 
1241
 
 
1242
type
 
1243
  ORDERS_GSPRP=record     // osgsprp
 
1244
    fbFlags: Byte;
 
1245
    uchReserved: Byte;
 
1246
    ptPos: POINTS;
 
1247
  end;
 
1248
 
 
1249
  ORDERL_GSPRP=record     // olgsprp
 
1250
    fbFlags: Byte;
 
1251
    uchReserved: Byte;
 
1252
    ptPos: POINTL;
 
1253
  end;
 
1254
 
 
1255
const
 
1256
  GSPRP_DEFAULT  =$80;
 
1257
  GSPRP_SPECIFY  =$00;
 
1258
 
 
1259
 
 
1260
// Set Individual Attribute
 
1261
  OCODE_GSIA     =$14;            // Set individual attribute
 
1262
  OCODE_GPSIA    =$54;            // Push and set ind attr
 
1263
 
 
1264
  GSIA_VL=3;
 
1265
 
 
1266
type
 
1267
  ORDER_GSIA=record       // ogsia
 
1268
    uchAttrType: Byte;
 
1269
    uchPrimType: Byte;
 
1270
    fbFlags: Byte;
 
1271
    auchValue: Array[0..GSIA_VL-1] of Byte;
 
1272
  end;
 
1273
 
 
1274
const
 
1275
  GSIA_COLOR     =$01;
 
1276
  GSIA_BCOLOR    =$02;
 
1277
  GSIA_MIX       =$03;
 
1278
  GSIA_BMIX      =$04;
 
1279
  GSIA_LINE      =$01;
 
1280
  GSIA_CHAR      =$02;
 
1281
  GSIA_MARKER    =$03;
 
1282
  GSIA_PATTERN   =$04;
 
1283
  GSIA_IMAGE     =$05;
 
1284
  GSIA_SPECIFY   =$00;
 
1285
  GSIA_SPECIAL   =$40;
 
1286
  GSIA_DEFAULT   =$80;
 
1287
  GSIA_BLACK     =1;
 
1288
  GSIA_WHITE     =2;
 
1289
  GSIA_ONES      =4;
 
1290
  GSIA_ZEROES    =5;
 
1291
 
 
1292
 
 
1293
// Set Model /Viewing Transform
 
1294
  OCODE_GSTM     =$24;            // Set model transform
 
1295
  OCODE_GPSTM    =$64;            // Push and set model tfm
 
1296
 
 
1297
  OCODE_GSTV     =$31;            // Set Viewing Transform
 
1298
 
 
1299
  GSTM_ML        =16;
 
1300
 
 
1301
type
 
1302
  ORDERS_GSTM=record       // osgstm
 
1303
    uchReserved: Byte;
 
1304
    fbFlags: Byte;
 
1305
    fsMask: Word;
 
1306
    asMatrix: Array[0..GSTM_ML-1] of Integer;
 
1307
  end;
 
1308
 
 
1309
  ORDERL_GSTM=record       // olgstm
 
1310
    uchReserved: Byte;
 
1311
    fbFlags: Byte;
 
1312
    fsMask: Word;
 
1313
    alMatrix: Array[0..GSTM_ML-1] of Longint;
 
1314
  end;
 
1315
 
 
1316
const
 
1317
  GSTM_M11     =$8000;
 
1318
  GSTM_M12     =$4000;
 
1319
  GSTM_M13     =$2000;
 
1320
  GSTM_M14     =$1000;
 
1321
  GSTM_M21     =$0800;
 
1322
  GSTM_M22     =$0400;
 
1323
  GSTM_M23     =$0200;
 
1324
  GSTM_M24     =$0100;
 
1325
  GSTM_M31     =$0080;
 
1326
  GSTM_M32     =$0040;
 
1327
  GSTM_M33     =$0020;
 
1328
  GSTM_M34     =$0010;
 
1329
  GSTM_M41     =$0008;
 
1330
  GSTM_M42     =$0004;
 
1331
  GSTM_M43     =$0002;
 
1332
  GSTM_M44     =$0001;
 
1333
 
 
1334
  GSTM_UNITY     =$00;
 
1335
  GSTM_AFTER     =$01;
 
1336
  GSTM_BEFORE    =$02;
 
1337
  GSTM_OVERWRITE =$03;
 
1338
 
 
1339
  GSTV_OVERWRITE =$00;
 
1340
  GSTV_AFTER     =$04;
 
1341
 
 
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
 
1346
 
 
1347
  GSSB_ML        =4;
 
1348
 
 
1349
type
 
1350
  ORDERS_GSSB=record      // osgssb
 
1351
    fbFlags: Byte;
 
1352
    fbMask: Byte;
 
1353
    alMatrix: Array[0..GSSB_ML-1] of Integer;
 
1354
  end;
 
1355
 
 
1356
  ORDERL_GSSB=record      // olgssb
 
1357
    fbFLags: Byte;
 
1358
    fbMask: Byte;
 
1359
    alMatrix: Array[0..GSSB_ML-1] of Longint;
 
1360
  end;
 
1361
 
 
1362
const
 
1363
  GSSB_XLEFT     =$20;
 
1364
  GSSB_XRIGHT    =$10;
 
1365
  GSSB_YBOTTOM   =$08;
 
1366
  GSSB_YTOP      =$04;
 
1367
 
 
1368
  GSVW_INTERSECT =$00;
 
1369
  GSVW_REPLACE   =$80;
 
1370
 
 
1371
// Set Segment Characteristics
 
1372
  OCODE_GSGCH    =$04;            // Set segment characteristics
 
1373
 
 
1374
  GSGCH_ML       =254;
 
1375
 
 
1376
type
 
1377
  ORDER_GSGCH=record      // ogsgch
 
1378
    uchIdent: Byte;
 
1379
    auchData: Array[0..GSGCH_ML-1] of Byte;
 
1380
  end;
 
1381
 
 
1382
// Set Stroke Line Width
 
1383
const
 
1384
  OCODE_GSSLW    =$15;            // Set stroke line width
 
1385
  OCODE_GPSSLW   =$55;            // Push and set strk l width
 
1386
 
 
1387
type
 
1388
  ORDERS_GSSLW=record     // osgsslw
 
1389
    fbFlags: Byte;
 
1390
    uchReserved: Byte;
 
1391
    LineWidth: Integer;
 
1392
  end;
 
1393
 
 
1394
type
 
1395
  ORDERL_GSSLW=record     // olgsslw
 
1396
    fbFlags: Byte;
 
1397
    uchReserved: Byte;
 
1398
    LineWidth: Longint;
 
1399
  end;
 
1400
 
 
1401
const
 
1402
  GSSLW_DEFAULT  =$80;
 
1403
  GSSLW_SPECIFY  =$00;
 
1404
 
 
1405
// Sharp Fillet at Current Position
 
1406
  OCODE_GCSFLT   =$A4;            // Sharp fillet at curr pos
 
1407
  OCODE_GSFLT    =$E4;            // Sharp fillet at given pos
 
1408
 
 
1409
  GCSFLT_SMF     =21;
 
1410
  GSFLT_SMF      =20;
 
1411
 
 
1412
type
 
1413
  ORDERS_GCSFLT=record    // osgcsflt
 
1414
    apt: Array[0..2*GCSFLT_SMF-1] of POINTS;
 
1415
    afxSharpness: Array[0..GCSFLT_SMF-1] of FIXED;
 
1416
  end;
 
1417
 
 
1418
const
 
1419
  GCSFLT_LMF    = 12;
 
1420
  GSFLT_LMF     = 12;
 
1421
 
 
1422
type
 
1423
  ORDERL_GCSFLT=record    // olgcsflt
 
1424
    apt: Array[0..2*GCSFLT_SMF-1] of POINTL;
 
1425
    afxSharpness: Array[0..GCSFLT_SMF-1] of FIXED;
 
1426
  end;
 
1427
 
 
1428
// Bitblt
 
1429
const
 
1430
  OCODE_GBBLT    =$D6;            // Bitblt
 
1431
 
 
1432
type
 
1433
  ORDERS_GBBLT=record      // osgbblt
 
1434
    fsFlags: Word;
 
1435
    usMix: Word;
 
1436
    hbmSrc: HBITMAP;
 
1437
    lOptions: Longint;
 
1438
    rcsTargetRect: RECT1S;
 
1439
    rclSourceRect: RECTL;
 
1440
  end;
 
1441
 
 
1442
  ORDERL_GBBLT=record      // olgbblt
 
1443
    fsFlags: Word;
 
1444
    usMix: Word;
 
1445
    hbmSrc: HBITMAP;
 
1446
    lOptions: Longint;
 
1447
    rclTargetRect: RECTL;
 
1448
    rclSourceRect: RECTL;
 
1449
  end;
 
1450
 
 
1451
// Char & break extra
 
1452
const
 
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
 
1457
 
 
1458
type
 
1459
  ORDER_GSCBE=record       // osgsce
 
1460
    fbFlags: Byte;
 
1461
    uchReserved: Byte;
 
1462
    ufxextra: FIXED;
 
1463
  end;
 
1464
  ORDER_GSCE=ORDER_GSCBE;
 
1465
  ORDER_GPSCE=ORDER_GSCBE;
 
1466
  ORDER_GPSCBE=ORDER_GSCBE;
 
1467
 
 
1468
// Escape
 
1469
const
 
1470
  OCODE_GESCP    =$D5;            // Escape
 
1471
 
 
1472
 
 
1473
//* type describes type of escape order, identifier gives the escape
 
1474
//* order if the type is registered
 
1475
const
 
1476
  GESCP_ML      = 253;
 
1477
 
 
1478
type
 
1479
  ORDER_GESCP=record      // ogescp
 
1480
    uchType: Byte;
 
1481
    uchIdent: Byte;
 
1482
    auchData: Array[0..GESCP_ML-1] of Byte;           // Escape data
 
1483
  end;
 
1484
 
 
1485
const
 
1486
  GESCP_REG      =$80;            // identifier is registered
 
1487
 
 
1488
// Escape (Bitblt)
 
1489
const
 
1490
  GEBB_REGID     =$02;            // uchIdent - Bitblt
 
1491
 
 
1492
  ETYPE_GEBB     =$800200D5;
 
1493
 
 
1494
  GEBB_LMP       =29;
 
1495
 
 
1496
type
 
1497
  ORDERL_GEBB=record      // olgebb
 
1498
    fbFlags: Byte;
 
1499
    usMix: Word;
 
1500
    cPoints: Byte;
 
1501
    hbmSrc: HBITMAP;
 
1502
    lReserved: Longint;
 
1503
    lOptions: Longint;
 
1504
    aptPoints: Array[0..GEBB_LMP-1] of POINTL;
 
1505
  end;
 
1506
 
 
1507
// Escape (Set Pel)
 
1508
const
 
1509
  GEPEL_REGID    =$01;            // uchIdent - Set Pel
 
1510
 
 
1511
  ETYPE_GEPEL         =$800100D5;
 
1512
 
 
1513
// Escape (DrawBits)
 
1514
  GEDB_REGID     =$04;          // uchIdent - DrawBits
 
1515
 
 
1516
  ETYPE_GEDB          =$800400D5;
 
1517
 
 
1518
type
 
1519
  ORDERL_GEDB=record      // olgedb
 
1520
    fsFlags: Word;
 
1521
    usMix: Word;
 
1522
    pBits: Pointer;
 
1523
    pbmi: PBITMAPINFO2;
 
1524
    lOptions: Longint;
 
1525
    rclTargetRect: RECTL;
 
1526
    rclSourceRect: RECTL;
 
1527
  end;
 
1528
 
 
1529
// Escape (FloodFill)
 
1530
const
 
1531
  GEFF_REGID     =$03;          // uchIdent - FloodFill
 
1532
 
 
1533
  ETYPE_GEFF          =$800300D5;
 
1534
 
 
1535
type
 
1536
  ORDERL_GEFF=record      // olgeff
 
1537
    fsFlags: Byte;
 
1538
    auchColor: Array[0..3-1] of Byte;
 
1539
  end;
 
1540
 
 
1541
// Element Types for attribute bundles
 
1542
const
 
1543
  ETYPE_LINEBUNDLE    =$0000FD01;
 
1544
  ETYPE_CHARBUNDLE    =$0000FD02;
 
1545
  ETYPE_MARKERBUNDLE  =$0000FD03;
 
1546
  ETYPE_AREABUNDLE    =$0000FD04;
 
1547
  ETYPE_IMAGEBUNDLE   =$0000FD05;
 
1548
 
 
1549
//***************************************************************************\
 
1550
//*
 
1551
//* Very long orders
 
1552
//*
 
1553
//***************************************************************************/
 
1554
 
 
1555
// macro to tell whether this is a very long order
 
1556
{$define VLONG_ORDER(oc):=((oc)=OCODE_VLONG)}
 
1557
 
 
1558
// Very long order structure
 
1559
const
 
1560
  VORDER_ML =65531;
 
1561
 
 
1562
type
 
1563
  VORDER=record           // vord
 
1564
    idCode: Byte;
 
1565
    uchQualifier: Byte;
 
1566
    uchLength: SWPUSHORT;
 
1567
    uchData: Array[0..VORDER_ML-1] of Byte;
 
1568
  end;
 
1569
 
 
1570
// Character String Extended
 
1571
const
 
1572
  OCODEQ_GCCHSTE  =$B0;           // Qualifier - current posn
 
1573
  OCODEQ_GCHSTE   =$F0;           // Qualifier - given position
 
1574
  OCODEQ_GTCHSPA  =$F4;           // Tabbed Char String At
 
1575
 
 
1576
  ETYPE_GCCHSTE       =$0000FEB0;
 
1577
  ETYPE_GCHSTE        =$0000FEF0;
 
1578
 
 
1579
type
 
1580
  ORDERS_GCCHSTE=record    // osgcchste
 
1581
    fbFlags: Byte;
 
1582
    uchReserved: Byte;
 
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;
 
1587
  end;
 
1588
 
 
1589
  ORDERL_GCCHSTE=record    // olgcchste
 
1590
    fbFlags: Byte;
 
1591
    uchReserved: Byte;
 
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;
 
1596
  end;
 
1597
 
 
1598
  ORDERL_GTCHSPA=record   // olgcchspa
 
1599
    fbFlags: Byte;
 
1600
    uchReserved: Byte;
 
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;
 
1606
  end;
 
1607
 
 
1608
const
 
1609
  GCCHSTE_DRAWRECT      =$80;
 
1610
  GCCHSTE_NORECT        =$00;
 
1611
  GCCHSTE_CLIP          =$40;
 
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;
 
1623
 
 
1624
// Extended Escape
 
1625
  OCODEQ_GEESCP   =$D5;           // Qualifier - extended escape
 
1626
 
 
1627
  GEESCP_ML      =65533;
 
1628
 
 
1629
type
 
1630
  ORDER_GEESCP=record     // ogeescp
 
1631
    uchType: Byte;
 
1632
    uchIdent: Byte;
 
1633
    auchData: Array[0..GEESCP_ML-1] of Byte;
 
1634
  end;
 
1635
 
 
1636
//#pragma pack()    /* reset to default packing */
 
1637
 
 
1638
 
 
1639
 
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;
796
1734
function GpiQueryNearestColor(hps,flOptions : cardinal;lRgbIn : longint) : longint; cdecl;
797
1735
function GpiQueryColorIndex(hps,flOptions : cardinal;lRgbColor : longint) : longint; cdecl;
798
1736
function GpiQueryRGBColor(hps,flOptions : cardinal;lColorIndex : longint) : longint; cdecl;
799
 
function GpiCreatePalette(hab,flOptions,ulFormat,ulCount : cardinal;var aulTable : cardinal) : cardinal; cdecl;
 
1737
function GpiCreatePalette(hab,flOptions,ulFormat,ulCount : cardinal;var aulTable) : cardinal; cdecl;
800
1738
function GpiDeletePalette(hpal : cardinal) : longbool; cdecl;
801
1739
function GpiSelectPalette(hps,hpal : cardinal) : cardinal; cdecl;
802
 
function GpiAnimatePalette(hpal,ulFormat,ulStart,ulCount : cardinal;var aulTable : cardinal) : longint; cdecl;
803
 
function GpiSetPaletteEntries(hpal,ulFormat,ulStart,ulCount : cardinal;var aulTable : cardinal) : longbool; cdecl;
 
1740
function GpiAnimatePalette(hpal,ulFormat,ulStart,ulCount : cardinal;var aulTable) : longint; cdecl;
 
1741
function GpiSetPaletteEntries(hpal,ulFormat,ulStart,ulCount : cardinal;var aulTable) : longbool; cdecl;
804
1742
function GpiQueryPalette(hps : cardinal) : cardinal; cdecl;
805
 
function GpiQueryPaletteInfo(hpal,hps,flOptions,ulStart,ulCount : cardinal;var aulArray : cardinal) : longint; cdecl;
 
1743
function GpiQueryPaletteInfo(hpal,hps,flOptions,ulStart,ulCount : cardinal;var aulArray) : longint; cdecl;
806
1744
function GpiSetColor(hps : cardinal;lColor : longint) : longbool; cdecl;
807
1745
function GpiQueryColor(hps : cardinal) : longint; cdecl;
808
1746
function GpiBox(hps : cardinal;lControl : longint;var pptlPoint : POINTL;lHRound,lVRound : longint) : longint; cdecl;
1060
1998
function GpiQueryNearestColor(hps,flOptions : cardinal;lRgbIn : longint) : longint; cdecl; external 'pmgpi' index 469;
1061
1999
function GpiQueryColorIndex(hps,flOptions : cardinal;lRgbColor : longint) : longint; cdecl; external 'pmgpi' index 439;
1062
2000
function GpiQueryRGBColor(hps,flOptions : cardinal;lColorIndex : longint) : longint; cdecl; external 'pmgpi' index 479;
1063
 
function GpiCreatePalette(hab,flOptions,ulFormat,ulCount : cardinal;var aulTable : cardinal) : cardinal; cdecl; external 'pmgpi' index 594;
 
2001
function GpiCreatePalette(hab,flOptions,ulFormat,ulCount : cardinal;var aulTable) : cardinal; cdecl; external 'pmgpi' index 594;
1064
2002
function GpiDeletePalette(hpal : cardinal) : longbool; cdecl; external 'pmgpi' index 577;
1065
2003
function GpiSelectPalette(hps,hpal : cardinal) : cardinal; cdecl; external 'pmgpi' index 578;
1066
 
function GpiAnimatePalette(hpal,ulFormat,ulStart,ulCount : cardinal;var aulTable : cardinal) : longint; cdecl; external 'pmgpi' index 595;
1067
 
function GpiSetPaletteEntries(hpal,ulFormat,ulStart,ulCount : cardinal;var aulTable : cardinal) : longbool; cdecl; external 'pmgpi' index 596;
 
2004
function GpiAnimatePalette(hpal,ulFormat,ulStart,ulCount : cardinal;var aulTable) : longint; cdecl; external 'pmgpi' index 595;
 
2005
function GpiSetPaletteEntries(hpal,ulFormat,ulStart,ulCount : cardinal;var aulTable) : longbool; cdecl; external 'pmgpi' index 596;
1068
2006
function GpiQueryPalette(hps : cardinal) : cardinal; cdecl; external 'pmgpi' index 579;
1069
 
function GpiQueryPaletteInfo(hpal,hps,flOptions,ulStart,ulCount : cardinal;var aulArray : cardinal) : longint; cdecl; external 'pmgpi' index 597;
 
2007
function GpiQueryPaletteInfo(hpal,hps,flOptions,ulStart,ulCount : cardinal;var aulArray) : longint; cdecl; external 'pmgpi' index 597;
1070
2008
function GpiSetColor(hps : cardinal;lColor : longint) : longbool; cdecl; external 'pmgpi' index 517;
1071
2009
function GpiQueryColor(hps : cardinal) : longint; cdecl; external 'pmgpi' index 437;
1072
2010
function GpiBox(hps : cardinal;lControl : longint;var pptlPoint : POINTL;lHRound,lVRound : longint) : longint; cdecl; external 'pmgpi' index 356;
1226
2164
function GpiPolygons(hps,ulCount : cardinal;var paplgn : POLYGON;flOptions,flModel : cardinal) : longint; cdecl; external 'pmgpi' index 650;
1227
2165
 
1228
2166
end.
 
2167
 
1229
2168
{
1230
2169
  $Log: pmgpi.pas,v $
1231
 
  Revision 1.1  2000/07/13 06:31:06  michael
1232
 
  + Initial import
1233
 
 
1234
 
  Revision 1.10  2000/02/09 16:59:33  peter
1235
 
    * truncated log
1236
 
 
1237
 
  Revision 1.9  2000/01/09 20:48:04  hajny
1238
 
    * FPK changed to FPC
1239
 
 
1240
 
  Revision 1.8  2000/01/07 16:41:48  daniel
1241
 
    * copyright 2000
1242
 
 
1243
 
  Revision 1.7  2000/01/07 16:32:32  daniel
1244
 
    * copyright 2000 added
1245
 
 
1246
 
  Revision 1.6  1999/08/04 15:51:07  hajny
1247
 
    * merging changes by RB and DM :-(
 
2170
  Revision 1.5  2003/03/27 18:11:23  yuri
 
2171
  Orders added
 
2172
 
 
2173
  Revision 1.4  2002/11/02 13:26:36  hajny
 
2174
    * Gpi*Palette* parameters corrected
 
2175
 
 
2176
  Revision 1.3  2002/09/07 16:01:25  peter
 
2177
    * old logs removed and tabs fixed
1248
2178
 
1249
2179
}