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
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
|
{
File: AE/AEDataModel.h
Contains: AppleEvent Data Model Interfaces.
Version: AppleEvents-496~1
Copyright: © 1996-2008 by Apple Computer, Inc., all rights reserved
Bugs?: For bug reports, consult the following page on
the World Wide Web:
http://www.freepascal.org/bugs.html
}
{ Pascal Translation Updated: Jonas Maebe, <jonas@freepascal.org>, October 2009 }
{
Modified for use with Free Pascal
Version 308
Please report any bugs to <gpc@microbizz.nl>
}
{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
{$mode macpas}
{$packenum 1}
{$macro on}
{$inline on}
{$calling mwpascal}
unit AEDataModel;
interface
{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
{$setc GAP_INTERFACES_VERSION := $0308}
{$ifc not defined USE_CFSTR_CONSTANT_MACROS}
{$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
{$endc}
{$ifc defined CPUPOWERPC and defined CPUI386}
{$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
{$endc}
{$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
{$endc}
{$ifc not defined __ppc__ and defined CPUPOWERPC32}
{$setc __ppc__ := 1}
{$elsec}
{$setc __ppc__ := 0}
{$endc}
{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
{$setc __ppc64__ := 1}
{$elsec}
{$setc __ppc64__ := 0}
{$endc}
{$ifc not defined __i386__ and defined CPUI386}
{$setc __i386__ := 1}
{$elsec}
{$setc __i386__ := 0}
{$endc}
{$ifc not defined __x86_64__ and defined CPUX86_64}
{$setc __x86_64__ := 1}
{$elsec}
{$setc __x86_64__ := 0}
{$endc}
{$ifc not defined __arm__ and defined CPUARM}
{$setc __arm__ := 1}
{$elsec}
{$setc __arm__ := 0}
{$endc}
{$ifc defined cpu64}
{$setc __LP64__ := 1}
{$elsec}
{$setc __LP64__ := 0}
{$endc}
{$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
{$error Conflicting definitions for __ppc__ and __i386__}
{$endc}
{$ifc defined __ppc__ and __ppc__}
{$setc TARGET_CPU_PPC := TRUE}
{$setc TARGET_CPU_PPC64 := FALSE}
{$setc TARGET_CPU_X86 := FALSE}
{$setc TARGET_CPU_X86_64 := FALSE}
{$setc TARGET_CPU_ARM := FALSE}
{$setc TARGET_OS_MAC := TRUE}
{$setc TARGET_OS_IPHONE := FALSE}
{$setc TARGET_IPHONE_SIMULATOR := FALSE}
{$elifc defined __ppc64__ and __ppc64__}
{$setc TARGET_CPU_PPC := FALSE}
{$setc TARGET_CPU_PPC64 := TRUE}
{$setc TARGET_CPU_X86 := FALSE}
{$setc TARGET_CPU_X86_64 := FALSE}
{$setc TARGET_CPU_ARM := FALSE}
{$setc TARGET_OS_MAC := TRUE}
{$setc TARGET_OS_IPHONE := FALSE}
{$setc TARGET_IPHONE_SIMULATOR := FALSE}
{$elifc defined __i386__ and __i386__}
{$setc TARGET_CPU_PPC := FALSE}
{$setc TARGET_CPU_PPC64 := FALSE}
{$setc TARGET_CPU_X86 := TRUE}
{$setc TARGET_CPU_X86_64 := FALSE}
{$setc TARGET_CPU_ARM := FALSE}
{$ifc defined(iphonesim)}
{$setc TARGET_OS_MAC := FALSE}
{$setc TARGET_OS_IPHONE := TRUE}
{$setc TARGET_IPHONE_SIMULATOR := TRUE}
{$elsec}
{$setc TARGET_OS_MAC := TRUE}
{$setc TARGET_OS_IPHONE := FALSE}
{$setc TARGET_IPHONE_SIMULATOR := FALSE}
{$endc}
{$elifc defined __x86_64__ and __x86_64__}
{$setc TARGET_CPU_PPC := FALSE}
{$setc TARGET_CPU_PPC64 := FALSE}
{$setc TARGET_CPU_X86 := FALSE}
{$setc TARGET_CPU_X86_64 := TRUE}
{$setc TARGET_CPU_ARM := FALSE}
{$setc TARGET_OS_MAC := TRUE}
{$setc TARGET_OS_IPHONE := FALSE}
{$setc TARGET_IPHONE_SIMULATOR := FALSE}
{$elifc defined __arm__ and __arm__}
{$setc TARGET_CPU_PPC := FALSE}
{$setc TARGET_CPU_PPC64 := FALSE}
{$setc TARGET_CPU_X86 := FALSE}
{$setc TARGET_CPU_X86_64 := FALSE}
{$setc TARGET_CPU_ARM := TRUE}
{ will require compiler define when/if other Apple devices with ARM cpus ship }
{$setc TARGET_OS_MAC := FALSE}
{$setc TARGET_OS_IPHONE := TRUE}
{$setc TARGET_IPHONE_SIMULATOR := FALSE}
{$elsec}
{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
{$endc}
{$ifc defined __LP64__ and __LP64__ }
{$setc TARGET_CPU_64 := TRUE}
{$elsec}
{$setc TARGET_CPU_64 := FALSE}
{$endc}
{$ifc defined FPC_BIG_ENDIAN}
{$setc TARGET_RT_BIG_ENDIAN := TRUE}
{$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
{$elifc defined FPC_LITTLE_ENDIAN}
{$setc TARGET_RT_BIG_ENDIAN := FALSE}
{$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
{$elsec}
{$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
{$endc}
{$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
{$setc CALL_NOT_IN_CARBON := FALSE}
{$setc OLDROUTINENAMES := FALSE}
{$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
{$setc OPAQUE_UPP_TYPES := TRUE}
{$setc OTCARBONAPPLICATION := TRUE}
{$setc OTKERNEL := FALSE}
{$setc PM_USE_SESSION_APIS := TRUE}
{$setc TARGET_API_MAC_CARBON := TRUE}
{$setc TARGET_API_MAC_OS8 := FALSE}
{$setc TARGET_API_MAC_OSX := TRUE}
{$setc TARGET_CARBON := TRUE}
{$setc TARGET_CPU_68K := FALSE}
{$setc TARGET_CPU_MIPS := FALSE}
{$setc TARGET_CPU_SPARC := FALSE}
{$setc TARGET_OS_UNIX := FALSE}
{$setc TARGET_OS_WIN32 := FALSE}
{$setc TARGET_RT_MAC_68881 := FALSE}
{$setc TARGET_RT_MAC_CFM := FALSE}
{$setc TARGET_RT_MAC_MACHO := TRUE}
{$setc TYPED_FUNCTION_POINTERS := TRUE}
{$setc TYPE_BOOL := FALSE}
{$setc TYPE_EXTENDED := FALSE}
{$setc TYPE_LONGLONG := TRUE}
uses MacTypes,MixedMode;
{$endc} {not MACOSALLINCLUDE}
{$ifc TARGET_OS_MAC}
{$ALIGN MAC68K}
{ Apple event descriptor types }
const
typeBoolean = FourCharCode('bool');
typeChar = FourCharCode('TEXT'); { Deprecated, use typeUTF8Text instead. }
{
* The following descriptor types are deprecated due to their lack of
* explicit encoding or byte order definition. Please use
* typeUTF16ExternalRepresentation or typeUTF8Text instead. }
const
typeStyledUnicodeText = FourCharCode('sutx'); { Not implemented }
typeEncodedString = FourCharCode('encs'); { Not implemented }
typeUnicodeText = FourCharCode('utxt'); { native byte ordering, optional BOM }
typeCString = FourCharCode('cstr'); { MacRoman characters followed by a NULL byte }
typePString = FourCharCode('pstr'); { Unsigned length byte followed by MacRoman characters }
{
* The preferred unicode text types. In both cases, there is no explicit null termination or length byte.
}
const
typeUTF16ExternalRepresentation = FourCharCode('ut16'); { big-endian 16 bit unicode with optional byte-order-mark, or little-endian 16 bit unicode with required byte-order-mark. }
typeUTF8Text = FourCharCode('utf8'); { 8 bit unicode }
{ Preferred numeric Apple event descriptor types }
const
typeSInt16 = FourCharCode('shor'); { SInt16 : signed, 16 bit integer }
typeUInt16 = FourCharCode('ushr'); { UInt16 : unsigned, 16 bit integer }
typeSInt32 = FourCharCode('long'); { SInt32 : signed, 32 bit integer }
typeUInt32 = FourCharCode('magn'); { UInt32 : unsigned, 32 bit integer }
typeSInt64 = FourCharCode('comp'); { SInt64 : signed, 64 bit integer }
typeUInt64 = FourCharCode('ucom'); { UInt64 : unsigned, 64 bit integer }
typeIEEE32BitFloatingPoint = FourCharCode('sing'); { float }
typeIEEE64BitFloatingPoint = FourCharCode('doub'); { double }
type128BitFloatingPoint = FourCharCode('ldbl');
typeDecimalStruct = FourCharCode('decm');
{ Non-preferred Apple event descriptor types }
{$ifc TARGET_CPU_64}
{ On Mac OS X 64 bit, the following types have been removed because their meaning is unclear or confusing.
For example, people have assumed that the appropriate data type for typeLongInteger would be long; but
on 64 bit 'long' is a 64 bit value and the appropriate type should be typeComp.
You should change your existing code to not use the following types, and use the more specific ones. Check
through your code to make sure that the datasize referenced by these types is the correct type.
type constant change to data type should be
------------- --------- -------------------
typeSMInt typeSInt16 SInt16
typeShortInteger typeSInt16 SInt16
typeInteger typeSInt32 SInt32
typeLongInteger typeSInt32 SInt32
typeComp typeSInt64 SInt64 or Wide
typeSMFloat typeIEEE32BitFloatingPoint Float32
typeShortFloat typeIEEE32BitFloatingPoint Float32
typeLongFloat typeIEEE64BitFloatingPoint Float64
There is no good type on 64 bit to use for typeEntended; either change your code to pass typeIEEE64BitFloatingPoint
for typeExtended and live with the reduction in range or use type128BitFloatingPoint.
}
{$elsec} {TARGET_CPU_64}
{ Non-preferred Apple event descriptor types }
typeSMInt = FourCharCode('shor');
typeShortInteger = FourCharCode('shor');
typeInteger = FourCharCode('long');
typeLongInteger = FourCharCode('long');
typeMagnitude = FourCharCode('magn');
typeComp = FourCharCode('comp');
typeSMFloat = FourCharCode('sing');
typeShortFloat = FourCharCode('sing');
typeFloat = FourCharCode('doub');
typeLongFloat = FourCharCode('doub');
typeExtended = FourCharCode('exte');
{$endc} {TARGET_CPU_64}
{ More Apple event descriptor types }
const
typeAEList = FourCharCode('list');
typeAERecord = FourCharCode('reco');
typeAppleEvent = FourCharCode('aevt');
typeEventRecord = FourCharCode('evrc');
typeTrue = FourCharCode('true');
typeFalse = FourCharCode('fals');
typeAlias = FourCharCode('alis'); { AliasPtr, from a valid AliasHandle }
typeEnumerated = FourCharCode('enum');
typeType = FourCharCode('type'); { OSType }
typeAppParameters = FourCharCode('appa');
typeProperty = FourCharCode('prop');
typeFSRef = FourCharCode('fsrf'); { FSRef }
typeFileURL = FourCharCode('furl');
typeBookmarkData = FourCharCode('bmrk');
typeKeyword = FourCharCode('keyw'); { OSType }
typeSectionH = FourCharCode('sect');
typeWildCard = FourCharCode('****');
typeApplSignature = FourCharCode('sign'); { OSType }
typeQDRectangle = FourCharCode('qdrt');
typeFixed = FourCharCode('fixd');
typeProcessSerialNumber = FourCharCode('psn '); { ProcessSerialNumber }
typeApplicationURL = FourCharCode('aprl');
typeNull = FourCharCode('null'); { null or nonexistent data }
{$ifc not TARGET_CPU_64}
{
FSSpecs are deprecated on Mac OS X, and their use in AppleEvents is discouraged. You should change
your code to use FSRefs. In __LP64__ code, coercions into typeFSS is not supported,
and coercion from typeFSS is not guaranteed to work correctly in all cases.
}
const
typeFSS = FourCharCode('fss '); { FSSpec }
{$endc} {not TARGET_CPU_64}
const
typeCFAttributedStringRef = FourCharCode('cfas');
typeCFMutableAttributedStringRef = FourCharCode('cfaa');
typeCFStringRef = FourCharCode('cfst');
typeCFMutableStringRef = FourCharCode('cfms');
typeCFArrayRef = FourCharCode('cfar');
typeCFMutableArrayRef = FourCharCode('cfma');
typeCFDictionaryRef = FourCharCode('cfdc');
typeCFMutableDictionaryRef = FourCharCode('cfmd');
typeCFNumberRef = FourCharCode('cfnb');
typeCFBooleanRef = FourCharCode('cftf');
typeCFTypeRef = FourCharCode('cfty');
{ New addressing modes for MacOS X }
const
typeKernelProcessID = FourCharCode('kpid');
typeMachPort = FourCharCode('port');
{ Targeting applications by bundle ID is only available in Mac OS X 10.3 or later. }
const
typeApplicationBundleID = FourCharCode('bund');
{ Keywords for Apple event attributes }
const
keyTransactionIDAttr = FourCharCode('tran'); { AETransactionID }
keyReturnIDAttr = FourCharCode('rtid'); { AEReturnID }
keyEventClassAttr = FourCharCode('evcl'); { AEEventClass }
keyEventIDAttr = FourCharCode('evid'); { AEEventID }
keyAddressAttr = FourCharCode('addr');
keyOptionalKeywordAttr = FourCharCode('optk');
keyTimeoutAttr = FourCharCode('timo'); { SInt32 }
keyInteractLevelAttr = FourCharCode('inte'); { this attribute is read only - will be set in AESend }
keyEventSourceAttr = FourCharCode('esrc'); { this attribute is read only - returned as typeShortInteger }
keyMissedKeywordAttr = FourCharCode('miss'); { this attribute is read only }
keyOriginalAddressAttr = FourCharCode('from'); { new in 1.0.1 }
keyAcceptTimeoutAttr = FourCharCode('actm'); { new for Mac OS X }
keyReplyRequestedAttr = FourCharCode('repq'); { Was a reply requested for this event - returned as typeBoolean }
keySenderEUIDAttr = FourCharCode('seid'); { read only, returned as typeSInt32. Will be the euid of the sender of this event. }
keySenderEGIDAttr = FourCharCode('sgid'); { read only, returned as typeSInt32. Will be the egid of the sender of this event. }
keySenderUIDAttr = FourCharCode('uids'); { read only, returned as typeSInt32. Will be the uid of the sender of this event. }
keySenderGIDAttr = FourCharCode('gids'); { read only, returned as typeSInt32. Will be the gid of the sender of this event. }
keySenderPIDAttr = FourCharCode('spid'); { read only, returned as typeSInt32. Will be the pid of the sender of this event. }
{ These bits are specified in the keyXMLDebuggingAttr (an SInt32) }
const
kAEDebugPOSTHeader = 1 shl 0; { headers of the HTTP post we sent - typeChar }
kAEDebugReplyHeader = 1 shl 1; { headers returned by the server }
kAEDebugXMLRequest = 1 shl 2; { the XML request we sent }
kAEDebugXMLResponse = 1 shl 3; { the XML reply from the server }
kAEDebugXMLDebugAll = $FFFFFFFF; { everything! }
{ These values can be added as a parameter to the direct object of a
SOAP message to specify the serialization schema. If not
specified, kSOAP1999Schema is the default. These should be added as
typeType. }
const
kSOAP1999Schema = FourCharCode('ss99');
kSOAP2001Schema = FourCharCode('ss01');
const
{ outgoing event attributes }
keyUserNameAttr = FourCharCode('unam');
keyUserPasswordAttr = FourCharCode('pass'); { not sent with the event }
keyDisableAuthenticationAttr = FourCharCode('auth'); { When present and with a non zero value (that is, false, or integer 0), }
{ AESend will not authenticate the user. If not present, or with a non-zero}
{ value, AESend will prompt for authentication information from the user if the interaction level allows. }
keyXMLDebuggingAttr = FourCharCode('xdbg'); { a bitfield of specifying which XML debugging data is to be returned with the event }
{ Event class / id }
kAERPCClass = FourCharCode('rpc '); { for outgoing XML events }
kAEXMLRPCScheme = FourCharCode('RPC2'); { event ID: event should be sent to an XMLRPC endpoint }
kAESOAPScheme = FourCharCode('SOAP'); { event ID: event should be sent to a SOAP endpoint }
kAESharedScriptHandler = FourCharCode('wscp'); { event ID: handler for incoming XML requests }
{ these parameters exist as part of the direct object of the event for both incoming and outgoing requests }
keyRPCMethodName = FourCharCode('meth'); { name of the method to call }
keyRPCMethodParam = FourCharCode('parm'); { the list (or structure) of parameters }
keyRPCMethodParamOrder = FourCharCode('/ord'); { if a structure, the order of parameters (a list) }
{ when keyXMLDebugginAttr so specifies, these additional parameters will be part of the reply. }
keyAEPOSTHeaderData = FourCharCode('phed'); { what we sent to the server }
keyAEReplyHeaderData = FourCharCode('rhed'); { what the server sent to us }
keyAEXMLRequestData = FourCharCode('xreq'); { what we sent to the server }
keyAEXMLReplyData = FourCharCode('xrep'); { what the server sent to us }
{ additional parameters that can be specified in the direct object of the event }
keyAdditionalHTTPHeaders = FourCharCode('ahed'); { list of additional HTTP headers (a list of 2 element lists) }
keySOAPAction = FourCharCode('sact'); { the SOAPAction header (required for SOAP messages) }
keySOAPMethodNameSpace = FourCharCode('mspc'); { Optional namespace (defaults to m:) }
keySOAPMethodNameSpaceURI = FourCharCode('mspu'); { Required namespace URI }
keySOAPSchemaVersion = FourCharCode('ssch'); { Optional XML Schema version, defaults to kSOAP1999Schama }
{
When serializing AERecords as SOAP structures, it is possible
to specify the namespace and type of the structure. To do this,
add a keySOAPStructureMetaData record to the top level of the
record to be serialized. If present, this will be used to specify
the structure namespace. This will produce a structure elment that
looks like:
<myStruct
xmlns:myNamespace="http://myUri.org/xsd",
xsi:type="myNamespace:MyStructType">
...
</myStruct>
}
const
keySOAPStructureMetaData = FourCharCode('/smd');
keySOAPSMDNamespace = FourCharCode('ssns'); { "myNamespace"}
keySOAPSMDNamespaceURI = FourCharCode('ssnu'); { "http://myUri.org/xsd"}
keySOAPSMDType = FourCharCode('sstp'); { "MyStructType"}
{
* Web Services Proxy support. Available only on Mac OS X 10.2 or later.
* These constants should be added as attributes on the event that is
* being sent (not part of the direct object.)
}
const
{ Automatically configure the proxy based on System Configuration }
kAEUseHTTPProxyAttr = FourCharCode('xupr'); { a typeBoolean. Defaults to true.}
{ manually specify the proxy host and port. }
kAEHTTPProxyPortAttr = FourCharCode('xhtp'); { a typeSInt32}
kAEHTTPProxyHostAttr = FourCharCode('xhth'); { a typeChar}
{
* Web Services SOCKS support. kAEUseSocksAttr is a boolean that
* specifies whether to automatically configure SOCKS proxies by
* querying System Configuration.
}
const
kAESocks4Protocol = 4;
kAESocks5Protocol = 5;
const
kAEUseSocksAttr = FourCharCode('xscs'); { a typeBoolean. Defaults to true.}
{ This attribute specifies a specific SOCKS protocol to be used }
kAESocksProxyAttr = FourCharCode('xsok'); { a typeSInt32}
{ if version >= 4 }
kAESocksHostAttr = FourCharCode('xshs'); { a typeChar}
kAESocksPortAttr = FourCharCode('xshp'); { a typeSInt32}
kAESocksUserAttr = FourCharCode('xshu'); { a typeChar}
{ if version >= 5 }
kAESocksPasswordAttr = FourCharCode('xshw'); { a typeChar}
{ Constants used for specifying the factoring of AEDescLists. }
const
kAEDescListFactorNone = 0;
kAEDescListFactorType = 4;
kAEDescListFactorTypeAndSize = 8;
{ Constants used creating an AppleEvent }
const
{ Constant for the returnID param of AECreateAppleEvent }
kAutoGenerateReturnID = -1; { AECreateAppleEvent will generate a session-unique ID }
{ Constant for transaction IDs }
kAnyTransactionID = 0; { no transaction is in use }
{ Apple event manager data types }
type
DescType = ResType;
DescTypePtr = ^DescType;
AEKeyword = FourCharCode;
AEKeywordPtr = ^AEKeyword;
{$ifc OPAQUE_TOOLBOX_STRUCTS}
AEDataStorage = ^SInt32; { an opaque type }
AEDataStoragePtr = ^AEDataStorage; { when a var xx:AEDataStorage parameter can be nil, it is changed to xx: AEDataStoragePtr }
{$elsec}
AEDataStorage = Handle;
{$endc} {OPAQUE_TOOLBOX_STRUCTS}
AEDescPtr = ^AEDesc;
AEDesc = record
descriptorType: DescType;
{ No alignment dummy here for 64 bit, also compiled with m68k alignment in C! }
dataHandle: AEDataStorage;
end;
type
AEKeyDescPtr = ^AEKeyDesc;
AEKeyDesc = record
descKey: AEKeyword;
descContent: AEDesc;
end;
{ a list of AEDesc's is a special kind of AEDesc }
type
AEDescList = AEDesc;
AEDescListPtr = ^AEDescList;
{ AERecord is a list of keyworded AEDesc's }
type
AERecord = AEDescList;
AERecordPtr = ^AERecord;
{ an AEDesc which contains address data }
type
AEAddressDesc = AEDesc;
AEAddressDescPtr = ^AEAddressDesc;
{ an AERecord that contains an AppleEvent, and related data types }
type
AppleEvent = AERecord;
AppleEventPtr = ^AppleEvent;
AEReturnID = SInt16;
AETransactionID = SInt32;
AEEventClass = FourCharCode;
AEEventID = FourCharCode;
AEArrayType = SInt8;
const
kAEDataArray = 0;
kAEPackedArray = 1;
kAEDescArray = 3;
kAEKeyDescArray = 4;
const
kAEHandleArray = 2;
type
AEArrayDataPtr = ^AEArrayData;
AEArrayData = record
case SInt16 of
0: (
kAEDataArray: array [0..0] of SInt16;
);
1: (
kAEPackedArray: SInt8;
);
2: (
kAEHandleArray: array [0..0] of Handle;
);
3: (
kAEDescArray: array [0..0] of AEDesc;
);
4: (
kAEKeyDescArray: array [0..0] of AEKeyDesc;
);
end;
type
AEArrayDataPointer = ^AEArrayData;
AEArrayDataPointerPtr = ^AEArrayDataPointer;
{*************************************************************************
These constants are used by AEMach and AEInteraction APIs. They are not
strictly part of the data format, but are declared here due to layering.
*************************************************************************}
type
AESendPriority = SInt16;
const
kAENormalPriority = $00000000; { post message at the end of the event queue }
kAEHighPriority = $00000001; { post message at the front of the event queue (same as nAttnMsg) }
type
AESendMode = SInt32;
const
kAENoReply = $00000001; { sender doesn't want a reply to event }
kAEQueueReply = $00000002; { sender wants a reply but won't wait }
kAEWaitReply = $00000003; { sender wants a reply and will wait }
kAEDontReconnect = $00000080; { don't reconnect if there is a sessClosedErr from PPCToolbox }
kAEWantReceipt = $00000200; { (nReturnReceipt) sender wants a receipt of message }
kAENeverInteract = $00000010; { server should not interact with user }
kAECanInteract = $00000020; { server may try to interact with user }
kAEAlwaysInteract = $00000030; { server should always interact with user where appropriate }
kAECanSwitchLayer = $00000040; { interaction may switch layer }
kAEDontRecord = $00001000; { don't record this event - available only in vers 1.0.1 and greater }
kAEDontExecute = $00002000; { don't send the event for recording - available only in vers 1.0.1 and greater }
kAEProcessNonReplyEvents = $00008000; { allow processing of non-reply events while awaiting synchronous AppleEvent reply }
{ Constants for timeout durations }
const
kAEDefaultTimeout = -1; { timeout value determined by AEM }
kNoTimeOut = -2; { wait until reply comes back, however long it takes }
{*************************************************************************
These calls are used to set up and modify the coercion dispatch table.
*************************************************************************}
type
AECoerceDescProcPtr = function( const (*var*) fromDesc: AEDesc; toType: DescType; handlerRefcon: SRefCon; var toDesc: AEDesc ): OSErr;
AECoercePtrProcPtr = function( typeCode: DescType; dataPtr: {const} UnivPtr; dataSize: Size; toType: DescType; handlerRefcon: SRefCon; var result: AEDesc ): OSErr;
AECoerceDescUPP = UniversalProcPtr;
AECoercePtrUPP = UniversalProcPtr;
{
* NewAECoerceDescUPP()
*
* Availability:
* Mac OS X: in version 10.0 and later in ApplicationServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: available as macro/inline
}
function NewAECoerceDescUPP( userRoutine: AECoerceDescProcPtr ): AECoerceDescUPP; external name '_NewAECoerceDescUPP';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* NewAECoercePtrUPP()
*
* Availability:
* Mac OS X: in version 10.0 and later in ApplicationServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: available as macro/inline
}
function NewAECoercePtrUPP( userRoutine: AECoercePtrProcPtr ): AECoercePtrUPP; external name '_NewAECoercePtrUPP';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* DisposeAECoerceDescUPP()
*
* Availability:
* Mac OS X: in version 10.0 and later in ApplicationServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: available as macro/inline
}
procedure DisposeAECoerceDescUPP( userUPP: AECoerceDescUPP ); external name '_DisposeAECoerceDescUPP';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* DisposeAECoercePtrUPP()
*
* Availability:
* Mac OS X: in version 10.0 and later in ApplicationServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: available as macro/inline
}
procedure DisposeAECoercePtrUPP( userUPP: AECoercePtrUPP ); external name '_DisposeAECoercePtrUPP';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* InvokeAECoerceDescUPP()
*
* Availability:
* Mac OS X: in version 10.0 and later in ApplicationServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: available as macro/inline
}
function InvokeAECoerceDescUPP( const (*var*) fromDesc: AEDesc; toType: DescType; handlerRefcon: SRefCon; var toDesc: AEDesc; userUPP: AECoerceDescUPP ): OSErr; external name '_InvokeAECoerceDescUPP';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* InvokeAECoercePtrUPP()
*
* Availability:
* Mac OS X: in version 10.0 and later in ApplicationServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: available as macro/inline
}
function InvokeAECoercePtrUPP( typeCode: DescType; dataPtr: {const} UnivPtr; dataSize: Size; toType: DescType; handlerRefcon: SRefCon; var result: AEDesc; userUPP: AECoercePtrUPP ): OSErr; external name '_InvokeAECoercePtrUPP';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{ a AECoercionHandlerUPP is by default a AECoerceDescUPP. If you are registering a
Ptr based coercion handler you will have to add a cast to AECoerceDescUPP from
your AECoercePtrUPP type. A future release of the interfaces will fix this by
introducing seperate Desc and Ptr coercion handler installation/remove/query routines. }
type
AECoercionHandlerUPP = AECoerceDescUPP;
{
* AEInstallCoercionHandler()
*
* Summary:
* Installs a coercion handler in either the application or system
* coercion handler dispatch table.
*
* Discussion:
* Before using AEInstallCoercionHandler to install a handler for a
* particular descriptor type, you can use the AEGetCoercionHandler
* function to determine whether the table already contains a
* coercion handler for that type.
* Version Notes
* See the Version Notes section for the AECoercePtr function for
* information on when to use descriptor-based versus pointer-based
* coercion handlers starting in Mac OS X version 10.2.
* Your application should not install a coercion handler in a
* system coercion handler dispatch table with the goal that the
* handler will get called when other applications perform coercions
* - this won't work in Mac OS X. For more information, see "Writing
* and Installing Coercion Handlers" in Apple Events Programming
* Guide.
*
* Mac OS X threading:
* Thread safe since version 10.2
*
* Parameters:
*
* fromType:
* The descriptor type of the data coerced by the handler.
*
* toType:
* The descriptor type of the resulting data.
* If there was already an entry in the specified coercion handler
* table for the same source descriptor type and result descriptor
* type, the existing entry is replaced.
*
* handler:
* A universal procedure pointer to the coercion handler function
* to install.
*
* handlerRefcon:
* A reference constant. The Apple Event Manager passes this value
* to the handler each time it calls it. If your handler doesn't
* require a reference constant, pass 0 for this parameter.
*
* fromTypeIsDesc:
* Specifies the form of the data to coerce. Pass TRUE if the
* coercion handler expects the data as a descriptor or FALSE if
* the coercion handler expects a pointer to the data. The Apple
* Event Manager can provide a pointer to data more efficiently
* than it can provide a descriptor, so all coercion functions
* should accept a pointer to data if possible.
*
* isSysHandler:
* Specifies the coercion table to add the handler to. Pass TRUE
* to add the handler to the system coercion table or FALSE to add
* the handler to your application's coercion table. Use of the
* system coercion table is not recommended.
*
* Availability:
* Mac OS X: in version 10.0 and later in ApplicationServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
function AEInstallCoercionHandler( fromType: DescType; toType: DescType; handler: AECoercionHandlerUPP; handlerRefcon: SRefCon; fromTypeIsDesc: Boolean; isSysHandler: Boolean ): OSErr; external name '_AEInstallCoercionHandler';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* AERemoveCoercionHandler()
*
* Discussion:
* Removes a coercion handler from a coercion handler dispatch table.
*
* Mac OS X threading:
* Thread safe since version 10.2
*
* Parameters:
*
* fromType:
* The descriptor type of the data coerced by the handler.
*
* toType:
* The descriptor type of the resulting data.
*
* handler:
* A universal procedure pointer to the coercion handler to
* remove. Although the parameters fromType and toType are
* sufficient to identify the handler, you can identify the
* handler explicitly as a safeguard. If you pass NULL for this
* parameter, the Apple Event Manager relies solely on the event
* class and event ID to identify the handler.
*
* isSysHandler:
* Specifies the coercion table to remove the handler from. Pass
* TRUE to remove the handler from the system coercion table or
* FALSE to remove the handler from your application's coercion
* table. Use of the system coercion table is not recommended.
*
* Availability:
* Mac OS X: in version 10.0 and later in ApplicationServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
function AERemoveCoercionHandler( fromType: DescType; toType: DescType; handler: AECoercionHandlerUPP; isSysHandler: Boolean ): OSErr; external name '_AERemoveCoercionHandler';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* AEGetCoercionHandler()
*
* Discussion:
* Gets the coercion handler for a specified descriptor type.
*
* Mac OS X threading:
* Thread safe since version 10.2
*
* Parameters:
*
* fromType:
* The descriptor type of the data coerced by the handler.
*
* toType:
* The descriptor type of the resulting data.
*
* handler:
* A universal procedure pointer. On return, a pointer to the
* specified handler, if a coercion table entry exists that
* exactly matches the values supplied in the parameters fromType
* and toType. See AECoercionHandlerUPP.
*
* handlerRefcon:
* A pointer to a reference constant. On return, the reference
* constant from the coercion table entry for the specified
* coercion handler. The Apple Event Manager passes this reference
* constant to the handler each time it calls the handler. The
* reference constant may have a value of 0.
*
* fromTypeIsDesc:
* A pointer to a Boolean value. The AEGetCoercionHandler function
* returns a value of TRUE in this parameter if the coercion
* handler expects the data as a descriptor or FALSE, if the
* coercion handler expects a pointer to the data.
*
* isSysHandler:
* Specifies the coercion table to get the handler from. Pass TRUE
* to get the handler from the system coercion table or FALSE to
* get the handler from your application's coercion table. Use of
* the system coercion table is not recommended.
*
* Availability:
* Mac OS X: in version 10.0 and later in ApplicationServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
function AEGetCoercionHandler( fromType: DescType; toType: DescType; var handler: AECoercionHandlerUPP; var handlerRefcon: SRefCon; var fromTypeIsDesc: Boolean; isSysHandler: Boolean ): OSErr; external name '_AEGetCoercionHandler';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{*************************************************************************
The following calls provide for a coercion interface.
*************************************************************************}
{
* AECoercePtr()
*
* Discussion:
* Coerces data to a desired descriptor type and creates a
* descriptor containing the newly coerced data.
*
* Mac OS X threading:
* Thread safe since version 10.2
*
* Parameters:
*
* typeCode:
* The descriptor type of the source data.
*
* dataPtr:
* A pointer to the data to coerce.
*
* dataSize:
* The length, in bytes, of the data to coerce.
*
* toType:
* The desired descriptor type of the resulting descriptor.
*
* result:
* A pointer to a descriptor. On successful return, a descriptor
* containing the coerced data and matching the descriptor type
* specified in toType. On error, a null descriptor. If the
* function returns successfully, your application should call the
* AEDisposeDesc function to dispose of the resulting descriptor
* after it has finished using it. See AEDesc.
*
* Availability:
* Mac OS X: in version 10.0 and later in ApplicationServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
function AECoercePtr( typeCode: DescType; dataPtr: {const} UnivPtr; dataSize: Size; toType: DescType; var result: AEDesc ): OSErr; external name '_AECoercePtr';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* AECoerceDesc()
*
* Discussion:
* Coerces the data in a descriptor to another descriptor type and
* creates a descriptor containing the newly coerced data.
*
* Mac OS X threading:
* Thread safe since version 10.2
*
* Parameters:
*
* theAEDesc:
* A pointer to the descriptor containing the data to coerce.
*
* toType:
* The desired descriptor type of the resulting descriptor.
*
* result:
* A pointer to a descriptor. On successful return, a descriptor
* containing the coerced data and matching the descriptor type
* specified in toType. On error, a null descriptor. If the
* function returns successfully, your application should call the
* AEDisposeDesc function to dispose of the resulting descriptor
* after it has finished using it.
*
* Availability:
* Mac OS X: in version 10.0 and later in ApplicationServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
function AECoerceDesc( const (*var*) theAEDesc: AEDesc; toType: DescType; var result: AEDesc ): OSErr; external name '_AECoerceDesc';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{*************************************************************************
The following calls apply to any AEDesc. Every 'result' descriptor is
created for you, so you will be responsible for memory management
(including disposing) of the descriptors so created.
*************************************************************************}
{ because AEDescs are opaque under Carbon, this AEInitializeDesc provides a
'clean' way of initializating them to be empty. }
{
* AEInitializeDesc()
*
* Discussion:
* The function sets the type of the descriptor to typeNull and sets
* the data handle to NULL. If you need to initialize a descriptor
* that already has some data in it, use AEDisposeDesc to deallocate
* the memory and initialize the descriptor.
*
* Mac OS X threading:
* Thread safe since version 10.2
*
* Parameters:
*
* desc:
* A pointer to a new descriptor.
*
* Availability:
* Mac OS X: in version 10.0 and later in ApplicationServices.framework
* CarbonLib: in CarbonLib 1.4 and later
* Non-Carbon CFM: not available
}
procedure AEInitializeDesc( var desc: AEDesc ); external name '_AEInitializeDesc';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* AECreateDesc()
*
* Summary:
* Creates a new descriptor that incorporates the specified data.
*
* Discussion:
* While it is possible to create an Apple event descriptor or a
* descriptor list or a descriptor with the AECreateDesc function
* (assuming you have access to the raw data for an Apple event,
* list, or descriptor), you typically create these structured
* objects with their specific creation routines -
* AECreateAppleEvent, AECreateList, or AECreateDesc.
*
* Mac OS X threading:
* Thread safe since version 10.2
*
* Parameters:
*
* typeCode:
* The descriptor type for the new descriptor.
*
* dataPtr:
* A pointer to the data for the new descriptor. This data is
* copied into a newly-allocated block of memory for the
* descriptor that is created. To minimize copying overhead,
* consider using AECreateDescFromExternalPtr.
*
* dataSize:
* The length, in bytes, of the data for the new descriptor.
*
* result:
* A pointer to a descriptor. On successful return, a descriptor
* that incorporates the data specified by the dataPtr parameter.
* On error, a null descriptor. If the function returns
* successfully, your application should call the AEDisposeDesc
* function to dispose of the resulting descriptor after it has
* finished using it.
*
* Availability:
* Mac OS X: in version 10.0 and later in ApplicationServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
function AECreateDesc( typeCode: DescType; dataPtr: {const} UnivPtr; dataSize: Size; var result: AEDesc ): OSErr; external name '_AECreateDesc';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* AEDisposeDesc()
*
* Summary:
* Deallocates the memory used by a descriptor.
*
* Discussion:
* The AEDisposeDesc function deallocates the memory used by a
* descriptor. After calling this method, the descriptor becomes an
* empty descriptor with a type of typeNULL. Because all Apple event
* structures (except for keyword-specified descriptors) are
* descriptors, you can use AEDisposeDesc for any of them.
* Do not call AEDisposeDesc on a descriptor obtained from another
* Apple Event Manager function (such as the reply event from a call
* to AESend) unless that function returns successfully.
* Special Considerations
* If the AEDesc might contain an OSL token, dispose of it with
* AEDisposeToken.
*
* Mac OS X threading:
* Thread safe since version 10.2
*
* Parameters:
*
* theAEDesc:
* A pointer to the descriptor to deallocate. On return, a null
* descriptor. If you pass a null descriptor in this parameter,
* AEDisposeDesc returns noErr.
*
* Availability:
* Mac OS X: in version 10.0 and later in ApplicationServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
function AEDisposeDesc( var theAEDesc: AEDesc ): OSErr; external name '_AEDisposeDesc';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* AEDuplicateDesc()
*
* Summary:
* Creates a copy of a descriptor.
*
* Discussion:
* It is common for applications to send Apple events that have one
* or more attributes or parameters in common. For example, if you
* send a series of Apple events to the same application, the
* address attribute is the same. In these cases, the most efficient
* way to create the necessary Apple events is to make a template
* Apple event that you can then copy - by calling the
* AEDuplicateDesc function - as needed. You then fill in or change
* the remaining parameters and attributes of the copy, send the
* copy by calling the AESend function and, after AESend returns a
* result code, dispose of the copy by calling AEDisposeDesc. You
* can use this approach to prepare structures of type AEDesc,
* AEDescList, AERecord, and AppleEvent.
*
* Mac OS X threading:
* Thread safe since version 10.2
*
* Parameters:
*
* theAEDesc:
* A pointer to the descriptor to duplicate. See AEDesc.
*
* result:
* A pointer to a descriptor. On return, the descriptor contains a
* copy of the descriptor specified by the theAEDesc parameter. If
* the function returns successfully, your application should call
* the AEDisposeDesc function to dispose of the resulting
* descriptor after it has finished using it.
*
* Availability:
* Mac OS X: in version 10.0 and later in ApplicationServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
function AEDuplicateDesc( const (*var*) theAEDesc: AEDesc; var result: AEDesc ): OSErr; external name '_AEDuplicateDesc';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* Create an AEDesc with memory "borrowed" from the application. The
* data passed in *must* be immutable and not freed until the Dispose
* callback is made.
* The dispose callback may be made at any time, including during the
* creation of the descriptor.
* If possible, the descriptor will be copied to the address space of
* any recipient process using virtual memory APIs and avoid an
* actual memory copy.
}
type
AEDisposeExternalProcPtr = procedure( dataPtr: {const} UnivPtr; dataLength: Size; refcon: SRefCon );
AEDisposeExternalUPP = AEDisposeExternalProcPtr;
{
* AECreateDescFromExternalPtr()
*
* Summary:
* Creates a new descriptor that uses a memory buffer supplied by
* the caller.
*
* Discussion:
* This function is different than AECreateDesc, in that it creates
* a descriptor that uses the data block provided by the caller "in
* place," rather than allocate a block of memory and copy the data
* to it. This function can provide dramatically improved
* performance if you're working with large chunks of data. It
* attempts to copy the descriptor to the address space of any
* recipient process using virtual memory APIs, avoiding an actual
* memory copy. For example, you might want to use this function to
* pass a large image in an Apple event.
* You can use the AEGetDescDataRange function to access a specific
* section of a large block of data.
*
* Mac OS X threading:
* Thread safe since version 10.2
*
* Parameters:
*
* descriptorType:
* The descriptor type for the new descriptor.
*
* dataPtr:
* A pointer to the data for the new descriptor. The memory that
* is pointed to cannot be a Handle (which may move in memory),
* cannot be modified by the caller, and must be preserved in
* place (and not freed), until the disposeCallback function is
* called.
* If possible, the descriptor will be mapped into the address
* space of the recipient using shared memory, avoiding an actual
* memory copy.
* The pointer that is passed in does not need to be aligned to
* any particular boundary, but is optimized to transfer data on a
* page boundary. You can get the current page size (4096 on all
* current Mac OS X systems) with the getpagesize(3) call. (Type
* man 3 getpagesize in a Terminal window for documentation.)
*
* dataLength:
* The length, in bytes, of the data for the new descriptor.
*
* disposeCallback:
* A universal procedure pointer to a dispose callback function of
* type AEDisposeExternalProcPtr. Your callback function will be
* called when the block of memory provided by dataPtr is no
* longer needed by the Apple Event Manager. The function can be
* called at any time, including during creation of the descriptor.
*
* disposeRefcon:
* A reference constant the Apple Event Manager passes to the
* disposeCallback function whenever it calls the function. If
* your dispose function doesn't require a reference constant,
* pass 0 for this parameter.
*
* theDesc:
* A pointer to a descriptor. On successful return, a descriptor
* that incorporates the data specified by the dataPtr parameter.
* On error, a null descriptor. If the function returns
* successfully, your application should call the AEDisposeDesc
* function to dispose of the resulting descriptor after it has
* finished using it.
*
* Availability:
* Mac OS X: in version 10.2 and later in ApplicationServices.framework
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
* Non-Carbon CFM: not available
}
function AECreateDescFromExternalPtr( descriptorType: OSType; dataPtr: {const} UnivPtr; dataLength: Size; disposeCallback: AEDisposeExternalUPP; disposeRefcon: SRefCon; var theDesc: AEDesc ): OSStatus; external name '_AECreateDescFromExternalPtr';
(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
{*************************************************************************
The following calls apply to AEDescList. Since AEDescList is a subtype of
AEDesc, the calls in the previous section can also be used for AEDescList.
All list and array indices are 1-based. If the data was greater than
maximumSize in the routines below, then actualSize will be greater than
maximumSize, but only maximumSize bytes will actually be retrieved.
*************************************************************************}
{
* AECreateList()
*
* Discussion:
* Creates an empty descriptor list or Apple event record.
*
* Mac OS X threading:
* Thread safe since version 10.2
*
* Parameters:
*
* factoringPtr:
* A pointer to the data at the beginning of each descriptor that
* is the same for all descriptors in the list. If there is no
* common data, or if you decide not to isolate the common data,
* pass NULL as the value of this parameter.
*
* factoredSize:
* The size of the common data. If there is no common data, or if
* you decide not to isolate the common data, pass 0 as the value
* of this parameter. (See the Discussion section for more
* information.)
*
* isRecord:
* A Boolean value that specifies the kind of list to create. Pass
* a value of TRUE to create an Apple event record (a data
* structure of type AERecord) or FALSE to create a descriptor
* list.
*
* resultList:
* A pointer to a descriptor list variable. On successful return,
* the descriptor list or Apple event record that the AECreateList
* function creates. On error, a null descriptor. See AEDescList.
*
* Availability:
* Mac OS X: in version 10.0 and later in ApplicationServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
function AECreateList( factoringPtr: {const} UnivPtr; factoredSize: Size; isRecord: Boolean; var resultList: AEDescList ): OSErr; external name '_AECreateList';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* AECountItems()
*
* Discussion:
* Counts the number of descriptors in a descriptor list.
*
* Mac OS X threading:
* Thread safe since version 10.2
*
* Parameters:
*
* theAEDescList:
* A pointer to the descriptor list to count
*
* theCount:
* A pointer to a count variable. On return, the number of
* descriptors in the specified descriptor list. Currently an
* AEDescList is limited to 2^31 items.
*
* Availability:
* Mac OS X: in version 10.0 and later in ApplicationServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
function AECountItems( const (*var*) theAEDescList: AEDescList; var theCount: SIGNEDLONG ): OSErr; external name '_AECountItems';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* AEPutPtr()
*
* Discussion:
* Puts data specified in a buffer to a descriptor list as a
* descriptor, possibly replacing an existing descriptor in the list.
*
* Mac OS X threading:
* Thread safe since version 10.2
*
* Parameters:
*
* theAEDescList:
* A pointer to the descriptor list to add a descriptor to. See
* AEDescList.
*
* index:
* A one-based positive integer indicating the position to insert
* the descriptor at. If there is already a descriptor in the
* specified position, it is replaced. You can pass a value of
* zero or count + 1 to add the descriptor at the end of the list.
* AEPutPtr returns an error (AEIllegalIndex) if you pass a
* negative number or a value that is out of range. Currently the
* upper limit on index is 2^31 items.
*
* typeCode:
* The descriptor type for the descriptor to be put into the list.
*
* dataPtr:
* A pointer to the data for the descriptor to add.
*
* dataSize:
* The length, in bytes, of the data for the descriptor to add.
*
* Availability:
* Mac OS X: in version 10.0 and later in ApplicationServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
function AEPutPtr( var theAEDescList: AEDescList; index: SIGNEDLONG; typeCode: DescType; dataPtr: {const} UnivPtr; dataSize: Size ): OSErr; external name '_AEPutPtr';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* AEPutDesc()
*
* Discussion:
* Adds a descriptor to any descriptor list, possibly replacing an
* existing descriptor in the list.
*
* Mac OS X threading:
* Thread safe since version 10.2
*
* Parameters:
*
* theAEDescList:
* A pointer to the descriptor list to add a descriptor to. See
* AEDescList.
*
* index:
* A one-based positive integer indicating the position to insert
* the descriptor at. If there is already a descriptor in the
* specified position, it is replaced. You can pass a value of
* zero or count + 1 to add the descriptor at the end of the list.
* AEPutPtr returns an error (AEIllegalIndex) if you pass a
* negative number or a value that is out of range. Currently the
* upper limit on index is 2^31 items.
*
* theAEDesc:
* A pointer to the descriptor to add to the list.
*
* Availability:
* Mac OS X: in version 10.0 and later in ApplicationServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
function AEPutDesc( var theAEDescList: AEDescList; index: SIGNEDLONG; const (*var*) theAEDesc: AEDesc ): OSErr; external name '_AEPutDesc';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* AEGetNthPtr()
*
* Discussion:
* Gets a copy of the data from a descriptor at a specified position
* in a descriptor list; typically used when your application needs
* to work with the extracted data directly.
*
* Mac OS X threading:
* Thread safe since version 10.2
*
* Parameters:
*
* theAEDescList:
* A pointer to the descriptor list to add a descriptor to. See
* AEDescList.
*
* index:
* A one-based positive integer indicating the position in the
* descriptor list of the descriptor to get the data from.
* AEGetNthPtr returns an error if you pass zero, a negative
* number, or a value that is out of range. Currently the upper
* limit on index is 2^31 items.
*
* desiredType:
* The desired descriptor type for the copied data. For a list of
* AppleScript's predefined descriptor types. If the descriptor
* specified by the index parameter is not of the desired type,
* AEGetNthPtr attempts to coerce the data to this type. If you
* pass a value of typeWildCard, no coercion is performed, and the
* descriptor type of the copied data is the same as the
* descriptor type of the original descriptor.
*
* theAEKeyword:
* A pointer to a keyword or NULL. On return, the keyword for the
* specified descriptor, if you are getting data from a list of
* keyword-specified descriptors; otherwise, AEGetNthPtr returns
* the value typeWildCard.
*
* typeCode:
* A pointer to a descriptor type or NULL. On return, specifies
* the descriptor type of the data pointed to by dataPtr.
*
* dataPtr:
* A pointer to a buffer, local variable, or other storage
* location created and disposed of by your application. The size
* in bytes must be at least as large as the value you pass in the
* maximumSize parameter. On return, contains the data from the
* descriptor at the position in the descriptor list specified by
* the index parameter.
*
* maximumSize:
* The maximum length, in bytes, of the expected data. The
* AEGetNthPtr function will not return more data than you specify
* in this parameter.
*
* actualSize:
* A pointer to a size variable or NULL. On return, the length, in
* bytes, of the data for the specified descriptor. If this value
* is larger than the value of the maximumSize parameter, the
* buffer pointed to by dataPtr was not large enough to contain
* all of the data for the descriptor, though AEGetNthPtr does not
* write beyond the end of the buffer. If the buffer was too
* small, you can resize it and call AEGetNthPtr again.
*
* Availability:
* Mac OS X: in version 10.0 and later in ApplicationServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
function AEGetNthPtr( const (*var*) theAEDescList: AEDescList; index: SIGNEDLONG; desiredType: DescType; theAEKeyword: AEKeywordPtr { can be NULL }; typeCode: DescTypePtr { can be NULL }; dataPtr: UnivPtr; maximumSize: Size; actualSize: SizePtr { can be NULL } ): OSErr; external name '_AEGetNthPtr';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* AEGetNthDesc()
*
* Discussion:
* Copies a descriptor from a specified position in a descriptor
* list into a specified descriptor; typically used when your
* application needs to pass the extracted data to another function
* as a descriptor.
*
* Mac OS X threading:
* Thread safe since version 10.2
*
* Parameters:
*
* theAEDescList:
* A pointer to the descriptor list to add a descriptor to. See
* AEDescList.
*
* index:
* A one-based positive integer indicating the position in the
* descriptor list of the descriptor to get the data from.
* AEGetNthDesc returns an error if you pass zero, a negative
* number, or a value that is out of range. Currently the upper
* limit on index is 2^31 items.
*
* desiredType:
* The desired descriptor type for the copied data. For a list of
* AppleScript's predefined descriptor types. If the descriptor
* specified by the index parameter is not of the desired type,
* AEGetNthDesc attempts to coerce the data to this type. If you
* pass a value of typeWildCard, no coercion is performed, and the
* descriptor type of the copied data is the same as the
* descriptor type of the original descriptor.
*
* theAEKeyword:
* A pointer to a keyword or NULL. On return, the keyword for the
* specified descriptor, if you are getting data from a list of
* keyword-specified descriptors; otherwise, AEGetNthDesc returns
* the value typeWildCard.
*
* result:
* A pointer to a descriptor. On successful return, a copy of the
* descriptor specified by the index parameter, coerced, if
* necessary, to the descriptor type specified by the desiredType
* parameter. On error, a null descriptor. If the function returns
* successfully, your application should call the AEDisposeDesc
* function to dispose of the resulting descriptor after it has
* finished using it.
*
* Availability:
* Mac OS X: in version 10.0 and later in ApplicationServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
function AEGetNthDesc( const (*var*) theAEDescList: AEDescList; index: SIGNEDLONG; desiredType: DescType; theAEKeyword: AEKeywordPtr { can be NULL }; var result: AEDesc ): OSErr; external name '_AEGetNthDesc';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* AESizeOfNthItem()
*
* Discussion:
* Gets the data size and descriptor type of the descriptor at a
* specified position in a descriptor list.
*
* Mac OS X threading:
* Thread safe since version 10.2
*
* Parameters:
*
* theAEDescList:
* A pointer to the descriptor list to add a descriptor to. See
* AEDescList.
*
* index:
* A one-based positive integer indicating the position in the
* descriptor list of the descriptor to get the data from.
* AESizeOfNthItem returns an error if you pass zero, a negative
* number, or a value that is out of range. Currently the upper
* limit on index is 2^31 items.
*
* typeCode:
* A pointer to a descriptor type or NULL. On return, specifies
* the descriptor type of the descriptor.
*
* dataSize:
* A pointer to a size variable or NULL. On return, the length (in
* bytes) of the data in the descriptor.
*
* Availability:
* Mac OS X: in version 10.0 and later in ApplicationServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
function AESizeOfNthItem( const (*var*) theAEDescList: AEDescList; index: SIGNEDLONG; typeCode: DescTypePtr { can be NULL }; dataSize: SizePtr { can be NULL } ): OSErr; external name '_AESizeOfNthItem';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* AEGetArray()
*
* Discussion:
* Extracts data from an Apple event array created with the
* AEPutArray function and stores it as a standard array of fixed
* size items in the specified buffer.
*
* Mac OS X threading:
* Thread safe since version 10.2
*
* Parameters:
*
* theAEDescList:
* A pointer to the descriptor list to add a descriptor to. See
* AEDescList.
*
* arrayType:
* The Apple event array type to convert. Pass one of the
* constants: kAEDataArray, kAEPackedArray, kAEDescArray,
* kAEKeyDescArray
*
* arrayPtr:
* A pointer to a buffer, allocated and disposed of by your
* application, for storing the array. The size in bytes must be
* at least as large as the value you pass in the maximumSize
* parameter. On return, the buffer contains the array of
* fixed-size items.
*
* maximumSize:
* The maximum length, in bytes, of the expected data. The
* AEGetArray function will not return more data than you specify
* in this parameter.
*
* itemType:
* A pointer to a descriptor type. On return, for arrays of type
* kAEDataArray, kAEPackedArray, or kAEHandleArray, the descriptor
* type of the items in the returned array. The AEGetArray
* function doesn't supply a value in itemType for arrays of type
* kAEDescArray and kAEKeyDescArray because they may contain
* descriptors of different types.
*
* itemSize:
* A pointer to a size variable. On return, for arrays of type
* kAEDataArray or kAEPackedArray, the size (in bytes) of each
* item in the returned array. You don't get an item size for
* arrays of type kAEDescArray, kAEKeyDescArray, or kAEHandleArray
* because descriptors and handles (though not the data they point
* to) have a known size.
*
* itemCount:
* A pointer to a size variable. On return, the number of items in
* the returned array. Currently the upper limit on the size of
* an array is 2^31 items.
*
* Availability:
* Mac OS X: in version 10.0 and later in ApplicationServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
function AEGetArray( const (*var*) theAEDescList: AEDescList; arrayType: AEArrayType; arrayPtr: AEArrayDataPointer; maximumSize: Size; var itemType: DescType; var itemSize: Size; var itemCount: SIGNEDLONG ): OSErr; external name '_AEGetArray';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* AEPutArray()
*
* Discussion:
* Extracts data from an Apple event array created with the
* AEPutArray function and stores it as a standard array of fixed
* size items in the specified buffer.
*
* Mac OS X threading:
* Thread safe since version 10.2
*
* Parameters:
*
* theAEDescList:
* A pointer to the descriptor list to add a descriptor to. See
* AEDescList.
*
* arrayType:
* The Apple event array type to convert. Pass one of the
* constants: kAEDataArray, kAEPackedArray, kAEDescArray,
* kAEKeyDescArray
*
* arrayPtr:
* A pointer to a buffer, local variable, or other storage
* location, created and disposed of by your application, that
* contains the array to put into the descriptor list.
*
* itemType:
* For arrays of type kAEDataArray, kAEPackedArray, or
* kAEHandleArray, the descriptor type of the array items to
* create. Use one of the constants such as typeLongInteger. You
* don't need to specify an item type for arrays of type
* kAEDescArray or kAEKeyDescArray because the data is already
* stored in descriptors which contain a descriptor type.
*
* itemSize:
* For arrays of type kAEDataArray or kAEPackedArray, the size (in
* bytes) of the array items to create. You don't need to specify
* an item size for arrays of type kAEDescArray, kAEKeyDescArray,
* or kAEHandleArray because their descriptors (though not the
* data they point to) have a known size.
*
* itemCount:
* A pointer to a size variable. On return, the number of items in
* the returned array. Currently the upper limit on the size of
* an array is 2^31 items.
*
* Availability:
* Mac OS X: in version 10.0 and later in ApplicationServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
function AEPutArray( var theAEDescList: AEDescList; arrayType: AEArrayType; const (*var*) arrayPtr: AEArrayData; itemType: DescType; itemSize: Size; itemCount: SIGNEDLONG ): OSErr; external name '_AEPutArray';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* AEDeleteItem()
*
* Discussion:
* Deletes a descriptor from a descriptor list, causing all
* subsequent descriptors to move up one place.
*
* Mac OS X threading:
* Thread safe since version 10.2
*
* Parameters:
*
* theAEDescList:
* A pointer to the descriptor list to add a descriptor to. See
* AEDescList.
*
* index:
* A one-based positive integer indicating the position in the
* descriptor list of the descriptor to delete. AEDeleteItem
* returns an error if you pass zero, a negative number, or a
* value that is out of range. Currently the upper limit on index
* is 2^31 items.
*
* Availability:
* Mac OS X: in version 10.0 and later in ApplicationServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
function AEDeleteItem( var theAEDescList: AEDescList; index: SIGNEDLONG ): OSErr; external name '_AEDeleteItem';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{*************************************************************************
The following calls apply to AERecord. Since AERecord is a subtype of
AEDescList, the calls in the previous sections can also be used for
AERecord an AERecord can be created by using AECreateList with isRecord
set to true.
*************************************************************************}
{************************************************************************
AERecords can have an abitrary descriptorType. This allows you to
check if desc is truly an AERecord
***********************************************************************}
{
* AECheckIsRecord()
*
* Mac OS X threading:
* Thread safe since version 10.2
*
* Availability:
* Mac OS X: in version 10.0 and later in ApplicationServices.framework
* CarbonLib: in CarbonLib 1.4 and later
* Non-Carbon CFM: not available
}
function AECheckIsRecord( const (*var*) theDesc: AEDesc ): Boolean; external name '_AECheckIsRecord';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{*************************************************************************
The following calls create and manipulate the AppleEvent data type.
*************************************************************************}
{
* AECreateAppleEvent()
*
* Summary:
* Creates an Apple event with several important attributes but no
* parameters.
*
* Discussion:
* The AECreateAppleEvent function creates an empty Apple event. You
* can add parameters to the Apple event after you create it with
* the functions described in "Adding Parameters and Attributes to
* an Apple Event".
*
* Mac OS X threading:
* Thread safe since version 10.2
*
* Parameters:
*
* theAEEventClass:
* The event class of the Apple event to create. This parameter
* becomes accessible through the keyEventClassAttr attribute of
* the Apple event. Some event classes are described in "Event
* Class Constants".
*
* theAEEventID:
* The event ID of the Apple event to create. This parameter
* becomes accessible through the keyEventIDAttr attribute of the
* Apple event.
*
* target:
* A pointer to an address descriptor. Before calling
* AECreateAppleEvent, you set the descriptor to identify the
* target (or server) application for the Apple event. This
* parameter becomes accessible through the keyAddressAttr
* attribute of the Apple event.
*
* returnID:
* The return ID for the created Apple event. If you pass a value
* of kAutoGenerateReturnID, the Apple Event Manager assigns the
* created Apple event a return ID that is unique to the current
* session. If you pass any other value, the Apple Event Manager
* assigns that value for the ID. This parameter becomes
* accessible through the keyReturnIDAttr attribute of the Apple
* event. The return ID constant is described in "ID Constants for
* the AECreateAppleEvent Function".
*
* transactionID:
* The transaction ID for this Apple event. A transaction is a
* sequence of Apple events that are sent back and forth between
* the client and server applications, beginning with the client's
* initial request for a service. All Apple events that are part
* of a transaction must have the same transaction ID. You can
* specify the kAnyTransactionID constant if the Apple event is
* not one of a series of interdependent Apple events. This
* parameter becomes accessible through the keyTransactionIDAttr
* attribute of the Apple event.
*
* result:
* A pointer to an Apple event. On successful return, the new
* Apple event. On error, a null descriptor (one with descriptor
* type typeNull). If the function returns successfully, your
* application should call the AEDisposeDesc function to dispose
* of the resulting Apple event after it has finished using it.
* See the AppleEvent data type.
*
* Availability:
* Mac OS X: in version 10.0 and later in ApplicationServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
function AECreateAppleEvent( theAEEventClass: AEEventClass; theAEEventID: AEEventID; const (*var*) target: AEAddressDesc; returnID: AEReturnID; transactionID: AETransactionID; var result: AppleEvent ): OSErr; external name '_AECreateAppleEvent';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{*************************************************************************
The following calls are used to pack and unpack parameters from records
of type AppleEvent. Since AppleEvent is a subtype of AERecord, the calls
in the previous sections can also be used for variables of type
AppleEvent. The next six calls are in fact identical to the six calls
for AERecord.
*************************************************************************}
{
* AEPutParamPtr()
*
* Discussion:
* Puts a pointer to data, a descriptor type, and a keyword into an
* Apple event or Apple event record as an Apple event parameter.
*
* Mac OS X threading:
* Thread safe since version 10.2
*
* Parameters:
*
* theAppleEvent:
* A pointer to the Apple event to add a parameter to. See the
* AppleEvent data type.
*
* theAEKeyword:
* The keyword for the parameter to add. If the Apple event
* already includes an parameter with this keyword, the parameter
* is replaced.
*
* typeCode:
* The descriptor type for the parameter to add.
*
* dataPtr:
* A pointer to the data for the parameter to add.
*
* dataSize:
* The length, in bytes, of the data for the parameter to add.
*
* Availability:
* Mac OS X: in version 10.0 and later in ApplicationServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
function AEPutParamPtr( var theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; typeCode: DescType; dataPtr: {const} UnivPtr; dataSize: Size ): OSErr; external name '_AEPutParamPtr';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* AEPutParamDesc()
*
* Discussion:
* Puts a descriptor and a keyword into an Apple event or Apple
* event record as an Apple event parameter.
*
* Mac OS X threading:
* Thread safe since version 10.2
*
* Parameters:
*
* theAppleEvent:
* A pointer to the Apple event to add a parameter to.
*
* theAEKeyword:
* The keyword specifying the parameter to add. If the Apple event
* already has a parameter with this keyword, the parameter is
* replaced.
*
* theAEDesc:
* A pointer to the descriptor for the parameter to add. See
* AEDesc.
*
* Availability:
* Mac OS X: in version 10.0 and later in ApplicationServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
function AEPutParamDesc( var theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; const (*var*) theAEDesc: AEDesc ): OSErr; external name '_AEPutParamDesc';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* AEGetParamPtr()
*
* Summary:
* Gets a copy of the data for a specified Apple event parameter
* from an Apple event or an Apple event record (type AERecord);
* typically used when your application needs to work with the
* extracted data directly.
*
* Discussion:
* You should use this function only to extract data from value
* descriptors such as typeUTF8Text.
* Because this function allows you to specify a desired type, it
* can result in coercion. When used correctly, this has the
* positive effect of returning the data in the desired format.
* However, it can have side effects you may not be expecting, such
* as the overhead of calls to coercion handlers. See also the
* Version Notes section below for possible problems with
* coercion.
* To get Apple event parameter data for your application to use
* directly, call AEGetParamPtr. To get a descriptor for an Apple
* event parameter to pass on to another Apple Event Manager
* routine, call AEGetParamDesc.
* Before calling AEGetParamPtr, you can call the AESizeOfParam
* function to determine a size for the dataPtr buffer. However,
* unless you specify typeWildCard for the desiredType parameter,
* AEGetParamPtr may coerce the data, which may cause the size of
* the data to change.
* In some cases, you may get improved efficiency extracting
* information from an Apple event with the AEGetDescDataRange
* function.
*
* Mac OS X threading:
* Thread safe since version 10.2
*
* Parameters:
*
* theAppleEvent:
* A pointer to the Apple event to get the parameter data from.
* See AppleEvent.
*
* theAEKeyword:
* The keyword that specifies the desired Apple event parameter.
*
* desiredType:
* The desired descriptor type for the copied data. If the
* descriptor specified by the theAEKeyword parameter is not of
* the desired type, AEGetParamPtr attempts to coerce the data to
* this type. However, if the desired type is typeWildCard, no
* coercion is performed. On return, you can determine the actual
* descriptor type by examining the typeCode parameter.
*
* actualType:
* A pointer to a descriptor type. On return, specifies the
* descriptor type of the data pointed to by dataPtr. The returned
* type is either the same as the type specified by the
* desiredType parameter or, if the desired type was typeWildcard,
* the true type of the descriptor. Specify NULL if you do not
* care about this return value.
*
* dataPtr:
* A pointer to a buffer, local variable, or other storage
* location created and disposed of by your application. The size
* in bytes must be at least as large as the value you pass in the
* maximumSize parameter. On return, contains the parameter data.
* Specify NULL if you do not care about this return value.
*
* maximumSize:
* The maximum length, in bytes, of the expected Apple event
* parameter data. The AEGetParamPtr function will not return more
* data than you specify in this parameter.
*
* actualSize:
* A pointer to a variable of type Size. On return, the length, in
* bytes, of the data for the specified Apple event parameter. If
* this value is larger than the value you passed in the
* maximumSize parameter, the buffer pointed to by dataPtr was not
* large enough to contain all of the data for the parameter,
* though AEGetParamPtr does not write beyond the end of the
* buffer. If the buffer was too small, you can resize it and call
* AEGetParamPtr again. Specify NULL if you do not care about this
* return value.
*
* Availability:
* Mac OS X: in version 10.0 and later in ApplicationServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
function AEGetParamPtr( const (*var*) theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; desiredType: DescType; actualType: DescTypePtr { can be NULL }; dataPtr: UnivPtr; maximumSize: Size; actualSize: SizePtr { can be NULL } ): OSErr; external name '_AEGetParamPtr';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* AEGetParamDesc()
*
* Summary:
* Gets a copy of the descriptor for a keyword-specified Apple event
* parameter from an Apple event or an Apple event record (type
* AERecord); typically used when your application needs to pass the
* extracted data to another function as a descriptor.
*
* Discussion:
* To get Apple event parameter data for your application to use
* directly, call AEGetParamPtr. To get a descriptor for an Apple
* event parameter to pass on to another Apple Event Manager
* routine, call AEGetParamDesc.
* If the actual parameter you are getting with AEGetParamDesc is a
* record, AEGetParamDesc will only allow you to request it as a
* typeAERecord, typeAEList, or typeWildcard. For any other type, it
* will return errAECoercionFail.
*
* Mac OS X threading:
* Thread safe since version 10.2
*
* Parameters:
*
* theAppleEvent:
* A pointer to the Apple event to get the parameter descriptor
* from.
*
* theAEKeyword:
* A keyword that specifies the desired Apple event parameter.
*
* desiredType:
* The descriptor type for the desired Apple event parameter. If
* the requested Apple event parameter is not of the desired type,
* the Apple Event Manager attempts to coerce it to the desired
* type. However, if you pass a value of typeWildCard, no coercion
* is performed, and the descriptor type of the returned
* descriptor is the same as the descriptor type of the Apple
* event parameter.
*
* result:
* A pointer to a descriptor. On successful return, a copy of the
* descriptor for the specified Apple event parameter, coerced, if
* necessary, to the descriptor type specified by the desiredType
* parameter. On error, a null descriptor. If the function returns
* successfully, your application should call the AEDisposeDesc
* function to dispose of the resulting descriptor after it has
* finished using it. See AEDesc.
*
* Availability:
* Mac OS X: in version 10.0 and later in ApplicationServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
function AEGetParamDesc( const (*var*) theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; desiredType: DescType; var result: AEDesc ): OSErr; external name '_AEGetParamDesc';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* AESizeOfParam()
*
* Discussion:
* Gets the size and descriptor type of an Apple event parameter
* from a descriptor of type AERecord or AppleEvent.
*
* Mac OS X threading:
* Thread safe since version 10.2
*
* Parameters:
*
* theAppleEvent:
* A pointer to the Apple event to get the parameter data from.
* See AppleEvent.
*
* theAEKeyword:
* The keyword that specifies the desired parameter.
*
* typeCode:
* A pointer to a descriptor type. On return, specifies the
* descriptor type of the Apple event parameter.
*
* dataSize:
* A pointer to a size variable. On return, the length, in bytes,
* of the data in the Apple event parameter.
*
* Availability:
* Mac OS X: in version 10.0 and later in ApplicationServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
function AESizeOfParam( const (*var*) theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; typeCode: DescTypePtr { can be NULL }; dataSize: SizePtr { can be NULL } ): OSErr; external name '_AESizeOfParam';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* AEDeleteParam()
*
* Discussion:
* Deletes a keyword-specified parameter from an Apple event or
* Apple event record.
*
* Mac OS X threading:
* Thread safe since version 10.2
*
* Parameters:
*
* theAppleEvent:
* A pointer to the Apple event or Apple event record to delete
* the parameter from.
*
* theAEKeyword:
* The keyword that specifies the parameter to delete.
*
* Availability:
* Mac OS X: in version 10.0 and later in ApplicationServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
function AEDeleteParam( var theAppleEvent: AppleEvent; theAEKeyword: AEKeyword ): OSErr; external name '_AEDeleteParam';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{*************************************************************************
The following calls also apply to type AppleEvent. Message attributes are
far more restricted, and can only be accessed through the following 5
calls. The various list and record routines cannot be used to access the
attributes of an event.
*************************************************************************}
{
* AEGetAttributePtr()
*
* Summary:
* Gets a copy of the data for a specified Apple event attribute
* from an Apple event; typically used when your application needs
* to work with the data directly.
*
* Discussion:
* To get Apple event attribute data for your application to use
* directly, call AEGetAttributePtr. To get a descriptor for an
* Apple event attribute to pass on to another Apple Event Manager
* routine, call AEGetAttributeDesc.
* Before calling AEGetAttributePtr, you can call the
* AESizeOfAttribute function to determine a size for the dataPtr
* buffer. However, unless you specify typeWildCard for the
* desiredType parameter, AEGetAttributePtr may coerce the data,
* which may cause the size of the data to change.
*
* Mac OS X threading:
* Thread safe since version 10.2
*
* Parameters:
*
* theAppleEvent:
* A pointer to the Apple event to get the attribute data from.
*
* theAEKeyword:
* The keyword that specifies the desired attribute.
*
* desiredType:
* The desired descriptor type for the copied data. If the
* descriptor specified by the theAEKeyword parameter is not of
* the desired type, AEGetAttributePtr attempts to coerce the data
* to this type. However, if you pass a value of typeWildCard, no
* coercion is performed, and the descriptor type of the returned
* data is the same as the descriptor type of the Apple event
* attribute. On return, you can determine the actual descriptor
* type by examining the typeCode parameter.
*
* typeCode:
* A pointer to a descriptor type. On return, specifies the
* descriptor type of the attribute data pointed to by dataPtr.
* The returned type is either the same as the type specified by
* the desiredType parameter or, if the desired type was type
* wildcard, the true type of the descriptor. For a list of
* AppleScript's predefined descriptor types, see "Descriptor Type
* Constants". See DescType.
*
* dataPtr:
* A pointer to a buffer, local variable, or other storage
* location, created and disposed of by your application. The size
* in bytes must be at least as large as the value you pass in the
* maximumSize parameter. On return, contains the attribute data.
*
* maximumSize:
* The maximum length, in bytes, of the expected attribute data.
* The AEGetAttributePtr function will not return more data than
* you specify in this parameter.
*
* actualSize:
* A pointer to a size variable. On return, the length, in bytes,
* of the data for the specified Apple event attribute. If this
* value is larger than the value you passed in the maximumSize
* parameter, the buffer pointed to by dataPtr was not large
* enough to contain all of the data for the attribute, though
* AEGetAttributePtr does not write beyond the end of the buffer.
* If the buffer was too small, you can resize it and call
* AEGetAttributePtr again.
*
* Availability:
* Mac OS X: in version 10.0 and later in ApplicationServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
function AEGetAttributePtr( const (*var*) theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; desiredType: DescType; typeCode: DescTypePtr { can be NULL }; dataPtr: UnivPtr; maximumSize: Size; actualSize: SizePtr { can be NULL } ): OSErr; external name '_AEGetAttributePtr';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* AEGetAttributeDesc()
*
* Summary:
* Gets a copy of the descriptor for a specified Apple event
* attribute from an Apple event; typically used when your
* application needs to pass the descriptor on to another function.
*
* Discussion:
* To get Apple event attribute data for your application to use
* directly, call AEGetAttributePtr. To get a descriptor for an
* Apple event attribute to pass on to another Apple Event Manager
* routine, call AEGetAttributeDesc.
*
* Mac OS X threading:
* Thread safe since version 10.2
*
* Parameters:
*
* theAppleEvent:
* A pointer to the Apple event to get the attribute descriptor
* from. See AppleEvent.
*
* theAEKeyword:
* The keyword that specifies the desired attribute.
*
* desiredType:
* The desired descriptor type for the copied data. If the
* descriptor specified by the theAEKeyword parameter is not of
* the desired type, AEGetAttributePtr attempts to coerce the data
* to this type. However, if you pass a value of typeWildCard, no
* coercion is performed, and the descriptor type of the returned
* data is the same as the descriptor type of the Apple event
* attribute. On return, you can determine the actual descriptor
* type by examining the typeCode parameter.
*
* result:
* A pointer to a descriptor. On successful return, a copy of the
* specified Apple event attribute, coerced, if necessary, to the
* descriptor type specified in desiredType. On error, a null
* descriptor. If the function returns successfully, your
* application should call the AEDisposeDesc function to dispose
* of the resulting descriptor after it has finished using it. See
* AEDesc.
*
* Availability:
* Mac OS X: in version 10.0 and later in ApplicationServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
function AEGetAttributeDesc( const (*var*) theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; desiredType: DescType; var result: AEDesc ): OSErr; external name '_AEGetAttributeDesc';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* AESizeOfAttribute()
*
* Discussion:
* Gets the size and descriptor type of an Apple event attribute
* from a descriptor of type AppleEvent.
*
* Mac OS X threading:
* Thread safe since version 10.2
*
* Parameters:
*
* theAppleEvent:
* A pointer to the Apple event to get the attribute data from.
*
* theAEKeyword:
* The keyword that specifies the attribute.
*
* typeCode:
* A pointer to a descriptor type. On return, specifies the
* descriptor type of the attribute. Can be NULL.
*
* dataSize:
* A pointer to a size variable. On return, the length, in bytes,
* of the data in the attribute. Can be NULL.
*
* Availability:
* Mac OS X: in version 10.0 and later in ApplicationServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
function AESizeOfAttribute( const (*var*) theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; typeCode: DescTypePtr { can be NULL }; dataSize: SizePtr { can be NULL } ): OSErr; external name '_AESizeOfAttribute';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* AEPutAttributePtr()
*
* Discussion:
* Adds a pointer to data, a descriptor type, and a keyword to an
* Apple event as an attribute.
*
* Mac OS X threading:
* Thread safe since version 10.2
*
* Parameters:
*
* theAppleEvent:
* A pointer to the Apple event to add an attribute to. See the
* AppleEvent data type.
*
* theAEKeyword:
* The keyword for the attribute to add. If the Apple event
* already includes an attribute with this keyword, the attribute
* is replaced.
*
* typeCode:
* The descriptor type for the attribute to add.
*
* dataPtr:
* A pointer to the data for the attribute to add.
*
* dataSize:
* The length, in bytes, of the data for the attribute to add.
*
* Availability:
* Mac OS X: in version 10.0 and later in ApplicationServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
function AEPutAttributePtr( var theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; typeCode: DescType; dataPtr: {const} UnivPtr; dataSize: Size ): OSErr; external name '_AEPutAttributePtr';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* AEPutAttributeDesc()
*
* Summary:
* Adds a descriptor and a keyword to an Apple event as an attribute.
*
* Discussion:
* The AEPutAttributeDesc function takes a descriptor and a keyword
* and adds them to an Apple event as an attribute. If the
* descriptor type required for the attribute is different from the
* descriptor type of the descriptor, the Apple Event Manager
* attempts to coerce the descriptor into the required type, with
* one exception: the Apple Event Manager does not attempt to coerce
* the data for an address attribute, thereby allowing applications
* to use their own address types.
*
* Mac OS X threading:
* Thread safe since version 10.2
*
* Parameters:
*
* theAppleEvent:
* A pointer to the Apple event to add an attribute to. See the
* AppleEvent data type.
*
* theAEKeyword:
* The keyword for the attribute to add. If the Apple event
* already includes an attribute with this keyword, the attribute
* is replaced.
*
* theAEDesc:
* A pointer to the descriptor to assign to the attribute. The
* descriptor type of the specified descriptor should match the
* defined descriptor type for that attribute.
*
* Availability:
* Mac OS X: in version 10.0 and later in ApplicationServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
function AEPutAttributeDesc( var theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; const (*var*) theAEDesc: AEDesc ): OSErr; external name '_AEPutAttributeDesc';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{*************************************************************************
AppleEvent Serialization Support
AESizeOfFlattenedDesc, AEFlattenDesc, AEUnflattenDesc
These calls will work for all AppleEvent data types and between different
versions of the OS (including between Mac OS 9 and X)
Basic types, AEDesc, AEList and AERecord are OK, but AppleEvent records
themselves may not be reliably flattened for storage.
*************************************************************************}
{
* AESizeOfFlattenedDesc()
*
* Discussion:
* Returns the amount of buffer space needed to flatten the AEDesc.
* Call this before AEFlattenDesc to make sure your buffer has
* enough room for the operation.
*
* Mac OS X threading:
* Thread safe since version 10.2
*
* Parameters:
*
* theAEDesc:
* A pointer to the descriptor to be flattened.
*
* Availability:
* Mac OS X: in version 10.0 and later in ApplicationServices.framework
* CarbonLib: in CarbonLib 1.4 and later
* Non-Carbon CFM: not available
}
function AESizeOfFlattenedDesc( const (*var*) theAEDesc: AEDesc ): Size; external name '_AESizeOfFlattenedDesc';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* AEFlattenDesc()
*
* Discussion:
* Fills a buffer with a flattened representation of the AEDesc and
* returns the amount of buffer used in actualSize. If bufferSize
* was too small it returns errAEBufferTooSmall (-1741) and does not
* fill in any of the buffer. The resulting buffer is only useful
* with an AEUnflattenDesc call.
* Note: if you pass a NULL buffer pointer it returns noErr but
* fills in the actualSize field anyway.
*
* Mac OS X threading:
* Thread safe since version 10.2
*
* Parameters:
*
* theAEDesc:
* A pointer to the descriptor to be flattened.
*
* buffer:
* A pointer to memory, allocated by the application, where the
* flattened data will be stored. See the bufferSize parameter for
* information on how large a buffer you should allocate.
*
* bufferSize:
* The size of the buffer pointed to by buffer. Prior to calling
* AEFlattenDesc, you call the AESizeOfFlattenedDesc function to
* determine the required size of the buffer for the flatten
* operation.
* If bufferSize is too small, AEFlattenDesc returns
* errAEBufferTooSmall and doesn't store any data in the buffer.
*
* actualSize:
* A pointer to a size variable. On return, the variable contains
* the actual size of the flattened data. You can specify NULL for
* this parameter if you do not care about the returned size.
*
* Availability:
* Mac OS X: in version 10.0 and later in ApplicationServices.framework
* CarbonLib: in CarbonLib 1.4 and later
* Non-Carbon CFM: not available
}
function AEFlattenDesc( const (*var*) theAEDesc: AEDesc; buffer: Ptr; bufferSize: Size; var actualSize: Size ): OSStatus; external name '_AEFlattenDesc';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* AEUnflattenDesc()
*
* Discussion:
* Allocates an AEDesc (given a Null Desc) given a flattened data
* buffer. It assumes it was given a good buffer filled in by
* AEFlattenDesc. It returns paramErr if it discovers something
* fishy about the buffer.
*
* Mac OS X threading:
* Thread safe since version 10.2
*
* Parameters:
*
* buffer:
* A pointer to memory, allocated by the application, that
* contains flattened data produced by a previous call to
* AEFlattenDesc.
*
* result:
* A null descriptor. On successful completion, points to a
* descriptor created from the flattened data. The caller is
* responsible for disposing of the descriptor.
*
* Availability:
* Mac OS X: in version 10.0 and later in ApplicationServices.framework
* CarbonLib: in CarbonLib 1.4 and later
* Non-Carbon CFM: not available
}
function AEUnflattenDesc( buffer: {const} UnivPtr; var result: AEDesc ): OSStatus; external name '_AEUnflattenDesc';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{*************************************************************************
The following calls are necessary to deal with opaque data in AEDescs, because the
traditional way of dealing with a basic AEDesc has been to dereference the dataHandle
directly. This is not supported under Carbon.
*************************************************************************}
{
AEGetDescData no longer supports automatic coercion. If you'd like to
coerce the descriptor use AECoerceDesc.
}
{
* AEGetDescData()
*
* Discussion:
* Gets the data from the specified descriptor. AEGetDescData no
* longer supports automatic coercion. If you'd like to coerce the
* descriptor use AECoerceDesc.
*
* Mac OS X threading:
* Thread safe since version 10.2
*
* Parameters:
*
* theAEDesc:
* A pointer to the descriptor to get the data from.
*
* dataPtr:
* A pointer to a buffer, local variable, or other storage
* location created and disposed of by your application. The size
* in bytes should be the same as the value you pass in the
* maximumSize parameter. On return, contains the data from the
* descriptor.
*
* maximumSize:
* The length, in bytes, of the expected descriptor data. The
* AEGetDescData function will not return more data than you
* specify in this parameter. You typically determine the maximum
* size by calling AEGetDescDataSize.
*
* Availability:
* Mac OS X: in version 10.0 and later in ApplicationServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in CarbonAccessors.o 1.0 and later
}
function AEGetDescData( const (*var*) theAEDesc: AEDesc; dataPtr: UnivPtr; maximumSize: Size ): OSErr; external name '_AEGetDescData';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* AEGetDescDataSize()
*
* Discussion:
* Gets the size, in bytes, of the data in the specified descriptor.
*
* Mac OS X threading:
* Thread safe since version 10.2
*
* Parameters:
*
* theAEDesc:
* A pointer to the descriptor to obtain the data size for. See
* AEDesc.
*
* Availability:
* Mac OS X: in version 10.0 and later in ApplicationServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in CarbonAccessors.o 1.0 and later
}
function AEGetDescDataSize( const (*var*) theAEDesc: AEDesc ): Size; external name '_AEGetDescDataSize';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* AEReplaceDescData()
*
* Discussion:
* Copies the specified data into the specified descriptor,
* replacing any previous data.
*
* Mac OS X threading:
* Thread safe since version 10.2
*
* Parameters:
*
* typeCode:
* Specifies the descriptor type of the data pointed to by dataPtr.
*
* dataPtr:
* A pointer to the data to store in the specified descriptor.
*
* dataSize:
* The size, in bytes, of the data pointed to by the dataSize
* parameter.
*
* theAEDesc:
* A pointer to a descriptor. On return, contains the copied data.
*
* Availability:
* Mac OS X: in version 10.0 and later in ApplicationServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in CarbonAccessors.o 1.0 and later
}
function AEReplaceDescData( typeCode: DescType; dataPtr: {const} UnivPtr; dataSize: Size; var theAEDesc: AEDesc ): OSErr; external name '_AEReplaceDescData';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* AEGetDescDataRange()
*
* Discussion:
* Retrieve a range of bytes from an AEDesc. This obviates the need
* to retrieve the entire data from the event using AEGetDescData.
* This is only valid for data type AEDescs. If the requested
* length and offset are such that they do not fit entirely with the
* data of the desc, errAEBufferTooSmall is returned.
*
* Mac OS X threading:
* Thread safe since version 10.2
*
* Parameters:
*
* dataDesc:
* A pointer to the descriptor to get the data from.
*
* buffer:
* A pointer to a buffer, local variable, or other storage
* location created and disposed of by your application. The size
* in bytes should be at least as large as the value you pass in
* the length parameter. On return, contains the specified data
* from the descriptor.
*
* offset:
* The zero-based offset to the data to be retrieved from the
* descriptor.
*
* length:
* The number of bytes of contiguous data to retrieve.
*
* Availability:
* Mac OS X: in version 10.2 and later in ApplicationServices.framework
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
* Non-Carbon CFM: not available
}
function AEGetDescDataRange( const (*var*) dataDesc: AEDesc; buffer: UnivPtr; offset: Size; length: Size ): OSStatus; external name '_AEGetDescDataRange';
(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
{*************************************************************************
A AEEventHandler is installed to process an AppleEvent
*************************************************************************}
type
AEEventHandlerProcPtr = function( const (*var*) theAppleEvent: AppleEvent; var reply: AppleEvent; handlerRefcon: SRefCon ): OSErr;
AEEventHandlerUPP = AEEventHandlerProcPtr;
{
* NewAEDisposeExternalUPP()
*
* Availability:
* Mac OS X: in version 10.2 and later in ApplicationServices.framework
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
* Non-Carbon CFM: available as macro/inline
}
function NewAEDisposeExternalUPP( userRoutine: AEDisposeExternalProcPtr ): AEDisposeExternalUPP; external name '_NewAEDisposeExternalUPP';
(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
{
* NewAEEventHandlerUPP()
*
* Availability:
* Mac OS X: in version 10.0 and later in ApplicationServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: available as macro/inline
}
function NewAEEventHandlerUPP( userRoutine: AEEventHandlerProcPtr ): AEEventHandlerUPP; external name '_NewAEEventHandlerUPP';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* DisposeAEDisposeExternalUPP()
*
* Availability:
* Mac OS X: in version 10.2 and later in ApplicationServices.framework
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
* Non-Carbon CFM: available as macro/inline
}
procedure DisposeAEDisposeExternalUPP( userUPP: AEDisposeExternalUPP ); external name '_DisposeAEDisposeExternalUPP';
(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
{
* DisposeAEEventHandlerUPP()
*
* Availability:
* Mac OS X: in version 10.0 and later in ApplicationServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: available as macro/inline
}
procedure DisposeAEEventHandlerUPP( userUPP: AEEventHandlerUPP ); external name '_DisposeAEEventHandlerUPP';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* InvokeAEDisposeExternalUPP()
*
* Availability:
* Mac OS X: in version 10.2 and later in ApplicationServices.framework
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
* Non-Carbon CFM: available as macro/inline
}
procedure InvokeAEDisposeExternalUPP( dataPtr: {const} UnivPtr; dataLength: Size; refcon: SRefCon; userUPP: AEDisposeExternalUPP ); external name '_InvokeAEDisposeExternalUPP';
(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
{
* InvokeAEEventHandlerUPP()
*
* Availability:
* Mac OS X: in version 10.0 and later in ApplicationServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: available as macro/inline
}
function InvokeAEEventHandlerUPP( const (*var*) theAppleEvent: AppleEvent; var reply: AppleEvent; handlerRefcon: SRefCon; userUPP: AEEventHandlerUPP ): OSErr; external name '_InvokeAEEventHandlerUPP';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{$endc} {TARGET_OS_MAC}
{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
end.
{$endc} {not MACOSALLINCLUDE}
|