summaryrefslogtreecommitdiff
path: root/specs/CH09.xml
blob: 7eaee80bebdf5f021b36e688d3bc605583041829 (plain)
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
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
<!-- .\" $Xorg: CH09,v 1.3 2000/08/17 19:42:46 cpqbld Exp $ -->
<!-- .\" Copyright \(co 1985, 1986, 1987, 1988, 1991, 1994 -->
<!-- .\" X Consortium -->
<!-- .\" -->
<!-- .\" Permission is hereby granted, free of charge, to any person obtaining -->
<!-- .\" a copy of this software and associated documentation files (the -->
<!-- .\" "Software"), to deal in the Software without restriction, including -->
<!-- .\" without limitation the rights to use, copy, modify, merge, publish, -->
<!-- .\" distribute, sublicense, and/or sell copies of the Software, and to -->
<!-- .\" permit persons to whom the Software is furnished to do so, subject to -->
<!-- .\" the following conditions: -->
<!-- .\" -->
<!-- .\" The above copyright notice and this permission notice shall be included -->
<!-- .\" in all copies or substantial portions of the Software. -->
<!-- .\" -->
<!-- .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -->
<!-- .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -->
<!-- .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -->
<!-- .\" IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR -->
<!-- .\" OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -->
<!-- .\" ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -->
<!-- .\" OTHER DEALINGS IN THE SOFTWARE. -->
<!-- .\" -->
<!-- .\" Except as contained in this notice, the name of the X Consortium shall -->
<!-- .\" not be used in advertising or otherwise to promote the sale, use or -->
<!-- .\" other dealings in this Software without prior written authorization -->
<!-- .\" from the X Consortium. -->
<!-- .\" -->
<!-- .\" Copyright \(co 1985, 1986, 1987, 1988, 1991, 1994 -->
<!-- .\" Digital Equipment Corporation, Maynard, Massachusetts. -->
<!-- .\" -->
<!-- .\" Permission to use, copy, modify and distribute this documentation for any -->
<!-- .\" purpose and without fee is hereby granted, provided that the above copyright -->
<!-- .\" notice appears in all copies and that both that copyright notice and this -->
<!-- .\" permission notice appear in supporting documentation, and that the name of -->
<!-- .\" Digital not be used in in advertising or publicity pertaining -->
<!-- .\" to distribution of the software without specific, written prior permission. -->
<!-- .\" Digital makes no representations about the suitability of the -->
<!-- .\" software described herein for any purpose. -->
<!-- .\" It is provided ``as is'' without express or implied warranty. -->
<!-- .\" -->
\&
<!-- .sp 1 -->
<!-- .ce 3 -->
\s+1<function>Chapter 9</function>\s-1

\s+1<function>Resource Management</function>\s-1
<!-- .sp 2 -->
<!-- .nr H1 9 -->
<!-- .nr H2 0 -->
<!-- .nr H3 0 -->
<!-- .nr H4 0 -->
<!-- .nr H5 0 -->
<para>
<!-- .LP -->
<!-- .XS -->
<!-- Chapter 9 \(em Resource Management -->
<!-- .XE -->
A resource is a field in the widget record with a corresponding
resource entry in the <emphasis remap='I'>resources</emphasis> list of the widget or any of its
superclasses.
This means that the field is
settable by
<function>XtCreateWidget</function>
(by naming the field in the argument list), by an
entry in a resource file (by using either the name or class), and by
<function>XtSetValues .</function>
In addition, it is readable by
<function>XtGetValues .</function>
Not all fields in a widget record are resources.
Some are for bookkeeping use by the
generic routines (like <emphasis remap='I'>managed</emphasis> and <emphasis remap='I'>being_destroyed</emphasis>).
Others can be for local bookkeeping,
and still others are derived from resources
(many graphics contexts and pixmaps).
</para>
<para>
<!-- .LP -->
Widgets typically need to obtain a large set of resources at widget
creation time.
Some of the resources come from the argument list supplied in the call to
<function>XtCreateWidget ,</function>
some from the resource database,
and some from the internal defaults specified by the widget.
Resources are obtained first from the argument list,
then from the resource database for all resources not specified
in the argument list,
and last, from the internal default, if needed.

</para>
<sect2 id="Resource_Lists">
<title>Resource Lists</title>
<!-- .XS -->
<!-- (SN Resource Lists -->
<!-- .XE -->
<para>
<!-- .LP -->
<!-- .IN "Resource Management" -->
A resource entry specifies a field in the widget,
the textual name and class of the field that argument lists
and external resource files use to refer to the field,
and a default value that the field should get if no value is specified.
The declaration for the
<function>XtResource</function>
structure is
</para>
<para>
<!-- .LP -->
<!-- .sM -->
<literallayout class="monospaced">
<!-- .TA .5i 3i -->
<!-- .ta .5i 3i -->
typedef struct {
	String resource_name;
	String resource_class;
	String resource_type;
	Cardinal resource_size;
	Cardinal resource_offset;
	String default_type;
	XtPointer default_addr;
} XtResource, *XtResourceList;
</literallayout>
<!-- .IN "XtResourceList" -->
<!-- .eM -->

</para>
<para>
<!-- .LP -->
When the resource list is specified as the
<function>CoreClassPart ,</function>
<function>ObjectClassPart ,</function>
<function>RectObjClassPart ,</function>
or
<function>ConstraintClassPart</function>
<emphasis remap='I'>resources</emphasis> field, the strings pointed to by <emphasis remap='I'>resource_name</emphasis>,
<emphasis remap='I'>resource_class</emphasis>, <emphasis remap='I'>resource_type</emphasis>, and <emphasis remap='I'>default_type</emphasis> must
be permanently allocated prior to or during the execution of the class
initialization procedure and must not be subsequently deallocated.

</para>
<para>
<!-- .LP -->
The <emphasis remap='I'>resource_name</emphasis> field contains the name used by clients to access the field
in the widget.
By convention, it starts with a lowercase letter
and is spelled exactly like the field name,
except all underscores (_) are deleted and the next letter is replaced by its
uppercase counterpart.
For example, the resource name for background_pixel becomes backgroundPixel.
Resource names beginning with the two-character
sequence ``xt'', and resource classes beginning with the two-character
sequence ``Xt'' are reserved to the (xI for future standard and
implementation-dependent uses.
Widget header files typically contain a symbolic name for each resource name.
All resource names, classes, and types used by the (xI are named in
<function>&lt; X11/StringDefs.h &gt;.</function>
The (xI's symbolic resource names begin with
``XtN''
and are followed by the string name (for example, XtNbackgroundPixel
for backgroundPixel).

</para>
<para>
<!-- .LP -->
The <emphasis remap='I'>resource_class</emphasis> field contains the class string used in resource
specification files to identify the field.
A resource class provides two functions:
</para>
<itemizedlist>
  <listitem>
    <para>
It isolates an application from different representations that widgets
can use for a similar resource.
    </para>
  </listitem>
  <listitem>
    <para>
It lets you specify values for several actual resources with a single name.
A resource class should be chosen to span a group of closely related fields.
    </para>
  </listitem>
</itemizedlist>
<para>
<!-- .LP -->
For example,
a widget can have several pixel resources: background, foreground,
border, block cursor, pointer cursor, and so on.
Typically, the background defaults to white
and everything else to black.
The resource class for each of these resources in the resource list
should be chosen so that it takes the minimal number of entries
in the resource database to make the background ivory
and everything else darkblue.
</para>
<para>
<!-- .LP -->
In this case, the background pixel should have a resource class of
``Background''
and all the other pixel entries a resource class of
``Foreground''.
Then, the resource file needs only two lines to
change all pixels to ivory or darkblue:
</para>
<para>
<!-- .LP -->
<literallayout class="monospaced">
<!-- .TA .5i 1.5i -->
<!-- .ta .5i 1.5i -->
*Background:	ivory
*Foreground:	darkblue
</literallayout>
</para>
<para>
<!-- .LP -->
Similarly, a widget may have several font resources (such as normal and bold),
but all fonts should have the class Font.
Thus, changing all fonts simply requires only a single line in the
default resource file:
</para>
<para>
<!-- .LP -->
<literallayout class="monospaced">
<!-- .TA .5i 3i -->
<!-- .ta .5i 3i -->
*Font:	6x13
</literallayout>
</para>
<para>
<!-- .LP -->
By convention,
resource classes are always spelled starting with a capital letter
to distinguish them from resource names.
Their symbolic names are preceded with
``XtC''
(for example, XtCBackground).
</para>
<para>
<!-- .LP -->
The <emphasis remap='I'>resource_type</emphasis> field gives the physical representation type of the resource
and also encodes information about the specific usage of the field.
By convention, it starts with an uppercase letter and is
spelled identically to the type name of the field.
The resource type is used when resources are fetched to
convert from the resource database format (usually
<function>String )</function>
or the format of the resource default value
(almost anything, but often
<function>String )</function>
to the desired
physical representation (see Section 9.6).
The (xI define the following resource types:
<informaltable>
  <tgroup cols='2' align='center'>
  <colspec colname='c1'/>
  <colspec colname='c2'/>
  <tbody>
    <row>
      <entry>lw(2.5i) lw(2.5i).</entry>
    </row>
    <row>
      <entry>_</entry>
    </row>
    <row>
      <entry>Resource Type</entry>
      <entry>Structure or Field Type</entry>
    </row>
    <row>
      <entry>_</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRAcceleratorTable</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>XtAccelerators</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRAtom</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>Atom</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRBitmap</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>Pixmap, depth=1</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRBoolean</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>Boolean</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRBool</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>Bool</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRCallback</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>XtCallbackList</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRCardinal</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>Cardinal</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRColor</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>XColor</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRColormap</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>Colormap</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRCommandArgArray</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>String*</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRCursor</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>Cursor</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRDimension</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>Dimension</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRDirectoryString</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>String</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRDisplay</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>Display*</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtREnum</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>XtEnum</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtREnvironmentArray</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>String*</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRFile</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>FILE*</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRFloat</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>float</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRFont</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>Font</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRFontSet</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>XFontSet</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRFontStruct</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>XFontStruct*</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRFunction</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>(*)()</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRGeometry</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>T{</entry>
    </row>
    <row>
      <entry>char*, format as defined by</entry>
    </row>
    <row>
      <entry><function>XParseGeometry</function></entry>
    </row>
    <row>
      <entry>T}</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRGravity</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>int</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRInitialState</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>int</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRInt</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>int</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRLongBoolean</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>long</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRObject</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>Object</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRPixel</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>Pixel</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRPixmap</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>Pixmap</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRPointer</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>XtPointer</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRPosition</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>Position</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRRestartStyle</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>unsigned char</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRScreen</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>Screen*</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRShort</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>short</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRSmcConn</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>XtPointer</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRString</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>String</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRStringArray</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>String*</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRStringTable</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>String*</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRTranslationTable</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>XtTranslations</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRUnsignedChar</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>unsigned char</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRVisual</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>Visual*</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRWidget</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>Widget</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRWidgetClass</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>WidgetClass</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRWidgetList</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>WidgetList</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRWindow</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>Window</entry>
    </row>
    <row>
      <entry>_</entry>
    </row>
  </tbody>
  </tgroup>
</informaltable>
<!-- .sp -->
</para>
<para>
<!-- .LP -->
<function>&lt; X11/StringDefs.h &gt;</function>
also defines the following resource types as a
convenience for widgets, although they do not have any corresponding
data type assigned:
<function>XtREditMode ,</function>
<function>XtRJustify ,</function>
and
<function>XtROrientation .</function>
</para>
<para>
<!-- .LP -->
The <emphasis remap='I'>resource_size</emphasis> field is the size of the physical representation in bytes;
you should specify it as
<function>sizeof (<emphasis remap='I'>type</emphasis>)</function>
so that the
compiler fills in the value.
The <emphasis remap='I'>resource_offset</emphasis> field is the offset in bytes of the field
within the widget.
You should use the
<function>XtOffsetOf</function>
macro to retrieve this value.
The <emphasis remap='I'>default_type</emphasis> field is the representation type of the default
resource value.
If <emphasis remap='I'>default_type</emphasis> is different from <emphasis remap='I'>resource_type</emphasis> and the default value
is needed,
the resource manager invokes a conversion procedure from <emphasis remap='I'>default_type</emphasis>
to <emphasis remap='I'>resource_type</emphasis>.
Whenever possible,
the default type should be identical to the resource type in order
to minimize widget creation time.
However, there are sometimes no values of the type that the program
can easily specify.
In this case,
it should be a value for which the converter is guaranteed to work (for example,
<function>XtDefaultForeground</function>
for a pixel resource).
The <emphasis remap='I'>default_addr</emphasis> field specifies the address of the default resource value.
As a special case, if <emphasis remap='I'>default_type</emphasis> is
<function>XtRString ,</function>
then the value in the <emphasis remap='I'>default_addr</emphasis> field is the pointer to
the string rather than a pointer to the pointer.
The default is used if a resource is not specified in the argument list
or in the resource database or if the conversion from the representation
type stored in the resource database fails,
which can happen for various reasons (for example, a misspelled entry in a
resource file).
</para>
<para>
<!-- .LP -->
Two special representation types
(XtRImmediate
and
XtRCallProc)
are usable only as default resource types.
XtRImmediate
indicates that the value in the <emphasis remap='I'>default_addr</emphasis> field is the actual value of
the resource rather than the address of the value.
The value must be in the correct representation type for the resource,
coerced to an
<function>XtPointer .</function>
No conversion is possible, since there is no source representation type.
XtRCallProc
indicates that the value in the <emphasis remap='I'>default_addr</emphasis> field is a procedure
pointer.
This procedure is automatically invoked with the widget,
<emphasis remap='I'>resource_offset</emphasis>, and a pointer to an
<function>XrmValue</function>
in which to store the result.
XtRCallProc
procedure pointers are of type
<function>XtResourceDefaultProc .</function>
</para>
<para>
<!-- .LP -->
<!-- .sM -->
</para>
<!-- .FD 0 -->
typedef void (*XtResourceDefaultProc)(Widget, int, XrmValue*);
<!-- .br -->
      Widget <emphasis remap='I'>w</emphasis>;
<!-- .br -->
      int <emphasis remap='I'>offset</emphasis>;
<!-- .br -->
      XrmValue *<emphasis remap='I'>value</emphasis>;
<!-- .FN -->
<variablelist>
  <varlistentry>
    <term>
      <emphasis remap='I'>w</emphasis>
    </term>
    <listitem>
      <para>
Specifies the widget whose resource value is to be obtained.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>offset</emphasis>
    </term>
    <listitem>
      <para>
Specifies the offset of the field in the widget record.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>value</emphasis>
    </term>
    <listitem>
      <para>
Specifies the resource value descriptor to return.
    </para>
  </listitem>
  </varlistentry>
</variablelist>
<para>
<!-- .LP -->
<!-- .eM -->
The
<function>XtResourceDefaultProc</function>
procedure should fill in the <emphasis remap='I'>value-&gt;addr</emphasis> field with a pointer
to the resource value in its correct representation type.
<!-- .sp -->
</para>
<para>
<!-- .LP -->
To get the resource list structure for a particular class, use
<function>XtGetResourceList .</function>
</para>
<para>
<!-- .LP -->
<!-- .IN "XtGetResourceList" "" "@DEF@" -->
<!-- .sM -->
</para>
<!-- .FD 0 -->
void XtGetResourceList(<emphasis remap='I'>class</emphasis>, <emphasis remap='I'>resources_return</emphasis>, <emphasis remap='I'>num_resources_return</emphasis>);
<!-- .br -->
      WidgetClass <emphasis remap='I'>class</emphasis>;
<!-- .br -->
      XtResourceList *<emphasis remap='I'>resources_return</emphasis>;
<!-- .br -->
      Cardinal *<emphasis remap='I'>num_resources_return</emphasis>;
<!-- .FN -->
<variablelist>
  <varlistentry>
    <term>
      <emphasis remap='I'>class</emphasis>
    </term>
    <listitem>
      <para>
Specifies the object class to be queried.  It must be
<function>objectClass</function>
or any subclass thereof.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>resources_return</emphasis>
    </term>
    <listitem>
      <para>
Returns the resource list.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>num_resources_return</emphasis>
    </term>
    <listitem>
      <para>
Returns the number of entries in the resource list.
    </para>
  </listitem>
  </varlistentry>
</variablelist>
<para>
<!-- .LP -->
<!-- .eM -->
If
<function>XtGetResourceList</function>
is called before the class is initialized,
it returns the resource list as specified in the class record.
If it is called after the class has been initialized,
<function>XtGetResourceList</function>
returns a merged resource list that includes the resources
for all superclasses.
The list returned by
<function>XtGetResourceList</function>
should be freed using
<function>XtFree</function>
when it is no longer needed.
<!-- .sp -->
</para>
<para>
<!-- .LP -->
To get the constraint resource list structure for a particular widget
class, use
<function>XtGetConstraintResourceList .</function>
</para>
<para>
<!-- .LP -->
<!-- .IN "XtGetConstraintResourceList" "" "@DEF@" -->
<!-- .sM -->
</para>
<!-- .FD 0 -->
void XtGetConstraintResourceList(<emphasis remap='I'>class</emphasis>, <emphasis remap='I'>resources_return</emphasis>, \
<emphasis remap='I'>num_resources_return</emphasis>)
<!-- .br -->
      WidgetClass <emphasis remap='I'>class</emphasis>;
<!-- .br -->
      XtResourceList *<emphasis remap='I'>resources_return</emphasis>;
<!-- .br -->
      Cardinal *<emphasis remap='I'>num_resources_return</emphasis>;
<!-- .FN -->
<variablelist>
  <varlistentry>
    <term>
      <emphasis remap='I'>class</emphasis>
    </term>
    <listitem>
      <para>
Specifies the object class to be queried.  It must be
<function>objectClass</function>
or any subclass thereof.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>resources_return</emphasis>
    </term>
    <listitem>
      <para>
Returns the constraint resource list.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>num_resources_return</emphasis>
    </term>
    <listitem>
      <para>
Returns the number of entries in the constraint resource list.
    </para>
  </listitem>
  </varlistentry>
</variablelist>
<para>
<!-- .LP -->
<!-- .eM -->
If
<function>XtGetConstraintResourceList</function>
is called before the widget class is
initialized, the resource list as specified in the widget
class Constraint part is returned.  If
<function>XtGetConstraintResourceList</function>
is called after the widget class has been initialized, the merged
resource list for the class and all Constraint superclasses is
returned.  If the
specified class is not a subclass of
<function>constraintWidgetClass ,</function>
*<emphasis remap='I'>resources_return</emphasis> is set to NULL
and *<emphasis remap='I'>num_resources_return</emphasis> is set to zero.
The list returned by
<function>XtGetConstraintResourceList</function>
should be freed using
<function>XtFree</function>
when it is no longer needed.
<!-- .sp -->
</para>
<para>
<!-- .LP -->
The routines
<function>XtSetValues</function>
and
<function>XtGetValues</function>
also use the resource list to set and get widget state;
see Sections 9.7.1 and 9.7.2.
</para>
<para>
<!-- .LP -->
Here is an abbreviated version of a possible resource list for a Label widget:
</para>
<para>
<!-- .LP -->
<literallayout class="monospaced">
<!-- .TA .5i 1.5i 3i -->
<!-- .ta .5i 1.5i 3i -->
/* Resources specific to Label */
static XtResource resources[] = {
{XtNforeground, XtCForeground, XtRPixel, sizeof(Pixel),
   XtOffsetOf(LabelRec, label.foreground), XtRString, XtDefaultForeground},
{XtNfont, XtCFont, XtRFontStruct, sizeof(XFontStruct*),
   XtOffsetOf(LabelRec, label.font), XtRString, XtDefaultFont},
{XtNlabel, XtCLabel, XtRString, sizeof(String),
   XtOffsetOf(LabelRec, label.label), XtRString, NULL},
	.
	.
	.
}
</literallayout>
</para>
<para>
<!-- .LP -->
The complete resource name for a field of a widget instance is the
concatenation of the application shell name (from
<function>XtAppCreateShell ),</function>
the instance names of all the widget's parents up to the
top of the widget tree,
the instance name of the widget itself,
and the resource name of the specified field of the widget.
Similarly,
the full resource class of a field of a widget instance is the
concatenation of the application class (from
<function>XtAppCreateShell ),</function>
the widget class names of all the widget's parents up to the
top of the widget tree,
the widget class name of the widget itself,
and the resource class of the specified field of the widget.

</para>
</sect2>
<sect2 id="Byte_Offset_Calculations">
<title>Byte Offset Calculations</title>
<!-- .XS -->
<!-- (SN Byte Offset Calculations -->
<!-- .XE -->
<para>
<!-- .LP -->
To determine the byte offset of a field within a structure type, use
<function>XtOffsetOf .</function>
</para>
<para>
<!-- .LP -->
<!-- .IN "XtOffsetOf" "" "@DEF@" -->
<!-- .sM -->
</para>
<!-- .FD 0 -->
Cardinal XtOffsetOf(<emphasis remap='I'>structure_type</emphasis>, <emphasis remap='I'>field_name</emphasis>)
<!-- .br -->
      <emphasis remap='I'>Type structure_type</emphasis>;
<!-- .br -->
      <emphasis remap='I'>Field field_name</emphasis>;
<!-- .FN -->
<variablelist>
  <varlistentry>
    <term>
      <emphasis remap='I'>structure_type</emphasis>
    </term>
    <listitem>
      <para>
Specifies a type that is declared as a structure.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>field_name</emphasis>
    </term>
    <listitem>
      <para>
Specifies the name of a member within the structure.
    </para>
  </listitem>
  </varlistentry>
</variablelist>
<para>
<!-- .LP -->
<!-- .eM -->
The
<function>XtOffsetOf</function>
macro expands to a constant expression that gives the
offset in bytes to the specified structure member from the beginning
of the structure.  It is normally used to statically initialize
resource lists and is more portable than
<function>XtOffset ,</function>
which serves the same function.

</para>
<para>
<!-- .LP -->
To determine the byte offset of a field within a structure pointer type, use
<function>XtOffset .</function>
</para>
<para>
<!-- .LP -->
<!-- .IN "XtOffset" "" "@DEF@" -->
<!-- .sM -->
</para>
<!-- .FD 0 -->
Cardinal XtOffset(<emphasis remap='I'>pointer_type</emphasis>, <emphasis remap='I'>field_name</emphasis>)
<!-- .br -->
      <emphasis remap='I'>Type pointer_type</emphasis>;
<!-- .br -->
      <emphasis remap='I'>Field field_name</emphasis>;
<!-- .FN -->
<variablelist>
  <varlistentry>
    <term>
      <emphasis remap='I'>pointer_type</emphasis>
    </term>
    <listitem>
      <para>
Specifies a type that is declared as a pointer to a structure.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>field_name</emphasis>
    </term>
    <listitem>
      <para>
Specifies the name of a member within the structure.
    </para>
  </listitem>
  </varlistentry>
</variablelist>
<para>
<!-- .LP -->
<!-- .eM -->
The
<function>XtOffset</function>
macro expands to a constant expression that gives the
offset in bytes to the specified structure member from the beginning
of the structure.  It may be used to statically initialize
resource lists.
<function>XtOffset</function>
is less portable than
<function>XtOffsetOf .</function>

</para>
</sect2>
<sect2 id="Superclass_to_Subclass_Chaining_of_Resource_Lists">
<title>Superclass-to-Subclass Chaining of Resource Lists</title>
<!-- .XS -->
<!-- (SN Superclass-to-Subclass Chaining of Resource Lists -->
<!-- .XE -->
<para>
<!-- .LP -->
<!-- .IN "Inheritance" -->
<!-- .IN "Superclass Chaining" -->
<!-- .IN "Chaining" -->
The
<function>XtCreateWidget</function>
function gets resources as a superclass-to-subclass chained operation.
That is, the resources specified in the
<function>objectClass</function>
resource list are fetched,
then those in
<function>rectObjClass ,</function>
and so on down to the resources specified
for this widget's class. Within a class, resources are fetched in the order
they are declared.
</para>
<para>
<!-- .LP -->
In general, if a widget resource field is declared in a superclass,
that field is included in the superclass's resource list and need not be
included in the subclass's resource list.
For example, the
Core
class contains a resource entry for <emphasis remap='I'>background_pixel</emphasis>.
Consequently,
the implementation of Label need not also have a resource entry
for <emphasis remap='I'>background_pixel</emphasis>.
However, a subclass,
by specifying a resource entry for that field in its own resource list,
can override the resource entry for any field declared in a superclass.
This is most often done to override the defaults provided in the
superclass with new ones.
At class initialization time,
resource lists for that class are scanned from the superclass down
to the class to look for resources with the same offset.
A matching resource in a subclass will be reordered to override
the superclass entry.
If reordering is necessary, a copy of the superclass resource list is made to
avoid affecting other subclasses of the superclass.
</para>
<para>
<!-- .LP -->
<!-- .IN "class_initialize procedure" -->
<!-- .IN "Widget" "class initialization" -->
Also at class initialization time, the (xI produce an
internal representation of the resource list to optimize access time
when creating widgets.  In order to save memory, the (xI may
overwrite the storage allocated for the resource list in the class
record; therefore, widgets must allocate resource lists in writable
storage and must not access the list contents directly after the
class_initialize procedure has returned.

</para>
</sect2>
<sect2 id="Subresources">
<title>Subresources</title>
<!-- .XS -->
<!-- (SN Subresources -->
<!-- .XE -->
<para>
<!-- .LP -->
A widget does not do anything to retrieve its own resources;
instead,
<function>XtCreateWidget</function>
does this automatically before calling the class initialize procedure.
</para>
<para>
<!-- .LP -->
Some widgets have subparts that are not widgets but for which the widget
would like to fetch resources.
Such widgets call
<function>XtGetSubresources</function>
to accomplish this.
</para>
<para>
<!-- .LP -->
<!-- .IN "XtGetSubresources" "" "@DEF@" -->
<!-- .sM -->
</para>
<!-- .FD 0 -->
void XtGetSubresources(<emphasis remap='I'>w</emphasis>, <emphasis remap='I'>base</emphasis>, <emphasis remap='I'>name</emphasis>, <emphasis remap='I'>class</emphasis>, \
<emphasis remap='I'>resources</emphasis>, <emphasis remap='I'>num_resources</emphasis>, <emphasis remap='I'>args</emphasis>, <emphasis remap='I'>num_args</emphasis>)
<!-- .br -->
      Widget <emphasis remap='I'>w</emphasis>;
<!-- .br -->
      XtPointer <emphasis remap='I'>base</emphasis>;
<!-- .br -->
      String <emphasis remap='I'>name</emphasis>;
<!-- .br -->
      String <emphasis remap='I'>class</emphasis>;
<!-- .br -->
      XtResourceList <emphasis remap='I'>resources</emphasis>;
<!-- .br -->
      Cardinal <emphasis remap='I'>num_resources</emphasis>;
<!-- .br -->
      ArgList <emphasis remap='I'>args</emphasis>;
<!-- .br -->
      Cardinal <emphasis remap='I'>num_args</emphasis>;
<!-- .FN -->
<variablelist>
  <varlistentry>
    <term>
      <emphasis remap='I'>w</emphasis>
    </term>
    <listitem>
      <para>
Specifies the object used to qualify the subpart resource name and
class.  (oI
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>base</emphasis>
    </term>
    <listitem>
      <para>
Specifies the base address of the subpart data structure into which the
resources will be written.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>name</emphasis>
    </term>
    <listitem>
      <para>
Specifies the name of the subpart.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>class</emphasis>
    </term>
    <listitem>
      <para>
Specifies the class of the subpart.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>resources</emphasis>
    </term>
    <listitem>
      <para>
Specifies the resource list for the subpart.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>num_resources</emphasis>
    </term>
    <listitem>
      <para>
Specifies the number of entries in the resource list.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>args</emphasis>
    </term>
    <listitem>
      <para>
Specifies the argument list to override any other resource specifications.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>num_args</emphasis>
    </term>
    <listitem>
      <para>
Specifies the number of entries in the argument list.
    </para>
  </listitem>
  </varlistentry>
</variablelist>
<para>
<!-- .LP -->
<!-- .eM -->
The
<function>XtGetSubresources</function>
function constructs a name and class list from the application name and class,
the names and classes of all the object's ancestors, and the object itself.
Then it appends to this list the <emphasis remap='I'>name</emphasis> and <emphasis remap='I'>class</emphasis> pair passed in.
The resources are fetched from the argument list, the resource database,
or the default values in the resource list.
Then they are copied into the subpart record.
If <emphasis remap='I'>args</emphasis> is NULL,
<emphasis remap='I'>num_args</emphasis> must be zero.
However, if <emphasis remap='I'>num_args</emphasis> is zero,
the argument list is not referenced.
</para>
<para>
<!-- .LP -->
<function>XtGetSubresources</function>
may overwrite the specified resource list with an
equivalent representation in an internal format, which optimizes access
time if the list is used repeatedly.  The resource list must be
allocated in writable storage, and the caller must not modify the list
contents after the call if the same list is to be used again.
Resources fetched by
<function>XtGetSubresources</function>
are reference-counted as
if they were referenced by the specified object.  Subresources might
therefore be freed from the conversion cache and destroyed
when the object is destroyed, but not before then.
<!-- .sp -->
</para>
<para>
<!-- .LP -->
To fetch resources for widget subparts using varargs lists, use
<function>XtVaGetSubresources .</function>
</para>
<para>
<!-- .LP -->
<!-- .IN "XtVaGetSubresources" "" "@DEF@" -->
<!-- .sM -->
</para>
<!-- .FD 0 -->
void XtVaGetSubresources(<emphasis remap='I'>w</emphasis>, <emphasis remap='I'>base</emphasis>, <emphasis remap='I'>name</emphasis>, <emphasis remap='I'>class</emphasis>, \
<emphasis remap='I'>resources</emphasis>, <emphasis remap='I'>num_resources</emphasis>, ...)
<!-- .br -->
    Widget <emphasis remap='I'>w</emphasis>;
<!-- .br -->
    XtPointer <emphasis remap='I'>base</emphasis>;
<!-- .br -->
    String <emphasis remap='I'>name</emphasis>;
<!-- .br -->
    String <emphasis remap='I'>class</emphasis>;
<!-- .br -->
    XtResourceList <emphasis remap='I'>resources</emphasis>;
<!-- .br -->
    Cardinal <emphasis remap='I'>num_resources</emphasis>;
<!-- .FN -->
<variablelist>
  <varlistentry>
    <term>
      <emphasis remap='I'>w</emphasis>
    </term>
    <listitem>
      <para>
Specifies the object used to qualify the subpart resource name and
class.  (oI
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>base</emphasis>
    </term>
    <listitem>
      <para>
Specifies the base address of the subpart data structure into which the
resources will be written.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>name</emphasis>
    </term>
    <listitem>
      <para>
Specifies the name of the subpart.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>class</emphasis>
    </term>
    <listitem>
      <para>
Specifies the class of the subpart.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>resources</emphasis>
    </term>
    <listitem>
      <para>
Specifies the resource list for the subpart.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>num_resources</emphasis>
    </term>
    <listitem>
      <para>
Specifies the number of entries in the resource list.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      ...
    </term>
    <listitem>
      <para>
Specifies the variable argument list to override any other
resource specifications.
    </para>
  </listitem>
  </varlistentry>
</variablelist>
<para>
<!-- .LP -->
<!-- .eM -->
<function>XtVaGetSubresources</function>
is identical in function to
<function>XtGetSubresources</function>
with the <emphasis remap='I'>args</emphasis> and <emphasis remap='I'>num_args</emphasis> parameters replaced by a varargs list, as
described in Section 2.5.1.

</para>
</sect2>
<sect2 id="Obtaining_Application_Resources">
<title>Obtaining Application Resources</title>
<!-- .XS -->
<!-- <function>(SN Obtaining Application Resources</function> -->
<!-- .XE -->
<para>
<!-- .LP -->
To retrieve resources that are not specific to a widget
but apply to the overall application, use
<function>XtGetApplicationResources .</function>
</para>
<para>
<!-- .LP -->
<!-- .IN "XtGetApplicationResources" "" "@DEF@" -->
<!-- .sM -->
</para>
<!-- .FD 0 -->
void XtGetApplicationResources(<emphasis remap='I'>w</emphasis>, <emphasis remap='I'>base</emphasis>, <emphasis remap='I'>resources</emphasis>, \
<emphasis remap='I'>num_resources</emphasis>, <emphasis remap='I'>args</emphasis>, <emphasis remap='I'>num_args</emphasis>)
<!-- .br -->
      Widget <emphasis remap='I'>w</emphasis>;
<!-- .br -->
      XtPointer <emphasis remap='I'>base</emphasis>;
<!-- .br -->
      XtResourceList <emphasis remap='I'>resources</emphasis>;
<!-- .br -->
      Cardinal <emphasis remap='I'>num_resources</emphasis>;
<!-- .br -->
      ArgList <emphasis remap='I'>args</emphasis>;
<!-- .br -->
      Cardinal <emphasis remap='I'>num_args</emphasis>;
<!-- .FN -->
<variablelist>
  <varlistentry>
    <term>
      <emphasis remap='I'>w</emphasis>
    </term>
    <listitem>
      <para>
Specifies the object that identifies the resource database to search
(the database is that associated with the display for this object).  (oI
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>base</emphasis>
    </term>
    <listitem>
      <para>
Specifies the base address into which
the resource values will be written.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>resources</emphasis>
    </term>
    <listitem>
      <para>
Specifies the resource list.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>num_resources</emphasis>
    </term>
    <listitem>
      <para>
Specifies the number of entries in the resource list.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>args</emphasis>
    </term>
    <listitem>
      <para>
Specifies the argument list to override any other resource specifications.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>num_args</emphasis>
    </term>
    <listitem>
      <para>
Specifies the number of entries in the argument list.
    </para>
  </listitem>
  </varlistentry>
</variablelist>
<para>
<!-- .LP -->
<!-- .eM -->
The
<function>XtGetApplicationResources</function>
function first uses the passed object,
which is usually an application shell widget,
to construct a resource name and class list.
The full name and class of the specified object (that is, including its
ancestors, if any) is logically added to the
front of each resource name and class.
Then it retrieves the resources from the argument list,
the resource database, or the resource list default values.
After adding base to each address,
<function>XtGetApplicationResources</function>
copies the resources into the addresses
obtained by adding <emphasis remap='I'>base</emphasis> to each <emphasis remap='I'>offset</emphasis> in the resource list.
If <emphasis remap='I'>args</emphasis> is NULL,
<emphasis remap='I'>num_args</emphasis> must be zero.
However, if <emphasis remap='I'>num_args</emphasis> is zero,
the argument list is not referenced.
The portable way to specify application resources is to declare them
as members of a structure and pass the address of the structure
as the <emphasis remap='I'>base</emphasis> argument.
</para>
<para>
<!-- .LP -->
<function>XtGetApplicationResources</function>
may overwrite the specified resource list
with an equivalent representation in an internal format, which
optimizes access time if the list is used repeatedly.  The resource
list must be allocated in writable storage, and the caller must not
modify the list contents after the call if the same list is to be
used again.  Any per-display resources fetched by
<function>XtGetApplicationResources</function>
will not be freed from the resource cache until the display is closed.
<!-- .sp -->
</para>
<para>
<!-- .LP -->
To retrieve resources for the overall application using varargs lists, use
<function>XtVaGetApplicationResources .</function>
</para>
<para>
<!-- .LP -->
<!-- .IN "XtVaGetApplicationResources" "" "@DEF@" -->
<!-- .sM -->
</para>
<!-- .FD 0 -->
void XtVaGetApplicationResources(<emphasis remap='I'>w</emphasis>, <emphasis remap='I'>base</emphasis>, <emphasis remap='I'>resources</emphasis>, \
<emphasis remap='I'>num_resources</emphasis>, ...)
<!-- .br -->
      Widget <emphasis remap='I'>w</emphasis>;
<!-- .br -->
      XtPointer <emphasis remap='I'>base</emphasis>;
<!-- .br -->
      XtResourceList <emphasis remap='I'>resources</emphasis>;
<!-- .br -->
      Cardinal <emphasis remap='I'>num_resources</emphasis>;
<!-- .FN -->
<variablelist>
  <varlistentry>
    <term>
      <emphasis remap='I'>w</emphasis>
    </term>
    <listitem>
      <para>
Specifies the object that identifies the resource database to search
(the database is that associated with the display for this object).  (oI
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>base</emphasis>
    </term>
    <listitem>
      <para>
Specifies the base address into which
the resource values will be written.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>resources</emphasis>
    </term>
    <listitem>
      <para>
Specifies the resource list for the subpart.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>num_resources</emphasis>
    </term>
    <listitem>
      <para>
Specifies the number of entries in the resource list.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      ...
    </term>
    <listitem>
      <para>
Specifies the variable argument list to override any other
resource specifications.
    </para>
  </listitem>
  </varlistentry>
</variablelist>
<para>
<!-- .LP -->
<!-- .eM -->
<function>XtVaGetApplicationResources</function>
is identical in function to
<function>XtGetApplicationResources</function>
with the <emphasis remap='I'>args</emphasis> and <emphasis remap='I'>num_args</emphasis> parameters
replaced by a varargs list, as described in Section 2.5.1.

</para>
</sect2>
<sect2 id="Resource_Conversions">
<title>Resource Conversions</title>
<!-- .XS -->
<!-- (SN Resource Conversions -->
<!-- .XE -->
<para>
<!-- .LP -->
The (xI provide a mechanism for registering representation converters that
are automatically invoked by the resource-fetching routines.
The (xI additionally provide and register several commonly used converters.
This resource conversion mechanism serves several purposes:
</para>
<itemizedlist>
  <listitem>
    <para>
It permits user and application resource files to contain textual
representations of nontextual values.
    </para>
  </listitem>
  <listitem>
    <para>
It allows textual or other representations of default resource values that
are dependent on the display, screen, or colormap, and thus must be
computed at runtime.
    </para>
  </listitem>
  <listitem>
    <para>
It caches conversion source and result data.
Conversions that require much computation or space
(for example, string-to-translation-table)
or that require round-trips to the server
(for example, string-to-font or string-to-color) are performed only once.

    </para>
  </listitem>
</itemizedlist>
<sect3 id="Predefined_Resource_Converters">
<title>Predefined Resource Converters</title>
<!-- .XS -->
<!-- (SN Predefined Resource Converters -->
<!-- .XE -->
<para>
<!-- .LP -->
The (xI define all the representations used in the
Object,
RectObj,
Core,
Composite,
Constraint,
and
Shell
widget classes.
The (xI register the following resource converters that accept
input values of representation type
<function>XtRString .</function>
</para>
<para>
<!-- .LP -->
<informaltable>
  <tgroup cols='4' align='center'>
  <colspec colname='c1'/>
  <colspec colname='c2'/>
  <colspec colname='c3'/>
  <colspec colname='c4'/>
  <tbody>
    <row>
      <entry>lw(1.7i) lw(2.4i) lw(1.5i) .</entry>
    </row>
    <row>
      <entry>_</entry>
    </row>
    <row>
      <entry>Target Representation</entry>
      <entry>Converter Name</entry>
      <entry>Additional Args</entry>
    </row>
    <row>
      <entry>_</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRAcceleratorTable</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtCvtStringToAcceleratorTable</function></entry>
    </row>
    <row>
      <entry>T}</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRAtom</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtCvtStringToAtom</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>Display*</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRBoolean</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtCvtStringToBoolean</function></entry>
    </row>
    <row>
      <entry>T}</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRBool</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtCvtStringToBool</function></entry>
    </row>
    <row>
      <entry>T}</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRCommandArgArray</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtCvtStringToCommandArgArray</function></entry>
    </row>
    <row>
      <entry>T}</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRCursor</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtCvtStringToCursor</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>Display*</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRDimension</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtCvtStringToDimension</function></entry>
    </row>
    <row>
      <entry>T}</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRDirectoryString</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtCvtStringToDirectoryString</function></entry>
    </row>
    <row>
      <entry>T}</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRDisplay</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtCvtStringToDisplay</function></entry>
    </row>
    <row>
      <entry>T}</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRFile</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtCvtStringToFile</function></entry>
    </row>
    <row>
      <entry>T}</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRFloat</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtCvtStringToFloat</function></entry>
    </row>
    <row>
      <entry>T}</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRFont</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtCvtStringToFont</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>Display*</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRFontSet</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtCvtStringToFontSet</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>Display*, String <emphasis remap='I'>locale</emphasis></entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRFontStruct</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtCvtStringToFontStruct</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>Display*</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRGravity</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtCvtStringToGravity</function></entry>
    </row>
    <row>
      <entry>T}</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRInitialState</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtCvtStringToInitialState</function></entry>
    </row>
    <row>
      <entry>T}</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRInt</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtCvtStringToInt</function></entry>
    </row>
    <row>
      <entry>T}</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRPixel</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtCvtStringToPixel</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>colorConvertArgs</function></entry>
    </row>
    <row>
      <entry>T}</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRPosition</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtCvtStringToPosition</function></entry>
    </row>
    <row>
      <entry>T}</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRRestartStyle</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtCvtStringToRestartStyle</function></entry>
    </row>
    <row>
      <entry>T}</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRShort</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtCvtStringToShort</function></entry>
    </row>
    <row>
      <entry>T}</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRTranslationTable</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtCvtStringToTranslationTable</function></entry>
    </row>
    <row>
      <entry>T}</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRUnsignedChar</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtCvtStringToUnsignedChar</function></entry>
    </row>
    <row>
      <entry>T}</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRVisual</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtCvtStringToVisual</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>Screen*, Cardinal <emphasis remap='I'>depth</emphasis></entry>
    </row>
    <row>
      <entry>_</entry>
    </row>
  </tbody>
  </tgroup>
</informaltable>

</para>
<para>
<!-- .LP -->
The String-to-Pixel conversion has two predefined constants that are
guaranteed to work and contrast with each other:
<function>XtDefaultForeground</function>
and
<function>XtDefaultBackground .</function>
<!-- .IN "XtDefaultBackground" "" "@DEF@" -->
<!-- .IN "XtDefaultForeground" "" "@DEF@" -->
They evaluate to the black and white pixel values of the widget's screen,
respectively.
<!-- .IN "Resources" "reverseVideo" -->
If the application resource reverseVideo is
<function>True ,</function>
they evaluate to the white and black pixel values of the widget's screen,
respectively.
Similarly, the String-to-Font and String-to-FontStruct converters recognize
the constant
<function>XtDefaultFont</function>
<!-- .IN "XtDefaultFont" "" "@DEF@" -->
<!-- .IN "Resources" "xtDefaultFont" -->
and evaluate this in the following manner:
</para>
<itemizedlist>
  <listitem>
    <para>
Query the resource database for the resource whose full name
is ``xtDefaultFont'', class ``XtDefaultFont'' (that is, no widget
name/class prefixes), and use a type
<function>XtRString</function>
value returned as the font name or a type
<function>XtRFont</function>
or
<function>XtRFontStruct</function>
value directly as the resource value.
    </para>
  </listitem>
  <listitem>
    <para>
If the resource database does not contain a value for xtDefaultFont,
class XtDefaultFont, or if the returned font name cannot be
successfully opened, an implementation-defined font in ISO8859-1
character set encoding is opened.  (One possible algorithm is to
perform an
<function>XListFonts</function>
using a wildcard font name and use the first
font in the list.  This wildcard font name should be as broad as
possible to maximize the probability of locating a useable font;
for example, "-*-*-*-R-*-*-*-120-*-*-*-*-ISO8859-1".)
    </para>
  </listitem>
  <listitem>
    <para>
If no suitable ISO8859-1 font can be found, issue a warning message
and return
<function>False .</function>
    </para>
  </listitem>
</itemizedlist>
<para>
<!-- .LP -->
The String-to-FontSet converter recognizes the constant
<function>XtDefaultFontSet</function>
<!-- .IN "XtDefaultFontSet" "" "@DEF@" -->
<!-- .IN "Resources" "xtDefaultFontSet" -->
and evaluate this in the following manner:
</para>
<itemizedlist>
  <listitem>
    <para>
Query the resource database for the resource whose full name
is ``xtDefaultFontSet'', class ``XtDefaultFontSet'' (that is, no widget
name/class prefixes), and use a type
<function>XtRString</function>
value returned as the base font name list or a type
<function>XtRFontSet</function>
value directly as the resource value.
    </para>
  </listitem>
  <listitem>
    <para>
If the resource database does not contain a value for xtDefaultFontSet,
class XtDefaultFontSet, or if a font set cannot be
successfully created from this resource,
an implementation-defined font set is created.
(One possible algorithm is to
perform an
<function>XCreateFontSet</function>
using a wildcard base font name.
This wildcard base font name should be as broad as
possible to maximize the probability of locating a useable font;
for example, "-*-*-*-R-*-*-*-120-*-*-*-*".)
    </para>
  </listitem>
  <listitem>
    <para>
If no suitable font set can be created, issue a warning message
and return
<function>False .</function>
    </para>
  </listitem>
</itemizedlist>
<para>
<!-- .LP -->
If a font set is created but <emphasis remap='I'>missing_charset_list</emphasis> is not
empty, a warning is issued and the partial font set is returned.
The (xI register the String-to-FontSet converter with
a conversion argument list that extracts the current process
locale at the time the converter is invoked.   This ensures
that the converter is invoked again if the same conversion
is required in a different locale.
</para>
<para>
<!-- .LP -->
The String-to-Gravity conversion accepts string values that are the
names of window and bit gravities and their numerical equivalents,
as defined in <emphasis remap='I'>(xL</emphasis>:
<function>ForgetGravity ,</function>
<function>UnmapGravity ,</function>
<function>NorthWestGravity ,</function>
<function>NorthGravity ,</function>
<function>NorthEastGravity ,</function>
<function>WestGravity ,</function>
<function>CenterGravity ,</function>
<function>EastGravity ,</function>
<function>SouthWestGravity ,</function>
<function>SouthGravity ,</function>
<function>SouthEastGravity ,</function>
and
<function>StaticGravity .</function>
Alphabetic case is not significant in the conversion.
</para>
<para>
<!-- .LP -->
The String-to-CommandArgArray conversion parses a String into an
array of strings.
White space characters separate elements of the command line.
The converter recognizes the backslash character ``\\'' as an escape
character to allow the following white space character to be part of the
array element.
</para>
<para>
<!-- .LP -->
<!-- .IN "XtCurrentDirectory" "" "@DEF@" -->
The String-to-DirectoryString conversion recognizes the
string ``XtCurrentDirectory'' and returns the result of a call
to the operating system to get the current directory.
</para>
<para>
<!-- .LP -->
The String-to-RestartStyle conversion accepts the values
<function>RestartIfRunning ,</function>
<function>RestartAnyway ,</function>
<function>RestartImmediately ,</function>
and
<function>RestartNever</function>
as defined by the <emphasis remap='I'>X Session Management Protocol</emphasis>.
</para>
<para>
<!-- .LP -->
The String-to-InitialState conversion accepts the values
<function>NormalState</function>
or
<function>IconicState</function>
as defined by the <emphasis remap='I'>(xC</emphasis>.
</para>
<para>
<!-- .LP -->
The String-to-Visual conversion calls
<function>XMatchVisualInfo</function>
using the
<emphasis remap='I'>screen</emphasis> and <emphasis remap='I'>depth</emphasis> fields from the core part and returns the first
matching Visual on the list.  The widget resource list must be certain
to specify any resource of type
<function>XtRVisual</function>
after the depth resource.
The allowed string values are the visual class names defined in <emphasis remap='I'>(xP</emphasis>,
Section 8;
<function>StaticGray ,</function>
<function>StaticColor ,</function>
<function>TrueColor ,</function>
<function>GrayScale ,</function>
<function>PseudoColor ,</function>
and
<function>DirectColor .</function>

</para>
<para>
<!-- .LP -->
The (xI register the following resource converter that accepts
an input value of representation type
<function>XtRColor .</function>
</para>
<para>
<!-- .LP -->
<informaltable>
  <tgroup cols='4' align='center'>
  <colspec colname='c1'/>
  <colspec colname='c2'/>
  <colspec colname='c3'/>
  <colspec colname='c4'/>
  <tbody>
    <row>
      <entry>lw(1.5i) lw(2.25i) lw(1.5i) .</entry>
    </row>
    <row>
      <entry>_</entry>
    </row>
    <row>
      <entry>Target Representation</entry>
      <entry>Converter Name</entry>
      <entry>Additional Args</entry>
    </row>
    <row>
      <entry>_</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRPixel</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtCvtColorToPixel</function></entry>
    </row>
    <row>
      <entry>T}</entry>
    </row>
    <row>
      <entry>_</entry>
    </row>
  </tbody>
  </tgroup>
</informaltable>

</para>
<para>
<!-- .LP -->
The (xI register the following resource converters that accept
input values of representation type
<function>XtRInt .</function>
</para>
<para>
<!-- .LP -->
<informaltable>
  <tgroup cols='4' align='center'>
  <colspec colname='c1'/>
  <colspec colname='c2'/>
  <colspec colname='c3'/>
  <colspec colname='c4'/>
  <tbody>
    <row>
      <entry>lw(1.5i) lw(2.25i) lw(1.5i) .</entry>
    </row>
    <row>
      <entry>_</entry>
    </row>
    <row>
      <entry>Target Representation</entry>
      <entry>Converter Name</entry>
      <entry>Additional Args</entry>
    </row>
    <row>
      <entry>_</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRBoolean</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtCvtIntToBoolean</function></entry>
    </row>
    <row>
      <entry>T}</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRBool</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtCvtIntToBool</function></entry>
    </row>
    <row>
      <entry>T}</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRColor</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtCvtIntToColor</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>colorConvertArgs</function></entry>
    </row>
    <row>
      <entry>T}</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRDimension</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtCvtIntToDimension</function></entry>
    </row>
    <row>
      <entry>T}</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRFloat</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtCvtIntToFloat</function></entry>
    </row>
    <row>
      <entry>T}</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRFont</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtCvtIntToFont</function></entry>
    </row>
    <row>
      <entry>T}</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRPixel</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtCvtIntToPixel</function></entry>
    </row>
    <row>
      <entry>T}</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRPixmap</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtCvtIntToPixmap</function></entry>
    </row>
    <row>
      <entry>T}</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRPosition</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtCvtIntToPosition</function></entry>
    </row>
    <row>
      <entry>T}</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRShort</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtCvtIntToShort</function></entry>
    </row>
    <row>
      <entry>T}</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRUnsignedChar</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtCvtIntToUnsignedChar</function></entry>
    </row>
    <row>
      <entry>T}</entry>
    </row>
    <row>
      <entry>_</entry>
    </row>
  </tbody>
  </tgroup>
</informaltable>

</para>
<para>
<!-- .LP -->
The (xI register the following resource converter that accepts
an input value of representation type
<function>XtRPixel .</function>
</para>
<para>
<!-- .LP -->
<informaltable>
  <tgroup cols='4' align='center'>
  <colspec colname='c1'/>
  <colspec colname='c2'/>
  <colspec colname='c3'/>
  <colspec colname='c4'/>
  <tbody>
    <row>
      <entry>lw(1.5i) lw(2.25i) lw(1.5i) .</entry>
    </row>
    <row>
      <entry>_</entry>
    </row>
    <row>
      <entry>Target Representation</entry>
      <entry>Converter Name</entry>
      <entry>Additional Args</entry>
    </row>
    <row>
      <entry>_</entry>
    </row>
    <row>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtRColor</function></entry>
    </row>
    <row>
      <entry>T}</entry>
      <entry>T{</entry>
    </row>
    <row>
      <entry><function>XtCvtPixelToColor</function></entry>
    </row>
    <row>
      <entry>T}</entry>
    </row>
    <row>
      <entry>_</entry>
    </row>
  </tbody>
  </tgroup>
</informaltable>

</para>
</sect3>
<sect3 id="New_Resource_Converters">
<title>New Resource Converters</title>
<!-- .XS -->
<!-- (SN New Resource Converters -->
<!-- .XE -->
<para>
<!-- .LP -->
Type converters use pointers to
<function>XrmValue</function>
structures (defined in
<function>&lt; X11/Xresource.h &gt;;</function>
see Section 15.4 in <emphasis remap='I'>(xL</emphasis>)
for input and output values.
</para>
<para>
<!-- .LP -->
<!-- .sM -->
<literallayout class="monospaced">
<!-- .TA .5i 3i -->
<!-- .ta .5i 3i -->
typedef struct {
	unsigned int size;
	XPointer addr;
} XrmValue, *XrmValuePtr;
</literallayout>
</para>
<para>
<!-- .LP -->
<!-- .eM -->
The <emphasis remap='I'>addr</emphasis> field specifies the address of the data, and the <emphasis remap='I'>size</emphasis>
field gives the total number of significant bytes in the data.
For values of type
<function>String ,</function>
<emphasis remap='I'>addr</emphasis> is the address of the first character and <emphasis remap='I'>size</emphasis>
includes the NULL-terminating byte.
</para>
<para>
<!-- .LP -->
A resource converter procedure pointer is of type
<function>XtTypeConverter .</function>
</para>
<para>
<!-- .LP -->
<!-- .IN "XtTypeConverter" "" "@DEF@" -->
<!-- .sM -->
</para>
<!-- .FD 0 -->
typedef Boolean (*XtTypeConverter)(Display*, XrmValue*, Cardinal*,
                              XrmValue*, XrmValue*, XtPointer*);
<!-- .br -->
      Display *<emphasis remap='I'>display</emphasis>;
<!-- .br -->
      XrmValue *<emphasis remap='I'>args</emphasis>;
<!-- .br -->
      Cardinal *<emphasis remap='I'>num_args</emphasis>;
<!-- .br -->
      XrmValue *<emphasis remap='I'>from</emphasis>;
<!-- .br -->
      XrmValue *<emphasis remap='I'>to</emphasis>;
<!-- .br -->
      XtPointer *<emphasis remap='I'>converter_data</emphasis>;
<!-- .FN -->
<variablelist>
  <varlistentry>
    <term>
      <emphasis remap='I'>display</emphasis>
    </term>
    <listitem>
      <para>
Specifies the display connection with which this conversion is associated.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>args</emphasis>
    </term>
    <listitem>
      <para>
Specifies a list of additional
<function>XrmValue</function>
arguments to the converter if additional context is needed
to perform the conversion, or NULL.
For example, the String-to-Font converter needs the widget's <emphasis remap='I'>display</emphasis>,
and the String-to-Pixel converter needs the widget's <emphasis remap='I'>screen</emphasis> and <emphasis remap='I'>colormap</emphasis>.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>num_args</emphasis>
    </term>
    <listitem>
      <para>
Specifies the number of entries in <emphasis remap='I'>args</emphasis>.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>from</emphasis>
    </term>
    <listitem>
      <para>
Specifies the value to convert.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>to</emphasis>
    </term>
    <listitem>
      <para>
Specifies a descriptor for a location into which to store the converted value.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>converter_data</emphasis>
    </term>
    <listitem>
      <para>
Specifies a location into which the converter may
store converter-specific data associated
with this conversion.
    </para>
  </listitem>
  </varlistentry>
</variablelist>
<para>
<!-- .LP -->
<!-- .eM -->
The <emphasis remap='I'>display</emphasis> argument is normally used only when generating error
messages, to identify the application context (with the function
<function>XtDisplayToApplicationContext ).</function>
</para>
<para>
<!-- .LP -->
The <emphasis remap='I'>to</emphasis> argument specifies the size and location into which the
converter should store the converted value.  If the <emphasis remap='I'>addr</emphasis> field is NULL,
the converter should allocate appropriate storage and store the size
and location into the <emphasis remap='I'>to</emphasis> descriptor.  If the type converter allocates
the storage, it remains under the ownership of the converter and must
not be modified by the caller.  The type converter is permitted to use
static storage for this purpose, and therefore the caller must
immediately copy the data upon return from the converter.  If the
<emphasis remap='I'>addr</emphasis> field is not NULL, the converter must check the <emphasis remap='I'>size</emphasis> field to
ensure that sufficient space has been allocated before storing the
converted value.  If insufficient space is specified, the converter
should update the <emphasis remap='I'>size</emphasis> field with the number of bytes required and
return
<function>False</function>
without modifying the data at the specified location.
If sufficient space was allocated by the caller, the converter should
update the <emphasis remap='I'>size</emphasis> field with the number of bytes actually occupied by the
converted value.  For converted values of type
<function>XtRString ,</function>
the size should
include the NULL-terminating byte, if any.
The converter may store any value in the location specified
in <emphasis remap='I'>converter_data</emphasis>; this value will be passed to the destructor, if any,
when the resource is freed by the (xI.
</para>
<para>
<!-- .LP -->
The converter must return
<function>True</function>
if the conversion was successful and
<function>False</function>
otherwise.  If the conversion cannot be performed because of an
improper source value, a warning message should also be issued with
<function>XtAppWarningMsg .</function>

</para>
<para>
<!-- .LP -->
Most type converters just take the data described by the specified <emphasis remap='I'>from</emphasis>
argument and return data by writing into the location specified in
the <emphasis remap='I'>to</emphasis> argument.
A few need other information, which is available in <emphasis remap='I'>args</emphasis>.
A type converter can invoke another type converter,
which allows differing sources that may convert into a common intermediate
result to make maximum use of the type converter cache.
</para>
<para>
<!-- .LP -->
Note that if an address is written into <emphasis remap='I'>to-&gt;addr</emphasis>, it cannot be that
of a local variable of the converter because the data will not be
valid after the converter returns.  Static variables may be used,
as in the following example.
If the converter modifies the resource database,
the changes affect any in-progress widget creation,
<function>XtGetApplicationResources ,</function>
or
<function>XtGetSubresources</function>
in an implementation-defined manner; however, insertion of new entries
or changes to existing entries is allowed and will not directly cause
an error.

</para>
<para>
<!-- .LP -->
The following is an example of a converter that takes a
<function>string</function>
and converts it to a
<function>Pixel .</function>
Note that the <emphasis remap='I'>display</emphasis> parameter is
used only to generate error messages; the
<function>Screen</function>
conversion argument is
still required to inform the (xI that the converted value is
a function of the particular display (and colormap).
</para>
<para>
<!-- .LP -->
<literallayout class="monospaced">
<!-- .TA .3i .7i 1i 1.3i 1.7i 2i 4i -->
<!-- .ta .3i .7i 1i 1.3i 1.7i 2i 4i -->

#define done(type, value) \\
	{						\\
		if (toVal-&gt;addr != NULL) {		\\
			if (toVal-&gt;size &lt; sizeof(type)) {	\\
				toVal-&gt;size = sizeof(type);	\\
				return False;	\\
			}				\\
			*(type*)(toVal-&gt;addr) = (value);	\\
		}					\\
		else {				\\
			static type static_val;	\\
			static_val = (value);	\\
			toVal-&gt;addr = (XPointer)&static_val;	\\
		}					\\
		toVal-&gt;size = sizeof(type);	\\
		return True;			\\
	}

static Boolean CvtStringToPixel(dpy, args, num_args, fromVal, toVal, converter_data)
	Display	*dpy;
	XrmValue	*args;
	Cardinal	*num_args;
	XrmValue	*fromVal;
	XrmValue	*toVal;
	XtPointer	*converter_data;
{
	static XColor	screenColor;
	XColor		exactColor;
	Screen		*screen;
	Colormap		colormap;
	Status			status;

	if (*num_args != 2)
		XtAppWarningMsg(XtDisplayToApplicationContext(dpy),
			"wrongParameters", "cvtStringToPixel", "XtToolkitError",
			"String to pixel conversion needs screen and colormap arguments",
			(String *)NULL, (Cardinal *)NULL);

	screen = *((Screen**) args[0].addr);
	colormap = *((Colormap *) args[1].addr);

	if (CompareISOLatin1(str, XtDefaultBackground) == 0) {
		*closure_ret = False;
		done(Pixel, WhitePixelOfScreen(screen));
	}
	if (CompareISOLatin1(str, XtDefaultForeground) == 0) {
		*closure_ret = False;
		done(Pixel, BlackPixelOfScreen(screen));
	}


	status = XAllocNamedColor(DisplayOfScreen(screen), colormap, (char*)fromVal-&gt;addr,
				               &screenColor, &exactColor);

	if (status == 0) {
		String params[1];
		Cardinal num_params = 1;
		params[0] = (String)fromVal-&gt;addr;
		XtAppWarningMsg(XtDisplayToApplicationContext(dpy),
			"noColormap", "cvtStringToPixel", "XtToolkitError",
			"Cannot allocate colormap entry for \\"%s\\"", params,\
 &num_params);
	        *converter_data = (char *) False;
                return False;
	} else {
                *converter_data = (char *) True;
		done(Pixel, &screenColor.pixel);
	}
}
</literallayout>
</para>
<para>
<!-- .LP -->
All type converters should define some set of conversion values for which they
are guaranteed to succeed so these can be used in the resource defaults.
This issue arises only with conversions, such as fonts and colors,
where there is no string representation that all server implementations
will necessarily recognize.
For resources like these,
the converter should define a symbolic constant
in the same manner as
<function>XtDefaultForeground ,</function>
<function>XtDefaultBackground ,</function>
and
<function>XtDefaultFont .</function>
<!-- .sp -->
</para>
<para>
<!-- .LP -->
To allow the (xI to deallocate resources produced by type
converters, a resource destructor procedure may also be provided.
</para>
<para>
<!-- .LP -->
A resource destructor procedure pointer is of type
<function>XtDestructor .</function>
</para>
<para>
<!-- .LP -->
<!-- .IN "XtDestructor" "" "@DEF@" -->
<!-- .sM -->
</para>
<!-- .FD 0 -->
typedef void (*XtDestructor) (XtAppContext, XrmValue*, XtPointer, XrmValue*, \
Cardinal*);
<!-- .br -->
      XtAppContext <emphasis remap='I'>app</emphasis>;
<!-- .br -->
      XrmValue *<emphasis remap='I'>to</emphasis>;
<!-- .br -->
      XtPointer <emphasis remap='I'>converter_data</emphasis>;
<!-- .br -->
      XrmValue *<emphasis remap='I'>args</emphasis>;
<!-- .br -->
      Cardinal *<emphasis remap='I'>num_args</emphasis>;
<!-- .FN -->
<variablelist>
  <varlistentry>
    <term>
      <emphasis remap='I'>app</emphasis>
    </term>
    <listitem>
      <para>
Specifies an application context in which the resource is being freed.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>to</emphasis>
    </term>
    <listitem>
      <para>
Specifies a descriptor for the resource produced by the type converter.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>converter_data</emphasis>
    </term>
    <listitem>
      <para>
Specifies the converter-specific data returned by the type converter.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>args</emphasis>
    </term>
    <listitem>
      <para>
Specifies the additional converter arguments as passed
to the type converter when the conversion was performed.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>num_args</emphasis>
    </term>
    <listitem>
      <para>
Specifies the number of entries in <emphasis remap='I'>args</emphasis>.
    </para>
  </listitem>
  </varlistentry>
</variablelist>
<para>
<!-- .LP -->
<!-- .eM -->
The destructor procedure is responsible for freeing the resource
specified by the <emphasis remap='I'>to</emphasis> argument, including any auxiliary storage
associated with that resource, but not the memory directly addressed
by the size and location in the <emphasis remap='I'>to</emphasis> argument or the memory specified
by <emphasis remap='I'>args</emphasis>.

</para>
</sect3>
<sect3 id="Issuing_Conversion_Warnings">
<title>Issuing Conversion Warnings</title>
<!-- .XS -->
<!-- (SN Issuing Conversion Warnings -->
<!-- .XE -->
<para>
<!-- .LP -->
The
<function>XtDisplayStringConversionWarning</function>
procedure is a convenience routine for resource type converters
that convert from string values.
</para>
<para>
<!-- .LP -->
<!-- .IN "XtDisplayStringConversionWarning" "" "@DEF@" -->
<!-- .sM -->
</para>
<!-- .FD 0 -->
void XtDisplayStringConversionWarning(<emphasis remap='I'>display</emphasis>, <emphasis remap='I'>from_value</emphasis>, \
<emphasis remap='I'>to_type</emphasis>)
<!-- .br -->
      Display *<emphasis remap='I'>display</emphasis>;
<!-- .br -->
      String <emphasis remap='I'>from_value</emphasis>, <emphasis remap='I'>to_type</emphasis>;
<!-- .FN -->
<variablelist>
  <varlistentry>
    <term>
      <emphasis remap='I'>display</emphasis>
    </term>
    <listitem>
      <para>
Specifies the display connection with which the conversion is associated.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>from_value</emphasis>
    </term>
    <listitem>
      <para>
Specifies the string that could not be converted.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>to_type</emphasis>
    </term>
    <listitem>
      <para>
Specifies the target representation type requested.
    </para>
  </listitem>
  </varlistentry>
</variablelist>
<para>
<!-- .LP -->
<!-- .eM -->
The
<function>XtDisplayStringConversionWarning</function>
procedure issues a warning message using
<function>XtAppWarningMsg</function>
with <emphasis remap='I'>name</emphasis> ``conversionError'',
<emphasis remap='I'>type</emphasis> ``string'', <emphasis remap='I'>class</emphasis> ``XtToolkitError'', and the default message
``Cannot convert "<emphasis remap='I'>from_value</emphasis>" to type <emphasis remap='I'>to_type</emphasis>''.
</para>
<para>
<!-- .LP -->
To issue other types of warning or error messages, the type converter
should use
<function>XtAppWarningMsg</function>
or
<function>XtAppErrorMsg .</function>
<!-- .sp -->
</para>
<para>
<!-- .LP -->
To retrieve the application context associated with a given
display connection, use
<function>XtDisplayToApplicationContext .</function>
</para>
<para>
<!-- .LP -->
<!-- .IN "XtDisplayToApplicationContext" "" "@DEF@" -->
<!-- .sM -->
</para>
<!-- .FD 0 -->
XtAppContext XtDisplayToApplicationContext( <emphasis remap='I'>display</emphasis> )
<!-- .br -->
      Display *<emphasis remap='I'>display</emphasis>;
<!-- .FN -->
<variablelist>
  <varlistentry>
    <term>
      <emphasis remap='I'>display</emphasis>
    </term>
    <listitem>
      <para>
Specifies an open and initialized display connection.
    </para>
  </listitem>
  </varlistentry>
</variablelist>
<para>
<!-- .LP -->
<!-- .eM -->
The
<function>XtDisplayToApplicationContext</function>
function returns the application
context in which the specified <emphasis remap='I'>display</emphasis> was initialized.  If the
display is not known to the (xI, an error message is issued.

</para>
</sect3>
<sect3 id="Registering_a_New_Resource_Converter">
<title>Registering a New Resource Converter</title>
<!-- .XS -->
<!-- <function>(SN Registering a New Resource Converter</function> -->
<!-- .XE -->
<para>
<!-- .LP -->
When registering a resource converter, the client must specify the
manner in which the conversion cache is to be used when there are multiple
calls to the converter.  Conversion cache control is specified
via an
<function>XtCacheType</function>
</para>
<para>
<!-- .LP -->
<!-- .IN "XtCacheType" "" "@DEF@" -->
argument.
<!-- .sM -->
<literallayout class="monospaced">
typedef int XtCacheType;
</literallayout>
</para>
<para>
<!-- .LP -->
<!-- .eM -->
An
<function>XtCacheType</function>
field may contain one of the following values:
<!-- .br -->
<!-- .sp -->
</para>
<para>
<!-- .LP -->
<function>XtCacheNone</function>
<!-- .IN "XtCacheNone" "" "@DEF@" -->
</para>
<itemizedlist>
  <listitem>
    <para>
Specifies that the results of a previous conversion
may not be reused to satisfy any other resource
requests; the specified converter will be called
each time the converted value is required.
<!-- .br -->
<!-- .sp -->
    </para>
  </listitem>
</itemizedlist>
<para>
<!-- .LP -->
<function>XtCacheAll</function>
<!-- .IN "XtCacheAll" "" "@DEF@" -->
</para>
<itemizedlist>
  <listitem>
    <para>
Specifies that the results of a previous conversion
should be reused for any resource request that depends
upon the same source value and conversion arguments.
<!-- .br -->
<!-- .sp -->
    </para>
  </listitem>
</itemizedlist>
<para>
<!-- .LP -->
<function>XtCacheByDisplay</function>
<!-- .IN "XtCacheByDisplay" "" "@DEF@" -->
</para>
<itemizedlist>
  <listitem>
    <para>
Specifies that the results of a previous conversion
should be used as for
<function>XtCacheAll</function>
but the destructor will be called, if specified, if
<function>XtCloseDisplay</function>
is called
for the display connection associated with the converted value, and
the value will be removed from the conversion cache.
    </para>
  </listitem>
</itemizedlist>
<para>
<!-- .LP -->
The qualifier
<function>XtCacheRefCount</function>
<!-- .IN "XtCacheRefCount" "" "@DEF@" -->
may be ORed with any of the above values.  If
<function>XtCacheRefCount</function>
is specified, calls to
<function>XtCreateWidget ,</function>
<function>XtCreateManagedWidget ,</function>
<function>XtGetApplicationResources ,</function>
and
<function>XtGetSubresources</function>
that use the converted value will be counted.  When a widget using the
converted value is destroyed, the count is decremented, and, if the
count reaches zero, the destructor procedure will be called and the
converted value will be removed from the conversion cache.

</para>
<para>
<!-- .LP -->
To register a type converter for all application contexts in a
process, use
<function>XtSetTypeConverter ,</function>
and to register a type converter in a single application context, use
<function>XtAppSetTypeConverter .</function>
</para>
<para>
<!-- .LP -->
<!-- .IN "XtSetTypeConverter" "" "@DEF@" -->
<!-- .sM -->
</para>
<!-- .FD 0 -->
void XtSetTypeConverter(<emphasis remap='I'>from_type</emphasis>, <emphasis remap='I'>to_type</emphasis>, <emphasis remap='I'>converter</emphasis>, \
<emphasis remap='I'>convert_args</emphasis>, <emphasis remap='I'>num_args</emphasis>,
                        <emphasis remap='I'>cache_type</emphasis>, <emphasis remap='I'>destructor</emphasis>)
<!-- .br -->
      String <emphasis remap='I'>from_type</emphasis>;
<!-- .br -->
      String <emphasis remap='I'>to_type</emphasis>;
<!-- .br -->
      XtTypeConverter <emphasis remap='I'>converter</emphasis>;
<!-- .br -->
      XtConvertArgList <emphasis remap='I'>convert_args</emphasis>;
<!-- .br -->
      Cardinal <emphasis remap='I'>num_args</emphasis>;
<!-- .br -->
      XtCacheType <emphasis remap='I'>cache_type</emphasis>;
<!-- .br -->
      XtDestructor <emphasis remap='I'>destructor</emphasis>;
<!-- .FN -->
<variablelist>
  <varlistentry>
    <term>
      <emphasis remap='I'>from_type</emphasis>
    </term>
    <listitem>
      <para>
Specifies the source type.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>to_type</emphasis>
    </term>
    <listitem>
      <para>
Specifies the destination type.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>converter</emphasis>
    </term>
    <listitem>
      <para>
Specifies the resource type converter procedure.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>convert_args</emphasis>
    </term>
    <listitem>
      <para>
Specifies additional conversion arguments, or NULL.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>num_args</emphasis>
    </term>
    <listitem>
      <para>
Specifies the number of entries in <emphasis remap='I'>convert_args</emphasis>.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>cache_type</emphasis>
    </term>
    <listitem>
      <para>
Specifies whether or not resources produced by this
converter are sharable or display-specific and when
they should be freed.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>destructor</emphasis>
    </term>
    <listitem>
      <para>
Specifies a destroy procedure for resources produced by
this conversion, or NULL if no additional action is
required to deallocate resources produced by the converter.
    </para>
  </listitem>
  </varlistentry>
</variablelist>
<para>
<!-- .LP -->
<!-- .IN "XtAppSetTypeConverter" "" "@DEF@" -->
</para>
<!-- .FD 0 -->
void XtAppSetTypeConverter(<emphasis remap='I'>app_context</emphasis>, <emphasis remap='I'>from_type</emphasis>, <emphasis remap='I'>to_type</emphasis>, \
<emphasis remap='I'>converter</emphasis>, <emphasis remap='I'>convert_args</emphasis>,
                           <emphasis remap='I'>num_args</emphasis>, <emphasis remap='I'>cache_type</emphasis>, <emphasis remap='I'>destructor</emphasis>)
<!-- .br -->
      XtAppContext <emphasis remap='I'>app_context</emphasis>;
<!-- .br -->
      String <emphasis remap='I'>from_type</emphasis>;
<!-- .br -->
      String <emphasis remap='I'>to_type</emphasis>;
<!-- .br -->
      XtTypeConverter <emphasis remap='I'>converter</emphasis>;
<!-- .br -->
      XtConvertArgList <emphasis remap='I'>convert_args</emphasis>;
<!-- .br -->
      Cardinal <emphasis remap='I'>num_args</emphasis>;
<!-- .br -->
      XtCacheType <emphasis remap='I'>cache_type</emphasis>;
<!-- .br -->
      XtDestructor <emphasis remap='I'>destructor</emphasis>;
<!-- .FN -->
<variablelist>
  <varlistentry>
    <term>
      <emphasis remap='I'>app_context</emphasis>
    </term>
    <listitem>
      <para>
Specifies the application context.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>from_type</emphasis>
    </term>
    <listitem>
      <para>
Specifies the source type.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>to_type</emphasis>
    </term>
    <listitem>
      <para>
Specifies the destination type.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>converter</emphasis>
    </term>
    <listitem>
      <para>
Specifies the resource type converter procedure.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>convert_args</emphasis>
    </term>
    <listitem>
      <para>
Specifies additional conversion arguments, or NULL.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>num_args</emphasis>
    </term>
    <listitem>
      <para>
Specifies the number of entries in <emphasis remap='I'>convert_args</emphasis>.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>cache_type</emphasis>
    </term>
    <listitem>
      <para>
Specifies whether or not resources produced by this
converter are sharable or display-specific and when
they should be freed.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>destructor</emphasis>
    </term>
    <listitem>
      <para>
Specifies a destroy procedure for resources produced by
this conversion, or NULL if no additional action is
required to deallocate resources produced by the converter.
    </para>
  </listitem>
  </varlistentry>
</variablelist>
<para>
<!-- .LP -->
<!-- .eM -->
<function>XtSetTypeConverter</function>
registers the specified type converter and
destructor in all application contexts created by the calling process,
including any future application contexts that may be created.
<function>XtAppSetTypeConverter</function>
registers the specified type converter in the
single application context specified.  If the same <emphasis remap='I'>from_type</emphasis> and
<emphasis remap='I'>to_type</emphasis> are specified in multiple calls to either function, the most
recent overrides the previous ones.
<!-- .sp -->
</para>
<para>
<!-- .LP -->
For the few type converters that need additional arguments,
the (xI conversion mechanism provides a method of specifying
how these arguments should be computed.
The enumerated type
<function>XtAddressMode</function>
and the structure
<function>XtConvertArgRec</function>
specify how each argument is derived.
These are defined in
<function>&lt; X11/Intrinsic.h &gt;.</function>
</para>
<para>
<!-- .LP -->
<!-- .sM -->
<literallayout class="monospaced">
<!-- .TA .5i 2.5i -->
<!-- .ta .5i 2.5i -->
typedef enum {
	/* address mode	parameter representation */
	   XtAddress,	/* address */
	   XtBaseOffset,	/* offset */
	   XtImmediate,	/* constant */
	   XtResourceString,	/* resource name string */
	   XtResourceQuark,	/* resource name quark */
	   XtWidgetBaseOffset,	/* offset */
	   XtProcedureArg	/* procedure to call */
} XtAddressMode;
<!-- .sp -->
typedef struct {
	XtAddressMode address_mode;
	XtPointer address_id;
	Cardinal size;
} XtConvertArgRec, *XtConvertArgList;
</literallayout>
<!-- .eM -->
</para>
<para>
<!-- .LP -->
The <emphasis remap='I'>size</emphasis> field specifies the length of the data in bytes.
The <emphasis remap='I'>address_mode</emphasis> field specifies how the <emphasis remap='I'>address_id</emphasis> field should be
interpreted.
<function>XtAddress</function>
<!-- .IN "XtAddress" "" "@DEF@" -->
causes <emphasis remap='I'>address_id</emphasis> to be interpreted as the address of the data.
<function>XtBaseOffset</function>
<!-- .IN "XtBaseOffset" "" "@DEF@" -->
causes <emphasis remap='I'>address_id</emphasis> to be interpreted as the offset from the widget base.
<function>XtImmediate</function>
<!-- .IN "XtImmediate" "" "@DEF@" -->
causes <emphasis remap='I'>address_id</emphasis> to be interpreted as a constant.
<function>XtResourceString</function>
<!-- .IN "XtResourceString" "" "@DEF@" -->
causes <emphasis remap='I'>address_id</emphasis> to be interpreted as the name of a resource
that is to be converted into an offset from the widget base.
<function>XtResourceQuark</function>
<!-- .IN "XtResourceQuark" "" "@DEF@" -->
causes <emphasis remap='I'>address_id</emphasis> to be interpreted as the result of an
<function>XrmStringToQuark</function>
conversion on the name of a resource,
which is to be converted into an offset from the widget base.
<function>XtWidgetBaseOffset</function>
<!-- .IN "XtWidgetBaseOffset" "" "@DEF@" -->
is similar to
<function>XtBaseOffset</function>
except that it
searches for the closest windowed ancestor if the object is not
of a subclass of
Core
(see Chapter 12).
<function>XtProcedureArg</function>
<!-- .IN "XtProcedureArg" "" "@DEF@" -->
specifies that <emphasis remap='I'>address_id</emphasis> is a pointer to a procedure to
be invoked to return the conversion argument.  If
<function>XtProcedureArg</function>
is specified, <emphasis remap='I'>address_id</emphasis> must contain
the address of a function of type
<function>XtConvertArgProc .</function>
</para>
<para>
<!-- .LP -->
<!-- .IN "XtConvertArgProc" "" "@DEF@" -->
<!-- .sM -->
</para>
<!-- .FD 0 -->
typedef void (*XtConvertArgProc)(Widget, Cardinal*, XrmValue*);
<!-- .br -->
      Widget <emphasis remap='I'>object</emphasis>;
<!-- .br -->
      Cardinal *<emphasis remap='I'>size</emphasis>;
<!-- .br -->
      XrmValue *<emphasis remap='I'>value</emphasis>;
<!-- .FN -->
<variablelist>
  <varlistentry>
    <term>
      <emphasis remap='I'>object</emphasis>
    </term>
    <listitem>
      <para>
Passes the object for which the resource is being
converted, or NULL if the converter was invoked by
<function>XtCallConverter</function>
or
<function>XtDirectConvert .</function>
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>size</emphasis>
    </term>
    <listitem>
      <para>
Passes a pointer to the <emphasis remap='I'>size</emphasis> field from the
<function>XtConvertArgRec .</function>
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>value</emphasis>
    </term>
    <listitem>
      <para>
Passes a pointer to a descriptor into which the procedure
must store the conversion argument.
    </para>
  </listitem>
  </varlistentry>
</variablelist>
<para>
<!-- .LP -->
<!-- .eM -->
When invoked, the
<function>XtConvertArgProc</function>
procedure must derive a conversion
argument and store the address and size of the argument in the location
pointed to by <emphasis remap='I'>value</emphasis>.
</para>
<para>
<!-- .LP -->
In order to permit reentrancy, the
<function>XtConvertArgProc</function>
should return the address of storage whose lifetime is no shorter than the
lifetime of <emphasis remap='I'>object</emphasis>.  If <emphasis remap='I'>object</emphasis> is NULL, the lifetime of the conversion
argument must be no shorter than the lifetime of the resource with
which the conversion argument is associated.  The (xI do not
guarantee to copy this storage but do guarantee not to reference it if
the resource is removed from the conversion cache.
</para>
<para>
<!-- .LP -->
The following example illustrates how to register the CvtStringToPixel
routine given earlier:
</para>
<para>
<!-- .LP -->
<literallayout class="monospaced">
<!-- .TA .2i 3i -->
<!-- .ta .2i 3i -->
static XtConvertArgRec colorConvertArgs[] = {
	{XtWidgetBaseOffset, (XtPointer)XtOffset(Widget, core.screen),  sizeof(Screen*)},
	{XtWidgetBaseOffset, (XtPointer)XtOffset(Widget, core.colormap),sizeof(Colormap)}
};

XtSetTypeConverter(XtRString, XtRPixel, CvtStringToPixel,
    colorConvertArgs, XtNumber(colorConvertArgs), XtCacheByDisplay, NULL);
</literallayout>
</para>
<para>
<!-- .LP -->
The conversion argument descriptors
<function>colorConvertArgs</function>
and
<function>screenConvertArg</function>
are predefined by the (xI.  Both take the
values from the closest windowed ancestor if the object is not of a
subclass of
Core.
The
<function>screenConvertArg</function>
descriptor puts the widget's <emphasis remap='I'>screen</emphasis> field into <emphasis remap='I'>args</emphasis>[0].  The
<function>colorConvertArgs</function>
descriptor puts the widget's <emphasis remap='I'>screen</emphasis> field into <emphasis remap='I'>args</emphasis>[0],
and the widget's <emphasis remap='I'>colormap</emphasis> field into <emphasis remap='I'>args</emphasis>[1].
</para>
<para>
<!-- .LP -->
Conversion routines should not just put a descriptor for the address of the
base of the widget into <emphasis remap='I'>args</emphasis>[0], and use that in the routine.
They should pass in the actual values on which the conversion depends.
By keeping the dependencies of the conversion procedure specific,
it is more likely that subsequent conversions will find what they need
in the conversion cache.
This way the cache is smaller and has fewer and more widely applicable entries.
</para>
<para>
<!-- .LP -->
If any conversion arguments of type
<function>XtBaseOffset ,</function>
<function>XtResourceString ,</function>
<function>XtResourceQuark ,</function>
and
<function>XtWidgetBaseOffset</function>
are specified for conversions performed by
<function>XtGetApplicationResources ,</function>
<function>XtGetSubresources ,</function>
<function>XtVaGetApplicationResources ,</function>
or
<function>XtVaGetSubresources ,</function>
the arguments are
computed with respect to the specified widget, not the base address or
resource list specified in the call.
</para>
<para>
<!-- .LP -->
If the
<function>XtConvertArgProc</function>
modifies the resource database,
the changes affect any in-progress widget creation,
<function>XtGetApplicationResources ,</function>
or
<function>XtGetSubresources</function>
in an implementation-defined manner; however, insertion of new entries
or changes to existing entries are allowed and will not directly cause
an error.

</para>
</sect3>
<sect3 id="Resource_Converter_Invocation">
<title>Resource Converter Invocation</title>
<!-- .XS -->
<!-- <function>(SN Resource Converter Invocation</function> -->
<!-- .XE -->
<para>
<!-- .LP -->
All resource-fetching routines (for example,
<function>XtGetSubresources ,</function>
<function>XtGetApplicationResources ,</function>
and so on) call resource converters if the resource database or
varargs list specifies a value
that has a different representation from the desired representation or if the
widget's default resource value representation is different from the desired
representation.
<!-- .sp -->
</para>
<para>
<!-- .LP -->
To invoke explicit resource conversions, use
<function>XtConvertAndStore</function>
or
<function>XtCallConverter .</function>
</para>
<para>
<!-- .LP -->
<!-- .sM -->
<literallayout class="monospaced">
typedef XtPointer XtCacheRef;
</literallayout>
<!-- .IN "XtCallConverter" "" "@DEF@" -->
</para>
<!-- .FD 0 -->
Boolean XtCallConverter(<emphasis remap='I'>display</emphasis>, <emphasis remap='I'>converter</emphasis>, \
<emphasis remap='I'>conversion_args</emphasis>, <emphasis remap='I'>num_args</emphasis>, <emphasis remap='I'>from</emphasis>, <emphasis remap='I'>to_in_out</emphasis>,
                                              <emphasis remap='I'>cache_ref_return</emphasis>)
<!-- .br -->
      Display* <emphasis remap='I'>display</emphasis>;
<!-- .br -->
      XtTypeConverter <emphasis remap='I'>converter</emphasis>;
<!-- .br -->
      XrmValuePtr <emphasis remap='I'>conversion_args</emphasis>;
<!-- .br -->
      Cardinal <emphasis remap='I'>num_args</emphasis>;
<!-- .br -->
      XrmValuePtr <emphasis remap='I'>from</emphasis>;
<!-- .br -->
      XrmValuePtr <emphasis remap='I'>to_in_out</emphasis>;
<!-- .br -->
      XtCacheRef *<emphasis remap='I'>cache_ref_return</emphasis>;
<!-- .FN -->
<variablelist>
  <varlistentry>
    <term>
      <emphasis remap='I'>display</emphasis>
    </term>
    <listitem>
      <para>
Specifies the display with which the conversion is to be associated.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>converter</emphasis>
    </term>
    <listitem>
      <para>
Specifies the conversion procedure to be called.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>conversion_args</emphasis>
    </term>
    <listitem>
      <para>
Specifies the additional conversion arguments needed
to perform the conversion, or NULL.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>num_args</emphasis>
    </term>
    <listitem>
      <para>
Specifies the number of entries in <emphasis remap='I'>conversion_args</emphasis>.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>from</emphasis>
    </term>
    <listitem>
      <para>
Specifies a descriptor for the source value.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>to_in_out</emphasis>
    </term>
    <listitem>
      <para>
Returns the converted value.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>cache_ref_return</emphasis>
    </term>
    <listitem>
      <para>
Returns a conversion cache id.
    </para>
  </listitem>
  </varlistentry>
</variablelist>
<para>
<!-- .LP -->
<!-- .eM -->
The
<function>XtCallConverter</function>
function looks up the
specified type converter in the application context associated with
the display and, if the converter was not registered or was registered
with cache type
<function>XtCacheAll</function>
or
<function>XtCacheByDisplay ,</function>
looks in the conversion cache to see if this conversion procedure
has been called with the specified conversion arguments.  If so, it
checks the success status of the prior call, and if
the conversion failed,
<function>XtCallConverter</function>
returns
<function>False</function>
immediately;
otherwise it checks the size specified in the <emphasis remap='I'>to</emphasis> argument, and, if it is
greater than or equal to the size stored in the cache, copies the
information stored in the cache into the location specified by
<emphasis remap='I'>to-&gt;addr</emphasis>, stores the cache size into <emphasis remap='I'>to-&gt;size</emphasis>, and returns
<function>True .</function>
If the size specified in the <emphasis remap='I'>to</emphasis> argument is smaller than the size stored
in the cache,
<function>XtCallConverter</function>
copies the cache size into <emphasis remap='I'>to-&gt;size</emphasis> and returns
<function>False .</function>
If the converter was registered with cache type
<function>XtCacheNone</function>
or no value was found in the conversion cache,
<function>XtCallConverter</function>
calls the converter, and if it was not registered with cache type
<function>XtCacheNone ,</function>
enters the result in the cache.
<function>XtCallConverter</function>
then returns what the converter returned.
</para>
<para>
<!-- .LP -->
The <emphasis remap='I'>cache_ref_return</emphasis> field specifies storage allocated by the caller in which
an opaque value will be stored.  If the type converter has been
registered with the
<function>XtCacheRefCount</function>
modifier and if the value returned
in <emphasis remap='I'>cache_ref_return</emphasis> is non-NULL, then the caller should store the
<emphasis remap='I'>cache_ref_return</emphasis> value in order to decrement the reference count when
the converted value is no longer required.  The <emphasis remap='I'>cache_ref_return</emphasis>
argument should be
NULL if the caller is unwilling or unable to store the
value.
<!-- .sp -->
</para>
<para>
<!-- .LP -->
To explicitly decrement the reference counts for resources obtained
from
<function>XtCallConverter ,</function>
use
<function>XtAppReleaseCacheRefs .</function>
</para>
<para>
<!-- .LP -->
<!-- .IN "XtAppReleaseCacheRefs" "" "@DEF@" -->
<!-- .sM -->
</para>
<!-- .FD 0 -->
void XtAppReleaseCacheRefs(<emphasis remap='I'>app_context</emphasis>, <emphasis remap='I'>refs</emphasis>)
<!-- .br -->
      XtAppContext <emphasis remap='I'>app_context</emphasis>;
<!-- .br -->
      XtCacheRef *<emphasis remap='I'>refs</emphasis>;
<!-- .FN -->
<variablelist>
  <varlistentry>
    <term>
      <emphasis remap='I'>app_context</emphasis>
    </term>
    <listitem>
      <para>
Specifies the application context.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>refs</emphasis>
    </term>
    <listitem>
      <para>
Specifies the list of cache references to be released.
    </para>
  </listitem>
  </varlistentry>
</variablelist>
<para>
<!-- .LP -->
<!-- .eM -->
<function>XtAppReleaseCacheRefs</function>
decrements the reference count for the
conversion entries identified by the <emphasis remap='I'>refs</emphasis> argument.
This argument is a
pointer to a NULL-terminated list of
<function>XtCacheRef</function>
values.  If any reference
count reaches zero, the destructor, if any, will be called and
the resource removed from the conversion cache.
<!-- .sp -->
</para>
<para>
<!-- .LP -->
As a convenience to clients needing to explicitly decrement reference
counts via a callback function, the (xI define two callback
procedures,
<function>XtCallbackReleaseCacheRef</function>
and
<function>XtCallbackReleaseCacheRefList .</function>
</para>
<para>
<!-- .LP -->
<!-- .IN "XtCallbackReleaseCacheRef" "" "@DEF@" -->
<!-- .sM -->
</para>
<!-- .FD 0 -->
void XtCallbackReleaseCacheRef(<emphasis remap='I'>object</emphasis>, <emphasis remap='I'>client_data</emphasis>, <emphasis remap='I'>call_data</emphasis>)
<!-- .br -->
      Widget <emphasis remap='I'>object</emphasis>;
<!-- .br -->
      XtPointer <emphasis remap='I'>client_data</emphasis>;
<!-- .br -->
      XtPointer <emphasis remap='I'>call_data</emphasis>;
<!-- .FN -->
<variablelist>
  <varlistentry>
    <term>
      <emphasis remap='I'>object</emphasis>
    </term>
    <listitem>
      <para>
Specifies the object with which the resource is associated.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>client_data</emphasis>
    </term>
    <listitem>
      <para>
Specifies the conversion cache entry to be released.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>call_data</emphasis>
    </term>
    <listitem>
      <para>
Is ignored.
    </para>
  </listitem>
  </varlistentry>
</variablelist>
<para>
<!-- .LP -->
<!-- .eM -->
This callback procedure may be added to a callback list to release a
previously returned
<function>XtCacheRef</function>
value.  When adding the callback, the
callback <emphasis remap='I'>client_data</emphasis> argument must be specified as the value of the
<function>XtCacheRef</function>
data cast to type
<function>XtPointer .</function>
</para>
<para>
<!-- .LP -->
<!-- .IN "XtCallbackReleaseCacheRefList" "" "@DEF@" -->
<!-- .sM -->
</para>
<!-- .FD 0 -->
void XtCallbackReleaseCacheRefList(<emphasis remap='I'>object</emphasis>, <emphasis remap='I'>client_data</emphasis>, <emphasis remap='I'>call_data</emphasis>)
<!-- .br -->
      Widget <emphasis remap='I'>object</emphasis>;
<!-- .br -->
      XtPointer <emphasis remap='I'>client_data</emphasis>;
<!-- .br -->
      XtPointer <emphasis remap='I'>call_data</emphasis>;
<!-- .FN -->
<variablelist>
  <varlistentry>
    <term>
      <emphasis remap='I'>object</emphasis>
    </term>
    <listitem>
      <para>
Specifies the object with which the resources are associated.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>client_data</emphasis>
    </term>
    <listitem>
      <para>
Specifies the conversion cache entries to be released.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>call_data</emphasis>
    </term>
    <listitem>
      <para>
Is ignored.
    </para>
  </listitem>
  </varlistentry>
</variablelist>
<para>
<!-- .LP -->
<!-- .eM -->
This callback procedure may be added to a callback list to release a
list of previously returned
<function>XtCacheRef</function>
values.  When adding the
callback, the callback <emphasis remap='I'>client_data</emphasis> argument must be specified as a
pointer to a NULL-terminated list of
<function>XtCacheRef</function>
values.
<!-- .sp -->
</para>
<para>
<!-- .LP -->
To lookup and call a resource converter, copy the resulting value,
and free a cached resource when a widget is destroyed, use
<function>XtConvertAndStore .</function>
</para>
<para>
<!-- .LP -->
<!-- .IN "XtConvertAndStore" "" "@DEF@" -->
<!-- .sM -->
</para>
<!-- .FD 0 -->
Boolean XtConvertAndStore(<emphasis remap='I'>object</emphasis>, <emphasis remap='I'>from_type</emphasis>, <emphasis remap='I'>from</emphasis>, \
<emphasis remap='I'>to_type</emphasis>, <emphasis remap='I'>to_in_out</emphasis>)
<!-- .br -->
      Widget <emphasis remap='I'>object</emphasis>;
<!-- .br -->
      String <emphasis remap='I'>from_type</emphasis>;
<!-- .br -->
      XrmValuePtr <emphasis remap='I'>from</emphasis>;
<!-- .br -->
      String <emphasis remap='I'>to_type</emphasis>;
<!-- .br -->
      XrmValuePtr <emphasis remap='I'>to_in_out</emphasis>;
<!-- .FN -->
<variablelist>
  <varlistentry>
    <term>
      <emphasis remap='I'>object</emphasis>
    </term>
    <listitem>
      <para>
Specifies the object to use for additional arguments, if any are needed,
and the destroy callback list.  (oI
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>from_type</emphasis>
    </term>
    <listitem>
      <para>
Specifies the source type.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>from</emphasis>
    </term>
    <listitem>
      <para>
Specifies the value to be converted.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>to_type</emphasis>
    </term>
    <listitem>
      <para>
Specifies the destination type.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>to_in_out</emphasis>
    </term>
    <listitem>
      <para>
Specifies a descriptor for storage into which the converted value
will be returned.
    </para>
  </listitem>
  </varlistentry>
</variablelist>
<para>
<!-- .LP -->
<!-- .eM -->
The
<function>XtConvertAndStore</function>
function looks up the type converter registered
to convert <emphasis remap='I'>from_type</emphasis> to <emphasis remap='I'>to_type</emphasis>, computes any additional arguments
needed, and then calls
<function>XtCallConverter</function>
(or
<function>XtDirectConvert</function>
if an old-style converter was registered with
<function>XtAddConverter</function>
or
<function>XtAppAddConverter ;</function>
see Appendix C) with the <emphasis remap='I'>from</emphasis> and <emphasis remap='I'>to_in_out</emphasis> arguments.  The
<emphasis remap='I'>to_in_out</emphasis> argument specifies the size and location into which the
converted value will be stored and is passed directly to the
converter.  If the location is specified as NULL, it will be replaced
with a pointer to private storage and the size will be returned in the
descriptor.  The caller is expected to copy this private storage
immediately and must not modify it in any way.  If a non-NULL location
is specified, the caller must allocate sufficient storage to hold the
converted value and must also specify the size of that storage in the
descriptor.
The <emphasis remap='I'>size</emphasis> field will be modified on return to indicate the actual
size of the converted data.
If the conversion succeeds,
<function>XtConvertAndStore</function>
returns
<function>True ;</function>
otherwise, it returns
<function>False .</function>
</para>
<para>
<!-- .LP -->
<function>XtConvertAndStore</function>
adds
<function>XtCallbackReleaseCacheRef</function>
<!-- .IN "destroyCallback" -->
to the destroyCallback list of the specified object if the conversion
returns an
<function>XtCacheRef</function>
value.  The resulting resource should not be referenced
after the object has been destroyed.
</para>
<para>
<!-- .LP -->
<function>XtCreateWidget</function>
performs processing equivalent to
<function>XtConvertAndStore</function>
when initializing the object instance.  Because there is extra memory
overhead required to implement reference counting, clients may
distinguish those objects that are never destroyed before the
application exits from those that may be destroyed and whose
resources should be deallocated.
</para>
<para>
<!-- .LP -->
To specify whether reference counting is to be enabled for the
resources of a particular object when the object is created, the
client can specify a value for the
<function>Boolean</function>
resource
XtNinitialResourcesPersistent,
<!-- .IN "XtNinitialResourcesPersistent" "" "@DEF@" -->
class
XtCInitialResourcesPersistent.
</para>
<para>
<!-- .LP -->
When
<function>XtCreateWidget</function>
is called, if this resource is not specified as
<function>False</function>
in either the arglist or the resource database, then the
resources referenced by this object are not reference-counted, regardless of
how the type converter may have been registered.  The effective
default value is
<function>True ;</function>
thus clients that expect to destroy one or
more objects and want resources deallocated must explicitly specify
<function>False</function>
for
<!-- .IN XtNinitialResourcesPersistent -->
XtNinitialResourcesPersistent.
</para>
<para>
<!-- .LP -->
The resources are still freed and destructors called when
<function>XtCloseDisplay</function>
is called if the conversion was registered as
<function>XtCacheByDisplay .</function>

</para>
</sect3>
</sect2>
<sect2 id="Reading_and_Writing_Widget_State">
<title>Reading and Writing Widget State</title>
<!-- .XS -->
<!-- <function>(SN Reading and Writing Widget State</function> -->
<!-- .XE -->
<para>
<!-- .LP -->
Any resource field in a widget can be read or written by a client.
On a write operation,
the widget decides what changes it will actually allow and updates all
derived fields appropriately.

</para>
<sect3 id="Obtaining_Widget_State">
<title>Obtaining Widget State</title>
<!-- .XS -->
<!-- <function>(SN Obtaining Widget State</function> -->
<!-- .XE -->
<para>
<!-- .LP -->
To retrieve the current values of resources associated with a
widget instance, use
<function>XtGetValues .</function>
</para>
<para>
<!-- .LP -->
<!-- .IN "XtGetValues" "" "@DEF@" -->
<!-- .sM -->
</para>
<!-- .FD 0 -->
void XtGetValues(<emphasis remap='I'>object</emphasis>, <emphasis remap='I'>args</emphasis>, <emphasis remap='I'>num_args</emphasis>)
<!-- .br -->
      Widget <emphasis remap='I'>object</emphasis>;
<!-- .br -->
      ArgList <emphasis remap='I'>args</emphasis>;
<!-- .br -->
      Cardinal <emphasis remap='I'>num_args</emphasis>;
<!-- .FN -->
<variablelist>
  <varlistentry>
    <term>
      <emphasis remap='I'>object</emphasis>
    </term>
    <listitem>
      <para>
Specifies the object whose resource values are to be returned.  (oI
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>args</emphasis>
    </term>
    <listitem>
      <para>
Specifies the argument list of name/address pairs that contain the
resource names and the addresses into which the resource values are to
be stored.
The resource names are widget-dependent.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>num_args</emphasis>
    </term>
    <listitem>
      <para>
Specifies the number of entries in the argument list.
    </para>
  </listitem>
  </varlistentry>
</variablelist>
<para>
<!-- .LP -->
<!-- .eM -->
The
<function>XtGetValues</function>
function starts with the resources specified for the Object class
and proceeds down the subclass chain to the class of the object.
The <emphasis remap='I'>value</emphasis> field of a passed argument list must contain the
address into which to copy the contents of the corresponding
object instance field.  If the field is a pointer type, the lifetime
of the pointed-to data is defined by the object class.  For the
(xI-defined resources, the following lifetimes apply:
</para>
<itemizedlist>
  <listitem>
    <para>
Not valid following any operation that modifies the resource:
<!-- .RS -->
    </para>
  </listitem>
  <listitem>
    <para>
XtNchildren resource of composite widgets.
    </para>
  </listitem>
  <listitem>
    <para>
All resources of representation type XtRCallback.
<!-- .RE -->
    </para>
  </listitem>
  <listitem>
    <para>
Remain valid at least until the widget is destroyed:
<!-- .RS -->
    </para>
  </listitem>
  <listitem>
    <para>
XtNaccelerators, XtNtranslations.
<!-- .RE -->
    </para>
  </listitem>
  <listitem>
    <para>
Remain valid until the Display is closed:
<!-- .RS -->
    </para>
  </listitem>
  <listitem>
    <para>
XtNscreen.
<!-- .RE -->
    </para>
  </listitem>
</itemizedlist>
<para>
<!-- .LP -->
It is the caller's responsibility
to allocate and deallocate storage for the copied data
according to the size of the
resource representation type used within the object.
</para>
<para>
<!-- .LP -->
If the class of the object's parent is a subclass of
<function>constraintWidgetClass ,</function>
<function>XtGetValues</function>
then fetches the values for any constraint resources requested.
It starts with the constraint resources specified for
<function>constraintWidgetClass</function>
and proceeds down the subclass chain to the parent's constraint resources.
If the argument list contains a resource name that is not found in any of the
resource lists searched,
the value at the corresponding address is not modified.
<!-- .IN "get_values_hook procedure" -->
If any get_values_hook procedures in the
object's class or superclass records are non-NULL,
they are called in superclass-to-subclass order after
all the resource values have been fetched by
<function>XtGetValues .</function>
Finally, if the object's parent is a
subclass of
<function>constraintWidgetClass ,</function>
and if any of the parent's class or
superclass records have declared
<function>ConstraintClassExtension</function>
records in
the Constraint class part <emphasis remap='I'>extension</emphasis> field with a record type of
<function>\s-1NULLQUARK\s+1 ,</function>
and if the <emphasis remap='I'>get_values_hook</emphasis> field in the extension record is non-NULL,
<function>XtGetValues</function>
calls the get_values_hook procedures in superclass-to-subclass order.
This permits a Constraint parent to provide
nonresource data via
<function>XtGetValues .</function>
</para>
<para>
<!-- .LP -->
Get_values_hook procedures may modify the data stored at the
location addressed by the <emphasis remap='I'>value</emphasis> field, including (but not
limited to) making a copy of data whose resource representation is a
pointer.  None of the (xI-defined object classes copy
data in this manner.  Any operation that modifies the queried
object resource may invalidate the pointed-to data.

<!-- .sp -->
</para>
<para>
<!-- .LP -->
To retrieve the current values of resources associated with a widget
instance using varargs lists, use
<function>XtVaGetValues .</function>
</para>
<para>
<!-- .LP -->
<!-- .IN "XtVaGetValues" "" "@DEF@" -->
<!-- .sM -->
</para>
<!-- .FD 0 -->
void XtVaGetValues(<emphasis remap='I'>object</emphasis>, ...)
<!-- .br -->
      Widget <emphasis remap='I'>object</emphasis>;
<!-- .FN -->
<variablelist>
  <varlistentry>
    <term>
      <emphasis remap='I'>object</emphasis>
    </term>
    <listitem>
      <para>
Specifies the object whose resource values are to be returned.  (oI
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      ...
    </term>
    <listitem>
      <para>
Specifies the variable argument list for the resources to
be returned.
    </para>
  </listitem>
  </varlistentry>
</variablelist>
<para>
<!-- .LP -->
<!-- .eM -->
<function>XtVaGetValues</function>
is identical in function to
<function>XtGetValues</function>
with the <emphasis remap='I'>args</emphasis>
and <emphasis remap='I'>num_args</emphasis> parameters replaced by a varargs list, as described in
Section 2.5.1.  All value entries in the list must specify pointers to
storage allocated by the caller to which the resource value will be
copied.  It is the caller's responsibility to ensure that sufficient
storage is allocated.  If
<function>XtVaTypedArg</function>
is specified, the <emphasis remap='I'>type</emphasis> argument
specifies the representation desired by the caller and <emphasis remap='I'>the</emphasis> size argument
specifies the number of bytes allocated to store the result of the
conversion.  If the size is insufficient, a warning message is issued
and the list entry is skipped.

</para>
<sect4 id="Widget_Subpart_Resource_Data_The_get_values_hook_Procedure">
<title>Widget Subpart Resource Data: The get_values_hook Procedure</title>
<!-- .XS -->
<!-- (SN Widget Subpart Resource Data: The get_values_hook Procedure -->
<!-- .XE -->
<para>
<!-- .LP -->
Widgets that have subparts can return resource values from them through
<function>XtGetValues</function>
by supplying a get_values_hook procedure.
The get_values_hook procedure pointer is of type
<function>XtArgsProc .</function>
</para>
<para>
<!-- .LP -->
<!-- .IN "get_values_hook procedure" "" "@DEF@" -->
<!-- .sM -->
</para>
<!-- .FD 0 -->
typedef void (*XtArgsProc)(Widget, ArgList, Cardinal*);
<!-- .br -->
      Widget <emphasis remap='I'>w</emphasis>;
<!-- .br -->
      ArgList <emphasis remap='I'>args</emphasis>;
<!-- .br -->
      Cardinal *<emphasis remap='I'>num_args</emphasis>;
<!-- .FN -->
<variablelist>
  <varlistentry>
    <term>
      <emphasis remap='I'>w</emphasis>
    </term>
    <listitem>
      <para>
Specifies the widget whose subpart resource values are to be retrieved.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>args</emphasis>
    </term>
    <listitem>
      <para>
Specifies the argument list that was passed to
<function>XtGetValues</function>
or the transformed varargs list passed to
<function>XtVaGetValues .</function>
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>num_args</emphasis>
    </term>
    <listitem>
      <para>
Specifies the number of entries in the argument list.
    </para>
  </listitem>
  </varlistentry>
</variablelist>
<para>
<!-- .LP -->
<!-- .eM -->
The widget with subpart resources should call
<function>XtGetSubvalues</function>
in the get_values_hook procedure
and pass in its subresource list and the <emphasis remap='I'>args</emphasis> and <emphasis remap='I'>num_args</emphasis> parameters.

</para>
</sect4>
<sect4 id="Widget_Subpart_State">
<title>Widget Subpart State</title>
<!-- .XS -->
<!-- (SN Widget Subpart State -->
<!-- .XE -->
<para>
<!-- .LP -->
To retrieve the current values of subpart resource data associated with a
widget instance, use
<function>XtGetSubvalues .</function>
For a discussion of subpart resources,
see Section 9.4.
</para>
<para>
<!-- .LP -->
<!-- .IN "XtGetSubvalues" "" "@DEF@" -->
<!-- .sM -->
</para>
<!-- .FD 0 -->
void XtGetSubvalues(<emphasis remap='I'>base</emphasis>, <emphasis remap='I'>resources</emphasis>, <emphasis remap='I'>num_resources</emphasis>, \
<emphasis remap='I'>args</emphasis>, <emphasis remap='I'>num_args</emphasis>)
<!-- .br -->
      XtPointer <emphasis remap='I'>base</emphasis>;
<!-- .br -->
      XtResourceList <emphasis remap='I'>resources</emphasis>;
<!-- .br -->
      Cardinal <emphasis remap='I'>num_resources</emphasis>;
<!-- .br -->
      ArgList <emphasis remap='I'>args</emphasis>;
<!-- .br -->
      Cardinal <emphasis remap='I'>num_args</emphasis>;
<!-- .FN -->
<variablelist>
  <varlistentry>
    <term>
      <emphasis remap='I'>base</emphasis>
    </term>
    <listitem>
      <para>
Specifies the base address of the subpart data structure for which the
resources should be retrieved.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>resources</emphasis>
    </term>
    <listitem>
      <para>
Specifies the subpart resource list.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>num_resources</emphasis>
    </term>
    <listitem>
      <para>
Specifies the number of entries in the resource list.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>args</emphasis>
    </term>
    <listitem>
      <para>
Specifies the argument list of name/address pairs that contain the
resource names and the addresses into which the resource values are to
be stored.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>num_args</emphasis>
    </term>
    <listitem>
      <para>
Specifies the number of entries in the argument list.
    </para>
  </listitem>
  </varlistentry>
</variablelist>
<para>
<!-- .LP -->
<!-- .eM -->
The
<function>XtGetSubvalues</function>
function obtains resource values from the structure identified by <emphasis remap='I'>base</emphasis>.
The <emphasis remap='I'>value</emphasis> field in each argument entry must contain the address into
which to store the corresponding resource value.  It is the caller's
responsibility to allocate and deallocate this storage according to
the size of the resource representation type used within the subpart.
If the argument list contains a resource name that is not found in the
resource list, the value at the corresponding address is not modified.

<!-- .sp -->
</para>
<para>
<!-- .LP -->
To retrieve the current values of subpart resources associated with
a widget instance using varargs lists, use
<function>XtVaGetSubvalues .</function>
</para>
<para>
<!-- .LP -->
<!-- .IN "XtVaGetSubvalues" "" "@DEF@" -->
<!-- .sM -->
</para>
<!-- .FD 0 -->
void XtVaGetSubvalues(<emphasis remap='I'>base</emphasis>, <emphasis remap='I'>resources</emphasis>, <emphasis remap='I'>num_resources</emphasis>, ...)
<!-- .br -->
      XtPointer <emphasis remap='I'>base</emphasis>;
<!-- .br -->
      XtResourceList <emphasis remap='I'>resources</emphasis>;
<!-- .br -->
      Cardinal <emphasis remap='I'>num_resources</emphasis>;
<!-- .FN -->
<variablelist>
  <varlistentry>
    <term>
      <emphasis remap='I'>base</emphasis>
    </term>
    <listitem>
      <para>
Specifies the base address of the subpart data structure for which the
resources should be retrieved.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>resources</emphasis>
    </term>
    <listitem>
      <para>
Specifies the subpart resource list.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>num_resources</emphasis>
    </term>
    <listitem>
      <para>
Specifies the number of entries in the resource list.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      ...
    </term>
    <listitem>
      <para>
Specifies a variable argument list of name/address pairs that
contain the resource names and the addresses into which the resource
values are to be stored.
    </para>
  </listitem>
  </varlistentry>
</variablelist>
<para>
<!-- .LP -->
<!-- .eM -->
<function>XtVaGetSubvalues</function>
is identical in function to
<function>XtGetSubvalues</function>
with the
<emphasis remap='I'>args</emphasis> and <emphasis remap='I'>num_args</emphasis> parameters replaced by a varargs list, as described
in Section 2.5.1.
<function>XtVaTypedArg</function>
is not supported for
<function>XtVaGetSubvalues .</function>
If
<function>XtVaTypedArg</function>
is specified in the list, a warning message is issued
and the entry is then ignored.

</para>
</sect4>
</sect3>
<sect3 id="Setting_Widget_State">
<title>Setting Widget State</title>
<!-- .XS -->
<!-- <function>(SN Setting Widget State</function> -->
<!-- .XE -->
<para>
<!-- .LP -->
To modify the current values of resources associated with a widget
instance, use
<function>XtSetValues .</function>
</para>
<para>
<!-- .LP -->
<!-- .IN "XtSetValues" "" "@DEF@" -->
<!-- .sM -->
</para>
<!-- .FD 0 -->
void XtSetValues(<emphasis remap='I'>object</emphasis>, <emphasis remap='I'>args</emphasis>, <emphasis remap='I'>num_args</emphasis>)
<!-- .br -->
      Widget <emphasis remap='I'>object</emphasis>;
<!-- .br -->
      ArgList <emphasis remap='I'>args</emphasis>;
<!-- .br -->
      Cardinal <emphasis remap='I'>num_args</emphasis>;
<!-- .FN -->
<variablelist>
  <varlistentry>
    <term>
      <emphasis remap='I'>object</emphasis>
    </term>
    <listitem>
      <para>
Specifies the object whose resources are to be modified.  (oI
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>args</emphasis>
    </term>
    <listitem>
      <para>
Specifies the argument list of name/value pairs that contain the
resources to be modified and their new values.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>num_args</emphasis>
    </term>
    <listitem>
      <para>
Specifies the number of entries in the argument list.
    </para>
  </listitem>
  </varlistentry>
</variablelist>
<para>
<!-- .LP -->
<!-- .eM -->
The
<function>XtSetValues</function>
function starts with the resources specified for the
Object
class fields and proceeds down the subclass chain to the object.
At each stage, it replaces the <emphasis remap='I'>object</emphasis> resource fields with any values
specified in the argument list.
<function>XtSetValues</function>
then calls the set_values procedures for the object in superclass-to-subclass
order.
<!-- .IN "set_values_hook procedure" -->
If the object has any non-NULL <emphasis remap='I'>set_values_hook</emphasis> fields,
these are called immediately after the
corresponding set_values procedure.
This procedure permits subclasses to set subpart data via
<function>XtSetValues .</function>
</para>
<para>
<!-- .LP -->
If the class of the object's parent is a subclass of
<function>constraintWidgetClass ,</function>
<function>XtSetValues</function>
also updates the object's constraints.
It starts with the constraint resources specified for
<function>constraintWidgetClass</function>
and proceeds down the subclass chain to the parent's class.
At each stage, it replaces the constraint resource fields with any
values specified in the argument list.
It then calls the constraint set_values procedures from
<function>constraintWidgetClass</function>
down to the parent's class.
The constraint set_values procedures are called with widget arguments,
as for all set_values procedures, not just the constraint records,
so that they can make adjustments to the desired values based
on full information about the widget.  Any arguments specified that
do not match a resource list entry are silently ignored.
</para>
<para>
<!-- .LP -->
If the object is of a subclass of
RectObj,
<function>XtSetValues</function>
determines if a geometry request is needed by comparing the old object to
the new object.
If any geometry changes are required,
<function>XtSetValues</function>
restores the original geometry and makes the request on behalf of the widget.
If the geometry manager returns
<function>XtGeometryYes ,</function>
<function>XtSetValues</function>
calls the object's resize procedure.
If the geometry manager returns
<function>XtGeometryDone ,</function>
<function>XtSetValues</function>
continues, as the object's resize procedure should have been called
by the geometry manager.
If the geometry manager returns
<function>XtGeometryNo ,</function>
<function>XtSetValues</function>
ignores the geometry request and continues.
If the geometry manager returns
<function>XtGeometryAlmost ,</function>
<function>XtSetValues</function>
calls the set_values_almost procedure,
which determines what should be done.
<function>XtSetValues</function>
then repeats this process,
deciding once more whether the geometry manager should be called.
</para>
<para>
<!-- .LP -->
Finally, if any of the set_values procedures returned
<function>True ,</function>
and the widget is realized,
<function>XtSetValues</function>
causes the widget's expose procedure to be invoked by calling
<function>XClearArea</function>
on the widget's window.
<!-- .sp -->
</para>
<para>
<!-- .LP -->
To modify the current values of resources associated with a widget
instance using varargs lists, use
<function>XtVaSetValues .</function>
</para>
<para>
<!-- .LP -->
<!-- .IN "XtVaSetValues" "" "@DEF@" -->
<!-- .sM -->
</para>
<!-- .FD 0 -->
void XtVaSetValues(<emphasis remap='I'>object</emphasis>, ...)
<!-- .br -->
      Widget <emphasis remap='I'>object</emphasis>;
<!-- .FN -->
<variablelist>
  <varlistentry>
    <term>
      <emphasis remap='I'>object</emphasis>
    </term>
    <listitem>
      <para>
Specifies the object whose resources are to be modified.  (oI
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      ...
    </term>
    <listitem>
      <para>
Specifies the variable argument list of name/value pairs that
contain the resources to be modified and their new values.
    </para>
  </listitem>
  </varlistentry>
</variablelist>
<para>
<!-- .LP -->
<!-- .eM -->
<function>XtVaSetValues</function>
is identical in function to
<function>XtSetValues</function>
with the <emphasis remap='I'>args</emphasis> and <emphasis remap='I'>num_args</emphasis> parameters replaced by a varargs list, as
described in Section 2.5.1.

</para>
<sect4 id="Widget_State_The_set_values_Procedure">
<title>Widget State: The set_values Procedure</title>
<!-- .XS -->
<!-- (SN Widget State: The set_values Procedure -->
<!-- .XE -->
<para>
<!-- .LP -->
The set_values procedure pointer in a widget class is of type
<function>XtSetValuesFunc .</function>
</para>
<para>
<!-- .LP -->
<!-- .IN "XtSetValuesFunc" "" "@DEF@" -->
<!-- .IN "set_values procedure" "" "@DEF@" -->
<!-- .sM -->
</para>
<!-- .FD 0 -->
typedef Boolean (*XtSetValuesFunc)(Widget, Widget, Widget, ArgList, Cardinal*);
<!-- .br -->
      Widget <emphasis remap='I'>current</emphasis>;
<!-- .br -->
      Widget <emphasis remap='I'>request</emphasis>;
<!-- .br -->
      Widget <emphasis remap='I'>new</emphasis>;
<!-- .br -->
      ArgList <emphasis remap='I'>args</emphasis>;
<!-- .br -->
      Cardinal *<emphasis remap='I'>num_args</emphasis>;
<!-- .FN -->
<variablelist>
  <varlistentry>
    <term>
      <emphasis remap='I'>current</emphasis>
    </term>
    <listitem>
      <para>
Specifies a copy of the widget as it was before the
<function>XtSetValues</function>
call.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>request</emphasis>
    </term>
    <listitem>
      <para>
Specifies a copy of the widget with all values changed as asked for by the
<function>XtSetValues</function>
call before any class set_values procedures have been called.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>new</emphasis>
    </term>
    <listitem>
      <para>
Specifies the widget with the new values that are actually allowed.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>args</emphasis>
    </term>
    <listitem>
      <para>
Specifies the argument list passed to
<function>XtSetValues</function>
or the transformed argument list passed to
<function>XtVaSetValues .</function>
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>num_args</emphasis>
    </term>
    <listitem>
      <para>
Specifies the number of entries in the argument list.
    </para>
  </listitem>
  </varlistentry>
</variablelist>
<para>
<!-- .LP -->
<!-- .eM -->
The set_values procedure should recompute any field
derived from resources that are changed
(for example, many GCs depend on foreground and background pixels).
If no recomputation is necessary, and if none of the resources specific to a
subclass require the window to be redisplayed when their values are changed,
you can specify NULL for the <emphasis remap='I'>set_values</emphasis> field in the class record.
</para>
<para>
<!-- .LP -->
Like the initialize procedure,
set_values mostly deals only with the fields defined in the subclass,
but it has to resolve conflicts with its superclass,
especially conflicts over width and height.
</para>
<para>
<!-- .LP -->
Sometimes a subclass may want to overwrite values filled in by its
superclass.
In particular, size calculations of a superclass are often
incorrect for a subclass, and, in this case,
the subclass must modify or recalculate fields declared
and computed by its superclass.
</para>
<para>
<!-- .LP -->
As an example,
a subclass can visually surround its superclass display.
In this case, the width and height calculated by the superclass set_values
procedure are too small and need to be incremented by the size of the surround.
The subclass needs to know if its superclass's size was calculated by the
superclass or was specified explicitly.
All widgets must place themselves into whatever size is explicitly given,
but they should compute a reasonable size if no size is requested.
How does a subclass know the difference between a specified size
and a size computed by a superclass?
</para>
<para>
<!-- .LP -->
The <emphasis remap='I'>request</emphasis> and <emphasis remap='I'>new</emphasis> parameters provide the necessary information.
The <emphasis remap='I'>request</emphasis> widget is a copy of the widget, updated as originally requested.
The <emphasis remap='I'>new</emphasis> widget starts with the values in the request,
but it has additionally been updated by all superclass set_values
procedures called so far.
A subclass set_values procedure can compare these two to resolve
any potential conflicts.
The set_values procedure need not refer to the <emphasis remap='I'>request</emphasis> widget
unless it must resolve conflicts between the <emphasis remap='I'>current</emphasis> and <emphasis remap='I'>new</emphasis> widgets.
Any changes the widget needs to make, including geometry changes,
should be made in the <emphasis remap='I'>new</emphasis> widget.
</para>
<para>
<!-- .LP -->
In the above example,
the subclass with the visual surround can see
if the <emphasis remap='I'>width</emphasis> and <emphasis remap='I'>height</emphasis> in the <emphasis remap='I'>request</emphasis> widget are zero.
If so,
it adds its surround size to the <emphasis remap='I'>width</emphasis> and
<emphasis remap='I'>height</emphasis> fields in the <emphasis remap='I'>new</emphasis> widget.
If not, it must make do with the size originally specified.
In this case, zero is a special value defined by the class to permit
the application to invoke this behavior.
</para>
<para>
<!-- .LP -->
The <emphasis remap='I'>new</emphasis> widget is the actual widget instance record.
Therefore,
the set_values procedure should do all its work on the <emphasis remap='I'>new</emphasis> widget;
the <emphasis remap='I'>request</emphasis> widget should never be modified.
If the set_values procedure needs to call any routines that operate on
a widget, it should specify <emphasis remap='I'>new</emphasis> as the widget instance.
</para>
<para>
<!-- .LP -->
Before calling the set_values procedures, the (xI modify the
resources of the <emphasis remap='I'>request</emphasis> widget according to the contents of the arglist;
if the widget names all its resources in the class resource list, it is
never necessary to examine the contents of <emphasis remap='I'>args</emphasis>.
</para>
<para>
<!-- .LP -->
Finally, the set_values procedure must return a Boolean that indicates whether
the widget needs to be redisplayed.
Note that a change in the geometry fields alone does not require
the set_values procedure to return
<function>True ;</function>
the X server will eventually generate an
<function>Expose</function>
event, if necessary.
After calling all the set_values procedures,
<function>XtSetValues</function>
forces a redisplay by calling
<function>XClearArea</function>
if any of the set_values procedures returned
<function>True .</function>
Therefore, a set_values procedure should not try to do its own redisplaying.
</para>
<para>
<!-- .LP -->
Set_values procedures should not do any work in response to changes in
geometry because
<function>XtSetValues</function>
eventually will perform a geometry request, and that request might be denied.
If the widget actually changes size in response to a
call to
<function>XtSetValues ,</function>
its resize procedure is called.
Widgets should do any geometry-related work in their resize procedure.
</para>
<para>
<!-- .LP -->
Note that it is permissible to call
<function>XtSetValues</function>
before a widget is realized.
Therefore, the set_values procedure must not assume that the widget is realized.

</para>
</sect4>
<sect4 id="Widget_State_The_set_values_almost_Procedure">
<title>Widget State: The set_values_almost Procedure</title>
<!-- .XS -->
<!-- (SN Widget State: The set_values_almost Procedure -->
<!-- .XE -->
<para>
<!-- .LP -->
The set_values_almost procedure pointer in the widget class record is of type
<function>XtAlmostProc .</function>
</para>
<para>
<!-- .LP -->
<!-- .IN "set_values_almost procedure" "" "@DEF@" -->
<!-- .IN "XtAlmostProc" "" "@DEF@" -->
<!-- .sM -->
</para>
<!-- .FD 0 -->
typedef void (*XtAlmostProc)(Widget, Widget, XtWidgetGeometry*, \
XtWidgetGeometry*);
<!-- .br -->
      Widget <emphasis remap='I'>old</emphasis>;
<!-- .br -->
      Widget <emphasis remap='I'>new</emphasis>;
<!-- .br -->
      XtWidgetGeometry *<emphasis remap='I'>request</emphasis>;
<!-- .br -->
      XtWidgetGeometry *<emphasis remap='I'>reply</emphasis>;
<!-- .FN -->
<variablelist>
  <varlistentry>
    <term>
      <emphasis remap='I'>old</emphasis>
    </term>
    <listitem>
      <para>
Specifies a copy of the object as it was before the
<function>XtSetValues</function>
call.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>new</emphasis>
    </term>
    <listitem>
      <para>
Specifies the object instance record.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>request</emphasis>
    </term>
    <listitem>
      <para>
Specifies the original geometry request that was sent to the geometry
manager that caused
<function>XtGeometryAlmost</function>
to be returned.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>reply</emphasis>
    </term>
    <listitem>
      <para>
Specifies the compromise geometry that was returned by the geometry
manager with
<function>XtGeometryAlmost .</function>
    </para>
  </listitem>
  </varlistentry>
</variablelist>
<para>
<!-- .LP -->
<!-- .eM -->
Most classes inherit the set_values_almost procedure from their superclass by
specifying
<function>XtInheritSetValuesAlmost</function>
in the class initialization.
The
set_values_almost procedure in
<function>rectObjClass</function>
accepts the compromise suggested.
</para>
<para>
<!-- .LP -->
The set_values_almost procedure is called when a client tries to set a widget's
geometry by means of a call to
<function>XtSetValues</function>
and the geometry manager cannot
satisfy the request but instead returns
<function>XtGeometryNo</function>
or
<function>XtGeometryAlmost</function>
and a compromise geometry.
The <emphasis remap='I'>new</emphasis> object is the actual instance record.  The <emphasis remap='I'>x</emphasis>, <emphasis remap='I'>y</emphasis>,
<emphasis remap='I'>width</emphasis>, <emphasis remap='I'>height</emphasis>,
and <emphasis remap='I'>border_width</emphasis> fields contain the original values as they were
before the
<function>XtSetValues</function>
call, and all other fields contain the new
values.  The <emphasis remap='I'>request</emphasis> parameter contains the new geometry request that
was made to the parent.  The <emphasis remap='I'>reply</emphasis> parameter contains
<emphasis remap='I'>reply-&gt;request_mode</emphasis> equal to zero if the parent returned
<function>XtGeometryNo</function>
and contains the parent's compromise geometry otherwise.  The
set_values_almost procedure takes the original geometry and the
compromise geometry and determines if the compromise is
acceptable or whether
to try a different compromise.
It returns its results in the <emphasis remap='I'>request</emphasis> parameter,
which is then sent back to the geometry manager for another try.
To accept the compromise, the procedure must copy the contents
of the <emphasis remap='I'>reply</emphasis> geometry into the <emphasis remap='I'>request</emphasis> geometry; to attempt an
alternative geometry, the procedure may modify any part of the <emphasis remap='I'>request</emphasis>
argument; to terminate the geometry negotiation and retain the
original geometry, the procedure must set <emphasis remap='I'>request-&gt;request_mode</emphasis> to
zero.  The geometry fields of the <emphasis remap='I'>old</emphasis> and <emphasis remap='I'>new</emphasis> instances must not be modified
directly.

</para>
</sect4>
<sect4 id="Widget_State_The_ConstraintClassPart_set_values_Procedure">
<title>Widget State: The ConstraintClassPart set_values Procedure</title>
<!-- .XS -->
<!-- (SN Widget State: The ConstraintClassPart set_values Procedure -->
<!-- .XE -->
<!-- .IN "set_values procedure" -->
<para>
<!-- .LP -->
The constraint set_values procedure pointer is of type
<function>XtSetValuesFunc .</function>
The values passed to the parent's constraint set_values procedure
are the same as those passed to the child's class
set_values procedure.
A class can specify NULL for the <emphasis remap='I'>set_values</emphasis> field of the
<function>ConstraintPart</function>
if it need not compute anything.
</para>
<para>
<!-- .LP -->
The constraint set_values procedure should recompute any constraint fields
derived from constraint resources that are changed.
Furthermore, it may modify other widget fields as appropriate.
For example, if a constraint for the maximum height of a widget is changed
to a value smaller than the widget's current height,
the constraint set_values procedure may reset the <emphasis remap='I'>height</emphasis> field in the
widget.

</para>
</sect4>
<sect4 id="Widget_Subpart_State">
<title>Widget Subpart State</title>
<!-- .XS -->
<!-- (SN Widget Subpart State -->
<!-- .XE -->
<para>
<!-- .LP -->
To set the current values of subpart resources associated with a
widget instance, use
<function>XtSetSubvalues .</function>
For a discussion of subpart resources,
see Section 9.4.
</para>
<para>
<!-- .LP -->
<!-- .IN "XtSetSubvalues" "" "@DEF@" -->
<!-- .sM -->
</para>
<!-- .FD 0 -->
void XtSetSubvalues(<emphasis remap='I'>base</emphasis>, <emphasis remap='I'>resources</emphasis>, <emphasis remap='I'>num_resources</emphasis>, \
<emphasis remap='I'>args</emphasis>, <emphasis remap='I'>num_args</emphasis>)
<!-- .br -->
      XtPointer <emphasis remap='I'>base</emphasis>;
<!-- .br -->
      XtResourceList <emphasis remap='I'>resources</emphasis>;
<!-- .br -->
      Cardinal <emphasis remap='I'>num_resources</emphasis>;
<!-- .br -->
      ArgList <emphasis remap='I'>args</emphasis>;
<!-- .br -->
      Cardinal <emphasis remap='I'>num_args</emphasis>;
<!-- .FN -->
<variablelist>
  <varlistentry>
    <term>
      <emphasis remap='I'>base</emphasis>
    </term>
    <listitem>
      <para>
Specifies the base address of the subpart data structure into which the
resources should be written.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>resources</emphasis>
    </term>
    <listitem>
      <para>
Specifies the subpart resource list.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>num_resources</emphasis>
    </term>
    <listitem>
      <para>
Specifies the number of entries in the resource list.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>args</emphasis>
    </term>
    <listitem>
      <para>
Specifies the argument list of name/value pairs that contain the
resources to be modified and their new values.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>num_args</emphasis>
    </term>
    <listitem>
      <para>
Specifies the number of entries in the argument list.
    </para>
  </listitem>
  </varlistentry>
</variablelist>
<para>
<!-- .LP -->
<!-- .eM -->
The
<function>XtSetSubvalues</function>
function updates the resource fields of the structure identified by
<emphasis remap='I'>base</emphasis>.  Any specified arguments that do not match an entry in the
resource list are silently ignored.
<!-- .sp -->
</para>
<para>
<!-- .LP -->
To set the current values of subpart resources associated with
a widget instance using varargs lists, use
<function>XtVaSetSubvalues .</function>
</para>
<para>
<!-- .LP -->
<!-- .IN "XtVaSetSubvalues" "" "@DEF@" -->
<!-- .sM -->
</para>
<!-- .FD 0 -->
void XtVaSetSubvalues(<emphasis remap='I'>base</emphasis>, <emphasis remap='I'>resources</emphasis>, <emphasis remap='I'>num_resources</emphasis>, ...)
<!-- .br -->
      XtPointer <emphasis remap='I'>base</emphasis>;
<!-- .br -->
      XtResourceList <emphasis remap='I'>resources</emphasis>;
<!-- .br -->
      Cardinal <emphasis remap='I'>num_resources</emphasis>;
<!-- .FN -->
<variablelist>
  <varlistentry>
    <term>
      <emphasis remap='I'>base</emphasis>
    </term>
    <listitem>
      <para>
Specifies the base address of the subpart data structure into which the
resources should be written.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>resources</emphasis>
    </term>
    <listitem>
      <para>
Specifies the subpart resource list.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>num_resources</emphasis>
    </term>
    <listitem>
      <para>
Specifies the number of entries in the resource list.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      ...
    </term>
    <listitem>
      <para>
Specifies the variable argument list of name/value pairs that
contain the resources to be modified and their new values.
    </para>
  </listitem>
  </varlistentry>
</variablelist>
<para>
<!-- .LP -->
<!-- .eM -->
<function>XtVaSetSubvalues</function>
is identical in function to
<function>XtSetSubvalues</function>
with the <emphasis remap='I'>args</emphasis> and <emphasis remap='I'>num_args</emphasis> parameters replaced by a varargs list, as
described in Section 2.5.1.
<function>XtVaTypedArg</function>
is not supported for
<function>XtVaSetSubvalues .</function>
If an entry containing
<function>XtVaTypedArg</function>
is specified in the list, a warning message is issued
and the entry is ignored.

</para>
</sect4>
<sect4 id="Widget_Subpart_Resource_Data_The_set_values_hook_Procedure">
<title>Widget Subpart Resource Data: The set_values_hook Procedure</title>
<!-- .XS -->
<!-- (SN Widget Subpart Resource Data: The set_values_hook Procedure -->
<!-- .XE -->
<!-- .IN "set_values_hook procedure" -->
<!-- .NT -->
The set_values_hook procedure is obsolete, as the same information
is now available to the set_values procedure.  The procedure has been
retained for those widgets that used it in versions prior to Release 4.
<!-- .NE -->
<para>
<!-- .LP -->
Widgets that have a subpart can set the subpart resource values through
<function>XtSetValues</function>
by supplying a set_values_hook procedure.
The set_values_hook procedure pointer in a widget class is of type
<function>XtArgsFunc .</function>
</para>
<para>
<!-- .LP -->
<!-- .IN "set_values_hook procedure" "" "@DEF@" -->
<!-- .IN "XtArgsFunc" "" "@DEF@" -->
<!-- .sM -->
</para>
<!-- .FD 0 -->
typedef Boolean (*XtArgsFunc)(Widget, Arglist, Cardinal*);
<!-- .br -->
      Widget <emphasis remap='I'>w</emphasis>;
<!-- .br -->
      Arglist <emphasis remap='I'>args</emphasis>;
<!-- .br -->
      Cardinal *<emphasis remap='I'>num_args</emphasis>;
<!-- .FN -->
<variablelist>
  <varlistentry>
    <term>
      <emphasis remap='I'>w</emphasis>
    </term>
    <listitem>
      <para>
Specifies the widget whose subpart resource values are to be changed.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>args</emphasis>
    </term>
    <listitem>
      <para>
Specifies the argument list that was passed to
<function>XtSetValues</function>
or the transformed varargs list passed to
<function>XtVaSetValues .</function>
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term>
      <emphasis remap='I'>num_args</emphasis>
    </term>
    <listitem>
      <para>
Specifies the number of entries in the argument list.
    </para>
  </listitem>
  </varlistentry>
</variablelist>
<para>
<!-- .LP -->
<!-- .eM -->
The widget with subpart resources may call
<function>XtSetValues</function>
from the set_values_hook procedure
and pass in its subresource list and the
<emphasis remap='I'>args</emphasis> and <emphasis remap='I'>num_args</emphasis> parameters.
<!-- .bp -->






























































</para>
</sect4>
</sect3>
</sect2>
</chapter>
</book>