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
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
|
/*
File: Controls.h
Contains: Control Manager interfaces
Version: QuickTime 7.3
Copyright: (c) 2007 (c) 1985-2001 by Apple Computer, Inc., all rights reserved
Bugs?: For bug reports, consult the following page on
the World Wide Web:
http://developer.apple.com/bugreporter/
*/
#ifndef __CONTROLS__
#define __CONTROLS__
#ifndef __MACTYPES__
#include <MacTypes.h>
#endif
#ifndef __QUICKDRAW__
#include <Quickdraw.h>
#endif
#ifndef __COLLECTIONS__
#include <Collections.h>
#endif
#ifndef __MACERRORS__
#include <MacErrors.h>
#endif
#ifndef __CFSTRING__
#include <CFString.h>
#endif
#ifndef __ICONS__
#include <Icons.h>
#endif
#ifndef __HIOBJECT__
#include <HIObject.h>
#endif
#ifndef __MENUS__
#include <Menus.h>
#endif
#ifndef __TEXTEDIT__
#include <TextEdit.h>
#endif
#ifndef __DRAG__
#include <Drag.h>
#endif
#if PRAGMA_ONCE
#pragma once
#endif
#ifdef __cplusplus
extern "C" {
#endif
#if PRAGMA_IMPORT
#pragma import on
#endif
#if PRAGMA_STRUCT_ALIGN
#pragma options align=mac68k
#elif PRAGMA_STRUCT_PACKPUSH
#pragma pack(push, 2)
#elif PRAGMA_STRUCT_PACK
#pragma pack(2)
#endif
/*------------------------------------------------------------------------------------------------------*/
/* o Resource Types */
/*------------------------------------------------------------------------------------------------------*/
enum {
kControlDefProcType = FOUR_CHAR_CODE('CDEF'),
kControlTemplateResourceType = FOUR_CHAR_CODE('CNTL'),
kControlColorTableResourceType = FOUR_CHAR_CODE('cctb'),
kControlDefProcResourceType = FOUR_CHAR_CODE('CDEF')
};
/*------------------------------------------------------------------------------------------------------*/
/* o Format of a 'CNTL' resource */
/*------------------------------------------------------------------------------------------------------*/
struct ControlTemplate {
Rect controlRect;
SInt16 controlValue;
Boolean controlVisible;
UInt8 fill;
SInt16 controlMaximum;
SInt16 controlMinimum;
SInt16 controlDefProcID;
SInt32 controlReference;
Str255 controlTitle;
};
typedef struct ControlTemplate ControlTemplate;
typedef ControlTemplate * ControlTemplatePtr;
typedef ControlTemplatePtr * ControlTemplateHandle;
#if !TARGET_OS_MAC
/*
---------------------------------------------------------------------------------------------------------
o NON-MAC COMPATIBILITY CODES (QuickTime 3.0)
---------------------------------------------------------------------------------------------------------
*/
typedef UInt32 ControlNotification;
enum {
controlNotifyNothing = FOUR_CHAR_CODE('nada'), /* No (null) notification*/
controlNotifyClick = FOUR_CHAR_CODE('clik'), /* Control was clicked*/
controlNotifyFocus = FOUR_CHAR_CODE('focu'), /* Control got keyboard focus*/
controlNotifyKey = FOUR_CHAR_CODE('key ') /* Control got a keypress*/
};
typedef UInt32 ControlCapabilities;
enum {
kControlCanAutoInvalidate = 1L << 0 /* Control component automatically invalidates areas left behind after hide/move operation.*/
};
/* procID's for our added "controls"*/
enum {
staticTextProc = 256, /* static text*/
editTextProc = 272, /* editable text*/
iconProc = 288, /* icon*/
userItemProc = 304, /* user drawn item*/
pictItemProc = 320 /* pict*/
};
#endif /* !TARGET_OS_MAC */
/*------------------------------------------------------------------------------------------------------*/
/* o ControlRef */
/*------------------------------------------------------------------------------------------------------*/
#if !OPAQUE_TOOLBOX_STRUCTS
typedef struct ControlRecord ControlRecord;
typedef ControlRecord * ControlPtr;
typedef ControlPtr * ControlRef;
#else
typedef struct OpaqueControlRef* ControlRef;
#endif /* !OPAQUE_TOOLBOX_STRUCTS */
/* ControlHandle is obsolete. Use ControlRef.*/
typedef ControlRef ControlHandle;
typedef SInt16 ControlPartCode;
/*------------------------------------------------------------------------------------------------------*/
/* o Control ActionProcPtr */
/*------------------------------------------------------------------------------------------------------*/
typedef CALLBACK_API( void , ControlActionProcPtr )(ControlRef theControl, ControlPartCode partCode);
typedef STACK_UPP_TYPE(ControlActionProcPtr) ControlActionUPP;
/*------------------------------------------------------------------------------------------------------*/
/* o ControlRecord */
/*------------------------------------------------------------------------------------------------------*/
#if !OPAQUE_TOOLBOX_STRUCTS
struct ControlRecord {
ControlRef nextControl; /* in Carbon use embedding heirarchy functions*/
WindowRef contrlOwner; /* in Carbon use GetControlOwner or EmbedControl*/
Rect contrlRect; /* in Carbon use Get/SetControlBounds*/
UInt8 contrlVis; /* in Carbon use IsControlVisible, SetControlVisibility*/
UInt8 contrlHilite; /* in Carbon use GetControlHilite, HiliteControl*/
SInt16 contrlValue; /* in Carbon use Get/SetControlValue, Get/SetControl32BitValue*/
SInt16 contrlMin; /* in Carbon use Get/SetControlMinimum, Get/SetControl32BitMinimum*/
SInt16 contrlMax; /* in Carbon use Get/SetControlMaximum, Get/SetControl32BitMaximum*/
Handle contrlDefProc; /* not supported in Carbon*/
Handle contrlData; /* in Carbon use Get/SetControlDataHandle*/
ControlActionUPP contrlAction; /* in Carbon use Get/SetControlAction*/
SInt32 contrlRfCon; /* in Carbon use Get/SetControlReference*/
Str255 contrlTitle; /* in Carbon use Get/SetControlTitle*/
};
#endif /* !OPAQUE_TOOLBOX_STRUCTS */
/*------------------------------------------------------------------------------------------------------*/
/* o Control ActionProcPtr : Epilogue */
/*------------------------------------------------------------------------------------------------------*/
/*
* NewControlActionUPP()
*
* Availability:
* Non-Carbon CFM: available as macro/inline
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API_C( ControlActionUPP )
NewControlActionUPP(ControlActionProcPtr userRoutine);
#if !OPAQUE_UPP_TYPES
enum { uppControlActionProcInfo = 0x000002C0 }; /* pascal no_return_value Func(4_bytes, 2_bytes) */
#ifdef __cplusplus
inline DEFINE_API_C(ControlActionUPP) NewControlActionUPP(ControlActionProcPtr userRoutine) { return (ControlActionUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlActionProcInfo, GetCurrentArchitecture()); }
#else
#define NewControlActionUPP(userRoutine) (ControlActionUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlActionProcInfo, GetCurrentArchitecture())
#endif
#endif
/*
* DisposeControlActionUPP()
*
* Availability:
* Non-Carbon CFM: available as macro/inline
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API_C( void )
DisposeControlActionUPP(ControlActionUPP userUPP);
#if !OPAQUE_UPP_TYPES
#ifdef __cplusplus
inline DEFINE_API_C(void) DisposeControlActionUPP(ControlActionUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
#else
#define DisposeControlActionUPP(userUPP) DisposeRoutineDescriptor(userUPP)
#endif
#endif
/*
* InvokeControlActionUPP()
*
* Availability:
* Non-Carbon CFM: available as macro/inline
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API_C( void )
InvokeControlActionUPP(
ControlRef theControl,
ControlPartCode partCode,
ControlActionUPP userUPP);
#if !OPAQUE_UPP_TYPES
#ifdef __cplusplus
inline DEFINE_API_C(void) InvokeControlActionUPP(ControlRef theControl, ControlPartCode partCode, ControlActionUPP userUPP) { CALL_TWO_PARAMETER_UPP(userUPP, uppControlActionProcInfo, theControl, partCode); }
#else
#define InvokeControlActionUPP(theControl, partCode, userUPP) CALL_TWO_PARAMETER_UPP((userUPP), uppControlActionProcInfo, (theControl), (partCode))
#endif
#endif
#if CALL_NOT_IN_CARBON || OLDROUTINENAMES
/* support for pre-Carbon UPP routines: New...Proc and Call...Proc */
#define NewControlActionProc(userRoutine) NewControlActionUPP(userRoutine)
#define CallControlActionProc(userRoutine, theControl, partCode) InvokeControlActionUPP(theControl, partCode, userRoutine)
#endif /* CALL_NOT_IN_CARBON */
/*------------------------------------------------------------------------------------------------------*/
/* o Control Color Table */
/*------------------------------------------------------------------------------------------------------*/
enum {
cFrameColor = 0,
cBodyColor = 1,
cTextColor = 2,
cThumbColor = 3,
kNumberCtlCTabEntries = 4
};
struct CtlCTab {
SInt32 ccSeed;
SInt16 ccRider;
SInt16 ctSize;
ColorSpec ctTable[4];
};
typedef struct CtlCTab CtlCTab;
typedef CtlCTab * CCTabPtr;
typedef CCTabPtr * CCTabHandle;
/*------------------------------------------------------------------------------------------------------*/
/* o Auxiliary Control Record */
/*------------------------------------------------------------------------------------------------------*/
#if !OPAQUE_TOOLBOX_STRUCTS
struct AuxCtlRec {
Handle acNext; /* not supported in Carbon*/
ControlRef acOwner; /* not supported in Carbon*/
CCTabHandle acCTable; /* not supported in Carbon*/
SInt16 acFlags; /* not supported in Carbon*/
SInt32 acReserved; /* not supported in Carbon*/
SInt32 acRefCon; /* in Carbon use Get/SetControlProperty if you need more refCons*/
};
typedef struct AuxCtlRec AuxCtlRec;
typedef AuxCtlRec * AuxCtlPtr;
typedef AuxCtlPtr * AuxCtlHandle;
#endif /* !OPAQUE_TOOLBOX_STRUCTS */
/*--------------------------------------------------------------------------------------*/
/* o Control Variants */
/*--------------------------------------------------------------------------------------*/
typedef SInt16 ControlVariant;
enum {
kControlNoVariant = 0, /* No variant*/
kControlUsesOwningWindowsFontVariant = 1 << 3 /* Control uses owning windows font to display text*/
};
/*--------------------------------------------------------------------------------------*/
/* o Control Part Codes */
/*--------------------------------------------------------------------------------------*/
/* Basic part codes */
enum {
kControlNoPart = 0,
kControlIndicatorPart = 129,
kControlDisabledPart = 254,
kControlInactivePart = 255
};
/* Use this constant in Get/SetControlData when the data referred to is not */
/* specific to a part, but rather the entire control, e.g. the list handle of a */
/* list box control. */
enum {
kControlEntireControl = 0
};
/* Meta-Parts */
/* */
/* If you haven't guessed from looking at other toolbox headers. We like the word */
/* 'meta'. It's cool. So here's one more for you. A meta-part is a part used in a call */
/* to the GetControlRegion API. These parts are parts that might be defined by a */
/* control, but should not be returned from calls like TestControl, et al. They define */
/* a region of a control, presently the structure and the content region. The content */
/* region is only defined by controls that can embed other controls. It is the area */
/* that embedded content can live. */
/* */
/* Along with these parts, you can also pass in normal part codes to get the regions */
/* of the parts. Not all controls fully support this at the time this was written. */
enum {
kControlStructureMetaPart = -1,
kControlContentMetaPart = -2
};
/* focusing part codes */
enum {
kControlFocusNoPart = 0, /* tells control to clear its focus*/
kControlFocusNextPart = -1, /* tells control to focus on the next part*/
kControlFocusPrevPart = -2 /* tells control to focus on the previous part*/
};
typedef SInt16 ControlFocusPart;
/*------------------------------------------------------------------------------------------------------*/
/* o Control Collection Tags */
/*------------------------------------------------------------------------------------------------------*/
/* These are standard tags that you will find in the initial data Collection that is passed in the */
/* 'param' parameter to the initCntl message (Carbon only). */
/* */
/* All tags at ID zero in a Control's Collection are reserved for Control Manager use. */
/* Custom control definitions should use other IDs. */
/* */
/* Most of these tags are interpreted when you call CreateCustomControl; the Control Manager will */
/* put value in the right place before calling the Control Definition with the initialization message. */
enum {
kControlCollectionTagBounds = FOUR_CHAR_CODE('boun'), /* Rect - the bounding rectangle*/
kControlCollectionTagValue = FOUR_CHAR_CODE('valu'), /* SInt32 - the value*/
kControlCollectionTagMinimum = FOUR_CHAR_CODE('min '), /* SInt32 - the minimum*/
kControlCollectionTagMaximum = FOUR_CHAR_CODE('max '), /* SInt32 - the maximum*/
kControlCollectionTagViewSize = FOUR_CHAR_CODE('view'), /* SInt32 - the view size*/
kControlCollectionTagVisibility = FOUR_CHAR_CODE('visi'), /* Boolean - the visible state*/
kControlCollectionTagRefCon = FOUR_CHAR_CODE('refc'), /* SInt32 - the refCon*/
kControlCollectionTagTitle = FOUR_CHAR_CODE('titl'), /* arbitrarily sized character array - the title*/
kControlCollectionTagUnicodeTitle = FOUR_CHAR_CODE('uttl'), /* bytes as received via CFStringCreateExternalRepresentation*/
kControlCollectionTagIDSignature = FOUR_CHAR_CODE('idsi'), /* OSType - the ControlID signature*/
kControlCollectionTagIDID = FOUR_CHAR_CODE('idid'), /* SInt32 - the ControlID id*/
kControlCollectionTagCommand = FOUR_CHAR_CODE('cmd '), /* UInt32 - the command*/
kControlCollectionTagVarCode = FOUR_CHAR_CODE('varc') /* SInt16 - the variant*/
};
/*------------------------------------------------------------------------------------------------------*/
/* o Control Image Content */
/*------------------------------------------------------------------------------------------------------*/
enum {
kControlContentTextOnly = 0,
kControlNoContent = 0,
kControlContentIconSuiteRes = 1,
kControlContentCIconRes = 2,
kControlContentPictRes = 3,
kControlContentICONRes = 4,
kControlContentIconSuiteHandle = 129,
kControlContentCIconHandle = 130,
kControlContentPictHandle = 131,
kControlContentIconRef = 132,
kControlContentICON = 133
};
typedef SInt16 ControlContentType;
struct ControlButtonContentInfo {
ControlContentType contentType;
union {
SInt16 resID;
CIconHandle cIconHandle;
Handle iconSuite;
IconRef iconRef;
PicHandle picture;
Handle ICONHandle;
} u;
};
typedef struct ControlButtonContentInfo ControlButtonContentInfo;
typedef ControlButtonContentInfo * ControlButtonContentInfoPtr;
typedef ControlButtonContentInfo ControlImageContentInfo;
typedef ControlButtonContentInfo * ControlImageContentInfoPtr;
/*------------------------------------------------------------------------------------------------------*/
/* o Control Key Script Behavior */
/*------------------------------------------------------------------------------------------------------*/
enum {
kControlKeyScriptBehaviorAllowAnyScript = FOUR_CHAR_CODE('any '), /* leaves the current keyboard alone and allows user to change the keyboard.*/
kControlKeyScriptBehaviorPrefersRoman = FOUR_CHAR_CODE('prmn'), /* switches the keyboard to roman, but allows them to change it as desired.*/
kControlKeyScriptBehaviorRequiresRoman = FOUR_CHAR_CODE('rrmn') /* switches the keyboard to roman and prevents the user from changing it.*/
};
typedef UInt32 ControlKeyScriptBehavior;
/*------------------------------------------------------------------------------------------------------*/
/* o Control Font Style */
/*------------------------------------------------------------------------------------------------------*/
/* SPECIAL FONT USAGE NOTES: You can specify the font to use for many control types.
The constants below are meta-font numbers which you can use to set a particular
control's font usage. There are essentially two modes you can use: 1) default,
which is essentially the same as it always has been, i.e. it uses the system font, unless
directed to use the window font via a control variant. 2) you can specify to use
the big or small system font in a generic manner. The Big system font is the font
used in menus, etc. Chicago has filled that role for some time now. Small system
font is currently Geneva 10. The meta-font number implies the size and style.
NOTE: Not all font attributes are used by all controls. Most, in fact, ignore
the fore and back color (Static Text is the only one that does, for
backwards compatibility). Also size, face, and addFontSize are ignored
when using the meta-font numbering.
*/
/* Meta-font numbering - see note above */
enum {
kControlFontBigSystemFont = -1, /* force to big system font*/
kControlFontSmallSystemFont = -2, /* force to small system font*/
kControlFontSmallBoldSystemFont = -3, /* force to small bold system font*/
kControlFontViewSystemFont = -4 /* force to views system font (DataBrowser control only)*/
};
/* Add these masks together to set the flags field of a ControlFontStyleRec */
/* They specify which fields to apply to the text. It is important to make */
/* sure that you specify only the fields that you wish to set. */
enum {
kControlUseFontMask = 0x0001,
kControlUseFaceMask = 0x0002,
kControlUseSizeMask = 0x0004,
kControlUseForeColorMask = 0x0008,
kControlUseBackColorMask = 0x0010,
kControlUseModeMask = 0x0020,
kControlUseJustMask = 0x0040,
kControlUseAllMask = 0x00FF,
kControlAddFontSizeMask = 0x0100
};
/* AddToMetaFont indicates that we want to start with a standard system */
/* font, but then we'd like to add the other attributes. Normally, the meta */
/* font ignores all other flags */
enum {
kControlAddToMetaFontMask = 0x0200 /* Available in Appearance 1.1 or later*/
};
/* UseThemeFontID indicates that the font field of the ControlFontStyleRec */
/* should be interpreted as a ThemeFontID (see Appearance.h). In all other */
/* ways, specifying a ThemeFontID is just like using one of the control */
/* meta-fonts IDs. */
enum {
kControlUseThemeFontIDMask = 0x0080 /* Available in Mac OS X or later*/
};
struct ControlFontStyleRec {
SInt16 flags;
SInt16 font;
SInt16 size;
SInt16 style;
SInt16 mode;
SInt16 just;
RGBColor foreColor;
RGBColor backColor;
};
typedef struct ControlFontStyleRec ControlFontStyleRec;
typedef ControlFontStyleRec * ControlFontStylePtr;
/*------------------------------------------------------------------------------------------------------*/
/* o Click Activation Results */
/*------------------------------------------------------------------------------------------------------*/
/* These are for use with GetControlClickActivation. The enumerated values should be pretty */
/* self-explanatory, but just in case: */
/* o Activate/DoNotActivate indicates whether or not to change the owning window's z-ordering before */
/* processing the click. If activation is requested, you may also want to immediately redraw the */
/* newly exposed portion of the window. */
/* o Ignore/Handle Click indicates whether or not to call an appropriate click handling API (like */
/* HandleControlClick) in respose to the event. */
enum {
kDoNotActivateAndIgnoreClick = 0, /* probably never used. here for completeness.*/
kDoNotActivateAndHandleClick = 1, /* let the control handle the click while the window is still in the background.*/
kActivateAndIgnoreClick = 2, /* control doesn't want to respond directly to the click, but window should still be brought forward.*/
kActivateAndHandleClick = 3 /* control wants to respond to the click, but only after the window has been activated.*/
};
typedef UInt32 ClickActivationResult;
/*------------------------------------------------------------------------------------------------------*/
/* o Common data tags for Get/SetControlData */
/*------------------------------------------------------------------------------------------------------*/
/*
* Discussion:
* Get/SetControlData Common Tags
*/
enum {
kControlFontStyleTag = FOUR_CHAR_CODE('font'),
kControlKeyFilterTag = FOUR_CHAR_CODE('fltr'),
/*
* Sent with a pointer to a ControlKind record to be filled in. Only
* valid for GetControlData.
*/
kControlKindTag = FOUR_CHAR_CODE('kind'),
/*
* Sent with a pointer to a ControlSize. Only valid with explicitly
* sizeable controls. Currently supported by the Check Box, Combo
* Box, Progress Bar, Indeterminate Progress Bar, Radio Button, Round
* Button, Scroll Bar, Slider and the Tab. Check your return value!
*/
kControlSizeTag = FOUR_CHAR_CODE('size')
};
/*------------------------------------------------------------------------------------------------------*/
/* o Control Feature Bits */
/*------------------------------------------------------------------------------------------------------*/
enum {
/* Control feature bits - returned by GetControlFeatures */
kControlSupportsGhosting = 1 << 0,
kControlSupportsEmbedding = 1 << 1,
kControlSupportsFocus = 1 << 2,
kControlWantsIdle = 1 << 3,
kControlWantsActivate = 1 << 4,
kControlHandlesTracking = 1 << 5,
kControlSupportsDataAccess = 1 << 6,
kControlHasSpecialBackground = 1 << 7,
kControlGetsFocusOnClick = 1 << 8,
kControlSupportsCalcBestRect = 1 << 9,
kControlSupportsLiveFeedback = 1 << 10,
kControlHasRadioBehavior = 1 << 11, /* Available in Appearance 1.0.1 or later*/
kControlSupportsDragAndDrop = 1 << 12, /* Available in Carbon*/
kControlAutoToggles = 1 << 14, /* Available in Appearance 1.1 or later*/
kControlSupportsGetRegion = 1 << 17, /* Available in Appearance 1.1 or later*/
kControlSupportsFlattening = 1 << 19, /* Available in Carbon*/
kControlSupportsSetCursor = 1 << 20, /* Available in Carbon*/
kControlSupportsContextualMenus = 1 << 21, /* Available in Carbon*/
kControlSupportsClickActivation = 1 << 22, /* Available in Carbon*/
kControlIdlesWithTimer = 1 << 23 /* Available in Carbon - this bit indicates that the control animates automatically*/
};
/*------------------------------------------------------------------------------------------------------*/
/* o Control Messages */
/*------------------------------------------------------------------------------------------------------*/
enum {
drawCntl = 0,
testCntl = 1,
calcCRgns = 2,
initCntl = 3, /* Param is Collection, result is OSStatus*/
dispCntl = 4,
posCntl = 5,
thumbCntl = 6,
dragCntl = 7,
autoTrack = 8,
calcCntlRgn = 10,
calcThumbRgn = 11,
drawThumbOutline = 12,
kControlMsgDrawGhost = 13,
kControlMsgCalcBestRect = 14, /* Calculate best fitting rectangle for control*/
kControlMsgHandleTracking = 15,
kControlMsgFocus = 16, /* param indicates action.*/
kControlMsgKeyDown = 17,
kControlMsgIdle = 18,
kControlMsgGetFeatures = 19,
kControlMsgSetData = 20,
kControlMsgGetData = 21,
kControlMsgActivate = 22,
kControlMsgSetUpBackground = 23,
kControlMsgCalcValueFromPos = 26,
kControlMsgTestNewMsgSupport = 27, /* See if this control supports new messaging*/
kControlMsgSubValueChanged = 25, /* Available in Appearance 1.0.1 or later*/
kControlMsgSubControlAdded = 28, /* Available in Appearance 1.0.1 or later*/
kControlMsgSubControlRemoved = 29, /* Available in Appearance 1.0.1 or later*/
kControlMsgApplyTextColor = 30, /* Available in Appearance 1.1 or later*/
kControlMsgGetRegion = 31, /* Available in Appearance 1.1 or later*/
kControlMsgFlatten = 32, /* Available in Carbon. Param is Collection.*/
kControlMsgSetCursor = 33, /* Available in Carbon. Param is ControlSetCursorRec*/
kControlMsgDragEnter = 38, /* Available in Carbon. Param is DragRef, result is boolean indicating acceptibility of drag.*/
kControlMsgDragLeave = 39, /* Available in Carbon. As above.*/
kControlMsgDragWithin = 40, /* Available in Carbon. As above.*/
kControlMsgDragReceive = 41, /* Available in Carbon. Param is DragRef, result is OSStatus indicating success/failure.*/
kControlMsgDisplayDebugInfo = 46, /* Available in Carbon on X.*/
kControlMsgContextualMenuClick = 47, /* Available in Carbon. Param is ControlContextualMenuClickRec*/
kControlMsgGetClickActivation = 48 /* Available in Carbon. Param is ControlClickActivationRec*/
};
typedef SInt16 ControlDefProcMessage;
/*--------------------------------------------------------------------------------------*/
/* o Control Sizes */
/*--------------------------------------------------------------------------------------*/
/*
* Discussion:
* ControlSize values to be used in conjunction with SetControlData
* and the kControlSizeTag.
*/
enum {
/*
* Use the control's default drawing variant. This does not apply to
* Scroll Bars, for which Normal is Large.
*/
kControlSizeNormal = 0,
/*
* Use the control's small drawing variant. Currently supported by
* the Check Box, Combo Box, Radio Button, Scroll Bar, Slider and Tab
* controls.
*/
kControlSizeSmall = 1,
/*
* Use the control's small drawing variant. Currently supported by
* the Indeterminate Progress Bar, Progress Bar and Round Button
* controls.
*/
kControlSizeLarge = 2,
/*
* Control drawing variant determined by the control's bounds. This
* ControlSize is only available with Scroll Bars to support their
* legacy behavior of drawing differently within different bounds.
*/
kControlSizeAuto = 0xFFFF
};
typedef UInt16 ControlSize;
/*--------------------------------------------------------------------------------------*/
/* o Constants for drawCntl message (passed in param) */
/*--------------------------------------------------------------------------------------*/
enum {
kDrawControlEntireControl = 0,
kDrawControlIndicatorOnly = 129
};
/*--------------------------------------------------------------------------------------*/
/* o Constants for dragCntl message (passed in param) */
/*--------------------------------------------------------------------------------------*/
enum {
kDragControlEntireControl = 0,
kDragControlIndicator = 1
};
/*--------------------------------------------------------------------------------------*/
/* o Drag Constraint Structure for thumbCntl message (passed in param) */
/*--------------------------------------------------------------------------------------*/
struct IndicatorDragConstraint {
Rect limitRect;
Rect slopRect;
DragConstraint axis;
};
typedef struct IndicatorDragConstraint IndicatorDragConstraint;
typedef IndicatorDragConstraint * IndicatorDragConstraintPtr;
/*--------------------------------------------------------------------------------------*/
/* CDEF should return as result of kControlMsgTestNewMsgSupport */
/*--------------------------------------------------------------------------------------*/
enum {
kControlSupportsNewMessages = FOUR_CHAR_CODE(' ok ')
};
/*--------------------------------------------------------------------------------------*/
/* This structure is passed into a CDEF when called with the kControlMsgHandleTracking */
/* message */
/*--------------------------------------------------------------------------------------*/
struct ControlTrackingRec {
Point startPt;
EventModifiers modifiers;
ControlActionUPP action;
};
typedef struct ControlTrackingRec ControlTrackingRec;
typedef ControlTrackingRec * ControlTrackingPtr;
/*--------------------------------------------------------------------------------------*/
/* This structure is passed into a CDEF when called with the kControlMsgKeyDown message */
/*--------------------------------------------------------------------------------------*/
struct ControlKeyDownRec {
EventModifiers modifiers;
SInt16 keyCode;
SInt16 charCode;
};
typedef struct ControlKeyDownRec ControlKeyDownRec;
typedef ControlKeyDownRec * ControlKeyDownPtr;
/*--------------------------------------------------------------------------------------*/
/* This structure is passed into a CDEF when called with the kControlMsgGetData or */
/* kControlMsgSetData message */
/*--------------------------------------------------------------------------------------*/
struct ControlDataAccessRec {
ResType tag;
ResType part;
Size size;
Ptr dataPtr;
};
typedef struct ControlDataAccessRec ControlDataAccessRec;
typedef ControlDataAccessRec * ControlDataAccessPtr;
/*--------------------------------------------------------------------------------------*/
/* This structure is passed into a CDEF when called with the kControlCalcBestRect msg */
/*--------------------------------------------------------------------------------------*/
struct ControlCalcSizeRec {
SInt16 height;
SInt16 width;
SInt16 baseLine;
};
typedef struct ControlCalcSizeRec ControlCalcSizeRec;
typedef ControlCalcSizeRec * ControlCalcSizePtr;
/*--------------------------------------------------------------------------------------*/
/* This structure is passed into a CDEF when called with the kControlMsgSetUpBackground */
/* message is sent */
/*--------------------------------------------------------------------------------------*/
struct ControlBackgroundRec {
SInt16 depth;
Boolean colorDevice;
};
typedef struct ControlBackgroundRec ControlBackgroundRec;
typedef ControlBackgroundRec * ControlBackgroundPtr;
/*--------------------------------------------------------------------------------------*/
/* This structure is passed into a CDEF when called with the kControlMsgApplyTextColor */
/* message is sent */
/*--------------------------------------------------------------------------------------*/
struct ControlApplyTextColorRec {
SInt16 depth;
Boolean colorDevice;
Boolean active;
};
typedef struct ControlApplyTextColorRec ControlApplyTextColorRec;
typedef ControlApplyTextColorRec * ControlApplyTextColorPtr;
/*--------------------------------------------------------------------------------------*/
/* This structure is passed into a CDEF when called with the kControlMsgGetRegion */
/* message is sent */
/*--------------------------------------------------------------------------------------*/
struct ControlGetRegionRec {
RgnHandle region;
ControlPartCode part;
};
typedef struct ControlGetRegionRec ControlGetRegionRec;
typedef ControlGetRegionRec * ControlGetRegionPtr;
/*--------------------------------------------------------------------------------------*/
/* This structure is passed into a CDEF when the kControlMsgSetCursor message is sent */
/* Only sent on Carbon */
/*--------------------------------------------------------------------------------------*/
struct ControlSetCursorRec {
Point localPoint;
EventModifiers modifiers;
Boolean cursorWasSet; /* your CDEF must set this to true if you set the cursor, or false otherwise*/
};
typedef struct ControlSetCursorRec ControlSetCursorRec;
typedef ControlSetCursorRec * ControlSetCursorPtr;
/*--------------------------------------------------------------------------------------*/
/* This structure is passed into a CDEF when the kControlMsgContextualMenuClick message */
/* is sent */
/* Only sent on Carbon */
/*--------------------------------------------------------------------------------------*/
struct ControlContextualMenuClickRec {
Point localPoint;
Boolean menuDisplayed; /* your CDEF must set this to true if you displayed a menu, or false otherwise*/
};
typedef struct ControlContextualMenuClickRec ControlContextualMenuClickRec;
typedef ControlContextualMenuClickRec * ControlContextualMenuClickPtr;
/*--------------------------------------------------------------------------------------*/
/* This structure is passed into a CDEF when the kControlMsgGetClickActivation message */
/* is sent */
/* Only sent on Carbon */
/*--------------------------------------------------------------------------------------*/
struct ControlClickActivationRec {
Point localPoint;
EventModifiers modifiers;
ClickActivationResult result; /* your CDEF must pass the desired result back*/
};
typedef struct ControlClickActivationRec ControlClickActivationRec;
typedef ControlClickActivationRec * ControlClickActivationPtr;
/*--------------------------------------------------------------------------------------*/
/* o 'CDEF' entrypoint */
/*--------------------------------------------------------------------------------------*/
typedef CALLBACK_API( SInt32 , ControlDefProcPtr )(SInt16 varCode, ControlRef theControl, ControlDefProcMessage message, SInt32 param);
typedef STACK_UPP_TYPE(ControlDefProcPtr) ControlDefUPP;
/*
* NewControlDefUPP()
*
* Availability:
* Non-Carbon CFM: available as macro/inline
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API_C( ControlDefUPP )
NewControlDefUPP(ControlDefProcPtr userRoutine);
#if !OPAQUE_UPP_TYPES
enum { uppControlDefProcInfo = 0x00003BB0 }; /* pascal 4_bytes Func(2_bytes, 4_bytes, 2_bytes, 4_bytes) */
#ifdef __cplusplus
inline DEFINE_API_C(ControlDefUPP) NewControlDefUPP(ControlDefProcPtr userRoutine) { return (ControlDefUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlDefProcInfo, GetCurrentArchitecture()); }
#else
#define NewControlDefUPP(userRoutine) (ControlDefUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlDefProcInfo, GetCurrentArchitecture())
#endif
#endif
/*
* DisposeControlDefUPP()
*
* Availability:
* Non-Carbon CFM: available as macro/inline
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API_C( void )
DisposeControlDefUPP(ControlDefUPP userUPP);
#if !OPAQUE_UPP_TYPES
#ifdef __cplusplus
inline DEFINE_API_C(void) DisposeControlDefUPP(ControlDefUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
#else
#define DisposeControlDefUPP(userUPP) DisposeRoutineDescriptor(userUPP)
#endif
#endif
/*
* InvokeControlDefUPP()
*
* Availability:
* Non-Carbon CFM: available as macro/inline
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API_C( SInt32 )
InvokeControlDefUPP(
SInt16 varCode,
ControlRef theControl,
ControlDefProcMessage message,
SInt32 param,
ControlDefUPP userUPP);
#if !OPAQUE_UPP_TYPES
#ifdef __cplusplus
inline DEFINE_API_C(SInt32) InvokeControlDefUPP(SInt16 varCode, ControlRef theControl, ControlDefProcMessage message, SInt32 param, ControlDefUPP userUPP) { return (SInt32)CALL_FOUR_PARAMETER_UPP(userUPP, uppControlDefProcInfo, varCode, theControl, message, param); }
#else
#define InvokeControlDefUPP(varCode, theControl, message, param, userUPP) (SInt32)CALL_FOUR_PARAMETER_UPP((userUPP), uppControlDefProcInfo, (varCode), (theControl), (message), (param))
#endif
#endif
#if CALL_NOT_IN_CARBON || OLDROUTINENAMES
/* support for pre-Carbon UPP routines: New...Proc and Call...Proc */
#define NewControlDefProc(userRoutine) NewControlDefUPP(userRoutine)
#define CallControlDefProc(userRoutine, varCode, theControl, message, param) InvokeControlDefUPP(varCode, theControl, message, param, userRoutine)
#endif /* CALL_NOT_IN_CARBON */
/*--------------------------------------------------------------------------------------*/
/* Control Key Filter */
/*--------------------------------------------------------------------------------------*/
/* Certain controls can have a keyfilter attached to them. */
/* Definition of a key filter for intercepting and possibly changing keystrokes */
/* which are destined for a control. */
/* Key Filter Result Codes */
/* The filter proc should return one of the two constants below. If */
/* kKeyFilterBlockKey is returned, the key is blocked and never makes it to the */
/* control. If kKeyFilterPassKey is returned, the control receives the keystroke. */
enum {
kControlKeyFilterBlockKey = 0,
kControlKeyFilterPassKey = 1
};
typedef SInt16 ControlKeyFilterResult;
typedef CALLBACK_API( ControlKeyFilterResult , ControlKeyFilterProcPtr )(ControlRef theControl, SInt16 *keyCode, SInt16 *charCode, EventModifiers *modifiers);
typedef STACK_UPP_TYPE(ControlKeyFilterProcPtr) ControlKeyFilterUPP;
/*
* NewControlKeyFilterUPP()
*
* Availability:
* Non-Carbon CFM: available as macro/inline
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API_C( ControlKeyFilterUPP )
NewControlKeyFilterUPP(ControlKeyFilterProcPtr userRoutine);
#if !OPAQUE_UPP_TYPES
enum { uppControlKeyFilterProcInfo = 0x00003FE0 }; /* pascal 2_bytes Func(4_bytes, 4_bytes, 4_bytes, 4_bytes) */
#ifdef __cplusplus
inline DEFINE_API_C(ControlKeyFilterUPP) NewControlKeyFilterUPP(ControlKeyFilterProcPtr userRoutine) { return (ControlKeyFilterUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlKeyFilterProcInfo, GetCurrentArchitecture()); }
#else
#define NewControlKeyFilterUPP(userRoutine) (ControlKeyFilterUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlKeyFilterProcInfo, GetCurrentArchitecture())
#endif
#endif
/*
* DisposeControlKeyFilterUPP()
*
* Availability:
* Non-Carbon CFM: available as macro/inline
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API_C( void )
DisposeControlKeyFilterUPP(ControlKeyFilterUPP userUPP);
#if !OPAQUE_UPP_TYPES
#ifdef __cplusplus
inline DEFINE_API_C(void) DisposeControlKeyFilterUPP(ControlKeyFilterUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
#else
#define DisposeControlKeyFilterUPP(userUPP) DisposeRoutineDescriptor(userUPP)
#endif
#endif
/*
* InvokeControlKeyFilterUPP()
*
* Availability:
* Non-Carbon CFM: available as macro/inline
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API_C( ControlKeyFilterResult )
InvokeControlKeyFilterUPP(
ControlRef theControl,
SInt16 * keyCode,
SInt16 * charCode,
EventModifiers * modifiers,
ControlKeyFilterUPP userUPP);
#if !OPAQUE_UPP_TYPES
#ifdef __cplusplus
inline DEFINE_API_C(ControlKeyFilterResult) InvokeControlKeyFilterUPP(ControlRef theControl, SInt16 * keyCode, SInt16 * charCode, EventModifiers * modifiers, ControlKeyFilterUPP userUPP) { return (ControlKeyFilterResult)CALL_FOUR_PARAMETER_UPP(userUPP, uppControlKeyFilterProcInfo, theControl, keyCode, charCode, modifiers); }
#else
#define InvokeControlKeyFilterUPP(theControl, keyCode, charCode, modifiers, userUPP) (ControlKeyFilterResult)CALL_FOUR_PARAMETER_UPP((userUPP), uppControlKeyFilterProcInfo, (theControl), (keyCode), (charCode), (modifiers))
#endif
#endif
#if CALL_NOT_IN_CARBON || OLDROUTINENAMES
/* support for pre-Carbon UPP routines: New...Proc and Call...Proc */
#define NewControlKeyFilterProc(userRoutine) NewControlKeyFilterUPP(userRoutine)
#define CallControlKeyFilterProc(userRoutine, theControl, keyCode, charCode, modifiers) InvokeControlKeyFilterUPP(theControl, keyCode, charCode, modifiers, userRoutine)
#endif /* CALL_NOT_IN_CARBON */
/*--------------------------------------------------------------------------------------*/
/* o DragGrayRgn Constatns */
/* */
/* For DragGrayRgnUPP used in TrackControl() */
/*--------------------------------------------------------------------------------------*/
enum {
noConstraint = kNoConstraint,
hAxisOnly = 1,
vAxisOnly = 2
};
/*--------------------------------------------------------------------------------------*/
/* o Control Creation/Deletion/Persistence */
/*--------------------------------------------------------------------------------------*/
/* CreateCustomControl is only available as part of Carbon */
enum {
kControlDefProcPtr = 0, /* raw proc-ptr based access*/
kControlDefObjectClass = 1 /* event-based definition (Mac OS X only)*/
};
typedef UInt32 ControlDefType;
struct ControlDefSpec {
ControlDefType defType;
union {
ControlDefUPP defProc;
void * classRef;
} u;
};
typedef struct ControlDefSpec ControlDefSpec;
/*
* CreateCustomControl()
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSStatus )
CreateCustomControl(
WindowRef owningWindow,
const Rect * contBounds,
const ControlDefSpec * def,
Collection initData,
ControlRef * outControl);
/*
* NewControl()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( ControlRef )
NewControl(
WindowRef owningWindow,
const Rect * boundsRect,
ConstStr255Param controlTitle,
Boolean initiallyVisible,
SInt16 initialValue,
SInt16 minimumValue,
SInt16 maximumValue,
SInt16 procID,
SInt32 controlReference) ONEWORDINLINE(0xA954);
/*
* GetNewControl()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( ControlRef )
GetNewControl(
SInt16 resourceID,
WindowRef owningWindow) ONEWORDINLINE(0xA9BE);
/*
* DisposeControl()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( void )
DisposeControl(ControlRef theControl) ONEWORDINLINE(0xA955);
/*
* KillControls()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( void )
KillControls(WindowRef theWindow) ONEWORDINLINE(0xA956);
/*--------------------------------------------------------------------------------------*/
/* o Control Definition Registration */
/*--------------------------------------------------------------------------------------*/
typedef CALLBACK_API( OSStatus , ControlCNTLToCollectionProcPtr )(const Rect *bounds, SInt16 value, Boolean visible, SInt16 max, SInt16 min, SInt16 procID, SInt32 refCon, ConstStr255Param title, Collection collection);
typedef STACK_UPP_TYPE(ControlCNTLToCollectionProcPtr) ControlCNTLToCollectionUPP;
/*
* NewControlCNTLToCollectionUPP()
*
* Availability:
* Non-Carbon CFM: available as macro/inline
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API_C( ControlCNTLToCollectionUPP )
NewControlCNTLToCollectionUPP(ControlCNTLToCollectionProcPtr userRoutine);
#if !OPAQUE_UPP_TYPES
enum { uppControlCNTLToCollectionProcInfo = 0x00FEA6F0 }; /* pascal 4_bytes Func(4_bytes, 2_bytes, 1_byte, 2_bytes, 2_bytes, 2_bytes, 4_bytes, 4_bytes, 4_bytes) */
#ifdef __cplusplus
inline DEFINE_API_C(ControlCNTLToCollectionUPP) NewControlCNTLToCollectionUPP(ControlCNTLToCollectionProcPtr userRoutine) { return (ControlCNTLToCollectionUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlCNTLToCollectionProcInfo, GetCurrentArchitecture()); }
#else
#define NewControlCNTLToCollectionUPP(userRoutine) (ControlCNTLToCollectionUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlCNTLToCollectionProcInfo, GetCurrentArchitecture())
#endif
#endif
/*
* DisposeControlCNTLToCollectionUPP()
*
* Availability:
* Non-Carbon CFM: available as macro/inline
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API_C( void )
DisposeControlCNTLToCollectionUPP(ControlCNTLToCollectionUPP userUPP);
#if !OPAQUE_UPP_TYPES
#ifdef __cplusplus
inline DEFINE_API_C(void) DisposeControlCNTLToCollectionUPP(ControlCNTLToCollectionUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
#else
#define DisposeControlCNTLToCollectionUPP(userUPP) DisposeRoutineDescriptor(userUPP)
#endif
#endif
/*
* InvokeControlCNTLToCollectionUPP()
*
* Availability:
* Non-Carbon CFM: available as macro/inline
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API_C( OSStatus )
InvokeControlCNTLToCollectionUPP(
const Rect * bounds,
SInt16 value,
Boolean visible,
SInt16 max,
SInt16 min,
SInt16 procID,
SInt32 refCon,
ConstStr255Param title,
Collection collection,
ControlCNTLToCollectionUPP userUPP);
#if !OPAQUE_UPP_TYPES
#ifdef __cplusplus
inline DEFINE_API_C(OSStatus) InvokeControlCNTLToCollectionUPP(const Rect * bounds, SInt16 value, Boolean visible, SInt16 max, SInt16 min, SInt16 procID, SInt32 refCon, ConstStr255Param title, Collection collection, ControlCNTLToCollectionUPP userUPP) { return (OSStatus)CALL_NINE_PARAMETER_UPP(userUPP, uppControlCNTLToCollectionProcInfo, bounds, value, visible, max, min, procID, refCon, title, collection); }
#else
#define InvokeControlCNTLToCollectionUPP(bounds, value, visible, max, min, procID, refCon, title, collection, userUPP) (OSStatus)CALL_NINE_PARAMETER_UPP((userUPP), uppControlCNTLToCollectionProcInfo, (bounds), (value), (visible), (max), (min), (procID), (refCon), (title), (collection))
#endif
#endif
#if CALL_NOT_IN_CARBON || OLDROUTINENAMES
/* support for pre-Carbon UPP routines: New...Proc and Call...Proc */
#define NewControlCNTLToCollectionProc(userRoutine) NewControlCNTLToCollectionUPP(userRoutine)
#define CallControlCNTLToCollectionProc(userRoutine, bounds, value, visible, max, min, procID, refCon, title, collection) InvokeControlCNTLToCollectionUPP(bounds, value, visible, max, min, procID, refCon, title, collection, userRoutine)
#endif /* CALL_NOT_IN_CARBON */
/*
* RegisterControlDefinition()
*
* Summary:
* Associates or dissociates a control definition with a virtual
* CDEF resource ID.
*
* Discussion:
* In GetNewControl or NewControl on Carbon, the Control Manager
* needs to know how to map the procID to a ControlDefSpec. With
* RegisterControlDefinition, your application can inform the
* Control Manager which ControlDefSpec to call when it sees a
* request to use a 'CDEF' of a particular resource ID. Since custom
* control definitions receive their initialization data in a
* Collection passed in the 'param' parameter, you must also provide
* a procedure to convert the bounds, min, max, and other parameters
* to NewControl into a Collection. If you don't provide a
* conversion proc, your control will receive an empty collection
* when it is sent the initialization message. If you want the
* value, min, visibility, etc. to be given to the control, you must
* add the appropriate tagged data to the collection. See the
* Control Collection Tags above. If you want to unregister a
* ControlDefSpec that you have already registered, call
* RegisterControlDefinition with the same CDEF resource ID, but
* pass NULL for the inControlDef parameter. In this situation,
* inConversionProc is effectively ignored.
*
* Parameters:
*
* inCDEFResID:
* The virtual CDEF resource ID to which you'd like to associate
* or dissociate the control definition.
*
* inControlDef:
* A pointer to a ControlDefSpec which represents the control
* definition you want to register, or NULL if you are attempting
* to unregister a control definition.
*
* inConversionProc:
* The conversion proc which will translate the NewControl
* parameters into a Collection.
*
* Result:
* An OSStatus code indicating success or failure.
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSStatus )
RegisterControlDefinition(
SInt16 inCDEFResID,
const ControlDefSpec * inControlDef,
ControlCNTLToCollectionUPP inConversionProc);
/*--------------------------------------------------------------------------------------*/
/* o Control Visible State */
/*--------------------------------------------------------------------------------------*/
/*
* HiliteControl()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( void )
HiliteControl(
ControlRef theControl,
ControlPartCode hiliteState) ONEWORDINLINE(0xA95D);
/*
* ShowControl()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( void )
ShowControl(ControlRef theControl) ONEWORDINLINE(0xA957);
/*
* HideControl()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( void )
HideControl(ControlRef theControl) ONEWORDINLINE(0xA958);
/* following state routines available only with Appearance 1.0 and later*/
/*
* IsControlActive()
*
* Availability:
* Non-Carbon CFM: in AppearanceLib 1.0 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( Boolean )
IsControlActive(ControlRef inControl) THREEWORDINLINE(0x303C, 0x0005, 0xAA73);
/*
* IsControlVisible()
*
* Availability:
* Non-Carbon CFM: in AppearanceLib 1.0 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( Boolean )
IsControlVisible(ControlRef inControl) THREEWORDINLINE(0x303C, 0x0006, 0xAA73);
/*
* ActivateControl()
*
* Availability:
* Non-Carbon CFM: in AppearanceLib 1.0 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSErr )
ActivateControl(ControlRef inControl) THREEWORDINLINE(0x303C, 0x0007, 0xAA73);
/*
* DeactivateControl()
*
* Availability:
* Non-Carbon CFM: in AppearanceLib 1.0 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSErr )
DeactivateControl(ControlRef inControl) THREEWORDINLINE(0x303C, 0x0008, 0xAA73);
/*
* SetControlVisibility()
*
* Availability:
* Non-Carbon CFM: in AppearanceLib 1.0 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSErr )
SetControlVisibility(
ControlRef inControl,
Boolean inIsVisible,
Boolean inDoDraw) THREEWORDINLINE(0x303C, 0x001E, 0xAA73);
/*--------------------------------------------------------------------------------------*/
/* o Control Imaging */
/*--------------------------------------------------------------------------------------*/
/*
* DrawControls()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( void )
DrawControls(WindowRef theWindow) ONEWORDINLINE(0xA969);
/*
* Draw1Control()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( void )
Draw1Control(ControlRef theControl) ONEWORDINLINE(0xA96D);
#define DrawOneControl(theControl) Draw1Control(theControl)
/*
* UpdateControls()
*
* Summary:
* Redraws the controls that intersect a specified region in a
* window.
*
* Parameters:
*
* inWindow:
* The window whose controls to redraw.
*
* inUpdateRegion:
* The region (in local coordinates) describing which controls to
* redraw. In Mac OS 10.1 and later, and in CarbonLib 1.5 and
* later, you may pass NULL for this parameter to redraw the
* controls intersecting the visible region of the window.
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( void )
UpdateControls(
WindowRef inWindow,
RgnHandle inUpdateRegion) /* can be NULL */ ONEWORDINLINE(0xA953);
/* following imaging routines available only with Appearance 1.0 and later*/
/*
* GetBestControlRect()
*
* Availability:
* Non-Carbon CFM: in AppearanceLib 1.0 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSErr )
GetBestControlRect(
ControlRef inControl,
Rect * outRect,
SInt16 * outBaseLineOffset) THREEWORDINLINE(0x303C, 0x001B, 0xAA73);
/*
* SetControlFontStyle()
*
* Availability:
* Non-Carbon CFM: in AppearanceLib 1.0 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSErr )
SetControlFontStyle(
ControlRef inControl,
const ControlFontStyleRec * inStyle) THREEWORDINLINE(0x303C, 0x001C, 0xAA73);
/*
* DrawControlInCurrentPort()
*
* Availability:
* Non-Carbon CFM: in AppearanceLib 1.0 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( void )
DrawControlInCurrentPort(ControlRef inControl) THREEWORDINLINE(0x303C, 0x0018, 0xAA73);
/*
* SetUpControlBackground()
*
* Summary:
* Applies the proper background color for the given control to the
* current port.
*
* Discussion:
* An embedding-savvy control which erases before drawing must
* ensure that its background color properly matches the body color
* of any parent controls on top of which it draws. This routine
* asks the Control Manager to determine and apply the proper
* background color to the current port. If a ControlColorProc has
* been provided for the given control, the proc will be called to
* set up the background color. If no proc exists, or if the proc
* returns a value other than noErr, the Control Manager ascends the
* parent chain for the given control looking for a control which
* has a special background (see the kControlHasSpecialBackground
* feature bit). The first such parent is asked to set up the
* background color (see the kControlMsgSetUpBackground message). If
* no such parent exists, the Control Manager applies any ThemeBrush
* which has been associated with the owning window (see
* SetThemeWindowBackground). Available in Appearance 1.0 (Mac OS
* 8), CarbonLib 1.0, Mac OS X, and later.
*
* Parameters:
*
* inControl:
* The ControlRef that wants to erase.
*
* inDepth:
* A short integer indicating the color depth of the device onto
* which drawing will take place.
*
* inIsColorDevice:
* A Boolean indicating whether the draw device is a color device.
*
* Result:
* An OSStatus code indicating success or failure. The most likely
* error is a controlHandleInvalidErr, resulting from a bad
* ControlRef. Any non-noErr result indicates that the color set up
* failed, and that the caller should probably give up its attempt
* to draw.
*
* Availability:
* Non-Carbon CFM: in AppearanceLib 1.0 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSErr )
SetUpControlBackground(
ControlRef inControl,
SInt16 inDepth,
Boolean inIsColorDevice) THREEWORDINLINE(0x303C, 0x001D, 0xAA73);
/*
* SetUpControlTextColor()
*
* Summary:
* Applies the proper text color for the given control to the
* current port.
*
* Discussion:
* An embedding-savvy control which draws text must ensure that its
* text color properly contrasts the background on which it draws.
* This routine asks the Control Manager to determine and apply the
* proper text color to the current port. If a ControlColorProc has
* been provided for the given control, the proc will be called to
* set up the text color. If no proc exists, or if the proc returns
* a value other than noErr, the Control Manager ascends the parent
* chain for the given control looking for a control which has a
* special background (see the kControlHasSpecialBackground feature
* bit). The first such parent is asked to set up the text color
* (see the kControlMsgApplyTextColor message). If no such parent
* exists, the Control Manager chooses a text color which contrasts
* any ThemeBrush which has been associated with the owning window
* (see SetThemeWindowBackground). Available in Appearance 1.1 (Mac
* OS 8.5), CarbonLib 1.0, Mac OS X, and later.
*
* Parameters:
*
* inControl:
* The ControlRef that wants to draw text.
*
* inDepth:
* A short integer indicating the color depth of the device onto
* which drawing will take place.
*
* inIsColorDevice:
* A Boolean indicating whether the draw device is a color device.
*
* Result:
* An OSStatus code indicating success or failure. The most likely
* error is a controlHandleInvalidErr, resulting from a bad
* ControlRef. Any non-noErr result indicates that the color set up
* failed, and that the caller should probably give up its attempt
* to draw.
*
* Availability:
* Non-Carbon CFM: in ControlsLib 8.5 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSErr )
SetUpControlTextColor(
ControlRef inControl,
SInt16 inDepth,
Boolean inIsColorDevice);
/*
* ControlColorProcPtr
*
* Discussion:
* Callback allowing clients to specify/override the background
* color and text color that a Control will use during drawing. Your
* procedure should make the color changes to the current port. See
* SetControlColorProc, SetUpControlBackground, and
* SetUpControlTextColor for more information. Available on Mac OS
* 8.5, CarbonLib 1.1, Mac OS X, and later.
*
* Parameters:
*
* inControl:
* A reference to the Control for whom your proc is setting up
* colors.
*
* inMessage:
* A ControlDefProcMessage indicating what sort of color your
* procedure should set up. It will be either
* kControlMsgApplyTextColor or kControlMsgSetUpBackground.
* kControlMsgApplyTextColor is a request to set up the
* appropriate text color (by setting the current port's
* foreground color, pen information, etc.).
* kControlMsgSetUpBackground is a request to set up the
* appropriate background color (the current port's background
* color, pattern, etc.).
*
* inDrawDepth:
* A short integer indicating the bit depth of the device into
* which the Control is drawing. The bit depth is typically passed
* in as a result of someone someone trying to draw properly
* across multiple monitors with different bit depths. If your
* procedure wants to handle proper color set up based on bit
* depth, it should use this parameter to help decide what color
* to apply.
*
* inDrawInColor:
* A Boolean indicating whether or not the device that the Control
* is drawing into is a color device. The value is typically
* passed in as a result of someone trying to draw properly across
* multiple monitors which may or may not be color devices. If
* your procedure wants to handle proper color set up for both
* color and grayscale devices, it should use this parameter to
* help decide what color to apply.
*
* Result:
* An OSStatus code indicating success or failure. Returning noErr
* is an indication that your proc completely handled the color set
* up. If you return any other value, the Control Manager will fall
* back to the normal color set up mechanism.
*/
typedef CALLBACK_API( OSStatus , ControlColorProcPtr )(ControlRef inControl, SInt16 inMessage, SInt16 inDrawDepth, Boolean inDrawInColor);
typedef STACK_UPP_TYPE(ControlColorProcPtr) ControlColorUPP;
/*
* NewControlColorUPP()
*
* Availability:
* Non-Carbon CFM: available as macro/inline
* CarbonLib: in CarbonLib 1.1 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API_C( ControlColorUPP )
NewControlColorUPP(ControlColorProcPtr userRoutine);
#if !OPAQUE_UPP_TYPES
enum { uppControlColorProcInfo = 0x00001AF0 }; /* pascal 4_bytes Func(4_bytes, 2_bytes, 2_bytes, 1_byte) */
#ifdef __cplusplus
inline DEFINE_API_C(ControlColorUPP) NewControlColorUPP(ControlColorProcPtr userRoutine) { return (ControlColorUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlColorProcInfo, GetCurrentArchitecture()); }
#else
#define NewControlColorUPP(userRoutine) (ControlColorUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlColorProcInfo, GetCurrentArchitecture())
#endif
#endif
/*
* DisposeControlColorUPP()
*
* Availability:
* Non-Carbon CFM: available as macro/inline
* CarbonLib: in CarbonLib 1.1 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API_C( void )
DisposeControlColorUPP(ControlColorUPP userUPP);
#if !OPAQUE_UPP_TYPES
#ifdef __cplusplus
inline DEFINE_API_C(void) DisposeControlColorUPP(ControlColorUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
#else
#define DisposeControlColorUPP(userUPP) DisposeRoutineDescriptor(userUPP)
#endif
#endif
/*
* InvokeControlColorUPP()
*
* Availability:
* Non-Carbon CFM: available as macro/inline
* CarbonLib: in CarbonLib 1.1 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API_C( OSStatus )
InvokeControlColorUPP(
ControlRef inControl,
SInt16 inMessage,
SInt16 inDrawDepth,
Boolean inDrawInColor,
ControlColorUPP userUPP);
#if !OPAQUE_UPP_TYPES
#ifdef __cplusplus
inline DEFINE_API_C(OSStatus) InvokeControlColorUPP(ControlRef inControl, SInt16 inMessage, SInt16 inDrawDepth, Boolean inDrawInColor, ControlColorUPP userUPP) { return (OSStatus)CALL_FOUR_PARAMETER_UPP(userUPP, uppControlColorProcInfo, inControl, inMessage, inDrawDepth, inDrawInColor); }
#else
#define InvokeControlColorUPP(inControl, inMessage, inDrawDepth, inDrawInColor, userUPP) (OSStatus)CALL_FOUR_PARAMETER_UPP((userUPP), uppControlColorProcInfo, (inControl), (inMessage), (inDrawDepth), (inDrawInColor))
#endif
#endif
#if CALL_NOT_IN_CARBON || OLDROUTINENAMES
/* support for pre-Carbon UPP routines: New...Proc and Call...Proc */
#define NewControlColorProc(userRoutine) NewControlColorUPP(userRoutine)
#define CallControlColorProc(userRoutine, inControl, inMessage, inDrawDepth, inDrawInColor) InvokeControlColorUPP(inControl, inMessage, inDrawDepth, inDrawInColor, userRoutine)
#endif /* CALL_NOT_IN_CARBON */
/*
* SetControlColorProc()
*
* Summary:
* Associates a ControlColorUPP with a given Control, thereby
* allowing you to bypass the embedding hierarchy-based color setup
* of SetUpControlBackground/SetUpControlTextColor and replace it
* with your own.
*
* Discussion:
* Before an embedded Control can erase, it calls
* SetUpControlBackground to have its background color set up by any
* parent controls. Similarly, any Control which draws text calls
* SetUpControlTextColor to have the appropriate text color set up.
* This allows certain controls (such as Tabs and Placards) to offer
* special backgrounds and text colors for any child controls. By
* default, the SetUp routines only move up the Control Manager
* embedding hierarchy looking for a parent which has a special
* background. This is fine in a plain vanilla embedding case, but
* many application frameworks find it troublesome; if there are
* interesting views between two Controls in the embedding
* hierarchy, the framework needs to be in charge of the background
* and text colors, otherwise drawing defects will occur. You can
* only associate a single color proc with a given ControlRef.
* Available on Mac OS 8.5, CarbonLib 1.1, Mac OS X, and later.
*
* Parameters:
*
* inControl:
* The ControlRef with whom the color proc should be associated.
*
* inProc:
* The color proc to associate with the ControlRef. If you pass
* NULL, the ControlRef will be dissociated from any previously
* installed color proc.
*
* Result:
* An OSStatus code indicating success or failure. The most likely
* error is a controlHandleInvalidErr resulting from a bad
* ControlRef.
*
* Availability:
* Non-Carbon CFM: in ControlsLib 8.5 and later
* CarbonLib: in CarbonLib 1.1 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSStatus )
SetControlColorProc(
ControlRef inControl,
ControlColorUPP inProc);
/*--------------------------------------------------------------------------------------*/
/* o Control Mousing */
/*--------------------------------------------------------------------------------------*/
/*
NOTE ON CONTROL ACTION PROCS
When using the TrackControl() call when tracking an indicator, the actionProc parameter
(type ControlActionUPP) should be replaced by a parameter of type DragGrayRgnUPP
(see Quickdraw.h).
If, however, you are using the live feedback variants of scroll bars or sliders, you
must pass a ControlActionUPP in when tracking the indicator as well. This functionality
is available in Appearance 1.0 or later.
*/
/*
* TrackControl()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( ControlPartCode )
TrackControl(
ControlRef theControl,
Point startPoint,
ControlActionUPP actionProc) /* can be NULL */ ONEWORDINLINE(0xA968);
/*
* DragControl()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( void )
DragControl(
ControlRef theControl,
Point startPoint,
const Rect * limitRect,
const Rect * slopRect,
DragConstraint axis) ONEWORDINLINE(0xA967);
/*
* TestControl()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( ControlPartCode )
TestControl(
ControlRef theControl,
Point testPoint) ONEWORDINLINE(0xA966);
/*
* FindControl()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( ControlPartCode )
FindControl(
Point testPoint,
WindowRef theWindow,
ControlRef * theControl) ONEWORDINLINE(0xA96C);
/* The following mousing routines available only with Appearance 1.0 and later */
/* */
/* HandleControlClick is preferable to TrackControl when running under */
/* Appearance 1.0 as you can pass in modifiers, which some of the new controls */
/* use, such as edit text and list boxes. */
/* NOTE: Passing NULL for the outPart parameter of FindControlUnderMouse is only*/
/* supported in systems later than 10.1.x */
/*
* FindControlUnderMouse()
*
* Availability:
* Non-Carbon CFM: in AppearanceLib 1.0 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( ControlRef )
FindControlUnderMouse(
Point inWhere,
WindowRef inWindow,
ControlPartCode * outPart) /* can be NULL */ THREEWORDINLINE(0x303C, 0x0009, 0xAA73);
/*
* HandleControlClick()
*
* Availability:
* Non-Carbon CFM: in AppearanceLib 1.0 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( ControlPartCode )
HandleControlClick(
ControlRef inControl,
Point inWhere,
EventModifiers inModifiers,
ControlActionUPP inAction) /* can be NULL */ THREEWORDINLINE(0x303C, 0x000A, 0xAA73);
/* Contextual Menu support in the Control Manager is only available on Carbon. */
/* If the control didn't display a contextual menu (possibly because the point */
/* was in a non-interesting part), the menuDisplayed output parameter will be */
/* false. If the control did display a menu, menuDisplayed will be true. */
/* This in on Carbon only */
/*
* HandleControlContextualMenuClick()
*
* Availability:
* Non-Carbon CFM: in ControlsLib 9.0 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSStatus )
HandleControlContextualMenuClick(
ControlRef inControl,
Point inWhere,
Boolean * menuDisplayed);
/* Some complex controls (like Data Browser) require proper sequencing of */
/* window activation and click processing. In some cases, the control might */
/* want the window to be left inactive yet still handle the click, or vice- */
/* versa. The GetControlClickActivation routine lets a control client ask the */
/* control how it wishes to behave for a particular click. */
/* This in on Carbon only. */
/*
* GetControlClickActivation()
*
* Availability:
* Non-Carbon CFM: in ControlsLib 9.0 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSStatus )
GetControlClickActivation(
ControlRef inControl,
Point inWhere,
EventModifiers inModifiers,
ClickActivationResult * outResult);
/*--------------------------------------------------------------------------------------*/
/* o Control Events (available only with Appearance 1.0 and later) */
/*--------------------------------------------------------------------------------------*/
/*
* HandleControlKey()
*
* Availability:
* Non-Carbon CFM: in AppearanceLib 1.0 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( ControlPartCode )
HandleControlKey(
ControlRef inControl,
SInt16 inKeyCode,
SInt16 inCharCode,
EventModifiers inModifiers) THREEWORDINLINE(0x303C, 0x000B, 0xAA73);
/*
* IdleControls()
*
* Availability:
* Non-Carbon CFM: in AppearanceLib 1.0 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( void )
IdleControls(WindowRef inWindow) THREEWORDINLINE(0x303C, 0x000C, 0xAA73);
/*--------------------------------------------------------------------------------------*/
/* o Control Mouse Tracking (available with Carbon) */
/*--------------------------------------------------------------------------------------*/
/* The HandleControlSetCursor routine requests that a given control set the cursor to */
/* something appropriate based on the mouse location. */
/* If the control didn't want to set the cursor (because the point was in a */
/* non-interesting part), the cursorWasSet output parameter will be false. If the */
/* control did set the cursor, cursorWasSet will be true. */
/* Carbon only. */
/*
* HandleControlSetCursor()
*
* Availability:
* Non-Carbon CFM: in ControlsLib 9.0 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSStatus )
HandleControlSetCursor(
ControlRef control,
Point localPoint,
EventModifiers modifiers,
Boolean * cursorWasSet);
/*--------------------------------------------------------------------------------------*/
/* o Control Positioning */
/*--------------------------------------------------------------------------------------*/
/*
* MoveControl()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( void )
MoveControl(
ControlRef theControl,
SInt16 h,
SInt16 v) ONEWORDINLINE(0xA959);
/*
* SizeControl()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( void )
SizeControl(
ControlRef theControl,
SInt16 w,
SInt16 h) ONEWORDINLINE(0xA95C);
/*--------------------------------------------------------------------------------------*/
/* o Control Title */
/*--------------------------------------------------------------------------------------*/
/*
* SetControlTitle()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( void )
SetControlTitle(
ControlRef theControl,
ConstStr255Param title) ONEWORDINLINE(0xA95F);
/*
* GetControlTitle()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( void )
GetControlTitle(
ControlRef theControl,
Str255 title) ONEWORDINLINE(0xA95E);
/*--------------------------------------------------------------------------------------*/
/* o Control Value */
/*--------------------------------------------------------------------------------------*/
/*
* GetControlValue()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( SInt16 )
GetControlValue(ControlRef theControl) ONEWORDINLINE(0xA960);
/*
* SetControlValue()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( void )
SetControlValue(
ControlRef theControl,
SInt16 newValue) ONEWORDINLINE(0xA963);
/*
* GetControlMinimum()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( SInt16 )
GetControlMinimum(ControlRef theControl) ONEWORDINLINE(0xA961);
/*
* SetControlMinimum()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( void )
SetControlMinimum(
ControlRef theControl,
SInt16 newMinimum) ONEWORDINLINE(0xA964);
/*
* GetControlMaximum()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( SInt16 )
GetControlMaximum(ControlRef theControl) ONEWORDINLINE(0xA962);
/*
* SetControlMaximum()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( void )
SetControlMaximum(
ControlRef theControl,
SInt16 newMaximum) ONEWORDINLINE(0xA965);
/* proportional scrolling/32-bit value support is new with Appearance 1.1*/
/*
* GetControlViewSize()
*
* Availability:
* Non-Carbon CFM: in ControlsLib 8.5 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( SInt32 )
GetControlViewSize(ControlRef theControl);
/*
* SetControlViewSize()
*
* Availability:
* Non-Carbon CFM: in ControlsLib 8.5 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( void )
SetControlViewSize(
ControlRef theControl,
SInt32 newViewSize);
/*
* GetControl32BitValue()
*
* Availability:
* Non-Carbon CFM: in ControlsLib 8.5 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( SInt32 )
GetControl32BitValue(ControlRef theControl);
/*
* SetControl32BitValue()
*
* Availability:
* Non-Carbon CFM: in ControlsLib 8.5 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( void )
SetControl32BitValue(
ControlRef theControl,
SInt32 newValue);
/*
* GetControl32BitMaximum()
*
* Availability:
* Non-Carbon CFM: in ControlsLib 8.5 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( SInt32 )
GetControl32BitMaximum(ControlRef theControl);
/*
* SetControl32BitMaximum()
*
* Availability:
* Non-Carbon CFM: in ControlsLib 8.5 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( void )
SetControl32BitMaximum(
ControlRef theControl,
SInt32 newMaximum);
/*
* GetControl32BitMinimum()
*
* Availability:
* Non-Carbon CFM: in ControlsLib 8.5 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( SInt32 )
GetControl32BitMinimum(ControlRef theControl);
/*
* SetControl32BitMinimum()
*
* Availability:
* Non-Carbon CFM: in ControlsLib 8.5 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( void )
SetControl32BitMinimum(
ControlRef theControl,
SInt32 newMinimum);
/*
IsValidControlHandle will tell you if the handle you pass in belongs to a control
the Control Manager knows about. It does not sanity check the data in the control.
*/
/*
* IsValidControlHandle()
*
* Availability:
* Non-Carbon CFM: in ControlsLib 8.5 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( Boolean )
IsValidControlHandle(ControlRef theControl);
/*--------------------------------------------------------------------------------------*/
/* o Control IDs */
/* Carbon only. */
/*--------------------------------------------------------------------------------------*/
struct ControlID {
OSType signature;
SInt32 id;
};
typedef struct ControlID ControlID;
/*
* SetControlID()
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSStatus )
SetControlID(
ControlRef inControl,
const ControlID * inID);
/*
* GetControlID()
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSStatus )
GetControlID(
ControlRef inControl,
ControlID * outID);
/*
* GetControlByID()
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSStatus )
GetControlByID(
WindowRef inWindow,
const ControlID * inID,
ControlRef * outControl);
/*--------------------------------------------------------------------------------------*/
/* o Control Command IDs */
/* Carbon only. */
/*--------------------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------------------*/
/* o Control Identification */
/* Carbon only. */
/*--------------------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------------------*/
/* o Properties */
/*--------------------------------------------------------------------------------------*/
enum {
kControlPropertyPersistent = 0x00000001 /* whether this property gets saved when flattening the control*/
};
/*
* GetControlProperty()
*
* Availability:
* Non-Carbon CFM: in ControlsLib 8.5 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSStatus )
GetControlProperty(
ControlRef control,
OSType propertyCreator,
OSType propertyTag,
UInt32 bufferSize,
UInt32 * actualSize, /* can be NULL */
void * propertyBuffer);
/*
* GetControlPropertySize()
*
* Availability:
* Non-Carbon CFM: in ControlsLib 8.5 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSStatus )
GetControlPropertySize(
ControlRef control,
OSType propertyCreator,
OSType propertyTag,
UInt32 * size);
/*
* SetControlProperty()
*
* Availability:
* Non-Carbon CFM: in ControlsLib 8.5 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSStatus )
SetControlProperty(
ControlRef control,
OSType propertyCreator,
OSType propertyTag,
UInt32 propertySize,
const void * propertyData);
/*
* RemoveControlProperty()
*
* Availability:
* Non-Carbon CFM: in ControlsLib 8.5 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSStatus )
RemoveControlProperty(
ControlRef control,
OSType propertyCreator,
OSType propertyTag);
/*
* GetControlPropertyAttributes()
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSStatus )
GetControlPropertyAttributes(
ControlRef control,
OSType propertyCreator,
OSType propertyTag,
UInt32 * attributes);
/*
* ChangeControlPropertyAttributes()
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSStatus )
ChangeControlPropertyAttributes(
ControlRef control,
OSType propertyCreator,
OSType propertyTag,
UInt32 attributesToSet,
UInt32 attributesToClear);
/*--------------------------------------------------------------------------------------*/
/* o Control Regions (Appearance 1.1 or later) */
/* */
/* See the discussion on meta-parts in this header for more information */
/*--------------------------------------------------------------------------------------*/
/*
* GetControlRegion()
*
* Availability:
* Non-Carbon CFM: in ControlsLib 8.5 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSStatus )
GetControlRegion(
ControlRef inControl,
ControlPartCode inPart,
RgnHandle outRegion);
/*--------------------------------------------------------------------------------------*/
/* o Control Variant */
/*--------------------------------------------------------------------------------------*/
/*
* GetControlVariant()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( ControlVariant )
GetControlVariant(ControlRef theControl) ONEWORDINLINE(0xA809);
/*--------------------------------------------------------------------------------------*/
/* o Control Action */
/*--------------------------------------------------------------------------------------*/
/*
* SetControlAction()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( void )
SetControlAction(
ControlRef theControl,
ControlActionUPP actionProc) ONEWORDINLINE(0xA96B);
/*
* GetControlAction()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( ControlActionUPP )
GetControlAction(ControlRef theControl) ONEWORDINLINE(0xA96A);
/*--------------------------------------------------------------------------------------*/
/* o Control Accessors */
/*--------------------------------------------------------------------------------------*/
/*
* SetControlReference()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( void )
SetControlReference(
ControlRef theControl,
SInt32 data) ONEWORDINLINE(0xA95B);
/*
* GetControlReference()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( SInt32 )
GetControlReference(ControlRef theControl) ONEWORDINLINE(0xA95A);
#if !OPAQUE_TOOLBOX_STRUCTS
#if CALL_NOT_IN_CARBON
/*
* GetAuxiliaryControlRecord()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: not available
* Mac OS X: not available
*/
EXTERN_API( Boolean )
GetAuxiliaryControlRecord(
ControlRef theControl,
AuxCtlHandle * acHndl) ONEWORDINLINE(0xAA44);
#endif /* CALL_NOT_IN_CARBON */
#endif /* !OPAQUE_TOOLBOX_STRUCTS */
#if CALL_NOT_IN_CARBON
/*
* SetControlColor()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: not available
* Mac OS X: not available
*/
EXTERN_API( void )
SetControlColor(
ControlRef theControl,
CCTabHandle newColorTable) ONEWORDINLINE(0xAA43);
/*--------------------------------------------------------------------------------------*/
/* o Control Hierarchy (Appearance 1.0 and later only) */
/*--------------------------------------------------------------------------------------*/
#endif /* CALL_NOT_IN_CARBON */
/*
* SendControlMessage()
*
* Availability:
* Non-Carbon CFM: in AppearanceLib 1.0 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( SInt32 )
SendControlMessage(
ControlRef inControl,
SInt16 inMessage,
void * inParam) THREEWORDINLINE(0x303C, 0xFFFE, 0xAA73);
/*
* DumpControlHierarchy()
*
* Availability:
* Non-Carbon CFM: in AppearanceLib 1.0 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSErr )
DumpControlHierarchy(
WindowRef inWindow,
const FSSpec * inDumpFile) THREEWORDINLINE(0x303C, 0xFFFF, 0xAA73);
/*
* CreateRootControl()
*
* Summary:
* Creates a new root control for a window.
*
* Parameters:
*
* inWindow:
* The window for which to create a root control.
*
* outControl:
* On exit, contains the window's root control. In Mac OS 10.1 and
* CarbonLib 1.5 and later, this parameter may be NULL if you
* don't need the ControlRef.
*
* Result:
* A result code indicating success or failure. errRootAlreadyExists
* is returned if the window already has a root control.
*
* Availability:
* Non-Carbon CFM: in AppearanceLib 1.0 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSErr )
CreateRootControl(
WindowRef inWindow,
ControlRef * outControl) /* can be NULL */ THREEWORDINLINE(0x303C, 0x0001, 0xAA73);
/*
* GetRootControl()
*
* Availability:
* Non-Carbon CFM: in AppearanceLib 1.0 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSErr )
GetRootControl(
WindowRef inWindow,
ControlRef * outControl) THREEWORDINLINE(0x303C, 0x0002, 0xAA73);
/*
* EmbedControl()
*
* Availability:
* Non-Carbon CFM: in AppearanceLib 1.0 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSErr )
EmbedControl(
ControlRef inControl,
ControlRef inContainer) THREEWORDINLINE(0x303C, 0x0003, 0xAA73);
/*
* AutoEmbedControl()
*
* Availability:
* Non-Carbon CFM: in AppearanceLib 1.0 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSErr )
AutoEmbedControl(
ControlRef inControl,
WindowRef inWindow) THREEWORDINLINE(0x303C, 0x0004, 0xAA73);
/*
* GetSuperControl()
*
* Availability:
* Non-Carbon CFM: in AppearanceLib 1.0 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSErr )
GetSuperControl(
ControlRef inControl,
ControlRef * outParent) THREEWORDINLINE(0x303C, 0x0015, 0xAA73);
/*
* CountSubControls()
*
* Availability:
* Non-Carbon CFM: in AppearanceLib 1.0 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSErr )
CountSubControls(
ControlRef inControl,
UInt16 * outNumChildren) THREEWORDINLINE(0x303C, 0x0016, 0xAA73);
/*
* GetIndexedSubControl()
*
* Availability:
* Non-Carbon CFM: in AppearanceLib 1.0 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSErr )
GetIndexedSubControl(
ControlRef inControl,
UInt16 inIndex,
ControlRef * outSubControl) THREEWORDINLINE(0x303C, 0x0017, 0xAA73);
/*
* SetControlSupervisor()
*
* Availability:
* Non-Carbon CFM: in AppearanceLib 1.0 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSErr )
SetControlSupervisor(
ControlRef inControl,
ControlRef inBoss) THREEWORDINLINE(0x303C, 0x001A, 0xAA73);
/*--------------------------------------------------------------------------------------*/
/* o Keyboard Focus (available only with Appearance 1.0 and later) */
/*--------------------------------------------------------------------------------------*/
/*
* GetKeyboardFocus()
*
* Discussion:
* Passes back the currently focused control within the given window.
*
* Parameters:
*
* inWindow:
* The window to get the focus of.
*
* outControl:
* On output, this will contain the ControlRef that is currently
* focused in the given window. If there is no currently focused
* control, outControl will contain NULL.
*
* Result:
* An operating system result code.
*
* Availability:
* Non-Carbon CFM: in AppearanceLib 1.0 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSErr )
GetKeyboardFocus(
WindowRef inWindow,
ControlRef * outControl) THREEWORDINLINE(0x303C, 0x000D, 0xAA73);
/*
* SetKeyboardFocus()
*
* Discussion:
* Focuses the given part of the given control in a particular
* window. If another control is currently focused in the window,
* focus will be removed from the other control before focus is
* given to the desired control. SetKeyboardFocus respects the full
* keyboard navigation mode.
*
* Parameters:
*
* inWindow:
* The window which contains the control you want to focus. If the
* window does not contain the control, an error will be returned.
*
* inControl:
* The control you want to focus.
*
* inPart:
* The part of the control you wish to focus. You may pass
* kControlFocusNoPart to clear the focus in the given control.
* You may pass kControlFocusNextPart or kControlFocusPrevPart to
* move the focus within the given control.
*
* Result:
* An operating system result code.
*
* Availability:
* Non-Carbon CFM: in AppearanceLib 1.0 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSErr )
SetKeyboardFocus(
WindowRef inWindow,
ControlRef inControl,
ControlFocusPart inPart) THREEWORDINLINE(0x303C, 0x000E, 0xAA73);
/*
* AdvanceKeyboardFocus()
*
* Discussion:
* Advances the focus to the next most appropriate control. Unless
* overriden in some fashion (either by overriding certain carbon
* events or using the HIViewSetNextFocus API), the Toolbox will use
* a spacially determinant method of focusing, attempting to focus
* left to right, top to bottom in a window, taking groups of
* controls into account. AdvanceKeyboardFocus does not respect the
* full keyboard navigation mode. It will only advance the focus
* between traditionally focusable controls. If you want to advance
* the focus in a way that respects the full keyboard navigation
* mode, use the HIViewAdvanceFocus API.
*
* Parameters:
*
* inWindow:
* The window to advance the focus in.
*
* Result:
* An operating system result code.
*
* Availability:
* Non-Carbon CFM: in AppearanceLib 1.0 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSErr )
AdvanceKeyboardFocus(WindowRef inWindow) THREEWORDINLINE(0x303C, 0x000F, 0xAA73);
/*
* ReverseKeyboardFocus()
*
* Discussion:
* Reverses the focus to the next most appropriate control. Unless
* overriden in some fashion (either by overriding certain carbon
* events or using the HIViewSetNextFocus API), the Toolbox will use
* a spacially determinant method of focusing, attempting to focus
* left to right, top to bottom in a window, taking groups of
* controls into account. ReverseKeyboardFocus does not respect the
* full keyboard navigation mode. It will only reverse the focus
* between traditionally focusable controls. If you want to reverse
* the focus in a way that respects the full keyboard navigation
* mode, use the HIViewAdvanceFocus API.
*
* Parameters:
*
* inWindow:
* The window to reverse the focus in.
*
* Result:
* An operating system result code.
*
* Availability:
* Non-Carbon CFM: in AppearanceLib 1.0 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSErr )
ReverseKeyboardFocus(WindowRef inWindow) THREEWORDINLINE(0x303C, 0x0010, 0xAA73);
/*
* ClearKeyboardFocus()
*
* Discussion:
* Clears focus from the currently focused control in a given
* window. The window will be left such that no control is focused
* within it.
*
* Parameters:
*
* inWindow:
* The window that you want to clear the focus in.
*
* Result:
* An operating system result code.
*
* Availability:
* Non-Carbon CFM: in AppearanceLib 1.0 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSErr )
ClearKeyboardFocus(WindowRef inWindow) THREEWORDINLINE(0x303C, 0x0019, 0xAA73);
/*--------------------------------------------------------------------------------------*/
/* o Control Data (available only with Appearance 1.0 and later) */
/*--------------------------------------------------------------------------------------*/
/*
* GetControlFeatures()
*
* Availability:
* Non-Carbon CFM: in AppearanceLib 1.0 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSErr )
GetControlFeatures(
ControlRef inControl,
UInt32 * outFeatures) THREEWORDINLINE(0x303C, 0x0011, 0xAA73);
/*
* SetControlData()
*
* Availability:
* Non-Carbon CFM: in AppearanceLib 1.0 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSErr )
SetControlData(
ControlRef inControl,
ControlPartCode inPart,
ResType inTagName,
Size inSize,
const void * inData) THREEWORDINLINE(0x303C, 0x0012, 0xAA73);
/*
* GetControlData()
*
* Availability:
* Non-Carbon CFM: in AppearanceLib 1.0 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSErr )
GetControlData(
ControlRef inControl,
ControlPartCode inPart,
ResType inTagName,
Size inBufferSize,
void * inBuffer,
Size * outActualSize) /* can be NULL */ THREEWORDINLINE(0x303C, 0x0013, 0xAA73);
/*
* GetControlDataSize()
*
* Availability:
* Non-Carbon CFM: in AppearanceLib 1.0 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSErr )
GetControlDataSize(
ControlRef inControl,
ControlPartCode inPart,
ResType inTagName,
Size * outMaxSize) THREEWORDINLINE(0x303C, 0x0014, 0xAA73);
/*--------------------------------------------------------------------------------------*/
/* o Control Drag & Drop */
/* Carbon only. */
/*--------------------------------------------------------------------------------------*/
/*
* Discussion:
* DragTrackingMessage values for use with HandleControlDragTracking.
*/
enum {
/*
* The drag was previously outside the control and it just now
* entered the control.
*/
kDragTrackingEnterControl = 2,
/*
* The drag was previously inside the control and it is still inside
* the control.
*/
kDragTrackingInControl = 3,
/*
* The drag was previously inside the control and it just now left
* the control.
*/
kDragTrackingLeaveControl = 4
};
/*
* HandleControlDragTracking()
*
* Summary:
* Tells a control to respond visually to a drag.
*
* Discussion:
* Call HandleControlDragTracking when a drag is above a control in
* your window and you want to give that control a chance to draw
* appropriately in response to the drag. Note that in order for a
* control to have any chance of responding to this API, you must
* enable the control's drag and drop support with
* SetControlDragTrackingEnabled.
*
* Parameters:
*
* inControl:
* The control the drag is over. Most controls won't track drags
* unless you enable drag tracking on it with
* SetControlDragTrackingEnabled.
*
* inMessage:
* A drag message indicating the state of the drag above the
* control. The meaning of the value you pass in must be relative
* to the control, not the whole window. For when the drag first
* enters the control, you should pass kDragTrackingEnterControl.
* While the drag stays within the control, pass
* kDragTrackingInControl. When the drag leaves the control, pass
* kDragTrackingLeaveControl.
*
* inDrag:
* The drag reference that is over the control.
*
* outLikesDrag:
* On output, this will be a boolean indicating whether the
* control "likes" the drag. A control "likes" the drag if the
* data in the drag ref can be accepted by the control. If the
* control does not like the drag, don't bother calling
* HandleControlDragReceive if the user drops the dragged object
* onto the control.
*
* Result:
* A result code indicating success or failure.
*
* Availability:
* Non-Carbon CFM: in ControlsLib 9.0 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSStatus )
HandleControlDragTracking(
ControlRef inControl,
DragTrackingMessage inMessage,
DragReference inDrag,
Boolean * outLikesDrag);
/*
* HandleControlDragReceive()
*
* Summary:
* Tells a control to accept the data in drag reference.
*
* Discussion:
* Call HandleControlDragReceive when the user dropped a drag on a
* control in your window. This gives the control the opportunity to
* pull any interesting data out of the drag and insert the data
* into itself. Note that in order for a control to have any chance
* of responding to this API, you must enable the control's drag and
* drop support with SetControlDragTrackingEnabled.
*
* Parameters:
*
* inControl:
* The control who should accept the data. Most controls won't
* accept drags unless you enable drag tracking on it with
* SetControlDragTrackingEnabled.
*
* inDrag:
* The drag reference that was dropped on the control.
*
* Result:
* A result code indicating success or failure.
*
* Availability:
* Non-Carbon CFM: in ControlsLib 9.0 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSStatus )
HandleControlDragReceive(
ControlRef inControl,
DragReference inDrag);
/*
* SetControlDragTrackingEnabled()
*
* Summary:
* Tells a control that it should track and receive drags.
*
* Discussion:
* Call SetControlDragTrackingEnabled to turn enable a control's
* support for drag and drop. Controls won't track drags unless you
* first turn on drag and drop support with this API. Some controls
* don't support drag and drop at all; these controls won't track or
* receive drags even if you call this API with true.
*
* Parameters:
*
* inControl:
* The control whose drag tracking enabled state you'd like to set.
*
* inTracks:
* A Boolean indicating whether you want this control to track and
* receive drags.
*
* Result:
* A result code indicating success or failure.
*
* Availability:
* Non-Carbon CFM: in ControlsLib 9.0 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSStatus )
SetControlDragTrackingEnabled(
ControlRef inControl,
Boolean inTracks);
/*
* IsControlDragTrackingEnabled()
*
* Summary:
* Tells you whether a control's drag track and receive support is
* enabled.
*
* Discussion:
* Call IsControlDragTrackingEnabled to query a whether a control's
* drag and drop support is enabled. Some controls don't support
* drag and drop at all; these controls won't track or receive drags
* even if you call this API and see a true output value.
*
* Parameters:
*
* inControl:
* The control whose drag tracking enabled state you'd like to
* query.
*
* outTracks:
* On output, this will contain a Boolean value whether the
* control's drag and drop support is enabled.
*
* Result:
* A result code indicating success or failure.
*
* Availability:
* Non-Carbon CFM: in ControlsLib 9.0 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSStatus )
IsControlDragTrackingEnabled(
ControlRef inControl,
Boolean * outTracks);
/*
* SetAutomaticControlDragTrackingEnabledForWindow()
*
* Summary:
* Enables or disables the Control Manager's automatic drag tracking
* for a given window.
*
* Discussion:
* Call SetAutomaticControlDragTrackingEnabledForWindow to turn on
* or off the Control Manager's automatic drag tracking support for
* a given window. By default, your application code is responsible
* for installing drag tracking and receive handlers on a given
* window. The Control Manager, however, has support for
* automatically tracking and receiving drags over controls. The
* Control Manager will detect the control the drag is over and call
* HandleControlDragTracking and HandleControlDragReceive
* appropriately. By default, this automatic support is turned off.
* You can turn on this support by calling
* SetAutomaticControlDragTrackingEnabledForWindow with true. Note
* that earlier versions of system software incorrectly enable this
* support by default; do not rely on this buggy behavior. As of Mac
* OS 10.1.3, Mac OS 9.2, and CarbonLib 1.4, the buggy behavior is
* fixed, and you must call this routine with true to enable
* automatic drag tracking.
*
* Parameters:
*
* inWindow:
* The window for which you'd like to enable or disable the
* Control Manager's automatic drag tracking support.
*
* inTracks:
* A Boolean value indicating whether you want to enable the
* Control Manager's automatic drag tracking support.
*
* Result:
* A result code indicating success or failure.
*
* Availability:
* Non-Carbon CFM: in ControlsLib 9.0 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSStatus )
SetAutomaticControlDragTrackingEnabledForWindow(
WindowRef inWindow,
Boolean inTracks);
/*
* IsAutomaticControlDragTrackingEnabledForWindow()
*
* Summary:
* Tells you whether the Control Manager's automatic drag tracking
* is enabled for a given window.
*
* Discussion:
* Call IsAutomaticControlDragTrackingEnabledForWindow to query the
* enabled state of the Control Manager's automatic drag tracking
* support for a given window. See the information on
* SetAutomaticControlDragTrackingEnabledForWindow for more details.
*
* Parameters:
*
* inWindow:
* The window whose Control Manager automatic drag tracking enable
* state you'd like to query.
*
* outTracks:
* On output, this will contain a Boolean value whether the
* Control Manager's automatic drag tracking is enabled.
*
* Result:
* A result code indicating success or failure.
*
* Availability:
* Non-Carbon CFM: in ControlsLib 9.0 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSStatus )
IsAutomaticControlDragTrackingEnabledForWindow(
WindowRef inWindow,
Boolean * outTracks);
#if !TARGET_OS_MAC
/*--------------------------------------------------------------------------------------*/
/* o QuickTime 3.0 Win32/unix notification mechanism */
/*--------------------------------------------------------------------------------------*/
/* Proc used to notify window that something happened to the control*/
typedef CALLBACK_API_C( void , ControlNotificationProcPtr )(WindowRef theWindow, ControlRef theControl, ControlNotification notification, long param1, long param2);
/*
Proc used to prefilter events before handled by control. A client of a control calls
CTRLSetPreFilterProc() to have the control call this proc before handling the event.
If the proc returns TRUE, the control can go ahead and handle the event.
*/
typedef CALLBACK_API_C( Boolean , PreFilterEventProc )(ControlRef theControl, EventRecord *theEvent);
#if CALL_NOT_IN_CARBON
/*
* GetControlComponentInstance()
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: not available
* Mac OS X: not available
*/
EXTERN_API_C( long )
GetControlComponentInstance(ControlRef theControl);
/*
* GetControlHandleFromCookie()
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: not available
* Mac OS X: not available
*/
EXTERN_API_C( ControlRef )
GetControlHandleFromCookie(long cookie);
#define GetControlRefFromCookie GetControlHandleFromCookie
/*
* SetControlDefProc()
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: not available
* Mac OS X: not available
*/
EXTERN_API_C( void )
SetControlDefProc(
short resID,
ControlDefProcPtr proc);
#endif /* CALL_NOT_IN_CARBON */
typedef ControlNotificationProcPtr ControlNotificationUPP;
#endif /* !TARGET_OS_MAC */
/*--------------------------------------------------------------------------------------*/
/* o C Glue */
/*--------------------------------------------------------------------------------------*/
#if CALL_NOT_IN_CARBON
#if CALL_NOT_IN_CARBON
/*
* dragcontrol()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: not available
* Mac OS X: not available
*/
EXTERN_API_C( void )
dragcontrol(
ControlRef theControl,
Point * startPt,
const Rect * limitRect,
const Rect * slopRect,
short axis);
/*
* newcontrol()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: not available
* Mac OS X: not available
*/
EXTERN_API_C( ControlRef )
newcontrol(
WindowRef theWindow,
const Rect * boundsRect,
const char * title,
Boolean visible,
short value,
short min,
short max,
short procID,
long refCon);
/*
* findcontrol()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: not available
* Mac OS X: not available
*/
EXTERN_API_C( short )
findcontrol(
Point * thePoint,
WindowRef theWindow,
ControlRef * theControl);
/*
* getcontroltitle()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: not available
* Mac OS X: not available
*/
EXTERN_API_C( void )
getcontroltitle(
ControlRef theControl,
char * title);
/*
* setcontroltitle()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: not available
* Mac OS X: not available
*/
EXTERN_API_C( void )
setcontroltitle(
ControlRef theControl,
const char * title);
/*
* trackcontrol()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: not available
* Mac OS X: not available
*/
EXTERN_API_C( short )
trackcontrol(
ControlRef theControl,
Point * thePoint,
ControlActionUPP actionProc);
/*
* testcontrol()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: not available
* Mac OS X: not available
*/
EXTERN_API_C( short )
testcontrol(
ControlRef theControl,
Point * thePt);
#endif /* CALL_NOT_IN_CARBON */
#endif /* CALL_NOT_IN_CARBON */
#if OLDROUTINENAMES
/*--------------------------------------------------------------------------------------*/
/* o OLDROUTINENAMES */
/*--------------------------------------------------------------------------------------*/
enum {
useWFont = kControlUsesOwningWindowsFontVariant
};
enum {
inThumb = kControlIndicatorPart,
kNoHiliteControlPart = kControlNoPart,
kInIndicatorControlPart = kControlIndicatorPart,
kReservedControlPart = kControlDisabledPart,
kControlInactiveControlPart = kControlInactivePart
};
#define SetCTitle(theControl, title) SetControlTitle(theControl, title)
#define GetCTitle(theControl, title) GetControlTitle(theControl, title)
#define UpdtControl(theWindow, updateRgn) UpdateControls(theWindow, updateRgn)
#define SetCtlValue(theControl, theValue) SetControlValue(theControl, theValue)
#define GetCtlValue(theControl) GetControlValue(theControl)
#define SetCtlMin(theControl, minValue) SetControlMinimum(theControl, minValue)
#define GetCtlMin(theControl) GetControlMinimum(theControl)
#define SetCtlMax(theControl, maxValue) SetControlMaximum(theControl, maxValue)
#define GetCtlMax(theControl) GetControlMaximum(theControl)
#define GetAuxCtl(theControl, acHndl) GetAuxiliaryControlRecord(theControl, acHndl)
#define SetCRefCon(theControl, data) SetControlReference(theControl, data)
#define GetCRefCon(theControl) GetControlReference(theControl)
#define SetCtlAction(theControl, actionProc) SetControlAction(theControl, actionProc)
#define GetCtlAction(theControl) GetControlAction(theControl)
#define SetCtlColor(theControl, newColorTable) SetControlColor(theControl, newColorTable)
#define GetCVariant(theControl) GetControlVariant(theControl)
#define getctitle(theControl, title) getcontroltitle(theControl, title)
#define setctitle(theControl, title) setcontroltitle(theControl, title)
#endif /* OLDROUTINENAMES */
#if ACCESSOR_CALLS_ARE_FUNCTIONS
/* Getters */
/*
* GetControlBounds()
*
* Availability:
* Non-Carbon CFM: in CarbonAccessors.o 1.0 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( Rect * )
GetControlBounds(
ControlRef control,
Rect * bounds);
/*
* IsControlHilited()
*
* Availability:
* Non-Carbon CFM: in CarbonAccessors.o 1.0 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( Boolean )
IsControlHilited(ControlRef control);
/*
* GetControlHilite()
*
* Availability:
* Non-Carbon CFM: in CarbonAccessors.o 1.0 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( UInt16 )
GetControlHilite(ControlRef control);
/*
* GetControlOwner()
*
* Availability:
* Non-Carbon CFM: in CarbonAccessors.o 1.0 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( WindowRef )
GetControlOwner(ControlRef control);
/*
* GetControlDataHandle()
*
* Availability:
* Non-Carbon CFM: in CarbonAccessors.o 1.0 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( Handle )
GetControlDataHandle(ControlRef control);
/*
* GetControlPopupMenuHandle()
*
* Availability:
* Non-Carbon CFM: in CarbonAccessors.o 1.0 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( MenuRef )
GetControlPopupMenuHandle(ControlRef control);
#define GetControlPopupMenuRef GetControlPopupMenuHandle
/*
* GetControlPopupMenuID()
*
* Availability:
* Non-Carbon CFM: in CarbonAccessors.o 1.0 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( short )
GetControlPopupMenuID(ControlRef control);
/* Setters */
/*
* SetControlDataHandle()
*
* Availability:
* Non-Carbon CFM: in CarbonAccessors.o 1.0 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( void )
SetControlDataHandle(
ControlRef control,
Handle dataHandle);
/*
* SetControlBounds()
*
* Availability:
* Non-Carbon CFM: in CarbonAccessors.o 1.0 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( void )
SetControlBounds(
ControlRef control,
const Rect * bounds);
/*
* SetControlPopupMenuHandle()
*
* Availability:
* Non-Carbon CFM: in CarbonAccessors.o 1.0 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( void )
SetControlPopupMenuHandle(
ControlRef control,
MenuRef popupMenu);
#define SetControlPopupMenuRef SetControlPopupMenuHandle
/*
* SetControlPopupMenuID()
*
* Availability:
* Non-Carbon CFM: in CarbonAccessors.o 1.0 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( void )
SetControlPopupMenuID(
ControlRef control,
short menuID);
#endif /* ACCESSOR_CALLS_ARE_FUNCTIONS */
#if !OPAQUE_TOOLBOX_STRUCTS && !ACCESSOR_CALLS_ARE_FUNCTIONS
#define GetControlListFromWindow(theWindow) ( *(ControlRef *) (((UInt8 *) theWindow) + sizeof(GrafPort) + 0x20))
#define GetControlOwningWindowControlList(theWindow) ( *(ControlRef *) (((UInt8 *) theWindow) + sizeof(GrafPort) + 0x20))
#endif /* !OPAQUE_TOOLBOX_STRUCTS && !ACCESSOR_CALLS_ARE_FUNCTIONS */
#if PRAGMA_STRUCT_ALIGN
#pragma options align=reset
#elif PRAGMA_STRUCT_PACKPUSH
#pragma pack(pop)
#elif PRAGMA_STRUCT_PACK
#pragma pack()
#endif
#ifdef PRAGMA_IMPORT_OFF
#pragma import off
#elif PRAGMA_IMPORT
#pragma import reset
#endif
#ifdef __cplusplus
}
#endif
#endif /* __CONTROLS__ */
|