summaryrefslogtreecommitdiff
path: root/common/quicktime_win32/PMTicket.h
blob: 26ed0fa1a337397de0a63cea96dd53178204b550 (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
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
/*
     File:       PMTicket.h
 
     Contains:   Mac OS X Printing Manager Job Ticket Interfaces.
 
     Version:    QuickTime 7.3
 
     Copyright:  (c) 2007 (c) 1999-2001 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 __MACTYPES__
#include <MacTypes.h>
#endif

#ifndef __CFSTRING__
#include <CFString.h>
#endif

#ifndef __CFNUMBER__
#include <CFNumber.h>
#endif

#ifndef __CFDATE__
#include <CFDate.h>
#endif

#ifndef __PMERRORS__
#include <PMErrors.h>
#endif

#ifndef __PMDEFINITIONS__
#include <PMDefinitions.h>
#endif

#include <stdio.h>


#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

/* SECTION I: DATA TYPES, STUCTURES, and CONSTANTS */
/* General opaque Ticket object reference. This is returned when you create a PageFormat, */
/* PrintSettings, DocumentInfo, JobInfo, or JobTicket. A list of Job Tickets or other */
/* tickets can be saved as a list of references. */
typedef struct OpaquePMTicketRef*       PMTicketRef;
typedef struct OpaquePMTemplateRef*     PMTemplateRef;
/* A few constants that will be useful in calling Job Ticket functions. */
enum {
  kPMUnlocked                   = false,
  kPMLocked                     = true
};

#define kPMDontFetchItem    NULL   /* Used to ask GetItem if an item exists. */
/* The following constant determines if the ticket code sets an item in the top level ticket */
/* or down in some sub-ticket within the top level ticket. If passed as the document number, */
/* the ticket code will simply set the item in the ticket passed. If the document number is */
/* non "kTopLevel" but the page number is "kTopLevel", the ticket code will set the item in the */
/* document level sub-ticket. If both parameters are non "kTopLevel", the ticket code will set */
/* the item in the correct sub ticket for the document and page. */
/* For now, all calls should use kPMTopLevel for document and page numbers, or the passed in */
/* docment and page numbers if they are available. In the future we expect to enable embedded */
/* document and page tickets. */
enum {
  kPMTopLevel                   = 0
};

/* There are several different types of tickets that use the same accessor functions and  */
/*  allow the programmer to use different keys to access the proper fields in each ticket. */
/*      A Job Ticket has the following structure: */
/*          Job Ticket */
/*              Job Ticket Fields */
/*              Page Format Ticket (required) */
/*                  Paper Info Ticket (required) */
/*              Print Settings Ticket (required) */
/*                  Paper Info Ticket (required) */
/* DOWNSTREAM TICKETS - Heading from PC or PJC to other modules. */
#define kPMJobTicket                    CFSTR("com.apple.print.JobTicket")
#define kPMDocumentTicket               CFSTR("com.apple.print.DocumentTicket")
#define kPMPageTicket                   CFSTR("com.apple.print.PageTicket")
#define kPMPageFormatTicket             CFSTR("com.apple.print.PageFormatTicket")
#define kPMPrintSettingsTicket          CFSTR("com.apple.print.PrintSettingsTicket")
#define kPMDestinationTicket            CFSTR("com.apple.print.DestinationTicket")
#define kPMConverterSetupTicket         CFSTR("com.apple.print.ConverterSetupTicket")
/* UPSTREAM TICKETS - Expected to be created by low level modules and passed up. */
#define kPMPrinterInfoTicket            CFSTR("com.apple.print.PrinterInfoTicket")
#define kPMModuleInfoTicket             CFSTR("com.apple.print.ModuleInfoTicket")
/* OTHER TICKETS, going either direction */
#define kPMTicketList                   CFSTR("com.apple.print.TicketList")
#define kPMPaperInfoTicket              CFSTR("com.apple.print.PaperInfoTicket")
/* An enum to keep track in a programmatic way of which type of ticket we're working */
/* with. These do not need to match up with the order of tickets listed in the ticket */
/* types in PMTicket.h because we convert from string to enum in an internal function. */
/* Warning: Don't use these tags when creating tickets.  Use the CFSTRs above. */
typedef SInt16 PMTicketType;
enum {
  kPMTicketTypeUnknown          = -1,
  kPMJobTicketType              = 1,
  kPMDocumentTicketType         = 2,
  kPMPageTicketType             = 3,
  kPMPageFormatTicketType       = 4,
  kPMPrintSettingsTicketType    = 5,
  kPMPrinterInfoTicketType      = 6,
  kPMDestinationTicketType      = 7,
  kPMConverterSetupTicketType   = 8,
  kPMModuleInfoTicketType       = 9,
  kPMTicketListType             = 10,
  kPMPaperInfoTicketType        = 11
};


/*
 *  PMPrintingPhaseType
 *  
 *  Discussion:
 *    An enum to demark where in the printing process we are. This
 *    value will be stored in the print settings ticket at the top
 *    level in the Job Ticket. It will be used to signal shift from one
 *    phase to the next and may be set by just about any part of the
 *    system. Users will want to check for ">" (greater than) or "<"
 *    (less than) conditions when possible, allowing for additional
 *    phases to be defined later on.
 */
typedef UInt16 PMPrintingPhaseType;
enum {
  kPMPhaseUnknown               = 0,    /* Not clear what phase we're in yet. */
  kPMPhasePreDialog             = 1,    /* Just before we execute the code to open the dialog. */
  kPMPhaseDialogsUp             = 2,    /* One of the dialogs is in front of the user. */
  kPMPhasePostDialogs           = 3,    /* Dialogs are down, not yet spooling. */
  kPMPhasePreAppDrawing         = 4,    /* Just before we begin to spool */
  kPMPhaseAppDrawing            = 5,    /* We're spooling drawing commands from the app. */
  kPMPhasePostAppDrawing        = 6,    /* Finished with spooling, not yet rendering or converting. */
  kPMPhasePreConversion         = 7,    /* Just before we begin to convert to PS, Raster, or other final format. */
  kPMPhaseConverting            = 8,    /* Converting from Spool file to final printer format. */
  kPMPhasePostConversion        = 9,    /* Done with printer ready data, waiting for completion. */
  kPMPhasePrinting              = 10    /* In the process of waiting for the printer. */
};

typedef SInt16                          PMTicketErrors;
/* BATCH PROCESSING ENUMS AND STRUCTURES  */
/* - Look in this section for help creating statically defined tickets. */
/* We have the ability to create a Ticket from an array of key/item pairs that define */
/* the keys and items for the entries in the ticket. To facilitate easy conversion of */
/* these key/item pairs, we've defined a few constants to help in the batch processing of */
/* these arrays. These are basically key types that are allowed for batch processing. */
typedef UInt16 PMTicketItemType;
enum {
  kPMItemInvalidType            = 0,
  kPMItemCStringType            = 1,    /* a C string pointed to by a char* */
  kPMItemSInt32Type             = 2,    /* a C signed 32 bit integer. */
  kPMItemBooleanType            = 3,    /* A Boolean */
  kPMItemCStrListType           = 4,    /* A list of c-strings. */
  kPMItemPMRectType             = 5,    /* A pointer to a PMRect */
  kPMItemSInt32ListType         = 6,    /* A pointer to a SInt32List */
  kPMItemPMRectListType         = 7     /* A pointer to a PMRectList */
};


/* A structure that holds a list of CString pointers, along with a definition for a constant list. */
struct CStrList {
  SInt32              count;                  /* Number of CString pointers in the array. */
  const char **       strArray;               /* Pointer to first CString pointer. */
};
typedef struct CStrList                 CStrList;
typedef const CStrList                  ConstCStrList;
/* A structure to hold a list of Signed 32 bit integers.  */
struct SInt32List {
  SInt32              count;                  /* Number of Signed 32 bit values in array. */
  const SInt32 *      sInt32Array;            /* Pointer to the first 32 bit value in array. */
};
typedef struct SInt32List               SInt32List;
typedef const SInt32List                ConstSInt32List;
/* A structure to hold a list of PMRect structures. PMRect is defined in PMDefinitions.h */
/* and is basically a set of four doubles (top, left, bottom, and right). */
struct PMRectList {
  SInt32              count;                  /* Number of PMRect pointers in the array. */
  const PMRect **     pmRectArray;            /* Pointer to the first PMRect pointer. */
};
typedef struct PMRectList               PMRectList;
typedef const PMRectList                ConstPMRectList;
/* CF types can't be statically initialized, but CString and Pascal strings can be. */
/* We have created utilities to convert from static C and Pascal based data into CF types. */
/* The structure below will serve as a statically defined "Ticket Item" that can then be */
/* converted into a job ticket item. An array of these structures would be made into a ticket. */
struct PMTicketItemStruct {
  char *              key;                    /* The CString for the key. */
  PMTicketItemType    itemType;               /* What type of item is being defined in union below. */
  Boolean             locked;                 /* Can other callers change this after it's entered in a ticket? */
  union {                                       /* The item data itself. */
    const void *        GenericData;          /* Generic data */
    const char *        cString;              /* kPMItemCStringType */
    SInt32              sInt32;               /* kPMItemSInt32Type */
    UInt32              boolean;              /* kPMItemBooleanType */
    ConstCStrList *     cStrlist;             /* kPMItemCStrListType */
    PMRect *            rect;                 /* kPMItemPMRectType */
    ConstSInt32List *   sInt32List;           /* kPMItemSInt32ListType */
    ConstPMRectList *   pmRectList;           /* kPMItemPMRectListType */
  }                       value;
};
typedef struct PMTicketItemStruct       PMTicketItemStruct;
/* END OF BATCH PROCESSING ENUMS AND STRUCTURES */
/* ENUMS for Ticket Values */
/* The values for kPMDuplexingKey */
enum {
  kPMDuplexNone                 = 1,
  kPMDuplexNoTumble             = 2,    /* Print on both sides of the paper, pages flip from left to right.*/
  kPMDuplexTumble               = 3,    /* Print on both sides of the paper, tumbling on so pages flip top to bottom.*/
  kPMSimplexTumble              = 4,    /* Print on only one side of the paper, but tumble the images while printing.*/
  kPMDuplexDefault              = kPMDuplexNone /* If the kPMDuplexingKey is not in a ticket then kPMDuplexDefault should be assumed.*/
};


/* Values for the kPMPSErrorHandlerKey */
enum {
  kPSNoErrorHandler             = 0,
  kPSErrorHandler               = 1
};

/* If the kPMCopyCollateKey is not present, then kPMCopyCollateDefault should be assumed. */
enum {
  kPMCopyCollateDefault         = true
};



/* END OF SECTION I: DATA TYPES, STUCTURES, and CONSTANTS */

/* SECTION II: TICKET KEYS */
/* - Look in this section for particular predefined keys for various tickets. */
/* Each key is defined to store it's data as a particular CF type, but there are some  */
/*  utilities defined to fetch data in different formats. For instance, it would be simple */
/*  to read in the Job Name as a CFString, or as a 'C' string. */
/* Ticket: PAPER INFO TICKET
    This ticket contains a single Paper Info set, with all the information necessary to 
    describe a paper type available from the Printer Module.
*/
#define kPMPaperInfoPrelude             "com.apple.print.PaperInfo."
/* CFString for the name of the paper displayed in UI */
#define kPMPaperNameStr                 "com.apple.print.PaperInfo.PMPaperName"
#define kPMPaperNameKey                 CFSTR("com.apple.print.PaperInfo.PMPaperName")
/* CFArray of 4 CFNumbers of kCFNumberDoubleType for paper size in points. */
#define kPMUnadjustedPaperRectStr       "com.apple.print.PaperInfo.PMUnadjustedPaperRect"
#define kPMUnadjustedPaperRectKey       CFSTR("com.apple.print.PaperInfo.PMUnadjustedPaperRect")
/* CFArray of 4 CFNumbers of kCFNumberDoubleType for page size within the paper, in points. */
#define kPMUnadjustedPageRectStr        "com.apple.print.PaperInfo.PMUnadjustedPageRect"
#define kPMUnadjustedPageRectKey        CFSTR("com.apple.print.PaperInfo.PMUnadjustedPageRect")
/* CFBoolean tells if we need to find a closest match for this paper */
#define kPMMatchPaperStr                "com.apple.print.PaperInfo.PMMatchPaper"
#define kPMMatchPaperKey                CFSTR("com.apple.print.PaperInfo.PMMatchPaper")

/* Ticket: PAGE FORMAT TICKET
    Describes the application's drawing environment, including resolution, scaling, and
    orientation. All information in the page format ticket is saved with the user's document,
    so the single paper info stored inside the page format ticket describes the logical page
    an application may draw to. This logical page is then mapped to a physical page defined
    in the Print Settings Ticket.
*/
#define kPMPageFormatPrelude            "com.apple.print.PageFormat."
/* CFArray of 4 CFNumbers of kCFNumberDoubleType for scaled and rotated page rectangle. */
#define kPMAdjustedPaperRectStr         "com.apple.print.PageFormat.PMAdjustedPaperRect"
#define kPMAdjustedPaperRectKey         CFSTR("com.apple.print.PageFormat.PMAdjustedPaperRect")
/* CFArray of 4 CFNumbers of kCFNumberDoubleType for scaled and rotated page rectangle, in points. */
#define kPMAdjustedPageRectStr          "com.apple.print.PageFormat.PMAdjustedPageRect"
#define kPMAdjustedPageRectKey          CFSTR("com.apple.print.PageFormat.PMAdjustedPageRect")
/* CFNumber - kCFNumberDoubleType, Drawing resolution in horizontal direction. */
#define kPMDrawingResHorizontalStr      "com.apple.print.PageFormat.PMHorizontalRes"
#define kPMDrawingResHorizontalKey      CFSTR("com.apple.print.PageFormat.PMHorizontalRes")
/* CFNumber - kCFNumberDoubleType, Drawing resolution in vertical direction. */
#define kPMDrawingResVerticalStr        "com.apple.print.PageFormat.PMVerticalRes"
#define kPMDrawingResVerticalKey        CFSTR("com.apple.print.PageFormat.PMVerticalRes")
/* CFNumber - kCFNumberDoubleType, Horizontal scaling factor applied to original page size - 1 = 100% */
#define kPMPageScalingHorizontalStr     "com.apple.print.PageFormat.PMScaling"
#define kPMPageScalingHorizontalKey     CFSTR("com.apple.print.PageFormat.PMScaling")
/* CFNumber - kCFNumberDoubleType, Vertical scaling factor applied to original page size - 1 = 100%. */
#define kPMPageScalingVerticalStr       "com.apple.print.PageFormat.PMVerticalScaling"
#define kPMPageScalingVerticalKey       CFSTR("com.apple.print.PageFormat.PMVerticalScaling")
/* CFNumber - kCFNumberSInt32Type, PMOrientation, 1 = portrait, 2 = landscape, 3 = reverse landscape, 4 = reverse portrait. */
#define kPMPageOrientationStr           "com.apple.print.PageFormat.PMOrientation"
#define kPMPageOrientationKey           CFSTR("com.apple.print.PageFormat.PMOrientation")
/* CFData - Print record handle, allowing easy access during most calls. Not used when flattened. (OS8 Only) */
#define kPMPageBackupRecordHdlStr       "com.apple.print.PageFormat.BackupPrintRecordHandle"
#define kPMPageBackupRecordHdlKey       CFSTR("com.apple.print.PageFormat.BackupPrintRecordHandle")
/* CFData - Print record stored in complete form - used when flattening Ticket w/ record. (OS8 only) */
#define kPMPageBackupRecordDataStr      "com.apple.print.PageFormat.BackupPrintRecord"
#define kPMPageBackupRecordDataKey      CFSTR("com.apple.print.PageFormat.BackupPrintRecord")
/* CFData - Handle to the print record using for custom dialog calls. Not stored when flattened. (OS8 Only) */
#define kPMPageCustomDialogHdlStr       "com.apple.print.PageFormat.CustomDialogRecord"
#define kPMPageCustomDialogHdlKey       CFSTR("com.apple.print.PageFormat.CustomDialogRecord")
/* CFString - name of the formating printer */
#define kPMFormattingPrinterStr         "com.apple.print.PageFormat.FormattingPrinter"
#define kPMFormattingPrinterKey         CFSTR("com.apple.print.PageFormat.FormattingPrinter")
/* Ticket: PRINT SETTINGS TICKET
    Contains the user's print dialog selections. Includes items set by the application to
    further refine the output produced on the printer. Information in this ticket may also
    be saved with the decument, but are likely to be overwritten by any saved settings. 
    Logical page information is mapped to the physical page defined in this ticket.
*/
#define kPMPrintSettingsPrelude         "com.apple.print.PrintSettings."
/* CFNumber, kCFNumberSInt32Type kPMDestinationPrinter kPMDestinationFile kPMDestinationFax. */
#define kPMDestinationTypeStr           "com.apple.print.PrintSettings.PMDestinationType"
#define kPMDestinationTypeKey           CFSTR("com.apple.print.PrintSettings.PMDestinationType")
/* CFString - URL for the output filename. */
#define kPMOutputFilenameStr            "com.apple.print.PrintSettings.PMOutputFilename"
#define kPMOutputFilenameKey            CFSTR("com.apple.print.PrintSettings.PMOutputFilename")
/* CFNumber, kCFNumberSInt32Type, number of copies to print. */
#define kPMCopiesStr                    "com.apple.print.PrintSettings.PMCopies"
#define kPMCopiesKey                    CFSTR("com.apple.print.PrintSettings.PMCopies")
/* CFBoolean, Turns on collating */
#define kPMCopyCollateStr               "com.apple.print.PrintSettings.PMCopyCollate"
#define kPMCopyCollateKey               CFSTR("com.apple.print.PrintSettings.PMCopyCollate")
/* CFBoolean, If true, we print sheets back to front. All layout options are unaffected by reverse order. */
#define kPMReverseOrderStr              "com.apple.print.PrintSettings.PMReverseOrder"
#define kPMReverseOrderKey              CFSTR("com.apple.print.PrintSettings.PMReverseOrder")
/* CFArray of kCFNumberSInt32Type, each pair indicating valid range of pages that the application is able to print. Does not signify user choices. */
#define kPMPageRangeStr                 "com.apple.print.PrintSettings.PMPageRange"
#define kPMPageRangeKey                 CFSTR("com.apple.print.PrintSettings.PMPageRange")
/* CFNumber - kCFNumberSInt32Type, first page selected by user to print. */
#define kPMFirstPageStr                 "com.apple.print.PrintSettings.PMFirstPage"
#define kPMFirstPageKey                 CFSTR("com.apple.print.PrintSettings.PMFirstPage")
/* CFNumber - kCFNumberSInt32Type, last page selected by user to print. */
#define kPMLastPageStr                  "com.apple.print.PrintSettings.PMLastPage"
#define kPMLastPageKey                  CFSTR("com.apple.print.PrintSettings.PMLastPage")
/* CFBoolean - If true, we do borders. */
#define kPMBorderStr                    "com.apple.print.PrintSettings.PMBorder"
#define kPMBorderKey                    CFSTR("com.apple.print.PrintSettings.PMBorder")
/* CFNumber - kCFNumberSInt32Type, Enum (PMBorderType) */
#define kPMBorderTypeStr                "com.apple.print.PrintSettings.PMBorderType"
#define kPMBorderTypeKey                CFSTR("com.apple.print.PrintSettings.PMBorderType")
/* CFBoolean, Turns on N-Up layout. */
#define kPMLayoutNUpStr                 "com.apple.print.PrintSettings.PMLayoutNUp"
#define kPMLayoutNUpKey                 CFSTR("com.apple.print.PrintSettings.PMLayoutNUp")
/* CFNumber - kCFNumberSInt32Type, indicates number of layout rows. */
#define kPMLayoutRowsStr                "com.apple.print.PrintSettings.PMLayoutRows"
#define kPMLayoutRowsKey                CFSTR("com.apple.print.PrintSettings.PMLayoutRows")
/* CFNumber - kCFNumberSInt32Type, indicates number of layout columns. */
#define kPMLayoutColumnsStr             "com.apple.print.PrintSettings.PMLayoutColumns"
#define kPMLayoutColumnsKey             CFSTR("com.apple.print.PrintSettings.PMLayoutColumns")
/* CFNumber - kCFNumberSInt32Type, Enum (PMLayoutDirection) */
#define kPMLayoutDirectionStr           "com.apple.print.PrintSettings.PMLayoutDirection"
#define kPMLayoutDirectionKey           CFSTR("com.apple.print.PrintSettings.PMLayoutDirection")
/* CFNumber - kCFNumberSInt32Type, PMOrientation, 1 = portrait, 2 = landscape, etc. */
#define kPMLayoutTileOrientationStr     "com.apple.print.PrintSettings.PMLayoutTileOrientation"
#define kPMLayoutTileOrientationKey     CFSTR("com.apple.print.PrintSettings.PMLayoutTileOrientation")
/* CFNumber - kCFNumberSInt32Type, Enum, draft, normal, best */
#define kPMQualityStr                   "com.apple.print.PrintSettings.PMQuality"
#define kPMQualityKey                   CFSTR("com.apple.print.PrintSettings.PMQuality")
/* CFNumber - kCFNumberSInt32Type, Enum, draft, normal, best */
#define kPMPaperTypeStr                 "com.apple.print.PrintSettings.PMPaperType"
#define kPMPaperTypeKey                 CFSTR("com.apple.print.PrintSettings.PMPaperType")
/* CFNumber - kCFNumberSInt32Type, Enum, active = 0, pending, hold until, hold indefinitely, aborted, finished */
#define kPMJobStateStr                  "com.apple.print.PrintSettings.PMJobState"
#define kPMJobStateKey                  CFSTR("com.apple.print.PrintSettings.PMJobState")
/* CFDate - Time we expect to print the job. */
#define kPMJobHoldUntilTimeStr          "com.apple.print.PrintSettings.PMJobHoldUntilTime"
#define kPMJobHoldUntilTimeKey          CFSTR("com.apple.print.PrintSettings.PMJobHoldUntilTime")
/* CFNumber - kCFNumberSInt32Type, Enum, Low = 0, normal, urgent */
#define kPMJobPriorityStr               "com.apple.print.PrintSettings.PMJobPriority"
#define kPMJobPriorityKey               CFSTR("com.apple.print.PrintSettings.PMJobPriority")
/* CFNUmber - kCFNumberSInt32Type, Enum, paper sources. */
#define kPMPaperSourceStr               "com.apple.print.PrintSettings.PMPaperSource"
#define kPMPaperSourceKey               CFSTR("com.apple.print.PrintSettings.PMPaperSource")
/* CFNumber - kCFNumberSInt32Type, Enum, kPMDuplexNone,  kPMDuplexNoTumble, kPMDuplexTumble, kPMSimplexTumble */
#define kPMDuplexingStr                 "com.apple.print.PrintSettings.PMDuplexing"
#define kPMDuplexingKey                 CFSTR("com.apple.print.PrintSettings.PMDuplexing")
/* CFNumber - kCFNumberSInt32Type, Enum, B/W, Grayscale, Color, HiFi Color. */
#define kPMColorModeStr                 "com.apple.print.PrintSettings.PMColorMode"
#define kPMColorModeKey                 CFSTR("com.apple.print.PrintSettings.PMColorMode")
/* CFNumber - kCFNumberSInt32Type, ID of profile to use. */
#define kPMColorSyncProfileIDStr        "com.apple.print.PrintSettings.PMColorSyncProfileID"
#define kPMColorSyncProfileIDKey        CFSTR("com.apple.print.PrintSettings.PMColorSyncProfileID")
/* CFString - path of system profile. */
#define kPMColorSyncSystemProfilePathStr  "com.apple.print.PrintSettings.PMColorSyncSystemProfilePath"
#define kPMColorSyncSystemProfilePathKey  CFSTR("com.apple.print.PrintSettings.PMColorSyncSystemProfilePath")
/* CFNumber - kCFNumberDoubleType, Horizontal scaling factor applied to original page size. */
#define kPMPrintScalingHorizontalStr    "com.apple.print.PrintSettings.PMScaling"
#define kPMPrintScalingHorizontalKey    CFSTR("com.apple.print.PrintSettings.PMScaling")
/* CFNumber - kCFNumberDoubleType, Vertical scaling factor applied to original page size. */
#define kPMPrintScalingVerticalStr      "com.apple.print.PrintSettings.PMVerticalScaling"
#define kPMPrintScalingVerticalKey      CFSTR("com.apple.print.PrintSettings.PMVerticalScaling")
/* CFNumber - kCFNumberSInt32Type, Enum (PMScalingAlignment) */
#define kPMPrintScalingAlignmentStr     "com.apple.print.PrintSettings.PMScalingAlignment"
#define kPMPrintScalingAlignmentKey     CFSTR("com.apple.print.PrintSettings.PMScalingAlignment")
/* CFNumber - kCFNumberSInt32Type, PMOrientation, 1 = portrait, 2 = landscape, etc. */
#define kPMPrintOrientationStr          "com.apple.print.PrintSettings.PMOrientation"
#define kPMPrintOrientationKey          CFSTR("com.apple.print.PrintSettings.PMOrientation")
/* CFString - YES means the user clicked on the Preview button */
#define kPMPreviewStr                   "com.apple.print.PrintSettings.PMPreview"
#define kPMPreviewKey                   CFSTR("com.apple.print.PrintSettings.PMPreview")
/* CFData - Print record handle, allowing easy access during most calls. Not used when flattened. (OS8 Only) */
#define kPMPrintBackupRecordHdlStr      "com.apple.print.PrintSettings.BackupPrintRecordHandle"
#define kPMPrintBackupRecordHdlKey      CFSTR("com.apple.print.PrintSettings.BackupPrintRecordHandle")
/* CFData - Print record stored in complete form - used when flattening Ticket w/ record. (OS8 only) */
#define kPMPrintBackupRecordDataStr     "com.apple.print.PrintSettings.BackupPrintRecord"
#define kPMPrintBackupRecordDataKey     CFSTR("com.apple.print.PrintSettings.BackupPrintRecord")
/* CFData - Handle to the print record using for custom dialog calls. Not stored when flattened. (OS8 Only) */
#define kPMPrintCustomDialogHdlStr      "com.apple.print.PrintSettings.CustomDialogRecord"
#define kPMPrintCustomDialogHdlKey      CFSTR("com.apple.print.PrintSettings.CustomDialogRecord")
/* CFArray - main & option PPD key for input paper feed */
#define kPMPrimaryPaperFeedStr          "com.apple.print.PrintSettings.PMPrimaryPaperFeed"
#define kPMPrimaryPaperFeedKey          CFSTR("com.apple.print.PrintSettings.PMPrimaryPaperFeed")
/* CFArray - main & option PPD key for input paper feed */
#define kPMSecondaryPaperFeedStr        "com.apple.print.PrintSettings.PMSecondaryPaperFeed"
#define kPMSecondaryPaperFeedKey        CFSTR("com.apple.print.PrintSettings.PMSecondaryPaperFeed")
/* CFNumber - kCFNumberSInt32Type  */
#define kPMPSErrorHandlerStr            "com.apple.print.PrintSettings.PMPSErrorHandler"
#define kPMPSErrorHandlerKey            CFSTR("com.apple.print.PrintSettings.PMPSErrorHandler")
/* CFBoolean, Turns on PS error on screen notification.  */
#define kPMPSErrorOnScreenStr           "com.apple.print.PrintSettings.PMPSErrorOnScreen"
#define kPMPSErrorOnScreenKey           CFSTR("com.apple.print.PrintSettings.PMPSErrorOnScreen")
/* CFArray - main & option PPD key for tray switching */
#define kPMPSTraySwitchStr              "com.apple.print.PrintSettings.PMPSTraySwitch"
#define kPMPSTraySwitchKey              CFSTR("com.apple.print.PrintSettings.PMPSTraySwitch")
/* CFDictionary - main & option PPD keys for additional features */
#define kPMPPDDictStr                   "com.apple.print.PrintSettings.kPMPPDDictStr"
#define kPMPPDDictKey                   CFSTR("com.apple.print.PrintSettings.kPMPPDDictStr")
/* Ticket: PAGE TICKET
    Future Feature. Intended to hold Page Format and Print Settings ticket for a single
    page of the document. Not yet implemented.
*/
#define kPMPageTicketPrelude            "com.apple.print.PageTicket."
/* Ticket: DOCUMENT TICKET
    Future Feature. Intended to hold multiple Page Tickets and separate Page Format
    and Print Settings tickets for a single document. Not yet implemented. For now,
    the keys listed here will be included at the Job Ticket Level.
*/
#define kPMDocumentTicketPrelude        "com.apple.print.DocumentTicket."
/* CFString. Indicates format of data stored in the spool file. */
#define kPMSpoolFormatStr               "com.apple.print.DocumentTicket.PMSpoolFormat"
#define kPMSpoolFormatKey               CFSTR("com.apple.print.DocumentTicket.PMSpoolFormat")
/* CFString. Indicates format of data going to the Printer Module. */
#define kPMPrinterModuleFormatStr       "com.apple.print.DocumentTicket.PMDocPMInputFormat"
#define kPMPrinterModuleFormatKey       CFSTR("com.apple.print.DocumentTicket.PMDocPMInputFormat")
/* Ticket: JOB TICKET
    Holds a Page Format and Print Settings ticket, as well as a few other fields that 
    are Job Specific, such as information about the user that submitted the job. The
    fidelity bit controls what happens when the system encounters settings that can't
    be obeyed.
    In the future a Job Ticket may hold multiple document tickets in addition to the 
    Print Settings and Page Format tickets.
*/
#define kPMJobTicketPrelude             "com.apple.print.JobInfo."
/* CFString, The name of the job to be displayed in the queue window. */
#define kPMJobNameStr                   "com.apple.print.JobInfo.PMJobName"
#define kPMJobNameKey                   CFSTR("com.apple.print.JobInfo.PMJobName")
/* CFString, The application's name */
#define kPMApplicationNameStr           "com.apple.print.JobInfo.PMApplicationName"
#define kPMApplicationNameKey           CFSTR("com.apple.print.JobInfo.PMApplicationName")
/* CFNumber - kCFNumberSInt32Type, TBD how this is interpreted. */
#define kPMUserLanguageStr              "com.apple.print.JobInfo.PMUserLanguage"
#define kPMUserLanguageKey              CFSTR("com.apple.print.JobInfo.PMUserLanguage")
/* CFString - Name of the user who submitted the job. */
#define kPMJobOwnerStr                  "com.apple.print.JobInfo.PMJobOwner"
#define kPMJobOwnerKey                  CFSTR("com.apple.print.JobInfo.PMJobOwner")
/* CFDictionary - PMTemplateRef, actually. See PMTemplate.h */
#define kPMJobTemplateStr               "com.apple.print.JobInfo.PMJobTemplate"
#define kPMJobTemplateKey               CFSTR("com.apple.print.JobInfo.PMJobTemplate")
/* CFNumber, kCFNumberSInt32Type, Enum - Spooling, RIPing, etc. */
#define kPMPhaseStr                     "com.apple.print.JobInfo.PMPrintingPhase"
#define kPMPhaseKey                     CFSTR("com.apple.print.JobInfo.PMPrintingPhase")
/* CFString, Mime type from the kPMOutputTypeListKey array the printer module should generate. */
#define kPMOutputTypeStr                "com.apple.print.JobInfo.PMOutputType"
#define kPMOutputTypeKey                CFSTR("com.apple.print.JobInfo.PMOutputType")
/* Ticket: LIST TICKET
    Contains a list of other tickets. There is no restriction on the type of tickets
    that can be stored in a list, any ticket will do. 
*/
#define kPMTicketListPrelude            "com.apple.print.TicketList."


/* Ticket: Printer Info Ticket
    Created by the Printer Module to describe features and settings of the current
    printer. This is information largely used by the Printer Module itself and the Print
    Dialog Extensions associated with the PM. All "range" type values that would be 
    verified at dialog time should go in a separate Template.
*/
#define kPMPrinterInfoPrelude           "com.apple.print.PrinterInfo."
/* CFString, Full name of the printer. */
#define kPMPrinterLongNameStr           "com.apple.print.PrinterInfo.PMPrinterLongName"
#define kPMPrinterLongNameKey           CFSTR("com.apple.print.PrinterInfo.PMPrinterLongName")
/* CFString, Shorter name to use when you have less space. */
#define kPMPrinterShortNameStr          "com.apple.print.PrinterInfo.PMPrinterShortName"
#define kPMPrinterShortNameKey          CFSTR("com.apple.print.PrinterInfo.PMPrinterShortName")
/* CFString, Product name is used for ???? */
#define kPMMakeAndModelNameStr          "com.apple.print.PrinterInfo.PMMakeAndModelName"
#define kPMMakeAndModelNameKey          CFSTR("com.apple.print.PrinterInfo.PMMakeAndModelName")
/* CFData, Product address.  */
#define kPMPrinterAddressStr            "com.apple.print.PrinterInfo.PMPrinterAddress"
#define kPMPrinterAddressKey            CFSTR("com.apple.print.PrinterInfo.PMPrinterAddress")
/* CFBoolean, If Non-zero, printer/PM can do color. */
#define kPMSupportsColorStr             "com.apple.print.PrinterInfo.PMSupportsColor"
#define kPMSupportsColorKey             CFSTR("com.apple.print.PrinterInfo.PMSupportsColor")
/* CFBoolean, If Non-zero, printer/PM can do copies */
#define kPMDoesCopiesStr                "com.apple.print.PrinterInfo.PMDoesCopies"
#define kPMDoesCopiesKey                CFSTR("com.apple.print.PrinterInfo.PMDoesCopies")
/* CFBoolean, If Non-zero, printer/PM can collate. */
#define kPMDoesCopyCollateStr           "com.apple.print.PrinterInfo.PMDoesCopyCollate"
#define kPMDoesCopyCollateKey           CFSTR("com.apple.print.PrinterInfo.PMDoesCopyCollate")
/* CFBoolean, If Non-zero, printer/PM can reverse the printing order. */
#define kPMDoesReverseOrderStr          "com.apple.print.PrinterInfo.PMDoesReverseOrderK"
#define kPMDoesReverseOrderKey          CFSTR("com.apple.print.PrinterInfo.PMDoesReverseOrderK")
/* CFArray of CFStrings indicating file types. See PMDefinitions.h for complete list. */
#define kPMInputFileTypeListStr         "com.apple.print.PrinterInfo.PMInputFileTypeList"
#define kPMInputFileTypeListKey         CFSTR("com.apple.print.PrinterInfo.PMInputFileTypeList")
/* CFArray of CFStrings indicating the MIME type for the data is can send to an IO module. */
#define kPMOutputTypeListStr            "com.apple.print.PrinterInfo.PMOutputTypeList"
#define kPMOutputTypeListKey            CFSTR("com.apple.print.PrinterInfo.PMOutputTypeList")
/* Postscript printing related tags */
/* CFNumber - kCFNumberSInt32Type, indicates PostScript Language level. Contains one of the values from the enum below */
#define kPMPostScriptLevelStr           "com.apple.print.PrinterInfo.PMPostScriptLevel"
#define kPMPostScriptLevelKey           CFSTR("com.apple.print.PrinterInfo.PMPostScriptLevel")
/* CFString e.g."2040.113"*/
#define kPMPostScriptVersionStr         "com.apple.print.PrinterInfo.PMPSVersion"
#define kPMPostScriptVersionKey         CFSTR("com.apple.print.PrinterInfo.PMPSVersion")
/* CFNumber - kCFNumberSInt32Type, contains the PostScript revision which is an integer.*/
#define kPMPostScriptRevisionStr        "com.apple.print.PrinterInfo.PMPSRevision"
#define kPMPostScriptRevisionKey        CFSTR("com.apple.print.PrinterInfo.PMPSRevision")
/* CFNumber - kCFNumberSInt32Type, contains one of the values from the enum below.*/
#define kPMPostScriptTrueTypeFontRasterizerStr  "com.apple.print.PrinterInfo.PMPSTTRasterizer"
#define kPMPostScriptTrueTypeFontRasterizerKey  CFSTR("com.apple.print.PrinterInfo.PMPSTTRasterizer")

/* Enum for the possible font rasterizers. */
enum {
  kPMPSTTRasterizerUnknown      = 0,    /*  unknown*/
  kPMPSTTRasterizerNone         = 1,    /*  none*/
  kPMPSTTRasterizerAccept68K    = 2,    /*  accept 68k*/
  kPMPSTTRasterizerType42       = 3     /*  type 42*/
};

/* Enum for possible PostScript Language Levels. */
enum {
  kPMPSTargetLanguageLevel2and3 = -3,   /* Level 2 Compatible, may take advantage of Level 3 features*/
  kPMPSTargetLanguageLevel1and2 = -2,   /* Level 1 Compatible, may take advantage of Level 2 and 3 features*/
  kPMPSTargetLanguageLevelUnknown = -1, /* language level of target is unknown*/
  kPMPSTargetLanguageLevel1     = 1,    /* level 1*/
  kPMPSTargetLanguageLevel2     = 2,    /* level 2*/
  kPMPSTargetLanguageLevel3     = 3,    /* level 3*/
  kPMPSTargetLanguageLevelDefault = kPMPSTargetLanguageLevelUnknown /* default*/
};


/* Note, we've removed the PMLanguageInfoKey because it's not valid to store strings or structures, everything needs to be a CFType.*/
/* CFNumber - kCFNumberSInt32Type, Memory on the Printer itself. */
#define kPMTotalMemInstalledStr         "com.apple.print.PrinterInfo.PMTotalMemInstalled"
#define kPMTotalMemInstalledKey         CFSTR("com.apple.print.PrinterInfo.PMTotalMemInstalled")
/* CFNumber - kCFNumberSInt32Type, Remaining memory available for use. */
#define kPMTotalMemAvailableStr         "com.apple.print.PrinterInfo.PMTotalMemAvailable"
#define kPMTotalMemAvailableKey         CFSTR("com.apple.print.PrinterInfo.PMTotalMemAvailable")
/* PPD related tags */
/* CFString, PPD file name or other description file. */
#define kPMDescriptionFileStr           "com.apple.print.PrinterInfo.PMDescriptionFile"
#define kPMDescriptionFileKey           CFSTR("com.apple.print.PrinterInfo.PMDescriptionFile")
/* CFData, Compiled PPD file to ease parsing after the fact. Not sure we need. */
#define kPMCompiledPPDStr               "com.apple.print.PrinterInfo.PMCompiledPPD"
#define kPMCompiledPPDKey               CFSTR("com.apple.print.PrinterInfo.PMCompiledPPD")
/* ColorSync related tags */
/* CFString, representing a CFUUID - must be unique per device */
#define kPMColorDeviceIDStr             "com.apple.print.PrinterInfo.PMColorDeviceID"
#define kPMColorDeviceIDKey             CFSTR("com.apple.print.PrinterInfo.PMColorDeviceID")
/* CFArray - of CFDicts, one for each factory profile. */
#define kPMColorSyncProfilesStr         "com.apple.print.PrinterInfo.PMColorSyncProfiles"
#define kPMColorSyncProfilesKey         CFSTR("com.apple.print.PrinterInfo.PMColorSyncProfiles")
/* Installable options string. */
/* CFData, Installable options from PPD file. */
#define kPMInstallableOptionStr         "com.apple.print.PrinterInfo.PMInstallableOption"
#define kPMInstallableOptionKey         CFSTR("com.apple.print.PrinterInfo.PMInstallableOption")
/* Suggested app drawing resolutions */
/* CFArray -  array of pairs of kCFNumberDoubleType - One pair for each recommended resolution*/
#define kPMPrinterSuggestedResStr       "com.apple.print.PrinterInfo.PMPrinterSuggestedRes"
#define kPMPrinterSuggestedResKey       CFSTR("com.apple.print.PrinterInfo.PMPrinterSuggestedRes")
/* Min and max range of resolutions */
/* CFArray - 2 CFNumber, kCFNumberDoubleType, min resolution of printer */
#define kPMPrinterMinResStr             "com.apple.print.PrinterInfo.PMPrinterMinRes"
#define kPMPrinterMinResKey             CFSTR("com.apple.print.PrinterInfo.PMPrinterMinRes")
/* CFArray - 2 CFNumber, kCFNumberDoubleType, max resolution of printer */
#define kPMPrinterMaxResStr             "com.apple.print.PrinterInfo.PMPrinterMaxRes"
#define kPMPrinterMaxResKey             CFSTR("com.apple.print.PrinterInfo.PMPrinterMaxRes")
/* driver creator code */
/* CFNumber - kCFNumberSInt32Type creator signiture  for  driver*/
#define kPMDriverCreatorStr             "com.apple.print.PrinterInfo.PMDriverCreator"
#define kPMDriverCreatorKey             CFSTR("com.apple.print.PrinterInfo.PMDriverCreator")
/* Printer Resident font data handle */
/* CFData, Printer resident fonts from printer query. */
#define kPMPrinterFontStr               "com.apple.print.PrinterInfo.Printer Fonts"
#define kPMPrinterFontKey               CFSTR("com.apple.print.PrinterInfo.Printer Fonts")
/* CFBoolean - PJCIsPostScriptDriver*/
#define kPMPrinterIsPostScriptDriverStr  "com.apple.print.PrinterInfo.PMIsPostScriptDriver"
#define kPMPrinterIsPostScriptDriverKey  CFSTR("com.apple.print.PrinterInfo.PMIsPostScriptDriver")
#define kPMIsBinaryOKStr                "com.apple.print.PrinterInfo.PMIsBinaryOK"
#define kPMIsBinaryOKKey                CFSTR("com.apple.print.PrinterInfo.PMIsBinaryOK")
/* CFBoolean - Can the comm channel take bytes with the high bit set?*/
#define kPM8BitCommStr                  "com.apple.print.PrinterInfo.PM8BitComm"
#define kPM8BitCommKey                  CFSTR("com.apple.print.PrinterInfo.PM8BitComm")
#define kPMTransparentCommStr           "com.apple.print.PrinterInfo.PMTransparentComm"
#define kPMTransparentCommKey           CFSTR("com.apple.print.PrinterInfo.PMTransparentComm")
/* Ticket: Converter Setup Ticket
    Contains controls for converter. Generally, the Printer Module and Job Manager will set
    tags in this ticket to control the various settings of the conversion process. 
*/
#define kPMConverterSetupPrelude        "com.apple.print.ConverterSetup."
/* CFBoolean, turns on banding if it's available. */
#define kPMBandingRequestedStr          "com.apple.print.ConverterSetup.PMBandingRequested"
#define kPMBandingRequestedKey          CFSTR("com.apple.print.ConverterSetup.PMBandingRequested")
/* CFNumber, number of scan lines needed for each band. Could be whole page, in which case banding is disabled. */
#define kPMRequiredBandHeightStr        "com.apple.print.ConverterSetup.PMRequiredBandHeight"
#define kPMRequiredBandHeightKey        CFSTR("com.apple.print.ConverterSetup.PMRequiredBandHeight")
/* CFBoolean. If true, the printer module wants converter to switch between b/w bands and color bands when possible. */
#define kPMDepthSwitchingEnabledStr     "com.apple.print.ConverterSetup.PMDepthSwitching"
#define kPMDepthSwitchingEnabledKey     CFSTR("com.apple.print.ConverterSetup.PMDepthSwitching")
/* CFBoolean. If true, the printer module wants converter to skip over white space if possible. */
#define kPMWhiteSkippingEnabledStr      "com.apple.print.ConverterSetup.PMWhiteSpaceSkipping"
#define kPMWhiteSkippingEnabledKey      CFSTR("com.apple.print.ConverterSetup.PMWhiteSpaceSkipping")
/* CFNumber, CFNumberDoubleType indicating horizontal final rendering resolution. */
#define kPMConverterResHorizontalStr    "com.apple.print.ConverterSetup.PMConversionResHorizontal"
#define kPMConverterResHorizontalKey    CFSTR("com.apple.print.ConverterSetup.PMConversionResHorizontal")
/* CFNumber, CFNumberDoubleType indicating vertical final rendering resolution. */
#define kPMConverterResVerticalStr      "com.apple.print.ConverterSetup.PMConversionResVertcial"
#define kPMConverterResVerticalKey      CFSTR("com.apple.print.ConverterSetup.PMConversionResVertcial")
/* CFNumber, CFNumberLongType, indicates the pixel format requested of the converter. */
#define kPMRequestedPixelFormatStr      "com.apple.print.ConverterSetup.PMPixelFormat"
#define kPMRequestedPixelFormatKey      CFSTR("com.apple.print.ConverterSetup.PMPixelFormat")
/* CFNumber, CFNumberLongType, indicates the pixel layout requested of the converter. */
#define kPMRequestedPixelLayoutStr      "com.apple.print.ConverterSetup.PMPixelLayout"
#define kPMRequestedPixelLayoutKey      CFSTR("com.apple.print.ConverterSetup.PMPixelLayout")
/* CFNumber, kCFNumberSInt32Type, the profile ID for the profile to be used with this job. */
#define kPMCVColorSyncProfileIDStr      "com.apple.print.ConverterSetup.PMProfileID"
#define kPMCVColorSyncProfileIDKey      CFSTR("com.apple.print.ConverterSetup.PMProfileID")

/* END OF SECTION II: TICKET KEYS */
/* SECTION III, FUNCTIONS: */
/* Create, or copy a Ticket. As a Ticket is created, its type is stored in the object itself */
/* and used to help the programmer make sure they are adding the correct fields to the object. */
/*
 *  PMTicketCreate()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketCreate(
  CFAllocatorRef   allocator,
  CFStringRef      ticketType,
  PMTicketRef *    newTicket);


/*
 *  PMTicketCopy()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketCopy(
  CFAllocatorRef   allocator,
  PMTicketRef      sourceTicket,
  PMTicketRef *    destinationTicket);


/* Retain, release, or get retain count of a Ticket. The behavior is modelled after */
/* CoreFoundation's CFRetain, CFRelease, and CFGetRetainCount APIs. */
/*
 *  PMTicketGetRetainCount()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketGetRetainCount(
  PMTicketRef   ticket,
  CFIndex *     retainCount);


/*
 *  PMTicketRetain()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketRetain(PMTicketRef ticket);


/*
 *  PMTicketRelease()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketRelease(PMTicketRef ticket);



/*
 *  PMTicketReleaseAndClear()
 *  
 *  Discussion:
 *    PMTicketReleaseAndClear does the same thing as PMTicketRelease
 *    except that it sets the passed in pointer to NULL, which we think
 *    is good programming practice. Other references to the ticket may
 *    still be valid, but this one is no longer expected to be used.
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketReleaseAndClear(PMTicketRef * ticket);




/*
 *  PMTicketGetLockedState()
 *  
 *  Discussion:
 *    Tickets may be locked by the printing system, so we provide a
 *    function to determine if the ticket is indeed locked. Any
 *    attempted changes to a locked ticket will result in
 *    "kPMTicketLocked" error.
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketGetLockedState(
  PMTicketRef   ticket,
  Boolean *     lockedState);



/*
 *  PMTicketConfirmTicket()
 *  
 *  Discussion:
 *    To confirm that we have a real ticket, this short function gets
 *    called.
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketConfirmTicket(PMTicketRef ticket);



/*
 *  PMTicketValidate()
 *  
 *  Discussion:
 *    We validate an entire ticket by calling our PMTicketValidate
 *    function, passing a template which contains constraints for all
 *    the values in the ticket. Those entries in the ticket that don't
 *    have constraints will not be checked, so developers can add their
 *    own custom data. For now we have to verify a single ticket at a
 *    time. Future updates will allow the caller to confirm an entire
 *    tree of tickets.
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketValidate(
  PMTicketRef     ticket,
  PMTemplateRef   verifyingTemplate,
  CFArrayRef *    invalidItems);



/* A couple of utility functions to find out what type of ticket is references, as well */
/* as access to the allocator function passed in for a ticket. We also provide a function */
/* to check the API version for a ticket, to protect against future conversion problems */
/* from old to new tickets. */
/*
 *  PMTicketGetType()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketGetType(
  PMTicketRef    ticket,
  CFStringRef *  ticketType);


/*
 *  PMTicketGetEnumType()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketGetEnumType(
  PMTicketRef     ticket,
  PMTicketType *  ticketType);


/*
 *  PMTicketGetAllocator()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketGetAllocator(
  PMTicketRef       ticket,
  CFAllocatorRef *  allocator);


/*
 *  PMTicketGetAPIVersion()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketGetAPIVersion(
  PMTicketRef    ticket,
  CFStringRef *  apiVersion);



/* To store a Ticket object it needs to be converted to XML, a serialization that */
/* creates human readable text. If the data is to be written to file anyway, a second */
/* function is provided to go "all the way." */
/*
 *  PMTicketToXML()
 *  
 *  Discussion:
 *    Convert to XML
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketToXML(
  PMTicketRef   ticket,
  CFDataRef *   anXMLTicket);


/*
 *  PMTicketWriteXMLToFile()
 *  
 *  Discussion:
 *    Convert to XML and write to file
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketWriteXMLToFile(
  PMTicketRef   ticket,
  const char *  path);


/*
 *  PMTicketWriteXML()
 *  
 *  Discussion:
 *    Convert to XML and write to FILE stream
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketWriteXML(
  PMTicketRef   ticket,
  FILE *        xmlFile);


/*
 *  PMXMLToTicket()
 *  
 *  Discussion:
 *    Convert from XML
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMXMLToTicket(
  CFAllocatorRef   allocator,
  CFDataRef        anXMLTicket,
  PMTicketRef *    ticket,
  CFStringRef *    conversionError);


/*
 *  PMTicketReadXMLFromFile()
 *  
 *  Discussion:
 *    Read from XML file
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketReadXMLFromFile(
  CFAllocatorRef   allocator,
  const char *     path,
  PMTicketRef *    ticket,
  CFStringRef *    errorString);



/* To add an item to a ticket, the "SetItem" call for the specific data type is used whenever  */
/* possible. This adds a new item if one doesn't exist and updates a previous item if it  */
/* already exists. The "locked" field will determine if subsequent updates are allowed. */
/* Strings: */
/* CFString */
/*
 *  PMTicketSetCFString()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketSetCFString(
  PMTicketRef   ticket,
  CFStringRef   clientID,
  CFStringRef   key,
  CFStringRef   item,
  Boolean       locked);


/* Pascal String */
/*
 *  PMTicketSetPString()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketSetPString(
  PMTicketRef      ticket,
  CFStringRef      clientID,
  CFStringRef      key,
  ConstStringPtr   value,
  Boolean          locked);


/* 'C' String */
/*
 *  PMTicketSetCString()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketSetCString(
  PMTicketRef   ticket,
  CFStringRef   clientID,
  CFStringRef   key,
  const char *  value,
  Boolean       locked);


/* Array of 'C' Strings */
/*
 *  PMTicketSetCStringArray()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketSetCStringArray(
  PMTicketRef    ticket,
  CFStringRef    clientID,
  CFStringRef    key,
  const char **  cStringArray,
  UInt32         count,
  Boolean        locked);



/* Numbers: */
/* CFNumber */
/*
 *  PMTicketSetCFNumber()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketSetCFNumber(
  PMTicketRef   ticket,
  CFStringRef   clientID,
  CFStringRef   key,
  CFNumberRef   item,
  Boolean       locked);


/* SInt32 */
/*
 *  PMTicketSetSInt32()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketSetSInt32(
  PMTicketRef   ticket,
  CFStringRef   clientID,
  CFStringRef   key,
  SInt32        value,
  Boolean       locked);


/* Array of SInt32 */
/*
 *  PMTicketSetSInt32Array()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketSetSInt32Array(
  PMTicketRef     ticket,
  CFStringRef     clientID,
  CFStringRef     key,
  const SInt32 *  sInt32Array,
  UInt32          count,
  Boolean         locked);


/* UInt32 */
/* NOTE: The underlying code uses SInt32s in the CF code, so this function can't set -1 */
/* as the largest unsigned number. Please avoid setting the high bit */
/*
 *  PMTicketSetUInt32()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketSetUInt32(
  PMTicketRef   ticket,
  CFStringRef   clientID,
  CFStringRef   key,
  UInt32        value,
  Boolean       locked);


/* Array of UInt32 */
/* NOTE: The underlying code uses SInt32s in the CF code, so this function can't set -1 */
/* as the largest unsigned number. Please avoid setting the high bit */
/*
 *  PMTicketSetUInt32Array()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketSetUInt32Array(
  PMTicketRef     ticket,
  CFStringRef     clientID,
  CFStringRef     key,
  const UInt32 *  uInt32Array,
  UInt32          count,
  Boolean         locked);


/* Double */
/*
 *  PMTicketSetDouble()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketSetDouble(
  PMTicketRef   ticket,
  CFStringRef   clientID,
  CFStringRef   key,
  double        value,
  Boolean       locked);


/* Array of doubles */
/*
 *  PMTicketSetDoubleArray()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketSetDoubleArray(
  PMTicketRef     ticket,
  CFStringRef     clientID,
  CFStringRef     key,
  const double *  doubleArray,
  UInt32          count,
  Boolean         changeable);


/* PMResolution - Array of 2 Doubles */
/*
 *  PMTicketSetPMResolution()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketSetPMResolution(
  PMTicketRef     ticket,
  CFStringRef     clientID,
  CFStringRef     key,
  PMResolution *  value,
  Boolean         locked);


/* Array of PMResolution */
/*
 *  PMTicketSetPMResolutionArray()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketSetPMResolutionArray(
  PMTicketRef     ticket,
  CFStringRef     clientID,
  CFStringRef     key,
  PMResolution *  pmResolutionArray,
  UInt32          count,
  Boolean         locked);


/* PMRect - Array of 4 Doubles */
/*
 *  PMTicketSetPMRect()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketSetPMRect(
  PMTicketRef   ticket,
  CFStringRef   clientID,
  CFStringRef   key,
  PMRect *      value,
  Boolean       locked);


/* Array of PMRects */
/*
 *  PMTicketSetPMRectArray()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketSetPMRectArray(
  PMTicketRef   ticket,
  CFStringRef   clientID,
  CFStringRef   key,
  PMRect *      pmRectArray,
  UInt32        count,
  Boolean       locked);


/* Raw Data */
/* CFData */
/*
 *  PMTicketSetCFData()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketSetCFData(
  PMTicketRef   ticket,
  CFStringRef   clientID,
  CFStringRef   key,
  CFDataRef     item,
  Boolean       locked);


/* UInt8 - 'C' Bytes */
/*
 *  PMTicketSetBytes()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketSetBytes(
  PMTicketRef    ticket,
  CFStringRef    clientID,
  CFStringRef    key,
  const UInt8 *  data,
  UInt32         size,
  Boolean        locked);


/* Booleans */
/* CFBoolean */
/*
 *  PMTicketSetCFBoolean()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketSetCFBoolean(
  PMTicketRef    ticket,
  CFStringRef    clientID,
  CFStringRef    key,
  CFBooleanRef   item,
  Boolean        locked);


/* 'C' Boolean */
/*
 *  PMTicketSetBoolean()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketSetBoolean(
  PMTicketRef   ticket,
  CFStringRef   clientID,
  CFStringRef   key,
  Boolean       value,
  Boolean       locked);



/* Dates */
/*
 *  PMTicketSetCFDate()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketSetCFDate(
  PMTicketRef   ticket,
  CFStringRef   clientID,
  CFStringRef   key,
  CFDateRef     item,
  Boolean       locked);


/* Arrays */
/*
 *  PMTicketSetCFArray()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketSetCFArray(
  PMTicketRef   ticket,
  CFStringRef   clientID,
  CFStringRef   key,
  CFArrayRef    item,
  Boolean       locked);


/* Dictionaries */
/*
 *  PMTicketSetCFDictionary()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketSetCFDictionary(
  PMTicketRef       ticket,
  CFStringRef       clientID,
  CFStringRef       key,
  CFDictionaryRef   item,
  Boolean           locked);


/* Templates, which are defined to be opaque. */
/*
 *  PMTicketSetTemplate()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketSetTemplate(
  PMTicketRef     ticket,
  CFStringRef     clientID,
  CFStringRef     key,
  PMTemplateRef   item,
  Boolean         locked);


/* Generic CF Type */
/*
 *  PMTicketSetItem()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketSetItem(
  PMTicketRef   ticket,
  CFStringRef   clientID,
  CFStringRef   key,
  CFTypeRef     item,
  Boolean       locked);



/*
 *  PMTicketSetMetaItem()
 *  
 *  Discussion:
 *    To add an item that doesn't need to be stored in the XML file,
 *    use the PMTicketSetMetaItem() call. It allows simple addition of
 *    an item, but that item won't be written to XML when the rest of
 *    the ticket is stored. By definition, all meta items are not
 *    locked, simply because we have no easy mechanism for keeping
 *    track of a locked state for a meta item. Our intent is to allow a
 *    caller to add items temporarily to a ticket, perhaps to keep
 *    track of the "default" ticket in a list of tickets, or the
 *    "current" paper info in a list of papers.
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketSetMetaItem(
  PMTicketRef   ticket,
  CFStringRef   key,
  CFTypeRef     item);



/*
 *  PMTicketFillFromArray()
 *  
 *  Discussion:
 *    Convert an array of static item structures into entries for a
 *    ticket and add them one at a time to the ticket. Could fail part
 *    way through.
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketFillFromArray(
  PMTicketRef                 ticket,
  CFStringRef                 clientID,
  const PMTicketItemStruct *  items,
  UInt32                      itemCount);



/*
 *  PMTicketCopyItem()
 *  
 *  Discussion:
 *    If an item must be copied from one ticket to another, use the
 *    "CopyItem" call to make the simple transfer. This will update the
 *    recorded date and client ID for the item. The "locked" field will
 *    determine if subsequent updates may be made.
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketCopyItem(
  PMTicketRef   sourceTicket,
  PMTicketRef   destTicket,
  CFStringRef   clientID,
  CFStringRef   key,
  Boolean       locked);



/* A couple of functions that will help in managing the "locked" state of any ticket */
/* item. These functions only work for items directly stored in the current ticket, not */
/* for items in sub-tickets. */
/*
 *  PMTicketIsItemLocked()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketIsItemLocked(
  PMTicketRef   ticket,
  CFStringRef   key,
  Boolean *     locked);


/*
 *  PMTicketLockItem()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketLockItem(
  PMTicketRef   ticket,
  CFStringRef   clientID,
  CFStringRef   key);


/*
 *  PMTicketUnlockItem()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketUnlockItem(
  PMTicketRef   ticket,
  CFStringRef   clientID,
  CFStringRef   key);



/*
 *  PMTicketDeleteItem()
 *  
 *  Discussion:
 *    Disable an item using PMTicketDelete. Future callers will see
 *    "ItemNotFound" errors. This call actually tags a new set of
 *    structures to the end of an item's dictionary, in order to keep a
 *    history of the item.
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketDeleteItem(
  PMTicketRef   ticket,
  CFStringRef   clientID,
  CFStringRef   key);


/*
 *  PMTicketReleaseItem()
 *  
 *  Discussion:
 *    Release an item (quite different from delete) when you want it
 *    completely removed from the ticket. This can only be done if the
 *    item is unlocked.
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketReleaseItem(
  PMTicketRef   ticket,
  CFStringRef   key);


/*
 *  PMTicketContainsItem()
 *  
 *  Discussion:
 *    Fetching an item back out of the ticket requires the "GetItem"
 *    call for the particular type of data you're fetching. In some
 *    cases, the caller doesn't know what type of data is being
 *    returned, so we have a generic "GetItem" call, but for all other
 *    cases developers are encouraged to use the specific call for the
 *    data they need, thus enabling type checking and reducing errors.
 *    Returns true if item exists.
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( Boolean )
PMTicketContainsItem(
  PMTicketRef   ticket,
  UInt32        nodeIndex1,
  UInt32        nodeIndex2,
  CFStringRef   key);


/* Strings */
/* CFString */
/*
 *  PMTicketGetCFString()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketGetCFString(
  PMTicketRef    ticket,
  UInt32         nodeIndex1,
  UInt32         nodeIndex2,
  CFStringRef    key,
  CFStringRef *  item);


/* Pascal String */
/*
 *  PMTicketGetPString()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketGetPString(
  PMTicketRef        ticket,
  UInt32             nodeIndex1,
  UInt32             nodeIndex2,
  CFStringRef        key,
  UInt32             bufferSize,
  CFStringEncoding   encoding,
  StringPtr          value);


/* 'C' String */
/*
 *  PMTicketGetCString()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketGetCString(
  PMTicketRef        ticket,
  UInt32             nodeIndex1,
  UInt32             nodeIndex2,
  CFStringRef        key,
  UInt32             bufferSize,
  CFStringEncoding   encoding,
  char *             value);



/* Numbers */
/* CFNumber */
/*
 *  PMTicketGetCFNumber()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketGetCFNumber(
  PMTicketRef    ticket,
  UInt32         nodeIndex1,
  UInt32         nodeIndex2,
  CFStringRef    key,
  CFNumberRef *  item);


/* SInt32 */
/*
 *  PMTicketGetSInt32()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketGetSInt32(
  PMTicketRef   ticket,
  UInt32        nodeIndex1,
  UInt32        nodeIndex2,
  CFStringRef   key,
  SInt32 *      value);


/* UInt32 */
/*
 *  PMTicketGetUInt32()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketGetUInt32(
  PMTicketRef   ticket,
  UInt32        nodeIndex1,
  UInt32        nodeIndex2,
  CFStringRef   key,
  UInt32 *      value);


/* Double */
/*
 *  PMTicketGetDouble()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketGetDouble(
  PMTicketRef   ticket,
  UInt32        nodeIndex1,
  UInt32        nodeIndex2,
  CFStringRef   key,
  double *      value);


/* PMResolution - Array of 2 doubles */
/*
 *  PMTicketGetPMResolution()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketGetPMResolution(
  PMTicketRef     ticket,
  UInt32          nodeIndex1,
  UInt32          nodeIndex2,
  CFStringRef     key,
  PMResolution *  res);


/*
 *  PMTicketGetIndexPMResolution()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketGetIndexPMResolution(
  PMTicketRef     ticket,
  UInt32          nodeIndex1,
  UInt32          nodeIndex2,
  CFStringRef     key,
  UInt32          index,
  PMResolution *  res);


/* PMRect - Array of 4 doubles */
/*
 *  PMTicketGetPMRect()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketGetPMRect(
  PMTicketRef   ticket,
  UInt32        nodeIndex1,
  UInt32        nodeIndex2,
  CFStringRef   key,
  PMRect *      value);



/* Raw Data */
/* CFData */
/*
 *  PMTicketGetCFData()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketGetCFData(
  PMTicketRef   ticket,
  UInt32        nodeIndex1,
  UInt32        nodeIndex2,
  CFStringRef   key,
  CFDataRef *   item);


/* UInt8 - 'C' Bytes */
/* NOTE: Caller is expected to call twice if size is unknown, passing null for data pointer */
/* and a valid pointer for the size before allocating space and calling back with both pointers */
/* set, this time with valid data pointer and valid size pointer pointing to # of bytes requested. */
/*
 *  PMTicketGetBytes()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketGetBytes(
  PMTicketRef   ticket,
  UInt32        nodeIndex1,
  UInt32        nodeIndex2,
  CFStringRef   key,
  UInt8 *       data,
  UInt32 *      size);


/* Booleans */
/* CFBoolean */
/*
 *  PMTicketGetCFBoolean()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketGetCFBoolean(
  PMTicketRef     ticket,
  UInt32          nodeIndex1,
  UInt32          nodeIndex2,
  CFStringRef     key,
  CFBooleanRef *  item);


/* 'C' Boolean  */
/*
 *  PMTicketGetBoolean()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketGetBoolean(
  PMTicketRef   ticket,
  UInt32        nodeIndex1,
  UInt32        nodeIndex2,
  CFStringRef   key,
  Boolean *     value);


/* Dates */
/*
 *  PMTicketGetCFDate()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketGetCFDate(
  PMTicketRef   ticket,
  UInt32        nodeIndex1,
  UInt32        nodeIndex2,
  CFStringRef   key,
  CFDateRef *   item);


/* Non-numeric Arrays */
/*
 *  PMTicketGetCFArray()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketGetCFArray(
  PMTicketRef   ticket,
  UInt32        nodeIndex1,
  UInt32        nodeIndex2,
  CFStringRef   key,
  CFArrayRef *  item);


/* Dictionaries */
/*
 *  PMTicketGetCFDictionary()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketGetCFDictionary(
  PMTicketRef        ticket,
  UInt32             nodeIndex1,
  UInt32             nodeIndex2,
  CFStringRef        key,
  CFDictionaryRef *  item);


/* PMTemplates, which are defined to be opaque. */
/*
 *  PMTicketCreateTemplate()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketCreateTemplate(
  PMTicketRef      ticket,
  UInt32           nodeIndex1,
  UInt32           nodeIndex2,
  CFStringRef      key,
  PMTemplateRef *  item);



/* The generic calls for regular items and meta items. See notes on "SetMetaItem" for more details. */
/*
 *  PMTicketGetItem()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketGetItem(
  PMTicketRef   ticket,
  UInt32        nodeIndex1,
  UInt32        nodeIndex2,
  CFStringRef   key,
  CFTypeRef *   item);


/* Meta items don't get saved to XML. */
/*
 *  PMTicketGetMetaItem()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketGetMetaItem(
  PMTicketRef   ticket,
  CFStringRef   key,
  CFTypeRef *   item);



/* Any ticket can contain another ticket, allowing us to store multiple PageFormat tickets */
/* (one for each page) and multiple Document Info tickets (for multi-document jobs). The following */
/* functions allow us to put a ticket into another ticket as a sub-ticket, and retreive it */
/* later on. */
/*
 *  PMTicketSetTicket()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketSetTicket(
  PMTicketRef   ticket,
  PMTicketRef   ticketToAdd,
  UInt32        index);


/*
 *  PMTicketContainsTicket()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketContainsTicket(
  PMTicketRef   ticket,
  CFStringRef   requestedType,
  UInt32        index,
  Boolean *     exists);


/*
 *  PMTicketGetTicket()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketGetTicket(
  PMTicketRef    ticket,
  CFStringRef    requestedType,
  UInt32         index,
  PMTicketRef *  retreivedTicket);


/*
 *  PMTicketRemoveTicket()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketRemoveTicket(
  PMTicketRef   ticket,
  CFStringRef   typeToRemove,
  UInt32        index);


/*
 *  PMTicketGetPPDDict()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( OSStatus )
PMTicketGetPPDDict(
  PMTicketRef               ticket,
  UInt32                    nodeIndex1,
  UInt32                    nodeIndex2,
  CFMutableDictionaryRef *  dict);





#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