summaryrefslogtreecommitdiff
path: root/common/quicktime_win32/GXTypes.h
blob: 6c6fd69a3e74707848563e54665cbf2459233cb6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
/*
     File:       GXTypes.h
 
     Contains:   QuickDraw GX object and constant definitions
 
     Version:    Technology: Quickdraw GX 1.1
                 Release:    QuickTime 7.3
 
     Copyright:  (c) 2007 (c) 1994-1999 by Apple Computer, Inc., all rights reserved.
 
     Bugs?:      For bug reports, consult the following page on
                 the World Wide Web:
 
                     http://developer.apple.com/bugreporter/
 
*/
#ifndef __GXTYPES__
#define __GXTYPES__

#ifndef __MACTYPES__
#include <MacTypes.h>
#endif

#ifndef __MIXEDMODE__
#include <MixedMode.h>
#endif

#ifndef __FIXMATH__
#include <FixMath.h>
#endif

#ifndef __GXMATH__
#include <GXMath.h>
#endif

#ifndef __IMAGECODEC__
#include <ImageCodec.h>
#endif




#if PRAGMA_ONCE
#pragma once
#endif

#ifdef __cplusplus
extern "C" {
#endif

#if PRAGMA_IMPORT
#pragma import on
#endif

#if PRAGMA_STRUCT_ALIGN
    #pragma options align=mac68k
#elif PRAGMA_STRUCT_PACKPUSH
    #pragma pack(push, 2)
#elif PRAGMA_STRUCT_PACK
    #pragma pack(2)
#endif



typedef struct OpaquegxShape*           gxShape;
typedef struct OpaquegxStyle*           gxStyle;
typedef struct OpaquegxInk*             gxInk;
typedef struct OpaquegxTransform*       gxTransform;
typedef struct OpaquegxTag*             gxTag;
typedef struct OpaquegxColorSet*        gxColorSet;
typedef struct OpaquegxColorProfile*    gxColorProfile;
typedef struct OpaquegxGraphicsClient*  gxGraphicsClient;
typedef struct OpaquegxViewGroup*       gxViewGroup;
typedef struct OpaquegxViewPort*        gxViewPort;
typedef struct OpaquegxViewDevice*      gxViewDevice;

typedef long                            gxColorSpace;
/* gxShape enumerations */
enum {
  gxEmptyType                   = 1,
  gxPointType                   = 2,
  gxLineType                    = 3,
  gxCurveType                   = 4,
  gxRectangleType               = 5,
  gxPolygonType                 = 6,
  gxPathType                    = 7,
  gxBitmapType                  = 8,
  gxTextType                    = 9,
  gxGlyphType                   = 10,
  gxLayoutType                  = 11,
  gxFullType                    = 12,
  gxPictureType                 = 13
};

typedef long                            gxShapeType;
enum {
  gxNoFill                      = 0,
  gxOpenFrameFill               = 1,
  gxFrameFill                   = gxOpenFrameFill,
  gxClosedFrameFill             = 2,
  gxHollowFill                  = gxClosedFrameFill,
  gxEvenOddFill                 = 3,
  gxSolidFill                   = gxEvenOddFill,
  gxWindingFill                 = 4,
  gxInverseEvenOddFill          = 5,
  gxInverseSolidFill            = gxInverseEvenOddFill,
  gxInverseFill                 = gxInverseEvenOddFill,
  gxInverseWindingFill          = 6
};

typedef long                            gxShapeFill;
enum {
  gxNoAttributes                = 0,
  gxDirectShape                 = 0x0001,
  gxRemoteShape                 = 0x0002,
  gxCachedShape                 = 0x0004,
  gxLockedShape                 = 0x0008,
  gxGroupShape                  = 0x0010,
  gxMapTransformShape           = 0x0020,
  gxUniqueItemsShape            = 0x0040,
  gxIgnorePlatformShape         = 0x0080,
  gxNoMetricsGridShape          = 0x0100,
  gxDiskShape                   = 0x0200,
  gxMemoryShape                 = 0x0400
};

typedef long                            gxShapeAttribute;
/* gxShape editing enumerations */
enum {
  gxBreakNeitherEdit            = 0,
  gxBreakLeftEdit               = 0x0001,
  gxBreakRightEdit              = 0x0002,
  gxRemoveDuplicatePointsEdit   = 0x0004
};

/* if the new first (or last) point exactly matches the point before it in */
/* the same contour, then remove it) */
typedef long                            gxEditShapeFlag;
enum {
  gxSelectToEnd                 = -1
};

#define gxSetToNil  (void *)(-1)
#define gxAnyNumber     1
enum {
  gxCounterclockwiseDirection   = 0,
  gxClockwiseDirection          = 1
};

typedef long                            gxContourDirection;
/* gxShape structures */
/* The type 'gxPoint' is defined in "GXMath.h" */
struct gxLine {
  gxPoint             first;
  gxPoint             last;
};
typedef struct gxLine                   gxLine;
struct gxCurve {
  gxPoint             first;
  gxPoint             control;
  gxPoint             last;
};
typedef struct gxCurve                  gxCurve;
struct gxRectangle {
  Fixed               left;
  Fixed               top;
  Fixed               right;
  Fixed               bottom;
};
typedef struct gxRectangle              gxRectangle;
struct gxPolygon {
  long                vectors;
  gxPoint             vector[1];
};
typedef struct gxPolygon                gxPolygon;
struct gxPolygons {
  long                contours;
  gxPolygon           contour[1];
};
typedef struct gxPolygons               gxPolygons;
/* Now defined in ImageCodec.i*/
#if 0
struct gxPath {
  long                vectors;
  long                controlBits[1];
  gxPoint             vector[1];
};
typedef struct gxPath                   gxPath;
struct gxPaths {
  long                contours;
  gxPath              contour[1];
};
typedef struct gxPaths                  gxPaths;
#endif  /* 0 */

struct gxBitmap {
    char            *image;     /* pointer to pixels */
    long            width;      /* width in pixels */
    long            height;     /* height in pixels */
    long            rowBytes;   /* width in bytes */
    long            pixelSize;      /* physical bits per pixel */
    gxColorSpace    space;
    gxColorSet      set;
    gxColorProfile  profile;
};
typedef struct gxBitmap gxBitmap;
struct gxLongRectangle {
  long                left;
  long                top;
  long                right;
  long                bottom;
};
typedef struct gxLongRectangle          gxLongRectangle;
/* gxStyle enumerations */
enum {
  gxCenterFrameStyle            = 0,
  gxSourceGridStyle             = 0x0001,
  gxDeviceGridStyle             = 0x0002,
  gxInsideFrameStyle            = 0x0004,
  gxOutsideFrameStyle           = 0x0008,
  gxAutoInsetStyle              = 0x0010
};


typedef long                            gxStyleAttribute;
enum {
  gxBendDash                    = 0x0001,
  gxBreakDash                   = 0x0002,
  gxClipDash                    = 0x0004,
  gxLevelDash                   = 0x0008,
  gxAutoAdvanceDash             = 0x0010
};

typedef long                            gxDashAttribute;
enum {
  gxPortAlignPattern            = 0x0001,
  gxPortMapPattern              = 0x0002
};

typedef long                            gxPatternAttribute;
enum {
  gxSharpJoin                   = 0x0000,
  gxCurveJoin                   = 0x0001,
  gxLevelJoin                   = 0x0002,
  gxSnapJoin                    = 0x0004
};

typedef long                            gxJoinAttribute;
enum {
  gxLevelStartCap               = 0x0001,
  gxLevelEndCap                 = 0x0002
};

typedef long                            gxCapAttribute;
enum {
  gxAutoAdvanceText             = 0x0001,
  gxNoContourGridText           = 0x0002,
  gxNoMetricsGridText           = 0x0004,
  gxAnchorPointsText            = 0x0008,
  gxVerticalText                = 0x0010,
  gxNoOpticalScaleText          = 0x0020
};

typedef long                            gxTextAttribute;
enum {
  gxLeftJustify                 = 0,
  gxCenterJustify               = fract1 / 2,
  gxRightJustify                = fract1,
  gxFillJustify                 = -1
};

enum {
  gxUnderlineAdvanceLayer       = 0x0001, /* a gxLine is drawn through the advances */
  gxSkipWhiteSpaceLayer         = 0x0002, /* except characters describing white space */
  gxUnderlineIntervalLayer      = 0x0004, /* (+ gxStringLayer) a gxLine is drawn through the gaps between advances */
  gxUnderlineContinuationLayer  = 0x0008, /* (+ gxStringLayer) join this underline with another face */
  gxWhiteLayer                  = 0x0010, /* the layer draws to white instead of black */
  gxClipLayer                   = 0x0020, /* the characters define a clip */
  gxStringLayer                 = 0x0040 /* all characters in run are combined */
};

typedef long                            gxLayerFlag;
/* gxStyle structures */
struct gxFaceLayer {
  gxShapeFill         outlineFill;            /* outline framed or filled */
  gxLayerFlag         flags;                  /* various additional effects */
  gxStyle             outlineStyle;           /* outline */
  gxTransform         outlineTransform;       /* italic, condense, extend */
  gxPoint             boldOutset;             /* bold */
};
typedef struct gxFaceLayer              gxFaceLayer;
struct gxTextFace {
  long                faceLayers;             /* layer to implement shadow */
  gxMapping           advanceMapping;         /* algorithmic change to advance width */
  gxFaceLayer         faceLayer[1];           /* zero or more face layers describing the face */
};
typedef struct gxTextFace               gxTextFace;
struct gxJoinRecord {
  gxJoinAttribute     attributes;
  gxShape             join;
  Fixed               miter;
};
typedef struct gxJoinRecord             gxJoinRecord;
struct gxDashRecord {
  gxDashAttribute     attributes;
  gxShape             dash;                   /* similar to pattern, except rotated to gxLine slope */
  Fixed               advance;                /* specifies repeating frequency of dash */
  Fract               phase;                  /* specifies offset into the gxPath to start dashing */
  Fixed               scale;                  /* specifies height of dash to be mapped to penWidth */
};
typedef struct gxDashRecord             gxDashRecord;
struct gxPatternRecord {
  gxPatternAttribute  attributes;
  gxShape             pattern;
  gxPoint             u;
  gxPoint             v;
};
typedef struct gxPatternRecord          gxPatternRecord;
struct gxCapRecord {
  gxCapAttribute      attributes;
  gxShape             startCap;
  gxShape             endCap;
};
typedef struct gxCapRecord              gxCapRecord;

/* gxInk enumerations */
enum {
  gxPortAlignDitherInk          = 0x0001,
  gxForceDitherInk              = 0x0002,
  gxSuppressDitherInk           = 0x0004,
  gxSuppressHalftoneInk         = 0x0008
};


typedef long                            gxInkAttribute;
enum {
  gxNoMode                      = 0,
  gxCopyMode                    = 1,
  gxAddMode                     = 2,
  gxBlendMode                   = 3,
  gxMigrateMode                 = 4,
  gxMinimumMode                 = 5,
  gxMaximumMode                 = 6,
  gxHighlightMode               = 7,
  gxAndMode                     = 8,
  gxOrMode                      = 9,
  gxXorMode                     = 10,
  gxRampAndMode                 = 11,
  gxRampOrMode                  = 12,
  gxRampXorMode                 = 13,
  gxOverMode                    = 14,   /* Alpha channel modes          */
  gxAtopMode                    = 15,   /* Note: In England = Beta channel modes   */
  gxExcludeMode                 = 16,
  gxFadeMode                    = 17
};

typedef unsigned char                   gxComponentMode;
enum {
  gxRejectSourceTransfer        = 0x0001, /* at least one component must be out of range       */
  gxRejectDeviceTransfer        = 0x0002, /* at least one component must be out of range       */
  gxSingleComponentTransfer     = 0x0004 /* duplicate gxTransferComponent[0] for all components in transfer */
};

typedef long                            gxTransferFlag;
enum {
  gxOverResultComponent         = 0x01, /* & result gxColor with 0xFFFF before clamping   */
  gxReverseComponent            = 0x02  /* reverse source and device before moding       */
};

typedef unsigned char                   gxComponentFlag;
/* gxInk structures */
struct gxTransferComponent {
  gxComponentMode     mode;                   /* how the component is operated upon */
  gxComponentFlag     flags;                  /* flags for each component   */
  gxColorValue        sourceMinimum;
  gxColorValue        sourceMaximum;          /* input filter range */
  gxColorValue        deviceMinimum;
  gxColorValue        deviceMaximum;          /* output filter range */
  gxColorValue        clampMinimum;
  gxColorValue        clampMaximum;           /* output clamping range */
  gxColorValue        operand;                /* ratio for blend, step for migrate, gxColor for highlight   */
};
typedef struct gxTransferComponent      gxTransferComponent;
struct gxTransferMode {
    gxColorSpace        space;          /* the gxColor-space the transfer mode is to operate in */
    gxColorSet          set;
    gxColorProfile      profile;
    Fixed               sourceMatrix[5][4];
    Fixed               deviceMatrix[5][4];
    Fixed               resultMatrix[5][4];
    gxTransferFlag      flags;
    gxTransferComponent component[4];  /* how each component is operated upon           */
};
typedef struct gxTransferMode gxTransferMode;

/* gxColor space enumerations */
enum {
  gxNoColorPacking              = 0x0000, /* 16 bits per channel */
  gxAlphaSpace                  = 0x0080, /* space includes alpha channel */
  gxWord5ColorPacking           = 0x0500, /* 5 bits per channel, right-justified */
  gxLong8ColorPacking           = 0x0800, /* 8 bits per channel, right-justified */
  gxLong10ColorPacking          = 0x0A00, /* 10 bits per channel, right-justified */
  gxAlphaFirstPacking           = 0x1000 /* alpha channel is the first field in the packed space */
};

enum {
  gxNoSpace                     = 0,
  gxRGBSpace                    = 1,
  gxCMYKSpace                   = 2,
  gxHSVSpace                    = 3,
  gxHLSSpace                    = 4,
  gxYXYSpace                    = 5,
  gxXYZSpace                    = 6,
  gxLUVSpace                    = 7,
  gxLABSpace                    = 8,
  gxYIQSpace                    = 9,
  gxNTSCSpace                   = gxYIQSpace,
  gxPALSpace                    = gxYIQSpace,
  gxGraySpace                   = 10,
  gxIndexedSpace                = 11,
  gxRGBASpace                   = gxRGBSpace + gxAlphaSpace,
  gxGrayASpace                  = gxGraySpace + gxAlphaSpace,
  gxRGB16Space                  = gxWord5ColorPacking + gxRGBSpace,
  gxRGB32Space                  = gxLong8ColorPacking + gxRGBSpace,
  gxARGB32Space                 = gxLong8ColorPacking + gxAlphaFirstPacking + gxRGBASpace,
  gxCMYK32Space                 = gxLong8ColorPacking + gxCMYKSpace,
  gxHSV32Space                  = gxLong10ColorPacking + gxHSVSpace,
  gxHLS32Space                  = gxLong10ColorPacking + gxHLSSpace,
  gxYXY32Space                  = gxLong10ColorPacking + gxYXYSpace,
  gxXYZ32Space                  = gxLong10ColorPacking + gxXYZSpace,
  gxLUV32Space                  = gxLong10ColorPacking + gxLUVSpace,
  gxLAB32Space                  = gxLong10ColorPacking + gxLABSpace,
  gxYIQ32Space                  = gxLong10ColorPacking + gxYIQSpace,
  gxNTSC32Space                 = gxYIQ32Space,
  gxPAL32Space                  = gxYIQ32Space
};

/* gxColor space structures */
struct gxRGBColor {
  gxColorValue        red;
  gxColorValue        green;
  gxColorValue        blue;
};
typedef struct gxRGBColor               gxRGBColor;
struct gxRGBAColor {
  gxColorValue        red;
  gxColorValue        green;
  gxColorValue        blue;
  gxColorValue        alpha;
};
typedef struct gxRGBAColor              gxRGBAColor;
struct gxHSVColor {
  gxColorValue        hue;
  gxColorValue        saturation;
  gxColorValue        value;
};
typedef struct gxHSVColor               gxHSVColor;
struct gxHLSColor {
  gxColorValue        hue;
  gxColorValue        lightness;
  gxColorValue        saturation;
};
typedef struct gxHLSColor               gxHLSColor;
struct gxCMYKColor {
  gxColorValue        cyan;
  gxColorValue        magenta;
  gxColorValue        yellow;
  gxColorValue        black;
};
typedef struct gxCMYKColor              gxCMYKColor;
struct gxXYZColor {
  gxColorValue        x;
  gxColorValue        y;
  gxColorValue        z;
};
typedef struct gxXYZColor               gxXYZColor;
struct gxYXYColor {
  gxColorValue        capY;
  gxColorValue        x;
  gxColorValue        y;
};
typedef struct gxYXYColor               gxYXYColor;
struct gxLUVColor {
  gxColorValue        l;
  gxColorValue        u;
  gxColorValue        v;
};
typedef struct gxLUVColor               gxLUVColor;
struct gxLABColor {
  gxColorValue        l;
  gxColorValue        a;
  gxColorValue        b;
};
typedef struct gxLABColor               gxLABColor;
struct gxYIQColor {
  gxColorValue        y;
  gxColorValue        i;
  gxColorValue        q;
};
typedef struct gxYIQColor               gxYIQColor;
struct gxGrayAColor {
  gxColorValue        gray;
  gxColorValue        alpha;
};
typedef struct gxGrayAColor             gxGrayAColor;

typedef long                            gxColorIndex;
struct gxIndexedColor {
    gxColorIndex    index;
    gxColorSet      set;
};
typedef struct gxIndexedColor gxIndexedColor;
struct gxColor {
  gxColorSpace        space;
  gxColorProfile      profile;
  union {
    gxCMYKColor         cmyk;
    gxRGBColor          rgb;
    gxRGBAColor         rgba;
    gxHSVColor          hsv;
    gxHLSColor          hls;
    gxXYZColor          xyz;
    gxYXYColor          yxy;
    gxLUVColor          luv;
    gxLABColor          lab;
    gxYIQColor          yiq;
    gxColorValue        gray;
    gxGrayAColor        graya;
    unsigned short      pixel16;
    unsigned long       pixel32;
    gxIndexedColor      indexed;
    gxColorValue        component[4];
  }                       element;
};
typedef struct gxColor                  gxColor;

/* gxColorSet structures */
union gxSetColor {
  gxCMYKColor         cmyk;
  gxRGBColor          rgb;
  gxRGBAColor         rgba;
  gxHSVColor          hsv;
  gxHLSColor          hls;
  gxXYZColor          xyz;
  gxYXYColor          yxy;
  gxLUVColor          luv;
  gxLABColor          lab;
  gxYIQColor          yiq;
  gxColorValue        gray;
  gxGrayAColor        graya;
  unsigned short      pixel16;
  unsigned long       pixel32;
  gxColorValue        component[4];
};
typedef union gxSetColor                gxSetColor;
/* gxTransform enumerations */
/* parts of a gxShape considered in hit testing: */
enum {
  gxNoPart                      = 0,    /* (in order of evaluation) */
  gxBoundsPart                  = 0x0001,
  gxGeometryPart                = 0x0002,
  gxPenPart                     = 0x0004,
  gxCornerPointPart             = 0x0008,
  gxControlPointPart            = 0x0010,
  gxEdgePart                    = 0x0020,
  gxJoinPart                    = 0x0040,
  gxStartCapPart                = 0x0080,
  gxEndCapPart                  = 0x0100,
  gxDashPart                    = 0x0200,
  gxPatternPart                 = 0x0400,
  gxGlyphBoundsPart             = gxJoinPart,
  gxGlyphFirstPart              = gxStartCapPart,
  gxGlyphLastPart               = gxEndCapPart,
  gxSideBearingPart             = gxDashPart,
  gxAnyPart                     = gxBoundsPart | gxGeometryPart | gxPenPart | gxCornerPointPart | gxControlPointPart | gxEdgePart | gxJoinPart | gxStartCapPart | gxEndCapPart | gxDashPart | gxPatternPart
};


typedef long                            gxShapePart;
/* gxTransform structures */
struct gxHitTestInfo {
  gxShapePart         what;                   /* which part of gxShape */
  long                index;                  /* control gxPoint index */
  Fixed               distance;               /* how far from gxPoint or outside of area click was */

                                              /* these fields are only set by GXHitTestPicture */
  gxShape             which;
  gxShape             containerPicture;       /* picture which contains gxShape hit */
  long                containerIndex;         /* the index within that picture  */
  long                totalIndex;             /* the total index within the root picture */
};
typedef struct gxHitTestInfo            gxHitTestInfo;
/* gxViewPort enumerations */
enum {
  gxGrayPort                    = 0x0001,
  gxAlwaysGridPort              = 0x0002,
  gxEnableMatchPort             = 0x0004
};


typedef long                            gxPortAttribute;
/* gxViewDevice enumerations */
enum {
  gxDirectDevice                = 0x01, /* for the device gxBitmap baseAddr pointer */
  gxRemoteDevice                = 0x02,
  gxInactiveDevice              = 0x04
};

typedef long                            gxDeviceAttribute;
enum {
  gxRoundDot                    = 1,
  gxSpiralDot                   = 2,
  gxSquareDot                   = 3,
  gxLineDot                     = 4,
  gxEllipticDot                 = 5,
  gxTriangleDot                 = 6,
  gxDispersedDot                = 7,
  gxCustomDot                   = 8
};

typedef long                            gxDotType;
/* gxViewPort structures */
enum {
  gxNoTint                      = 0,
  gxLuminanceTint               = 1,    /* use the luminance of the gxColor */
  gxAverageTint                 = 2,    /* add all the components and divide by the number of components */
  gxMixtureTint                 = 3,    /* find the closest gxColor on the axis between the foreground and background */
  gxComponent1Tint              = 4,    /* use the value of the first component of the gxColor */
  gxComponent2Tint              = 5,    /* ... etc. */
  gxComponent3Tint              = 6,
  gxComponent4Tint              = 7
};

typedef long                            gxTintType;
struct gxHalftone {
  Fixed               angle;
  Fixed               frequency;
  gxDotType           method;
  gxTintType          tinting;
  gxColor             dotColor;
  gxColor             backgroundColor;
  gxColorSpace        tintSpace;
};
typedef struct gxHalftone               gxHalftone;
struct gxHalftoneMatrix {
  Fixed               dpiX;                   /* intended resolution */
  Fixed               dpiY;
  long                width;                  /* width of matrix (in device pixels) */
  long                height;                 /* height of matrix (in device pixels) */
  long                tileShift;              /* shift amount (in samples) for rectangular tiling */
  unsigned short      samples[1];             /* samples from 0..MAX(halftone tintSpace) */
};
typedef struct gxHalftoneMatrix         gxHalftoneMatrix;
/* gxViewGroup enumerations */
#define gxAllViewDevices        ((gxViewGroup) 0)
#define gxScreenViewDevices     ((gxViewGroup) 1)
/* graphics stream constants and structures */
enum {
  gxOpenReadSpool               = 1,
  gxOpenWriteSpool              = 2,
  gxReadSpool                   = 3,
  gxWriteSpool                  = 4,
  gxCloseSpool                  = 5
};


typedef long                            gxSpoolCommand;
typedef unsigned char                   gxGraphicsOpcode;
typedef struct gxSpoolBlock             gxSpoolBlock;
typedef CALLBACK_API_C( long , gxSpoolProcPtr )(gxSpoolCommand command, gxSpoolBlock *block);
typedef STACK_UPP_TYPE(gxSpoolProcPtr)                          gxSpoolUPP;
struct gxSpoolBlock {
  gxSpoolUPP          spoolProcedure;         /* these fields are read only */
  void *              buffer;                 /* source/destination pointer to data */
  long                bufferSize;             /* how many bytes for the system to read (flatten) / write (unflatten) */
                                              /* these fields are written to (but are not read from) */
  long                count;                  /* how many bytes for the caller to read (unflatten) /write (flatten) */
  long                operationSize;          /* operation size (including operand byte) */
  long                operationOffset;        /* the data offset, if any, within the current operation */
  gxGraphicsOpcode    lastTypeOpcode;         /* type of last created object */
  gxGraphicsOpcode    currentOperation;       /* operation emitted by flatten, or intrepreted by last unflatten */
  gxGraphicsOpcode    currentOperand;         /* e.g., gxTransformTypeOpcode, gxInkTagOpcode */
  unsigned char       compressed;             /* one of: gxTwoBitCompressionValues */
};

#if CALL_NOT_IN_CARBON
/*
 *  NewgxSpoolUPP()
 *  
 *  Availability:
 *    Non-Carbon CFM:   available as macro/inline
 *    CarbonLib:        not available
 *    Mac OS X:         not available
 */
EXTERN_API_C( gxSpoolUPP )
NewgxSpoolUPP(gxSpoolProcPtr userRoutine);
#if !OPAQUE_UPP_TYPES
  enum { uppgxSpoolProcInfo = 0x000003F1 };  /* 4_bytes Func(4_bytes, 4_bytes) */
  #ifdef __cplusplus
    inline DEFINE_API_C(gxSpoolUPP) NewgxSpoolUPP(gxSpoolProcPtr userRoutine) { return (gxSpoolUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppgxSpoolProcInfo, GetCurrentArchitecture()); }
  #else
    #define NewgxSpoolUPP(userRoutine) (gxSpoolUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppgxSpoolProcInfo, GetCurrentArchitecture())
  #endif
#endif

/*
 *  DisposegxSpoolUPP()
 *  
 *  Availability:
 *    Non-Carbon CFM:   available as macro/inline
 *    CarbonLib:        not available
 *    Mac OS X:         not available
 */
EXTERN_API_C( void )
DisposegxSpoolUPP(gxSpoolUPP userUPP);
#if !OPAQUE_UPP_TYPES
  #ifdef __cplusplus
      inline DEFINE_API_C(void) DisposegxSpoolUPP(gxSpoolUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  #else
      #define DisposegxSpoolUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  #endif
#endif

/*
 *  InvokegxSpoolUPP()
 *  
 *  Availability:
 *    Non-Carbon CFM:   available as macro/inline
 *    CarbonLib:        not available
 *    Mac OS X:         not available
 */
EXTERN_API_C( long )
InvokegxSpoolUPP(
  gxSpoolCommand  command,
  gxSpoolBlock *  block,
  gxSpoolUPP      userUPP);
#if !OPAQUE_UPP_TYPES
  #ifdef __cplusplus
      inline DEFINE_API_C(long) InvokegxSpoolUPP(gxSpoolCommand command, gxSpoolBlock * block, gxSpoolUPP userUPP) { return (long)CALL_TWO_PARAMETER_UPP(userUPP, uppgxSpoolProcInfo, command, block); }
  #else
    #define InvokegxSpoolUPP(command, block, userUPP) (long)CALL_TWO_PARAMETER_UPP((userUPP), uppgxSpoolProcInfo, (command), (block))
  #endif
#endif

#endif  /* CALL_NOT_IN_CARBON */

#if CALL_NOT_IN_CARBON || OLDROUTINENAMES
    /* support for pre-Carbon UPP routines: New...Proc and Call...Proc */
    #define NewgxSpoolProc(userRoutine)                         NewgxSpoolUPP(userRoutine)
    #define CallgxSpoolProc(userRoutine, command, block)        InvokegxSpoolUPP(command, block, userRoutine)
#endif /* CALL_NOT_IN_CARBON */


enum {
  gxFontListFlatten             = 0x01, /* if set, generate a gxTag containing list of each gxFont referenced */
  gxFontGlyphsFlatten           = 0x02, /* if set, generate a gxTag containing the list of glyphs referenced inside the gxFont */
  gxFontVariationsFlatten       = 0x04, /* if set, append the gxTag with separate [variation] coordinates */
  gxBitmapAliasFlatten          = 0x08  /* if set, open bitmap alias files and flatten out their image data */
};


typedef long                            gxFlattenFlag;
/* gxGraphicsClient constants */
#define gxGraphicsSystemClient      (gxGraphicsClient)(-1)
enum {
  gxStaticHeapClient            = 0x0001
};

typedef long                            gxClientAttribute;
/* graphics patching constants */
enum {
  gxOriginalGraphicsFunction    = -1,
  gxOriginalGraphicsIdentifier  = FOUR_CHAR_CODE('grfx')
};

struct gxBitmapDataSourceAlias {
  unsigned long       fileOffset;             /* file offset (in bytes) of top-left pixel */
  unsigned long       aliasRecordSize;        /* size of alias record below */
  unsigned char       aliasRecord[1];         /* the actual alias record data */
};
typedef struct gxBitmapDataSourceAlias  gxBitmapDataSourceAlias;
enum {
  gxBitmapFileAliasTagType      = FOUR_CHAR_CODE('bfil'),
  gxPICTFileAliasTagType        = FOUR_CHAR_CODE('pict'),
  gxBitmapFileAliasImageValue   = 1L
};

typedef struct OpaquegxFont*            gxFont;
enum {
  gxNoPlatform                  = 0,
  gxNoScript                    = 0,
  gxNoLanguage                  = 0,
  gxNoFontName                  = 0,
  gxGlyphPlatform               = -1
};

enum {
  gxUnicodePlatform             = 1,
  gxMacintoshPlatform           = 2,
  gxReservedPlatform            = 3,
  gxMicrosoftPlatform           = 4,
  gxCustomPlatform              = 5
};


typedef long                            gxFontPlatform;
enum {
  gxUnicodeDefaultSemantics     = 1,
  gxUnicodeV1_1Semantics        = 2,
  gxISO10646_1993Semantics      = 3
};

enum {
  gxRomanScript                 = 1,
  gxJapaneseScript              = 2,
  gxTraditionalChineseScript    = 3,
  gxChineseScript               = gxTraditionalChineseScript,
  gxKoreanScript                = 4,
  gxArabicScript                = 5,
  gxHebrewScript                = 6,
  gxGreekScript                 = 7,
  gxCyrillicScript              = 8,
  gxRussian                     = gxCyrillicScript,
  gxRSymbolScript               = 9,
  gxDevanagariScript            = 10,
  gxGurmukhiScript              = 11,
  gxGujaratiScript              = 12,
  gxOriyaScript                 = 13,
  gxBengaliScript               = 14,
  gxTamilScript                 = 15,
  gxTeluguScript                = 16,
  gxKannadaScript               = 17,
  gxMalayalamScript             = 18,
  gxSinhaleseScript             = 19,
  gxBurmeseScript               = 20,
  gxKhmerScript                 = 21,
  gxThaiScript                  = 22,
  gxLaotianScript               = 23,
  gxGeorgianScript              = 24,
  gxArmenianScript              = 25,
  gxSimpleChineseScript         = 26,
  gxTibetanScript               = 27,
  gxMongolianScript             = 28,
  gxGeezScript                  = 29,
  gxEthiopicScript              = gxGeezScript,
  gxAmharicScript               = gxGeezScript,
  gxSlavicScript                = 30,
  gxEastEuropeanRomanScript     = gxSlavicScript,
  gxVietnameseScript            = 31,
  gxExtendedArabicScript        = 32,
  gxSindhiScript                = gxExtendedArabicScript,
  gxUninterpretedScript         = 33
};

enum {
  gxMicrosoftSymbolScript       = 1,
  gxMicrosoftStandardScript     = 2
};

enum {
  gxCustom8BitScript            = 1,
  gxCustom816BitScript          = 2,
  gxCustom16BitScript           = 3
};

typedef long                            gxFontScript;
enum {
  gxEnglishLanguage             = 1,
  gxFrenchLanguage              = 2,
  gxGermanLanguage              = 3,
  gxItalianLanguage             = 4,
  gxDutchLanguage               = 5,
  gxSwedishLanguage             = 6,
  gxSpanishLanguage             = 7,
  gxDanishLanguage              = 8,
  gxPortugueseLanguage          = 9,
  gxNorwegianLanguage           = 10,
  gxHebrewLanguage              = 11,
  gxJapaneseLanguage            = 12,
  gxArabicLanguage              = 13,
  gxFinnishLanguage             = 14,
  gxGreekLanguage               = 15,
  gxIcelandicLanguage           = 16,
  gxMalteseLanguage             = 17,
  gxTurkishLanguage             = 18,
  gxCroatianLanguage            = 19,
  gxTradChineseLanguage         = 20,
  gxUrduLanguage                = 21,
  gxHindiLanguage               = 22,
  gxThaiLanguage                = 23,
  gxKoreanLanguage              = 24,
  gxLithuanianLanguage          = 25,
  gxPolishLanguage              = 26,
  gxHungarianLanguage           = 27,
  gxEstonianLanguage            = 28,
  gxLettishLanguage             = 29,
  gxLatvianLanguage             = gxLettishLanguage,
  gxSaamiskLanguage             = 30,
  gxLappishLanguage             = gxSaamiskLanguage,
  gxFaeroeseLanguage            = 31,
  gxFarsiLanguage               = 32,
  gxPersianLanguage             = gxFarsiLanguage,
  gxRussianLanguage             = 33,
  gxSimpChineseLanguage         = 34,
  gxFlemishLanguage             = 35,
  gxIrishLanguage               = 36,
  gxAlbanianLanguage            = 37,
  gxRomanianLanguage            = 38,
  gxCzechLanguage               = 39,
  gxSlovakLanguage              = 40,
  gxSlovenianLanguage           = 41,
  gxYiddishLanguage             = 42,
  gxSerbianLanguage             = 43,
  gxMacedonianLanguage          = 44,
  gxBulgarianLanguage           = 45,
  gxUkrainianLanguage           = 46,
  gxByelorussianLanguage        = 47,
  gxUzbekLanguage               = 48,
  gxKazakhLanguage              = 49,
  gxAzerbaijaniLanguage         = 50,
  gxAzerbaijanArLanguage        = 51,
  gxArmenianLanguage            = 52,
  gxGeorgianLanguage            = 53,
  gxMoldavianLanguage           = 54,
  gxKirghizLanguage             = 55,
  gxTajikiLanguage              = 56,
  gxTurkmenLanguage             = 57,
  gxMongolianLanguage           = 58,
  gxMongolianCyrLanguage        = 59,
  gxPashtoLanguage              = 60,
  gxKurdishLanguage             = 61,
  gxKashmiriLanguage            = 62,
  gxSindhiLanguage              = 63,
  gxTibetanLanguage             = 64,
  gxNepaliLanguage              = 65,
  gxSanskritLanguage            = 66,
  gxMarathiLanguage             = 67,
  gxBengaliLanguage             = 68,
  gxAssameseLanguage            = 69,
  gxGujaratiLanguage            = 70,
  gxPunjabiLanguage             = 71,
  gxOriyaLanguage               = 72,
  gxMalayalamLanguage           = 73,
  gxKannadaLanguage             = 74,
  gxTamilLanguage               = 75,
  gxTeluguLanguage              = 76,
  gxSinhaleseLanguage           = 77,
  gxBurmeseLanguage             = 78,
  gxKhmerLanguage               = 79,
  gxLaoLanguage                 = 80,
  gxVietnameseLanguage          = 81,
  gxIndonesianLanguage          = 82,
  gxTagalogLanguage             = 83,
  gxMalayRomanLanguage          = 84,
  gxMalayArabicLanguage         = 85,
  gxAmharicLanguage             = 86,
  gxTigrinyaLanguage            = 87,
  gxGallaLanguage               = 88,
  gxOromoLanguage               = gxGallaLanguage,
  gxSomaliLanguage              = 89,
  gxSwahiliLanguage             = 90,
  gxRuandaLanguage              = 91,
  gxRundiLanguage               = 92,
  gxChewaLanguage               = 93,
  gxMalagasyLanguage            = 94,
  gxEsperantoLanguage           = 95,
  gxWelshLanguage               = 129,
  gxBasqueLanguage              = 130,
  gxCatalanLanguage             = 131,
  gxLatinLanguage               = 132,
  gxQuechuaLanguage             = 133,
  gxGuaraniLanguage             = 134,
  gxAymaraLanguage              = 135,
  gxTatarLanguage               = 136,
  gxUighurLanguage              = 137,
  gxDzongkhaLanguage            = 138,
  gxJavaneseRomLanguage         = 139,
  gxSundaneseRomLanguage        = 140
};

typedef long                            gxFontLanguage;
enum {
  gxCopyrightFontName           = 1,
  gxFamilyFontName              = 2,
  gxStyleFontName               = 3,
  gxUniqueFontName              = 4,
  gxFullFontName                = 5,
  gxVersionFontName             = 6,
  gxPostscriptFontName          = 7,
  gxTrademarkFontName           = 8,
  gxManufacturerFontName        = 9,
  gxLastReservedFontName        = 256
};

typedef long                            gxFontName;
typedef long                            gxFontTableTag;
typedef long                            gxFontVariationTag;
typedef long                            gxFontFormatTag;
typedef long                            gxFontStorageTag;
typedef gxFontVariationTag              gxFontDescriptorTag;
struct gxFontVariation {
  gxFontVariationTag  name;
  Fixed               value;
};
typedef struct gxFontVariation          gxFontVariation;
typedef gxFontVariation                 gxFontDescriptor;
struct gxFontFeatureSetting {
  unsigned short      setting;
  unsigned short      nameID;
};
typedef struct gxFontFeatureSetting     gxFontFeatureSetting;
enum {
  gxSystemFontAttribute         = 0x0001,
  gxReadOnlyFontAttribute       = 0x0002
};


typedef long                            gxFontAttribute;
enum {
  gxMutuallyExclusiveFeature    = 0x00008000
};

typedef long                            gxFontFeatureFlag;
typedef long                            gxFontFeature;
enum {
  gxResourceFontStorage         = FOUR_CHAR_CODE('rsrc'),
  gxHandleFontStorage           = FOUR_CHAR_CODE('hndl'),
  gxFileFontStorage             = FOUR_CHAR_CODE('bass'),
  gxNfntFontStorage             = FOUR_CHAR_CODE('nfnt')
};

typedef void *                          gxFontStorageReference;
typedef unsigned short                  gxGlyphcode;
/* single glyph in a font */
/* byte offset within backing store */
typedef long                            gxByteOffset;
/* The actual constants for feature types and selectors have been moved to a library. */
typedef unsigned short                  gxRunFeatureType;
typedef unsigned short                  gxRunFeatureSelector;
/* If tracking is not desired, specify the following value in the track field in the
        gxRunControls record (note that a track of 0 does *not* mean to turn tracking off;
        rather, it means to use normal tracking). */
enum {
  gxNoTracking                  = gxNegativeInfinity
};

/* The special "gxNoStake" value is returned by the GXGetLayoutBreakOffset call to
        indicate the absence of a character offset that is stable with respect to
        metamorphosis and contextual kerning. */
enum {
  gxNoStake                     = -1
};

/* A glyph's behavior with respect to other glyphs on its line is defined in part by its
        gxBaselineType. These types allow correct alignment of the baselines of all glyphs on
        the line. */
enum {
  gxRomanBaseline               = 0,
  gxIdeographicCenterBaseline   = 1,
  gxIdeographicLowBaseline      = 2,
  gxHangingBaseline             = 3,
  gxMathBaseline                = 4,
  gxLastBaseline                = 31,
  gxNumberOfBaselineTypes       = gxLastBaseline + 1,
  gxNoOverrideBaseline          = 255
};

typedef unsigned long                   gxBaselineType;
typedef Fixed                           gxBaselineDeltas[32];
/* gxJustificationPriority defines the point during the justification process at which a
    glyph will begin to receive deltas before and after itself. */
enum {
  gxKashidaPriority             = 0,
  gxWhiteSpacePriority          = 1,
  gxInterCharPriority           = 2,
  gxNullJustificationPriority   = 3,
  gxNumberOfJustificationPriorities = 4
};

typedef unsigned char                   gxJustificationPriority;
/* gxJustificationFlags are used to control which fields of a gxWidthDeltaRecord are to
        be overridden and which are not if a gxPriorityJustificationOverride or
        gxGlyphJustificationOverride (qq.v.) is specified. */
enum {
  gxOverridePriority            = 0x8000, /* use priority value from override */
  gxOverrideLimits              = 0x4000, /* use limits values from override */
  gxOverrideUnlimited           = 0x2000, /* use unlimited flag from override */
  gxUnlimitedGapAbsorption      = 0x1000, /* glyph can take unlimited gap */
  gxJustificationPriorityMask   = 0x000F, /* justification priority */
  gxAllJustificationFlags       = (gxOverridePriority | gxOverrideLimits | gxOverrideUnlimited | gxUnlimitedGapAbsorption | gxJustificationPriorityMask)
};

typedef unsigned short                  gxJustificationFlags;
/* The directional behavior of a glyph can be overridden using a gxDirectionOverride. */
enum {
  gxNoDirectionOverride         = 0,
  gxImposeLeftToRight           = 1,
  gxImposeRightToLeft           = 2,
  gxImposeArabic                = 3
};

typedef unsigned short                  gxDirectionOverride;
/* gxRunControlFlags describe the nonparametric layout options contained in a gxStyle. */
enum {
  gxNoCaretAngle                = 0x40000000,
  gxImposeWidth                 = 0x20000000,
  gxNoCrossKerning              = 0x10000000,
  gxNoOpticalAlignment          = 0x08000000,
  gxForceHanging                = 0x04000000,
  gxNoSpecialJustification      = 0x02000000,
  gxDirectionOverrideMask       = 0x00000003,
  gxNoLigatureSplits            = (long)0x80000000
};

enum {
  gxAllRunControlFlags          = (gxNoLigatureSplits | gxNoCaretAngle | gxImposeWidth | gxNoCrossKerning | gxNoOpticalAlignment | gxForceHanging | gxNoSpecialJustification | gxDirectionOverrideMask)
};

typedef unsigned long                   gxRunControlFlags;
/* gxHighlightType is used to distinguish various highlighting methods, both in terms of
        character offset based vs. visual based, and in terms of angled sides vs. non-angled
        sides. */
enum {
  gxHighlightStraight           = 0,    /* straight-edged simple highlighting */
  gxHighlightAverageAngle       = 1     /* takes average of two edge angles */
};

typedef unsigned long                   gxHighlightType;
/* gxCaretType is used to control whether the caret that is returned from GXGetLayoutCaret
        is a split caret or a (keyboard-syncronized) single caret. */
enum {
  gxSplitCaretType              = 0,    /* returns Mac-style split caret (default) */
  gxLeftRightKeyboardCaret      = 1,    /* single caret in left-right position */
  gxRightLeftKeyboardCaret      = 2     /* single caret in right-left position */
};

typedef unsigned long                   gxCaretType;
/* gxLayoutOffsetState describes the characteristics of a given gxByteOffset in some
        layout. It is returned by the GXGetOffsetGlyphs call. Note that the
        gxOffsetInsideLigature value is returned in addition to the 8/16 (or invalid)
        indication. */
enum {
  gxOffset8_8                   = 0,
  gxOffset8_16                  = 1,
  gxOffset16_8                  = 2,
  gxOffset16_16                 = 3,
  gxOffsetInvalid               = 4
};

enum {
  gxOffsetInsideLigature        = 0x8000
};

typedef unsigned short                  gxLayoutOffsetState;
/* gxLayoutOptionsFlags are single-bit flags contained in a gxLayoutOptions record. We
    also define here some utility constants that are useful in setting various fields in
    the gxLayoutOptions record. */
enum {
  gxNoLayoutOptions             = 0,
  gxLineIsDisplayOnly           = 0x00000001,
  gxKeepSpacesInMargin          = 0x00000002,
  gxLimitReorderingToTwoLevels  = 0x00000004,
  gxLineLeftEdgeNotAtMargin     = 0x00000008,
  gxLineRightEdgeNotAtMargin    = 0x00000010,
  gxAllLayoutOptionsFlags       = gxLineIsDisplayOnly | gxKeepSpacesInMargin | gxLimitReorderingToTwoLevels | gxLineLeftEdgeNotAtMargin | gxLineRightEdgeNotAtMargin,
  gxMaxRunLevel                 = 15,
  gxFlushLeft                   = 0,
  gxFlushCenter                 = fract1 / 2,
  gxFlushRight                  = fract1,
  gxNoJustification             = 0,
  gxFullJustification           = fract1
};

typedef unsigned long                   gxLayoutOptionsFlags;
/* A gxRunFeature describes a feature and a level for that feature. */
struct gxRunFeature {
  gxRunFeatureType    featureType;
  gxRunFeatureSelector  featureSelector;
};
typedef struct gxRunFeature             gxRunFeature;
/* A gxWidthDeltaRecord contains all of the information needed to describe the behavior of one
        class of glyphs during the justification process. */
struct gxWidthDeltaRecord {
  Fixed               beforeGrowLimit;        /* ems AW can grow by at most on LT */
  Fixed               beforeShrinkLimit;      /* ems AW can shrink by at most on LT */
  Fixed               afterGrowLimit;         /* ems AW can grow by at most on RB */
  Fixed               afterShrinkLimit;       /* ems AW can shrink by at most on RB */
  gxJustificationFlags  growFlags;            /* flags controlling grow case */
  gxJustificationFlags  shrinkFlags;          /* flags controlling shrink case */
};
typedef struct gxWidthDeltaRecord       gxWidthDeltaRecord;
/* A gxPriorityJustificationOverride contains an array of WidthDeltaRecords, one for each
        gxJustificationPriority. */
struct gxPriorityJustificationOverride {
  gxWidthDeltaRecord  deltas[4];              /* overrides for each of the priorities */
};
typedef struct gxPriorityJustificationOverride gxPriorityJustificationOverride;
/* A gxGlyphJustificationOverride contains a gxWidthDeltaRecord that is to be used for a
        specific glyph in a specific run (this limitation is because glyphcodes vary by font). */
struct gxGlyphJustificationOverride {
  gxGlyphcode         glyph;
  gxWidthDeltaRecord  override;
};
typedef struct gxGlyphJustificationOverride gxGlyphJustificationOverride;

/* gxRunControls contains flags, shifts, imposed widths and overrides for a run. */
/* NOTE: a value of "gxNoTracking" (see above) in track disables tracking */
struct gxRunControls {
  gxRunControlFlags   flags;
  Fixed               beforeWithStreamShift;
  Fixed               afterWithStreamShift;
  Fixed               crossStreamShift;
  Fixed               imposedWidth;
  Fixed               track;
  Fract               hangingInhibitFactor;
  Fract               kerningInhibitFactor;
  Fixed               decompositionAdjustmentFactor;
  gxBaselineType      baselineType;
};
typedef struct gxRunControls            gxRunControls;
/* A gxGlyphSubstitution describes one client-provided substitution that occurs after all
        other automatic glyph changes have happened. */
struct gxGlyphSubstitution {
  gxGlyphcode         originalGlyph;          /* Whenever you see this glyph... */
  gxGlyphcode         substituteGlyph;        /* ...change it to this one. */
};
typedef struct gxGlyphSubstitution      gxGlyphSubstitution;
/* gxKerningAdjustmentFactors specify an adjustment to automatic kerning. The adjustment
        is ax + b where x is the automatic kerning value, a is scaleFactor, and b is
        adjustmentPointSizeFactor times the run's point size. */
struct gxKerningAdjustmentFactors {
  Fract               scaleFactor;
  Fixed               adjustmentPointSizeFactor;
};
typedef struct gxKerningAdjustmentFactors gxKerningAdjustmentFactors;
/* A gxKerningAdjustment identifies with- and cross-stream kerning adjustments
        for specific glyph pairs. */
struct gxKerningAdjustment {
  gxGlyphcode         firstGlyph;
  gxGlyphcode         secondGlyph;
  gxKerningAdjustmentFactors  withStreamFactors;
  gxKerningAdjustmentFactors  crossStreamFactors;
};
typedef struct gxKerningAdjustment      gxKerningAdjustment;
/* A value of gxResetCrossStreamFactor in crossStreamFactors.adjustmentPointSizeFactor
        will reset the cross-stream kerning to the baseline. */
enum {
  gxResetCrossStreamFactor      = gxNegativeInfinity
};

/* gxLayoutHitInfo contains the output from the GXHitTestLayout call. */
struct gxLayoutHitInfo {
  Fixed               firstPartialDist;
  Fixed               lastPartialDist;
  gxByteOffset        hitSideOffset;
  gxByteOffset        nonHitSideOffset;
  Boolean             leadingEdge;
  Boolean             inLoose;
};
typedef struct gxLayoutHitInfo          gxLayoutHitInfo;
/* A gxLineBaselineRecord contains the deltas from 0 to all the different baselines for
        the layout. It can be filled via a call to GetBaselineDeltas (q.v.). */
struct gxLineBaselineRecord {
  gxBaselineDeltas    deltas;
};
typedef struct gxLineBaselineRecord     gxLineBaselineRecord;
/* The gxLayoutOptions type contains information about the layout characteristics of the
        whole line. */
struct gxLayoutOptions {
  Fixed               width;
  Fract               flush;
  Fract               just;
  gxLayoutOptionsFlags  flags;
  gxLineBaselineRecord * baselineRec;
};
typedef struct gxLayoutOptions          gxLayoutOptions;
enum {
  gxNewObjectOpcode             = 0x00, /* create new object */
  gxSetDataOpcode               = 0x40, /* add reference to current object */
  gxSetDefaultOpcode            = 0x80, /* replace current default with this object */
  gxReservedOpcode              = 0xC0, /* (may be used in future expansion) */
  gxNextOpcode                  = 0xFF  /* used by currentOperand field to say opcode is coming */
};

/* new object types (new object opcode) */
enum {
  gxHeaderTypeOpcode            = 0x00, /* byte following new object uses bottom 6 bits for type */
                                        /* gxShape types use values 1 (gxEmptyType) through 13 (gxPictureType) */
  gxStyleTypeOpcode             = 0x28,
  gxInkTypeOpcode               = 0x29,
  gxTransformTypeOpcode         = 0x2A,
  gxColorProfileTypeOpcode      = 0x2B,
  gxColorSetTypeOpcode          = 0x2C,
  gxTagTypeOpcode               = 0x2D,
  gxBitImageOpcode              = 0x2E,
  gxFontNameTypeOpcode          = 0x2F,
  gxTrailerTypeOpcode           = 0x3F
};

/* fields of objects (set data opcodes) */
enum {
  gxShapeAttributesOpcode       = 0,
  gxShapeTagOpcode              = 1,
  gxShapeFillOpcode             = 2
};

enum {
  gxOmitPathPositionXMask       = 0xC0,
  gxOmitPathPositionYMask       = 0x30,
  gxOmitPathDeltaXMask          = 0x0C,
  gxOmitPathDeltaYMask          = 0x03
};

enum {
  gxOmitPathPositionXShift      = 6,
  gxOmitPathPositionYShift      = 4,
  gxOmitPathDeltaXShift         = 2,
  gxOmitPathDeltaYShift         = 0
};

enum {
  gxOmitBitmapImageMask         = 0xC0,
  gxOmitBitmapWidthMask         = 0x30,
  gxOmitBitmapHeightMask        = 0x0C,
  gxOmitBitmapRowBytesMask      = 0x03
};

enum {
  gxOmitBitmapImageShift        = 6,
  gxOmitBitmapWidthShift        = 4,
  gxOmitBitmapHeightShift       = 2,
  gxOmitBitmapRowBytesShift     = 0
};

enum {
  gxOmitBitmapPixelSizeMask     = 0xC0,
  gxOmitBitmapSpaceMask         = 0x30,
  gxOmitBitmapSetMask           = 0x0C,
  gxOmitBitmapProfileMask       = 0x03
};

enum {
  gxOmitBitmapPixelSizeShift    = 6,
  gxOmitBitmapSpaceShift        = 4,
  gxOmitBitmapSetShift          = 2,
  gxOmitBitmapProfileShift      = 0
};

enum {
  gxOmitBitmapPositionXMask     = 0xC0,
  gxOmitBitmapPositionYMask     = 0x30
};

enum {
  gxOmitBitmapPositionXShift    = 6,
  gxOmitBitmapPositionYShift    = 4
};

enum {
  gxOmitBitImageRowBytesMask    = 0xC0,
  gxOmitBitImageHeightMask      = 0x30,
  gxOmitBitImageDataMask        = 0x08
};

enum {
  gxOmitBitImageRowBytesShift   = 6,
  gxOmitBitImageHeightShift     = 4,
  gxOmitBitImageDataShift       = 3
};

enum {
  gxCopyBitImageBytesOpcode     = 0x00,
  gxRepeatBitImageBytesOpcode   = 0x40,
  gxLookupBitImageBytesOpcode   = 0x80,
  gxRepeatBitImageScanOpcode    = 0xC0
};

enum {
  gxOmitTextCharactersMask      = 0xC0,
  gxOmitTextPositionXMask       = 0x30,
  gxOmitTextPositionYMask       = 0x0C,
  gxOmitTextDataMask            = 0x02
};

enum {
  gxOmitTextCharactersShift     = 6,
  gxOmitTextPositionXShift      = 4,
  gxOmitTextPositionYShift      = 2,
  gxOmitTextDataShift           = 1
};

enum {
  gxOmitGlyphCharactersMask     = 0xC0,
  gxOmitGlyphLengthMask         = 0x30,
  gxOmitGlyphRunNumberMask      = 0x0C,
  gxOmitGlyphOnePositionMask    = 0x02,
  gxOmitGlyphDataMask           = 0x01
};

enum {
  gxOmitGlyphCharactersShift    = 6,
  gxOmitGlyphLengthShift        = 4,
  gxOmitGlyphRunNumberShift     = 2,
  gxOmitGlyphOnePositionShift   = 1,
  gxOmitGlyphDataShift          = 0
};

enum {
  gxOmitGlyphPositionsMask      = 0xC0,
  gxOmitGlyphAdvancesMask       = 0x20,
  gxOmitGlyphTangentsMask       = 0x18,
  gxOmitGlyphRunsMask           = 0x04,
  gxOmitGlyphStylesMask         = 0x03
};

enum {
  gxOmitGlyphPositionsShift     = 6,
  gxOmitGlyphAdvancesShift      = 5,
  gxOmitGlyphTangentsShift      = 3,
  gxOmitGlyphRunsShift          = 2,
  gxOmitGlyphStylesShift        = 0
};

enum {
  gxOmitLayoutLengthMask        = 0xC0,
  gxOmitLayoutPositionXMask     = 0x30,
  gxOmitLayoutPositionYMask     = 0x0C,
  gxOmitLayoutDataMask          = 0x02
};

enum {
  gxOmitLayoutLengthShift       = 6,
  gxOmitLayoutPositionXShift    = 4,
  gxOmitLayoutPositionYShift    = 2,
  gxOmitLayoutDataShift         = 1
};

enum {
  gxOmitLayoutWidthMask         = 0xC0,
  gxOmitLayoutFlushMask         = 0x30,
  gxOmitLayoutJustMask          = 0x0C,
  gxOmitLayoutOptionsMask       = 0x03
};

enum {
  gxOmitLayoutWidthShift        = 6,
  gxOmitLayoutFlushShift        = 4,
  gxOmitLayoutJustShift         = 2,
  gxOmitLayoutOptionsShift      = 0
};

enum {
  gxOmitLayoutStyleRunNumberMask = 0xC0,
  gxOmitLayoutLevelRunNumberMask = 0x30,
  gxOmitLayoutHasBaselineMask   = 0x08,
  gxOmitLayoutStyleRunsMask     = 0x04,
  gxOmitLayoutStylesMask        = 0x03
};

enum {
  gxOmitLayoutStyleRunNumberShift = 6,
  gxOmitLayoutLevelRunNumberShift = 4,
  gxOmitLayoutHasBaselineShift  = 3,
  gxOmitLayoutStyleRunsShift    = 2,
  gxOmitLayoutStylesShift       = 0
};

enum {
  gxOmitLayoutLevelRunsMask     = 0x80,
  gxOmitLayoutLevelsMask        = 0x40
};

enum {
  gxOmitLayoutLevelRunsShift    = 7,
  gxOmitLayoutLevelsShift       = 6
};

enum {
  gxInkAttributesOpcode         = 0,
  gxInkTagOpcode                = 1,
  gxInkColorOpcode              = 2,
  gxInkTransferModeOpcode       = 3
};

enum {
  gxOmitColorsSpaceMask         = 0xC0,
  gxOmitColorsProfileMask       = 0x30,
  gxOmitColorsComponentsMask    = 0x0F,
  gxOmitColorsIndexMask         = 0x0C,
  gxOmitColorsIndexSetMask      = 0x03
};

enum {
  gxOmitColorsSpaceShift        = 6,
  gxOmitColorsProfileShift      = 4,
  gxOmitColorsComponentsShift   = 0,
  gxOmitColorsIndexShift        = 2,
  gxOmitColorsIndexSetShift     = 0
};

enum {
  gxOmitTransferSpaceMask       = 0xC0,
  gxOmitTransferSetMask         = 0x30,
  gxOmitTransferProfileMask     = 0x0C
};

enum {
  gxOmitTransferSpaceShift      = 6,
  gxOmitTransferSetShift        = 4,
  gxOmitTransferProfileShift    = 2
};

enum {
  gxOmitTransferSourceMatrixMask = 0xC0,
  gxOmitTransferDeviceMatrixMask = 0x30,
  gxOmitTransferResultMatrixMask = 0x0C,
  gxOmitTransferFlagsMask       = 0x03
};

enum {
  gxOmitTransferSourceMatrixShift = 6,
  gxOmitTransferDeviceMatrixShift = 4,
  gxOmitTransferResultMatrixShift = 2,
  gxOmitTransferFlagsShift      = 0
};

enum {
  gxOmitTransferComponentModeMask = 0x80,
  gxOmitTransferComponentFlagsMask = 0x40,
  gxOmitTransferComponentSourceMinimumMask = 0x30,
  gxOmitTransferComponentSourceMaximumMask = 0x0C,
  gxOmitTransferComponentDeviceMinimumMask = 0x03
};

enum {
  gxOmitTransferComponentModeShift = 7,
  gxOmitTransferComponentFlagsShift = 6,
  gxOmitTransferComponentSourceMinimumShift = 4,
  gxOmitTransferComponentSourceMaximumShift = 2,
  gxOmitTransferComponentDeviceMinimumShift = 0
};

enum {
  gxOmitTransferComponentDeviceMaximumMask = 0xC0,
  gxOmitTransferComponentClampMinimumMask = 0x30,
  gxOmitTransferComponentClampMaximumMask = 0x0C,
  gxOmitTransferComponentOperandMask = 0x03
};

enum {
  gxOmitTransferComponentDeviceMaximumShift = 6,
  gxOmitTransferComponentClampMinimumShift = 4,
  gxOmitTransferComponentClampMaximumShift = 2,
  gxOmitTransferComponentOperandShift = 0
};

enum {
  gxStyleAttributesOpcode       = 0,
  gxStyleTagOpcode              = 1,
  gxStyleCurveErrorOpcode       = 2,
  gxStylePenOpcode              = 3,
  gxStyleJoinOpcode             = 4,
  gxStyleDashOpcode             = 5,
  gxStyleCapsOpcode             = 6,
  gxStylePatternOpcode          = 7,
  gxStyleTextAttributesOpcode   = 8,
  gxStyleTextSizeOpcode         = 9,
  gxStyleFontOpcode             = 10,
  gxStyleTextFaceOpcode         = 11,
  gxStylePlatformOpcode         = 12,
  gxStyleFontVariationsOpcode   = 13,
  gxStyleRunControlsOpcode      = 14,
  gxStyleRunPriorityJustOverrideOpcode = 15,
  gxStyleRunGlyphJustOverridesOpcode = 16,
  gxStyleRunGlyphSubstitutionsOpcode = 17,
  gxStyleRunFeaturesOpcode      = 18,
  gxStyleRunKerningAdjustmentsOpcode = 19,
  gxStyleJustificationOpcode    = 20
};

enum {
  gxOmitDashAttributesMask      = 0xC0,
  gxOmitDashShapeMask           = 0x30,
  gxOmitDashAdvanceMask         = 0x0C,
  gxOmitDashPhaseMask           = 0x03
};

enum {
  gxOmitDashAttributesShift     = 6,
  gxOmitDashShapeShift          = 4,
  gxOmitDashAdvanceShift        = 2,
  gxOmitDashPhaseShift          = 0
};

enum {
  gxOmitDashScaleMask           = 0xC0
};

enum {
  gxOmitDashScaleShift          = 6
};

enum {
  gxOmitPatternAttributesMask   = 0xC0,
  gxOmitPatternShapeMask        = 0x30,
  gxOmitPatternUXMask           = 0x0C,
  gxOmitPatternUYMask           = 0x03
};

enum {
  gxOmitPatternAttributesShift  = 6,
  gxOmitPatternShapeShift       = 4,
  gxOmitPatternUXShift          = 2,
  gxOmitPatternUYShift          = 0
};

enum {
  gxOmitPatternVXMask           = 0xC0,
  gxOmitPatternVYMask           = 0x30
};

enum {
  gxOmitPatternVXShift          = 6,
  gxOmitPatternVYShift          = 4
};

enum {
  gxOmitJoinAttributesMask      = 0xC0,
  gxOmitJoinShapeMask           = 0x30,
  gxOmitJoinMiterMask           = 0x0C
};

enum {
  gxOmitJoinAttributesShift     = 6,
  gxOmitJoinShapeShift          = 4,
  gxOmitJoinMiterShift          = 2
};

enum {
  gxOmitCapAttributesMask       = 0xC0,
  gxOmitCapStartShapeMask       = 0x30,
  gxOmitCapEndShapeMask         = 0x0C
};

enum {
  gxOmitCapAttributesShift      = 6,
  gxOmitCapStartShapeShift      = 4,
  gxOmitCapEndShapeShift        = 2
};

enum {
  gxOmitFaceLayersMask          = 0xC0,
  gxOmitFaceMappingMask         = 0x30
};

enum {
  gxOmitFaceLayersShift         = 6,
  gxOmitFaceMappingShift        = 4
};

enum {
  gxOmitFaceLayerFillMask       = 0xC0,
  gxOmitFaceLayerFlagsMask      = 0x30,
  gxOmitFaceLayerStyleMask      = 0x0C,
  gxOmitFaceLayerTransformMask  = 0x03
};

enum {
  gxOmitFaceLayerFillShift      = 6,
  gxOmitFaceLayerFlagsShift     = 4,
  gxOmitFaceLayerStyleShift     = 2,
  gxOmitFaceLayerTransformShift = 0
};

enum {
  gxOmitFaceLayerBoldXMask      = 0xC0,
  gxOmitFaceLayerBoldYMask      = 0x30
};

enum {
  gxOmitFaceLayerBoldXShift     = 6,
  gxOmitFaceLayerBoldYShift     = 4
};

enum {
  gxColorSetReservedOpcode      = 0,
  gxColorSetTagOpcode           = 1
};

enum {
  gxColorProfileReservedOpcode  = 0,
  gxColorProfileTagOpcode       = 1
};

enum {
  gxTransformReservedOpcode     = 0,
  gxTransformTagOpcode          = 1,
  gxTransformClipOpcode         = 2,
  gxTransformMappingOpcode      = 3,
  gxTransformPartMaskOpcode     = 4,
  gxTransformToleranceOpcode    = 5
};

enum {
  gxTypeOpcode                  = 0,
  gxSizeOpcode                  = 1
};

/* used by currentOperand when currentOperation is gxNextOpcode */
/*    format of top byte:
xx yyyyyy   xx == 0x00, 0x40, 0x80, 0xC0: defines graphics operation (see gxGraphicsOperationOpcode)
            yyyyyy == size of operation in bytes
            if (yyyyyy == 0), byte size follows. If byte following == 0, word size follows; if == 0, long follows
            word and long, if present, are specified in high-endian order (first byte is largest magnitude)
            
format of byte following size specifiers, if any:
xx yyyyyy   xx == 0x00, 0x40, 0x80, 0xC0: defines compression level (0 == none, 0xC0 == most)
            exact method of compression is defined by type of data
            yyyyyy == data type selector (0 to 63): see gxGraphicsNewOpcode, __DataOpcode
*/
enum {
  gxOpcodeShift                 = 6,
  gxObjectSizeMask              = 0x3F,
  gxCompressionShift            = 6,
  gxObjectTypeMask              = 0x3F,
  gxBitImageOpcodeMask          = 0xC0,
  gxBitImageCountMask           = 0x3F,
  gxBitImageOpcodeShift         = 6
};

enum {
  gxNoCompression               = 0,
  gxWordCompression             = 1,
  gxByteCompression             = 2,
  gxOmitCompression             = 3,
  gxCompressionMask             = 0x03
};

/*    the following structures define how primitives without a public geometry
    are stored (their format mirrors that of the New call to create them)   */
struct gxFlatFontName {
  unsigned char       name;                   /* gxFontName */
  unsigned char       platform;               /* gxFontPlatform */
  unsigned char       script;                 /* gxFontScript */
  unsigned char       language;               /* gxFontLanguage */
  short               length;                 /* byte length */
};
typedef struct gxFlatFontName           gxFlatFontName;
enum {
  gxFlatFontListItemTag         = FOUR_CHAR_CODE('flst')
};

struct gxFlatFontListItem {
  gxFont              fontID;                 /*** if we get rid of this, remove #include "font types.h", above */
  unsigned char       name;                   /* gxFontName */
  unsigned char       platform;               /* gxFontPlatform */
  unsigned char       script;                 /* gxFontScript */
  unsigned char       language;               /* gxFontLanguage */
  short               length;                 /* byte length of the name that follows */
  unsigned short      glyphCount;             /* CountFontGlyphs or 0 if gxFontGlyphsFlatten is false */
  unsigned short      axisCount;              /* CountFontVariations or 0 if gxFontVariationsFlatten is false */
  unsigned short      variationCount;         /* number of bitsVariationPairs that follow the (optional) glyphBits */
};
typedef struct gxFlatFontListItem       gxFlatFontListItem;
struct gxFlatFontList {
  long                count;
  gxFlatFontListItem  items[1];
};
typedef struct gxFlatFontList           gxFlatFontList;
struct gxFlattenHeader {
  Fixed               version;
  unsigned char       flatFlags;
  SInt8               padding;
};
typedef struct gxFlattenHeader          gxFlattenHeader;
enum {
  gxOmitPictureShapeMask        = 0xC0,
  gxOmitOverrideStyleMask       = 0x30,
  gxOmitOverrideInkMask         = 0x0C,
  gxOmitOverrideTransformMask   = 0x03
};

enum {
  gxOmitPictureShapeShift       = 0x06,
  gxOmitOverrideStyleShift      = 0x04,
  gxOmitOverrideInkShift        = 0x02,
  gxOmitOverrideTransformShift  = 0x00
};

enum {
  gxPostScriptTag               = FOUR_CHAR_CODE('post'),
  gxPostControlTag              = FOUR_CHAR_CODE('psct')
};

enum {
  gxNoSave                      = 1,    /* don't do save-restore around PS data */
  gxPSContinueNext              = 2     /* next shape is continuation of this shape's PS -- only obeyed if gxNoSave is true */
};

struct gxPostControl {
  long                flags;                  /* PostScript state flags */
};
typedef struct gxPostControl            gxPostControl;
enum {
  gxDashSynonymTag              = FOUR_CHAR_CODE('sdsh')
};

struct gxDashSynonym {
  long                size;                   /* number of elements in array */
  Fixed               dashLength[1];          /* Array of dash lengths */
};
typedef struct gxDashSynonym            gxDashSynonym;
enum {
  gxLineCapSynonymTag           = FOUR_CHAR_CODE('lcap')
};

enum {
  gxButtCap                     = 0,
  gxRoundCap                    = 1,
  gxSquareCap                   = 2,
  gxTriangleCap                 = 3
};

/* gxLine cap type */

typedef long                            gxLineCapSynonym;
enum {
  gxCubicSynonymTag             = FOUR_CHAR_CODE('cubx')
};

enum {
  gxIgnoreFlag                  = 0x0000, /* Ignore this word, get next one */
  gxLineToFlag                  = 0x0001, /* Draw a gxLine to gxPoint following this flag */
  gxCurveToFlag                 = 0x0002, /* Draw a gxCurve through the 3 points following this flag */
  gxMoveToFlag                  = 0x0003, /* Start a new contour at the gxPoint following this flag */
  gxClosePathFlag               = 0x0004 /* Close the contour */
};

typedef long                            gxCubicSynonym;
enum {
  gxCubicInstructionMask        = 0x000F /* low four bits are gxPoint instructions */
};

/* Low four bits are instruction (moveto, lineto, curveto, closepath) */
typedef short                           gxCubicSynonymFlags;
enum {
  gxPatternSynonymTag           = FOUR_CHAR_CODE('ptrn')
};

enum {
  gxHatch                       = 0,
  gxCrossHatch                  = 1
};

struct gxPatternSynonym {
  long                patternType;            /* one of the gxPatterns: gxHatch or gxCrossHatch */
  Fixed               angle;                  /* angle at which pattern is drawn */
  Fixed               spacing;                /* distance between two parallel pattern lines */
  Fixed               thickness;              /* thickness of the pattern */
  gxPoint             anchorPoint;            /* gxPoint with with respect to which pattern position is calculated */
};
typedef struct gxPatternSynonym         gxPatternSynonym;
enum {
  gxURLTag                      = FOUR_CHAR_CODE('urlt')
};


#if PRAGMA_STRUCT_ALIGN
    #pragma options align=reset
#elif PRAGMA_STRUCT_PACKPUSH
    #pragma pack(pop)
#elif PRAGMA_STRUCT_PACK
    #pragma pack()
#endif

#ifdef PRAGMA_IMPORT_OFF
#pragma import off
#elif PRAGMA_IMPORT
#pragma import reset
#endif

#ifdef __cplusplus
}
#endif

#endif /* __GXTYPES__ */