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
|
/*
* Motif
*
* Copyright (c) 1987-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these librararies and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
#ifdef REV_INFO
#ifndef lint
static char rcsid[] = "$TOG: BaseClass.c /main/20 1997/03/31 13:14:31 dbl $"
#endif
#endif
#define HAVE_EXTENSIONS
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <Xm/XmP.h>
#include <X11/ShellP.h>
#include <Xm/ExtObjectP.h>
#include <Xm/Screen.h>
#include <Xm/VendorSEP.h>
#include <Xm/XmosP.h> /* for bzero */
#include "BaseClassI.h"
#include "CallbackI.h"
#include "DropSMgrI.h"
#include "MessagesI.h"
#include "TraversalI.h"
#include "XmI.h"
#define FIX_1392
#define MSG1 _XmMMsgBaseClass_0000
#define MSG2 _XmMMsgBaseClass_0001
#define IsBaseClass(wc) \
((wc == xmGadgetClass) ||\
(wc == xmManagerWidgetClass) ||\
(wc == xmPrimitiveWidgetClass) ||\
(wc == vendorShellWidgetClass) ||\
(wc == xmDisplayClass) ||\
(wc == xmScreenClass) ||\
(wc == xmExtObjectClass) ||\
(_XmIsFastSubclass(wc, XmMENU_SHELL_BIT)))
#define isWrappedXtClass(wc) \
((wc == rectObjClass) ||\
(wc == compositeWidgetClass))
/*
* These must be initialized; otherwise they are "secondary symbols"
* and are not actually present in the library under HP/UX 10.0. That
* caused exportlistgen to hide them entirely, causing links to fail.
*/
externaldef(baseclass) XrmQuark XmQmotif = NULLQUARK;
externaldef(baseclass) XmBaseClassExt *_Xm_fastPtr = NULL;
typedef struct _XmObjectClassWrapper {
XtInitProc initialize;
XtSetValuesFunc setValues;
XtArgsProc getValues;
XtWidgetClassProc classPartInit;
} XmObjectClassWrapper;
static XmObjectClassWrapper objectClassWrapper;
static XContext resizeRefWContext = 0;
static XContext geoRefWContext = 0;
#define GetRefW(dpy, context, w) \
if (XFindContext(dpy, None, context, (XPointer *) &w)) w = NULL
#define SetRefW(dpy, context, w) \
XSaveContext(dpy, None, context, (char *)w)
externaldef(xminheritclass) int _XmInheritClass = 0;
/******** Static Function Declarations ********/
static XmWrapperData GetWrapperData(WidgetClass w_class);
static XContext ExtTypeToContext(unsigned char extType);
static void RealizeWrapper0(Widget w, Mask *vmask, XSetWindowAttributes *attr);
static void RealizeWrapper1(Widget w, Mask *vmask, XSetWindowAttributes *attr);
static void RealizeWrapper2(Widget w, Mask *vmask, XSetWindowAttributes *attr);
static void RealizeWrapper3(Widget w, Mask *vmask, XSetWindowAttributes *attr);
static void RealizeWrapper4(Widget w, Mask *vmask, XSetWindowAttributes *attr);
static void RealizeWrapper5(Widget w, Mask *vmask, XSetWindowAttributes *attr);
static void RealizeWrapper6(Widget w, Mask *vmask, XSetWindowAttributes *attr);
static void RealizeWrapper7(Widget w, Mask *vmask, XSetWindowAttributes *attr);
static void RealizeWrapper8(Widget w, Mask *vmask, XSetWindowAttributes *attr);
static void RealizeWrapper9(Widget w, Mask *vmask, XSetWindowAttributes *attr);
static void RealizeWrapper10(Widget w, Mask *vmask, XSetWindowAttributes *attr);
static Cardinal GetRealizeDepth(WidgetClass wc);
static void RealizeWrapper(Widget w,
Mask *vmask,
XSetWindowAttributes *attr,
Cardinal depth);
static void ResizeWrapper0(Widget w);
static void ResizeWrapper1(Widget w);
static void ResizeWrapper2(Widget w);
static void ResizeWrapper3(Widget w);
static void ResizeWrapper4(Widget w);
static void ResizeWrapper5(Widget w);
static void ResizeWrapper6(Widget w);
static void ResizeWrapper7(Widget w);
static void ResizeWrapper8(Widget w);
static void ResizeWrapper9(Widget w);
static void ResizeWrapper10(Widget w);
static void ResizeWrapper11(Widget w);
static void ResizeWrapper12(Widget w);
static void ResizeWrapper13(Widget w);
static Cardinal GetResizeDepth(WidgetClass wc);
static void ResizeWrapper(Widget w, int depth);
static XtGeometryResult GeometryHandlerWrapper0(Widget w,
XtWidgetGeometry *desired,
XtWidgetGeometry *allowed);
static XtGeometryResult GeometryHandlerWrapper1(Widget w,
XtWidgetGeometry *desired,
XtWidgetGeometry *allowed);
static XtGeometryResult GeometryHandlerWrapper2(Widget w,
XtWidgetGeometry *desired,
XtWidgetGeometry *allowed);
static XtGeometryResult GeometryHandlerWrapper3(Widget w,
XtWidgetGeometry *desired,
XtWidgetGeometry *allowed);
static XtGeometryResult GeometryHandlerWrapper4(Widget w,
XtWidgetGeometry *desired,
XtWidgetGeometry *allowed);
static XtGeometryResult GeometryHandlerWrapper5(Widget w,
XtWidgetGeometry *desired,
XtWidgetGeometry *allowed);
static XtGeometryResult GeometryHandlerWrapper6(Widget w,
XtWidgetGeometry *desired,
XtWidgetGeometry *allowed);
static XtGeometryResult GeometryHandlerWrapper7(Widget w,
XtWidgetGeometry *desired,
XtWidgetGeometry *allowed);
static XtGeometryResult GeometryHandlerWrapper8(Widget w,
XtWidgetGeometry *desired,
XtWidgetGeometry *allowed);
static XtGeometryResult GeometryHandlerWrapper9(Widget w,
XtWidgetGeometry *desired,
XtWidgetGeometry *allowed);
static XtGeometryResult GeometryHandlerWrapper10(Widget w,
XtWidgetGeometry *desired,
XtWidgetGeometry *allowed);
static XtGeometryResult GeometryHandlerWrapper11(Widget w,
XtWidgetGeometry *desired,
XtWidgetGeometry *allowed);
static XtGeometryResult GeometryHandlerWrapper12(Widget w,
XtWidgetGeometry *desired,
XtWidgetGeometry *allowed);
static Cardinal GetGeometryHandlerDepth(WidgetClass wc);
static XtGeometryResult GeometryHandlerWrapper(Widget w,
XtWidgetGeometry *desired,
XtWidgetGeometry *allowed,
int depth);
static XmBaseClassExt * BaseClassPartInitialize(WidgetClass wc);
static void ClassPartInitRootWrapper(WidgetClass wc);
static void ClassPartInitLeafWrapper(WidgetClass wc);
static XtResourceList * CreateIndirectionTable(XtResourceList resources,
Cardinal num_resources);
static void InitializeRootWrapper(
Widget req,
Widget new_w,
ArgList args,
Cardinal *num_args) ;
static void InitializeLeafWrapper(
Widget req,
Widget new_w,
ArgList args,
Cardinal *num_args,
int depth);
static void CInitializeLeafWrapper(
Widget req,
Widget new_w,
ArgList args,
Cardinal *num_args,
int depth);
static Boolean SetValuesRootWrapper(
Widget current,
Widget req,
Widget new_w,
ArgList args,
Cardinal *num_args);
static Boolean SetValuesLeafWrapper(
Widget current,
Widget req,
Widget new_w,
ArgList args,
Cardinal *num_args,
int depth);
static Boolean CSetValuesLeafWrapper(
Widget current,
Widget req,
Widget new_w,
ArgList args,
Cardinal *num_args,
int depth);
static void GetValuesRootWrapper(
Widget new_w,
ArgList args,
Cardinal *num_args);
static void GetValuesLeafWrapper(
Widget new_w,
ArgList args,
Cardinal *num_args,
int depth);
static int GetDepth(WidgetClass wc);
static void InitializeLeafWrapper0(
Widget req,
Widget new_w,
ArgList args,
Cardinal *num_args);
static void InitializeLeafWrapper1(
Widget req,
Widget new_w,
ArgList args,
Cardinal *num_args);
static void InitializeLeafWrapper2(
Widget req,
Widget new_w,
ArgList args,
Cardinal *num_args);
static void InitializeLeafWrapper3(
Widget req,
Widget new_w,
ArgList args,
Cardinal *num_args);
static void InitializeLeafWrapper4(
Widget req,
Widget new_w,
ArgList args,
Cardinal *num_args);
static void InitializeLeafWrapper5(
Widget req,
Widget new_w,
ArgList args,
Cardinal *num_args);
static void InitializeLeafWrapper6(
Widget req,
Widget new_w,
ArgList args,
Cardinal *num_args);
static void InitializeLeafWrapper7(
Widget req,
Widget new_w,
ArgList args,
Cardinal *num_args);
static void InitializeLeafWrapper8(
Widget req,
Widget new_w,
ArgList args,
Cardinal *num_args);
static void InitializeLeafWrapper9(
Widget req,
Widget new_w,
ArgList args,
Cardinal *num_args);
static void CInitializeLeafWrapper0(
Widget req,
Widget new_w,
ArgList args,
Cardinal *num_args);
static void CInitializeLeafWrapper1(
Widget req,
Widget new_w,
ArgList args,
Cardinal *num_args);
static void CInitializeLeafWrapper2(
Widget req,
Widget new_w,
ArgList args,
Cardinal *num_args);
static void CInitializeLeafWrapper3(
Widget req,
Widget new_w,
ArgList args,
Cardinal *num_args);
static void CInitializeLeafWrapper4(
Widget req,
Widget new_w,
ArgList args,
Cardinal *num_args);
static void CInitializeLeafWrapper5(
Widget req,
Widget new_w,
ArgList args,
Cardinal *num_args);
static void CInitializeLeafWrapper6(
Widget req,
Widget new_w,
ArgList args,
Cardinal *num_args);
static void CInitializeLeafWrapper7(
Widget req,
Widget new_w,
ArgList args,
Cardinal *num_args);
static void CInitializeLeafWrapper8(
Widget req,
Widget new_w,
ArgList args,
Cardinal *num_args);
static void CInitializeLeafWrapper9(
Widget req,
Widget new_w,
ArgList args,
Cardinal *num_args);
static Boolean SetValuesLeafWrapper0(
Widget current,
Widget req,
Widget new_w,
ArgList args,
Cardinal *num_args);
static Boolean SetValuesLeafWrapper1(
Widget current,
Widget req,
Widget new_w,
ArgList args,
Cardinal *num_args);
static Boolean SetValuesLeafWrapper2(
Widget current,
Widget req,
Widget new_w,
ArgList args,
Cardinal *num_args);
static Boolean SetValuesLeafWrapper3(
Widget current,
Widget req,
Widget new_w,
ArgList args,
Cardinal *num_args);
static Boolean SetValuesLeafWrapper4(
Widget current,
Widget req,
Widget new_w,
ArgList args,
Cardinal *num_args);
static Boolean SetValuesLeafWrapper5(
Widget current,
Widget req,
Widget new_w,
ArgList args,
Cardinal *num_args);
static Boolean SetValuesLeafWrapper6(
Widget current,
Widget req,
Widget new_w,
ArgList args,
Cardinal *num_args);
static Boolean SetValuesLeafWrapper7(
Widget current,
Widget req,
Widget new_w,
ArgList args,
Cardinal *num_args);
static Boolean SetValuesLeafWrapper8(
Widget current,
Widget req,
Widget new_w,
ArgList args,
Cardinal *num_args);
static Boolean SetValuesLeafWrapper9(
Widget current,
Widget req,
Widget new_w,
ArgList args,
Cardinal *num_args);
static Boolean CSetValuesLeafWrapper0(
Widget current,
Widget req,
Widget new_w,
ArgList args,
Cardinal *num_args);
static Boolean CSetValuesLeafWrapper1(
Widget current,
Widget req,
Widget new_w,
ArgList args,
Cardinal *num_args);
static Boolean CSetValuesLeafWrapper2(
Widget current,
Widget req,
Widget new_w,
ArgList args,
Cardinal *num_args);
static Boolean CSetValuesLeafWrapper3(
Widget current,
Widget req,
Widget new_w,
ArgList args,
Cardinal *num_args);
static Boolean CSetValuesLeafWrapper4(
Widget current,
Widget req,
Widget new_w,
ArgList args,
Cardinal *num_args);
static Boolean CSetValuesLeafWrapper5(
Widget current,
Widget req,
Widget new_w,
ArgList args,
Cardinal *num_args);
static Boolean CSetValuesLeafWrapper6(
Widget current,
Widget req,
Widget new_w,
ArgList args,
Cardinal *num_args);
static Boolean CSetValuesLeafWrapper7(
Widget current,
Widget req,
Widget new_w,
ArgList args,
Cardinal *num_args);
static Boolean CSetValuesLeafWrapper8(
Widget current,
Widget req,
Widget new_w,
ArgList args,
Cardinal *num_args);
static Boolean CSetValuesLeafWrapper9(
Widget current,
Widget req,
Widget new_w,
ArgList args,
Cardinal *num_args);
static void GetValuesLeafWrapper0(
Widget new_w,
ArgList args,
Cardinal *num_args);
static void GetValuesLeafWrapper1(
Widget new_w,
ArgList args,
Cardinal *num_args);
static void GetValuesLeafWrapper2(
Widget new_w,
ArgList args,
Cardinal *num_args);
static void GetValuesLeafWrapper3(
Widget new_w,
ArgList args,
Cardinal *num_args);
static void GetValuesLeafWrapper4(
Widget new_w,
ArgList args,
Cardinal *num_args);
static void GetValuesLeafWrapper5(
Widget new_w,
ArgList args,
Cardinal *num_args);
static void GetValuesLeafWrapper6(
Widget new_w,
ArgList args,
Cardinal *num_args);
static void GetValuesLeafWrapper7(
Widget new_w,
ArgList args,
Cardinal *num_args);
static void GetValuesLeafWrapper8(
Widget new_w,
ArgList args,
Cardinal *num_args);
static void GetValuesLeafWrapper9(
Widget new_w,
ArgList args,
Cardinal *num_args);
/******** End Static Function Declarations ********/
XmGenericClassExt *
_XmGetClassExtensionPtr(
XmGenericClassExt *listHeadPtr,
XrmQuark owner )
{
XmGenericClassExt *lclPtr = listHeadPtr;
#ifdef DEBUG
if (!lclPtr)
{
XmeWarning(NULL, "_XmGetClassExtensionPtr: invalid class ext pointer");
return NULL;
}
#endif /* DEBUG */
while (lclPtr && *lclPtr && ((*lclPtr)->record_type != owner))
lclPtr = (XmGenericClassExt *) &((*lclPtr)->next_extension);
return lclPtr;
}
static XmWrapperData
GetWrapperData(
WidgetClass w_class )
{
XmBaseClassExt *wcePtr;
wcePtr = _XmGetBaseClassExtPtr( w_class, XmQmotif);
if (!*wcePtr)
{
*wcePtr = (XmBaseClassExt) XtCalloc(1, sizeof(XmBaseClassExtRec));
(*wcePtr)->next_extension = NULL;
(*wcePtr)->record_type = XmQmotif;
(*wcePtr)->version = XmBaseClassExtVersion;
(*wcePtr)->record_size = sizeof( XmBaseClassExtRec);
}
if ((*wcePtr)->version < XmBaseClassExtVersion)
return NULL;
if (!((*wcePtr)->wrapperData))
(*wcePtr)->wrapperData =
(XmWrapperData) XtCalloc(1, sizeof(XmWrapperDataRec));
return (*wcePtr)->wrapperData;
}
typedef struct _ExtToContextRec {
unsigned char extType;
XContext context;
} ExtToContextRec, *ExtToContext;
static XContext
ExtTypeToContext(
unsigned char extType )
{
static ExtToContextRec extToContextMap[16];
Cardinal i;
ExtToContext curr;
XContext context = (XContext) NULL;
_XmProcessLock();
for (i = 0, curr = &extToContextMap[0];
i < XtNumber(extToContextMap) && !context;
i++, curr++)
{
if (curr->extType == extType)
context = curr->context;
else if (!curr->extType)
{
curr->extType = extType;
context = curr->context = XUniqueContext();
}
}
_XmProcessUnlock();
if (!context)
XmeWarning(NULL, MSG1);
return context;
}
typedef struct _XmAssocDataRec {
XtPointer data;
struct _XmAssocDataRec *next;
} XmAssocDataRec, *XmAssocData;
void
_XmPushWidgetExtData(
Widget widget,
XmWidgetExtData data,
#if NeedWidePrototypes
unsigned int extType )
#else
unsigned char extType )
#endif /* NeedWidePrototypes */
{
XmAssocData newData;
XmAssocData assocData = NULL;
XmAssocData *assocDataPtr;
Boolean empty;
XContext widgetExtContext = ExtTypeToContext(extType);
newData = (XmAssocData) XtCalloc(1, sizeof(XmAssocDataRec));
newData->data = (XtPointer)data;
empty = XFindContext(XtDisplay(widget), (Window) widget,
widgetExtContext, (char **) &assocData);
assocDataPtr = &assocData;
while (*assocDataPtr)
assocDataPtr = &((*assocDataPtr)->next);
*assocDataPtr = newData;
if (empty)
XSaveContext(XtDisplay(widget), (Window) widget,
widgetExtContext, (XPointer) assocData);
}
void
_XmPopWidgetExtData(
Widget widget,
XmWidgetExtData *dataRtn,
#if NeedWidePrototypes
unsigned int extType )
#else
unsigned char extType )
#endif /* NeedWidePrototypes */
{
XmAssocData assocData = NULL;
XmAssocData *assocDataPtr;
XContext widgetExtContext = ExtTypeToContext(extType);
/* Initialize the return parameter. */
*dataRtn = NULL;
if (XFindContext(XtDisplay(widget),
(Window) widget,
widgetExtContext,
(char **) &assocData))
{
#ifdef DEBUG
XmeWarning(NULL, MSG2);
#endif
return;
}
assocDataPtr = &assocData;
while ((*assocDataPtr) && (*assocDataPtr)->next)
assocDataPtr = &((*assocDataPtr)->next);
if (*assocDataPtr == assocData)
XDeleteContext(XtDisplay(widget), (Window)widget, widgetExtContext);
if (*assocDataPtr)
{
*dataRtn = (XmWidgetExtData) (*assocDataPtr)->data;
XtFree((char *) *assocDataPtr);
*assocDataPtr = NULL;
}
}
XmWidgetExtData
_XmGetWidgetExtData(
Widget widget,
#if NeedWidePrototypes
unsigned int extType )
#else
unsigned char extType )
#endif /* NeedWidePrototypes */
{
XmAssocData assocData = NULL;
XmAssocData *assocDataPtr;
XContext widgetExtContext = ExtTypeToContext(extType);
if ((XFindContext(XtDisplay(widget),
(Window) widget,
widgetExtContext,
(char **) &assocData)))
{
#ifdef DEBUG
XmeWarning(NULL, "no extension data on stack");
#endif /* DEBUG */
return NULL;
}
else
{
assocDataPtr = &assocData;
while ((*assocDataPtr)->next)
assocDataPtr = &((*assocDataPtr)->next);
return (XmWidgetExtData) (*assocDataPtr)->data;
}
}
Boolean
_XmIsSubclassOf(
WidgetClass wc,
WidgetClass sc)
{
WidgetClass p = wc;
while ((p) && (p != sc))
p = p->core_class.superclass;
return (p == sc);
}
/*********************************************************************
*
* RealizeWrappers for vendorShell
*
*********************************************************************/
static void
RealizeWrapper0(
Widget w,
Mask *vmask,
XSetWindowAttributes *attr )
{
RealizeWrapper(w, vmask, attr, 0);
}
static void
RealizeWrapper1(
Widget w,
Mask *vmask,
XSetWindowAttributes *attr )
{
RealizeWrapper(w, vmask, attr, 1);
}
static void
RealizeWrapper2(
Widget w,
Mask *vmask,
XSetWindowAttributes *attr )
{
RealizeWrapper(w, vmask, attr, 2);
}
static void
RealizeWrapper3(
Widget w,
Mask *vmask,
XSetWindowAttributes *attr )
{
RealizeWrapper(w, vmask, attr, 3);
}
static void
RealizeWrapper4(
Widget w,
Mask *vmask,
XSetWindowAttributes *attr )
{
RealizeWrapper(w, vmask, attr, 4);
}
static void
RealizeWrapper5(
Widget w,
Mask *vmask,
XSetWindowAttributes *attr )
{
RealizeWrapper(w, vmask, attr, 5);
}
static void
RealizeWrapper6(
Widget w,
Mask *vmask,
XSetWindowAttributes *attr )
{
RealizeWrapper(w, vmask, attr, 6);
}
static void
RealizeWrapper7(
Widget w,
Mask *vmask,
XSetWindowAttributes *attr )
{
RealizeWrapper(w, vmask, attr, 7);
}
static void
RealizeWrapper8(
Widget w,
Mask *vmask,
XSetWindowAttributes *attr )
{
RealizeWrapper(w, vmask, attr, 8);
}
static void
RealizeWrapper9(
Widget w,
Mask *vmask,
XSetWindowAttributes *attr )
{
RealizeWrapper(w, vmask, attr, 9);
}
static void
RealizeWrapper10(
Widget w,
Mask *vmask,
XSetWindowAttributes *attr )
{
RealizeWrapper(w, vmask, attr, 10);
}
/* Used to be XmConst, but this was not linking on Solaris */
static XtRealizeProc realizeWrappers[] = {
RealizeWrapper0,
RealizeWrapper1,
RealizeWrapper2,
RealizeWrapper3,
RealizeWrapper4,
RealizeWrapper5,
RealizeWrapper6,
RealizeWrapper7,
RealizeWrapper8,
RealizeWrapper9,
RealizeWrapper10
};
static Cardinal
GetRealizeDepth(
WidgetClass wc )
{
Cardinal i;
i = 0;
while (wc && wc != vendorShellWidgetClass)
{
i++;
wc = wc->core_class.superclass;
}
if (wc)
return i;
#ifdef DEBUG
else
XtError("bad class for shell realize");
#endif /* DEBUG */
return 0;
}
/************************************************************************
*
* RealizeWrapper
*
************************************************************************/
static void
RealizeWrapper(
Widget w,
Mask *vmask,
XSetWindowAttributes *attr,
Cardinal depth )
{
if (XmIsVendorShell(w))
{
XmWidgetExtData extData;
WidgetClass wc = XtClass(w);
XmWrapperData wrapperData;
XtRealizeProc realize;
Cardinal leafDepth = GetRealizeDepth(wc);
Cardinal depthDiff = leafDepth - depth;
while (depthDiff)
{
depthDiff--;
wc = wc->core_class.superclass;
}
_XmProcessLock();
wrapperData = GetWrapperData(wc);
realize = wrapperData ? wrapperData->realize : NULL;
_XmProcessUnlock();
if (realize)
(*realize)(w, vmask, attr);
#if 0
/* DRK 6/20/94 -- This change breaks our test environment; when
* present the normal shell isn't added to the grab list
* because VendorExtRealize is never called. It used to
* be called for the ApplicationShell class.
*/
/*
* CR 9266: Only call the RealizeCallback if we're doing the
* VendorShell class level. Do not call multiple times for
* VendorShell subclasses.
*/
if ((extData = _XmGetWidgetExtData(w, XmSHELL_EXTENSION)) &&
(extData->widget) && wc == vendorShellWidgetClass)
#else
/*
* CR 3353 - Avoid calling the RealizeCallback twice for DialogShells
* by checking the WidgetClass name. If it is XmDialogShell,
* do not call the callback (it will be called prior when
* the WidgetClass is VendorShell).
*/
if ((extData = _XmGetWidgetExtData(w, XmSHELL_EXTENSION)) &&
(extData->widget) &&
strcmp(wc->core_class.class_name, "XmDialogShell"))
#endif
{
_XmCallCallbackList(extData->widget,
((XmVendorShellExtObject)
(extData->widget))->vendor.realize_callback,
NULL);
}
#ifdef DEBUG
else
XmeWarning(NULL, "we only support realize callbacks on shells");
#endif /* DEBUG */
}
}
/*********************************************************************
*
* ResizeWrappers for rectObj
*
*********************************************************************/
static void
ResizeWrapper0(
Widget w )
{
ResizeWrapper(w, 0);
}
static void
ResizeWrapper1(
Widget w )
{
ResizeWrapper(w, 1);
}
static void
ResizeWrapper2(
Widget w )
{
ResizeWrapper(w, 2);
}
static void
ResizeWrapper3(
Widget w )
{
ResizeWrapper(w, 3);
}
static void
ResizeWrapper4(
Widget w )
{
ResizeWrapper(w, 4);
}
static void
ResizeWrapper5(
Widget w )
{
ResizeWrapper(w, 5);
}
static void
ResizeWrapper6(
Widget w )
{
ResizeWrapper(w, 6);
}
static void
ResizeWrapper7(
Widget w )
{
ResizeWrapper(w, 7);
}
static void
ResizeWrapper8(
Widget w )
{
ResizeWrapper(w, 8);
}
static void
ResizeWrapper9(
Widget w )
{
ResizeWrapper(w, 9);
}
static void
ResizeWrapper10(
Widget w )
{
ResizeWrapper(w, 10);
}
static void
ResizeWrapper11(
Widget w )
{
ResizeWrapper(w, 11);
}
static void
ResizeWrapper12(
Widget w )
{
ResizeWrapper(w, 12);
}
static void
ResizeWrapper13(
Widget w )
{
ResizeWrapper(w, 13);
}
/* Used to be XmConst, but this was not linking on Solaris */
static XtWidgetProc resizeWrappers[] = {
ResizeWrapper0,
ResizeWrapper1,
ResizeWrapper2,
ResizeWrapper3,
ResizeWrapper4,
ResizeWrapper5,
ResizeWrapper6,
ResizeWrapper7,
ResizeWrapper8,
ResizeWrapper9,
ResizeWrapper10,
ResizeWrapper11,
ResizeWrapper12,
ResizeWrapper13
};
static Cardinal
GetResizeDepth(
WidgetClass wc )
{
Cardinal i;
i = 0;
while (wc && wc != rectObjClass)
{
i++;
wc = wc->core_class.superclass;
}
if (wc)
return i;
return 0;
}
/************************************************************************
*
* ResizeWrapper
*
************************************************************************/
static void
ResizeWrapper(
Widget w,
int depth )
{
Widget refW = NULL;
WidgetClass wc = XtClass(w);
Display *dpy = XtDisplay(w);
XmWrapperData wrapperData;
XtWidgetProc resize;
Cardinal leafDepth = GetResizeDepth(wc);
Cardinal depthDiff = leafDepth - depth;
Boolean call_navig_resize = FALSE;
/* Call _XmNavigResize() only once per resize event, so nested
* resize calls are completed before evaluating the status of
* the focus widget. Only check for lost focus in
* response to resize events from a Shell; otherwise
* _XmNavigResize may (prematurely) determine that the
* focus widget is no longer traversable before the
* new layout is complete.
*/
if (XtParent(w) && XtIsShell(XtParent(w)))
call_navig_resize = TRUE;
while (depthDiff)
{
depthDiff--;
wc = wc->core_class.superclass;
}
GetRefW(dpy, resizeRefWContext, refW);
_XmProcessLock();
wrapperData = GetWrapperData(wc);
resize = wrapperData ? wrapperData->resize: NULL;
_XmProcessUnlock();
if (resize)
{
if ((refW == NULL) && (_XmDropSiteWrapperCandidate(w)))
{
refW = w;
SetRefW(dpy, resizeRefWContext, refW);
XmDropSiteStartUpdate(refW);
(*resize)(w);
XmDropSiteEndUpdate(refW);
refW = NULL;
SetRefW(dpy, resizeRefWContext, refW);
}
else
(*resize)(w);
}
if (call_navig_resize)
_XmNavigResize( w);
}
/*********************************************************************
*
* GeometryHandlerWrappers for composite
*
*********************************************************************/
static XtGeometryResult
GeometryHandlerWrapper0(
Widget w,
XtWidgetGeometry *desired,
XtWidgetGeometry *allowed )
{
return GeometryHandlerWrapper(w, desired, allowed, 0);
}
static XtGeometryResult
GeometryHandlerWrapper1(
Widget w,
XtWidgetGeometry *desired,
XtWidgetGeometry *allowed )
{
return GeometryHandlerWrapper(w, desired, allowed, 1);
}
static XtGeometryResult
GeometryHandlerWrapper2(
Widget w,
XtWidgetGeometry *desired,
XtWidgetGeometry *allowed )
{
return GeometryHandlerWrapper(w, desired, allowed, 2);
}
static XtGeometryResult
GeometryHandlerWrapper3(
Widget w,
XtWidgetGeometry *desired,
XtWidgetGeometry *allowed )
{
return GeometryHandlerWrapper(w, desired, allowed, 3);
}
static XtGeometryResult
GeometryHandlerWrapper4(
Widget w,
XtWidgetGeometry *desired,
XtWidgetGeometry *allowed )
{
return GeometryHandlerWrapper(w, desired, allowed, 4);
}
static XtGeometryResult
GeometryHandlerWrapper5(
Widget w,
XtWidgetGeometry *desired,
XtWidgetGeometry *allowed )
{
return GeometryHandlerWrapper(w, desired, allowed, 5);
}
static XtGeometryResult
GeometryHandlerWrapper6(
Widget w,
XtWidgetGeometry *desired,
XtWidgetGeometry *allowed )
{
return GeometryHandlerWrapper(w, desired, allowed, 6);
}
static XtGeometryResult
GeometryHandlerWrapper7(
Widget w,
XtWidgetGeometry *desired,
XtWidgetGeometry *allowed )
{
return GeometryHandlerWrapper(w, desired, allowed, 7);
}
static XtGeometryResult
GeometryHandlerWrapper8(
Widget w,
XtWidgetGeometry *desired,
XtWidgetGeometry *allowed )
{
return GeometryHandlerWrapper(w, desired, allowed, 8);
}
static XtGeometryResult
GeometryHandlerWrapper9(
Widget w,
XtWidgetGeometry *desired,
XtWidgetGeometry *allowed )
{
return GeometryHandlerWrapper(w, desired, allowed, 9);
}
static XtGeometryResult
GeometryHandlerWrapper10(
Widget w,
XtWidgetGeometry *desired,
XtWidgetGeometry *allowed )
{
return GeometryHandlerWrapper(w, desired, allowed, 10);
}
static XtGeometryResult
GeometryHandlerWrapper11(
Widget w,
XtWidgetGeometry *desired,
XtWidgetGeometry *allowed )
{
return GeometryHandlerWrapper(w, desired, allowed, 11);
}
static XtGeometryResult
GeometryHandlerWrapper12(
Widget w,
XtWidgetGeometry *desired,
XtWidgetGeometry *allowed )
{
return GeometryHandlerWrapper(w, desired, allowed, 12);
}
/* Used to be XmConst, but this was not linkking on Solaris */
static XtGeometryHandler geometryHandlerWrappers[] = {
GeometryHandlerWrapper0,
GeometryHandlerWrapper1,
GeometryHandlerWrapper2,
GeometryHandlerWrapper3,
GeometryHandlerWrapper4,
GeometryHandlerWrapper5,
GeometryHandlerWrapper6,
GeometryHandlerWrapper7,
GeometryHandlerWrapper8,
GeometryHandlerWrapper9,
GeometryHandlerWrapper10,
GeometryHandlerWrapper11,
GeometryHandlerWrapper12
};
static Cardinal
GetGeometryHandlerDepth(
WidgetClass wc )
{
Cardinal i;
i = 0;
while (wc && wc != rectObjClass)
{
i++;
wc = wc->core_class.superclass;
}
if (wc)
return i;
return 0;
}
/************************************************************************
*
* GeometryHandlerWrapper
*
************************************************************************/
static XtGeometryResult
GeometryHandlerWrapper(
Widget w,
XtWidgetGeometry *desired,
XtWidgetGeometry *allowed,
int depth)
{
Widget refW = NULL;
XtGeometryResult result = XtGeometryNo;
Widget parent = XtParent(w);
WidgetClass wc = XtClass(parent);
Display *dpy = XtDisplay(w);
XmWrapperData wrapperData;
XtGeometryHandler geometry_manager;
Cardinal leafDepth = GetGeometryHandlerDepth(wc);
Cardinal depthDiff = leafDepth - depth;
while (depthDiff)
{
depthDiff--;
wc = wc->core_class.superclass;
}
GetRefW(dpy, geoRefWContext, refW);
_XmProcessLock();
wrapperData = GetWrapperData(wc);
geometry_manager = wrapperData ? wrapperData->geometry_manager: NULL;
_XmProcessUnlock();
if (geometry_manager)
{
if ((refW == NULL) && (_XmDropSiteWrapperCandidate(w)))
{
refW = w;
SetRefW(dpy, geoRefWContext, refW);
XmDropSiteStartUpdate(refW);
result = (*geometry_manager) (w, desired, allowed);
XmDropSiteEndUpdate(refW);
refW = NULL;
SetRefW(dpy, geoRefWContext, refW);
}
else
result = (*geometry_manager) (w, desired, allowed);
}
return result;
}
/************************************************************************
*
* BaseClassPartInitialize
*
************************************************************************/
static XmBaseClassExt *
BaseClassPartInitialize(
WidgetClass wc )
{
XmBaseClassExt *wcePtr, *scePtr;
Cardinal i;
Boolean inited;
XmWrapperData wcData, scData;
Boolean isBaseClass = IsBaseClass(wc);
/*
* This routine is called out of the ClassPartInitRootWrapper. It
* needs to make sure that this is a Motif class and if it is,
* then to initialize it. We assume that the base classes always
* have a static initializer !!!
*/
wcePtr = _XmGetBaseClassExtPtr(wc, XmQmotif);
scePtr = _XmGetBaseClassExtPtr(wc->core_class.superclass, XmQmotif);
if (!isBaseClass &&
!isWrappedXtClass(wc) &&
(!scePtr || !(*scePtr)))
return NULL;
if ((isBaseClass) || (scePtr && (*scePtr)))
{
if (!(*wcePtr))
{
inited = False;
*wcePtr = (XmBaseClassExt) XtCalloc(1, sizeof(XmBaseClassExtRec));
(*wcePtr)->classPartInitPrehook = XmInheritClassPartInitPrehook;
(*wcePtr)->classPartInitPosthook = XmInheritClassPartInitPosthook;
(*wcePtr)->initializePrehook = XmInheritInitializePrehook;
(*wcePtr)->setValuesPrehook = XmInheritSetValuesPrehook;
(*wcePtr)->getValuesPrehook = XmInheritGetValuesPrehook;
(*wcePtr)->initializePosthook = XmInheritInitializePosthook;
(*wcePtr)->setValuesPosthook = XmInheritSetValuesPosthook;
(*wcePtr)->getValuesPosthook = XmInheritGetValuesPosthook;
(*wcePtr)->secondaryObjectClass = XmInheritClass;
(*wcePtr)->secondaryObjectCreate = XmInheritSecObjectCreate;
(*wcePtr)->getSecResData = XmInheritGetSecResData;
(*wcePtr)->widgetNavigable = XmInheritWidgetNavigable;
(*wcePtr)->focusChange = XmInheritFocusChange;
}
else
inited = True;
/* this should get done by the static initializers */
for (i = 0; i < 32; i++)
(*wcePtr)->flags[i] = 0;
if (scePtr && *scePtr)
{
if (!inited)
{
(*wcePtr)->next_extension = NULL;
(*wcePtr)->record_type = (*scePtr)->record_type;
(*wcePtr)->version = (*scePtr)->version;
(*wcePtr)->record_size = (*scePtr)->record_size;
}
if ((*wcePtr)->classPartInitPrehook == XmInheritClassPartInitPrehook)
(*wcePtr)->classPartInitPrehook = (*scePtr)->classPartInitPrehook;
if ((*wcePtr)->classPartInitPosthook == XmInheritClassPartInitPosthook)
(*wcePtr)->classPartInitPosthook = (*scePtr)->classPartInitPosthook;
if ((*wcePtr)->initializePrehook == XmInheritInitializePrehook)
(*wcePtr)->initializePrehook = (*scePtr)->initializePrehook;
if ((*wcePtr)->setValuesPrehook == XmInheritSetValuesPrehook)
(*wcePtr)->setValuesPrehook = (*scePtr)->setValuesPrehook;
if ((*wcePtr)->getValuesPrehook == XmInheritGetValuesPrehook)
(*wcePtr)->getValuesPrehook = (*scePtr)->getValuesPrehook;
if ((*wcePtr)->initializePosthook == XmInheritInitializePosthook)
(*wcePtr)->initializePosthook = (*scePtr)->initializePosthook;
if ((*wcePtr)->setValuesPosthook == XmInheritSetValuesPosthook)
(*wcePtr)->setValuesPosthook = (*scePtr)->setValuesPosthook;
if ((*wcePtr)->getValuesPosthook == XmInheritGetValuesPosthook)
(*wcePtr)->getValuesPosthook = (*scePtr)->getValuesPosthook;
if ((*wcePtr)->secondaryObjectClass == XmInheritClass)
(*wcePtr)->secondaryObjectClass = (*scePtr)->secondaryObjectClass;
if ((*wcePtr)->secondaryObjectCreate == XmInheritSecObjectCreate)
(*wcePtr)->secondaryObjectCreate = (*scePtr)->secondaryObjectCreate;
if ((*wcePtr)->getSecResData == XmInheritGetSecResData)
(*wcePtr)->getSecResData = (*scePtr)->getSecResData;
if ((*wcePtr)->widgetNavigable == XmInheritWidgetNavigable)
(*wcePtr)->widgetNavigable = (*scePtr)->widgetNavigable;
if ((*wcePtr)->focusChange == XmInheritFocusChange)
(*wcePtr)->focusChange = (*scePtr)->focusChange;
}
#ifdef DEBUG
else if (!IsBaseClass(wc))
XtError("class must have non-null superclass extension");
#endif /* DEBUG */
/*
* If this class has a secondary object class and that
* class does not have it's own extension (or has not
* been class inited because its a pseudo class) then
* we will give a dummy pointer so that fast subclass
* checking will not fail for the meta classes
* (gadget, manager, etc...)
*/
{
WidgetClass sec = (*wcePtr)->secondaryObjectClass;
static XmBaseClassExtRec xmExtExtensionRec = {
NULL, /* Next extension */
NULLQUARK, /* record type XmQmotif */
XmBaseClassExtVersion, /* version */
sizeof(XmBaseClassExtRec), /* size */
};
if (xmExtExtensionRec.record_type == NULLQUARK)
xmExtExtensionRec.record_type = XmQmotif;
if (sec && !sec->core_class.extension)
sec->core_class.extension = (XtPointer)&xmExtExtensionRec;
}
}
wcData = GetWrapperData(wc);
scData = GetWrapperData(wc->core_class.superclass);
if ((wc == vendorShellWidgetClass) ||
_XmIsSubclassOf(wc, vendorShellWidgetClass))
{
/* Wrap Realize */
/*
* check if this widget was using XtInherit and got the wrapper
* from the superclass
*/
if (wc->core_class.realize == XtInheritRealize)
{
wcData->realize = scData->realize;
}
/*
* It has declared it's own realize routine so save it
*/
else
{
wcData->realize = wc->core_class.realize;
}
wc->core_class.realize = realizeWrappers[GetRealizeDepth(wc)];
}
if ((wc == rectObjClass) ||
_XmIsSubclassOf(wc, rectObjClass))
{
/* Wrap resize */
/*
* check if this widget was using XtInherit and got the wrapper
* from the superclass
*/
if (wc->core_class.resize == XtInheritResize)
{
wcData->resize = scData->resize;
}
/*
* It has declared it's own resize routine so save it
*/
else
{
wcData->resize = wc->core_class.resize;
}
wc->core_class.resize = resizeWrappers[GetResizeDepth(wc)];
}
if ((wc == compositeWidgetClass) ||
_XmIsSubclassOf(wc, compositeWidgetClass))
{
/* Wrap GeometryManager */
/*
* check if this widget was using XtInherit and got the wrapper
* from the superclass
*/
if (((CompositeWidgetClass) wc)->composite_class.geometry_manager
== XtInheritGeometryManager)
{
wcData->geometry_manager = scData->geometry_manager;
}
/*
* It has declared it's own resize routine so save it
*/
else
{
wcData->geometry_manager = ((CompositeWidgetClass) wc)
->composite_class.geometry_manager;
}
((CompositeWidgetClass) wc)->composite_class.geometry_manager =
(XtGeometryHandler)
geometryHandlerWrappers[GetGeometryHandlerDepth(wc)];
}
return wcePtr;
}
/*
* This function replaces the objectClass classPartInit slot and is
* called at the start of the first XtCreate invocation.
*/
static void
ClassPartInitRootWrapper(
WidgetClass wc )
{
XtWidgetClassProc *leafFuncPtr;
XmBaseClassExt *wcePtr;
wcePtr = BaseClassPartInitialize(wc);
/*
* check that it's a class that we know about
*/
if (wcePtr && *wcePtr)
{
if ((*wcePtr)->classPartInitPrehook)
(*((*wcePtr)->classPartInitPrehook)) (wc);
/*
* If we have a prehook, then envelop the leaf class function
* that whould be called last.
*/
if ((*wcePtr)->classPartInitPosthook)
{
XmWrapperData wrapperData;
wrapperData = GetWrapperData(wc);
leafFuncPtr = (XtWidgetClassProc *)
&(wc->core_class.class_part_initialize);
wrapperData->classPartInitLeaf = *leafFuncPtr;
*leafFuncPtr = ClassPartInitLeafWrapper;
}
}
if (objectClassWrapper.classPartInit)
(* objectClassWrapper.classPartInit) (wc);
}
static void
ClassPartInitLeafWrapper(
WidgetClass wc )
{
XtWidgetClassProc *leafFuncPtr;
XmBaseClassExt *wcePtr;
wcePtr = _XmGetBaseClassExtPtr(wc, XmQmotif);
if (*wcePtr && (*wcePtr)->classPartInitPosthook)
{
XmWrapperData wrapperData;
wrapperData = GetWrapperData(wc);
leafFuncPtr = (XtWidgetClassProc *)
&(wc->core_class.class_part_initialize);
if (wrapperData->classPartInitLeaf)
(* wrapperData->classPartInitLeaf) (wc);
if ((*wcePtr)->classPartInitPosthook)
(*((*wcePtr)->classPartInitPosthook)) (wc);
#ifdef DEBUG
else
XmeWarning(NULL, "there should be a non-null hook for a leaf wrapper");
#endif /* DEBUG */
*leafFuncPtr = wrapperData->classPartInitLeaf;
wrapperData->classPartInitLeaf = NULL;
}
}
static Boolean
is_constraint_subclass(WidgetClass cls)
{
WidgetClass sc;
for (sc = cls; sc != NULL; sc = sc->core_class.superclass)
if (sc == (WidgetClass) &constraintClassRec)
return True;
return False;
}
void
_XmInitializeExtensions( void )
{
static Boolean firstTime = True;
if (firstTime)
{
XmQmotif = XrmPermStringToQuark("OSF_MOTIF");
objectClassWrapper.initialize =
objectClass->core_class.initialize;
objectClassWrapper.setValues =
objectClass->core_class.set_values;
objectClassWrapper.getValues =
objectClass->core_class.get_values_hook;
objectClassWrapper.classPartInit =
objectClass->core_class.class_part_initialize;
objectClass->core_class.class_part_initialize =
ClassPartInitRootWrapper;
objectClass->core_class.initialize =
InitializeRootWrapper;
objectClass->core_class.set_values =
SetValuesRootWrapper;
objectClass->core_class.get_values_hook =
GetValuesRootWrapper;
firstTime = False;
}
resizeRefWContext = XUniqueContext();
geoRefWContext = XUniqueContext();
}
Cardinal
_XmSecondaryResourceData(
XmBaseClassExt bcePtr,
XmSecondaryResourceData **secResDataRtn,
XtPointer client_data,
String name,
String class_name,
XmResourceBaseProc basefunctionpointer )
{
WidgetClass secObjClass;
XmSecondaryResourceData secResData, *sd;
Cardinal count = 0;
if (bcePtr)
{
secObjClass = ( (bcePtr)->secondaryObjectClass);
if (secObjClass)
{
secResData = XtNew(XmSecondaryResourceDataRec);
_XmTransformSubResources(secObjClass->core_class.resources,
secObjClass->core_class.num_resources,
&(secResData->resources),
&(secResData->num_resources));
secResData->name = name;
secResData->res_class = class_name;
secResData->client_data = client_data;
secResData->base_proc = basefunctionpointer;
sd = XtNew(XmSecondaryResourceData);
*sd = secResData;
*secResDataRtn = sd;
count++;
}
}
return count;
}
/*
* This function makes assumptions about what the Intrinsics is
* doing with the resource lists. It is based on the X11R5 version
* of the Intrinsics. It is used as a work around for a bug in
* the Intrinsics that deals with recompiling already compiled resource
* lists. When that bug is fixed, this function should be removed.
*/
static XtResourceList*
CreateIndirectionTable(XtResourceList resources,
Cardinal num_resources)
{
register int i;
XtResourceList* table;
table = (XtResourceList*)XtMalloc(num_resources * sizeof(XtResourceList));
for (i = 0; i < num_resources; i++)
table[i] = (XtResourceList)(&(resources[i]));
return table;
}
/*
* The statement in this function calls CreateIndirectionTable() which
* is scheduled for removal (see comment in function above).
* It is used as a work around for an X11R5 Intrinsics bug. When the
* bug is fixed, change to the assignement statement so the
* constraint_class.reources is assigned comp_resources. Next,
* change the class_inited field of the core_class record to False.
* Then remove the check for class_inited, in the conditional statement
* which calls XtInitializeWidgetClass() and move the call to
* XtInitializeWidgetClass() to just above the call to
* XtGetConstraintResourceList(). Then remove the call to
* XtFree() and the last two assignment statements.
*/
void
_XmTransformSubResources(
XtResourceList comp_resources,
Cardinal num_comp_resources,
XtResourceList *resources,
Cardinal *num_resources)
{
static ConstraintClassRec shadowObjectClassRec = {
{
/* superclass */ (WidgetClass) &constraintClassRec,
/* class_name */ "Shadow",
/* widget_size */ sizeof(ConstraintRec),
/* class_initialize */ NULL,
/* class_part_initialize*/ NULL,
/* class_inited */ FALSE,
/* initialize */ NULL,
/* initialize_hook */ NULL,
/* realize */ XtInheritRealize,
/* actions */ NULL,
/* num_actions */ 0,
/* resources */ NULL,
/* num_resources */ 0,
/* xrm_class */ NULLQUARK,
/* compress_motion */ FALSE,
/* compress_exposure */ TRUE,
/* compress_enterleave */ FALSE,
/* visible_interest */ FALSE,
/* destroy */ NULL,
/* resize */ NULL,
/* expose */ NULL,
/* set_values */ NULL,
/* set_values_hook */ NULL,
/* set_values_almost */ XtInheritSetValuesAlmost,
/* get_values_hook */ NULL,
/* accept_focus */ NULL,
/* version */ XtVersion,
/* callback_offsets */ NULL,
/* tm_table */ NULL,
/* query_geometry */ NULL,
/* display_accelerator */ NULL,
/* extension */ NULL
},
{ /**** CompositePart *****/
/* geometry_handler */ NULL,
/* change_managed */ NULL,
/* insert_child */ XtInheritInsertChild,
/* delete_child */ XtInheritDeleteChild,
/* extension */ NULL
},
{ /**** ConstraintPart ****/
/* resources */ NULL,
/* num_resources */ 0,
/* constraint_size */ 0,
/* initialize */ NULL,
/* destroy */ NULL,
/* set_values */ NULL,
/* extension */ NULL
}
};
if (((int)comp_resources[0].resource_offset) >= 0)
{
XtResourceList tmp_resources;
tmp_resources = (XtResourceList)
XtMalloc(sizeof(XtResource) * num_comp_resources);
memcpy(tmp_resources, comp_resources,
sizeof(XtResource) * num_comp_resources);
*resources = tmp_resources;
*num_resources = num_comp_resources;
}
else
{
if (!shadowObjectClassRec.core_class.class_inited)
XtInitializeWidgetClass((WidgetClass) &shadowObjectClassRec);
/* This next statement is marked for change */
shadowObjectClassRec.constraint_class.resources = (XtResourceList)
CreateIndirectionTable(comp_resources, num_comp_resources);
shadowObjectClassRec.constraint_class.num_resources = num_comp_resources;
XtGetConstraintResourceList((WidgetClass) &shadowObjectClassRec,
resources, num_resources);
if (shadowObjectClassRec.constraint_class.resources)
XtFree((char *) shadowObjectClassRec.constraint_class.resources);
shadowObjectClassRec.constraint_class.resources = NULL;
shadowObjectClassRec.constraint_class.num_resources = 0;
}
}
static XtInitProc InitializeLeafWrappers[] = {
InitializeLeafWrapper0,
InitializeLeafWrapper1,
InitializeLeafWrapper2,
InitializeLeafWrapper3,
InitializeLeafWrapper4,
InitializeLeafWrapper5,
InitializeLeafWrapper6,
InitializeLeafWrapper7,
InitializeLeafWrapper8,
InitializeLeafWrapper9
};
static XtInitProc CInitializeLeafWrappers[] = {
CInitializeLeafWrapper0,
CInitializeLeafWrapper1,
CInitializeLeafWrapper2,
CInitializeLeafWrapper3,
CInitializeLeafWrapper4,
CInitializeLeafWrapper5,
CInitializeLeafWrapper6,
CInitializeLeafWrapper7,
CInitializeLeafWrapper8,
CInitializeLeafWrapper9
};
/*
* This function replaces the objectClass initialize slot and is
* called at the start of every XtCreate invocation.
*/
static void
InitializeRootWrapper(
Widget req,
Widget new_w,
ArgList args,
Cardinal *num_args)
{
WidgetClass wc = XtClass(new_w);
XmBaseClassExt *wcePtr;
wcePtr = _XmGetBaseClassExtPtr(wc, XmQmotif);
if (wcePtr && *wcePtr) {
if ((*wcePtr)->initializePrehook)
(*((*wcePtr)->initializePrehook))(req, new_w, args, num_args);
if ((*wcePtr)->initializePosthook) {
XmWrapperData wrapperData;
_XmProcessLock();
if (!XtIsShell(new_w) && XtParent(new_w)
&& XtIsConstraint(XtParent(new_w))) {
ConstraintWidgetClass cwc;
cwc = (ConstraintWidgetClass) XtClass(XtParent(new_w));
wrapperData = GetWrapperData((WidgetClass) cwc);
if (wrapperData->constraintInitializeLeafCount ==0)
{
wrapperData->constraintInitializeLeaf =
cwc->constraint_class.initialize;
cwc->constraint_class.initialize =
CInitializeLeafWrappers[
GetDepth((WidgetClass) cwc)];
}
(wrapperData->constraintInitializeLeafCount)++;
}
else {
wrapperData = GetWrapperData(wc);
if (wrapperData->initializeLeafCount ==0) {
wrapperData->initializeLeaf =
wc->core_class.initialize;
wc->core_class.initialize =
InitializeLeafWrappers[
GetDepth(wc)];
}
(wrapperData->initializeLeafCount)++;
}
_XmProcessUnlock();
}
if (objectClassWrapper.initialize)
(*objectClassWrapper.initialize)(req, new_w,args, num_args);
}
}
static void
InitializeLeafWrapper(
Widget req,
Widget new_w,
ArgList args,
Cardinal *num_args,
int depth)
{
WidgetClass wc = XtClass(new_w);
XtInitProc init_proc = NULL;
XtInitProc post_proc = NULL;
int leafDepth = GetDepth(wc);
XmWrapperData wrapperData;
_XmProcessLock();
if (leafDepth == depth) { /* Correct depth */
wrapperData = GetWrapperData(wc);
if (!XtIsShell(new_w) && XtParent(new_w) &&
XtIsConstraint(XtParent(new_w))) {
init_proc = wrapperData->initializeLeaf;
}
else {
/* We're home ! */
XmBaseClassExt *wcePtr = _XmGetBaseClassExtPtr(wc, XmQmotif);
init_proc = wrapperData->initializeLeaf;
post_proc = (*wcePtr)->initializePosthook;
#ifdef FIX_1392
if (post_proc) {
#endif
if ((--(wrapperData->initializeLeafCount)) == 0)
wc->core_class.initialize =
wrapperData->initializeLeaf;
#ifdef FIX_1392
}
#endif
}
}
else {
int depthDiff = leafDepth - depth;
for ( ; depthDiff;
depthDiff--, wc = wc->core_class.superclass)
{};
wrapperData = GetWrapperData(wc);
init_proc = wrapperData->initializeLeaf;
}
_XmProcessUnlock();
if (init_proc)
(*init_proc)(req, new_w, args, num_args);
if (post_proc)
(*post_proc)(req, new_w, args, num_args);
}
static void
CInitializeLeafWrapper(
Widget req,
Widget new_w,
ArgList args,
Cardinal *num_args,
int depth)
{
WidgetClass wc = XtClass(new_w);
ConstraintWidgetClass cwc = (ConstraintWidgetClass)
XtClass(XtParent(new_w));
XtInitProc init_proc = NULL;
XtInitProc post_proc = NULL;
int leafDepth = GetDepth((WidgetClass) cwc);
XmWrapperData wrapperData;
_XmProcessLock();
if (leafDepth == depth) {
XmBaseClassExt *wcePtr = _XmGetBaseClassExtPtr(wc, XmQmotif);
wrapperData = GetWrapperData((WidgetClass) cwc);
init_proc = wrapperData->constraintInitializeLeaf;
post_proc = (*wcePtr)->initializePosthook;
#ifdef FIX_1392
if (post_proc) {
#endif
if ((--(wrapperData->constraintInitializeLeafCount)) ==0)
cwc->constraint_class.initialize =
wrapperData->constraintInitializeLeaf;
#ifdef FIX_1392
}
#endif
}
else {
int depthDiff = leafDepth - depth;
for ( ; depthDiff;
depthDiff--, cwc = (ConstraintWidgetClass)
cwc->core_class.superclass)
{};
wrapperData = GetWrapperData((WidgetClass) cwc);
init_proc = wrapperData->constraintInitializeLeaf;
}
_XmProcessUnlock();
if (init_proc)
(*init_proc)(req, new_w, args, num_args);
if (post_proc)
(*post_proc)(req, new_w, args, num_args);
}
static void
InitializeLeafWrapper0(
Widget req, Widget new_w, ArgList args, Cardinal *num_args)
{
InitializeLeafWrapper(req, new_w, args, num_args, 0);
}
static void
InitializeLeafWrapper1(
Widget req, Widget new_w, ArgList args, Cardinal *num_args)
{
InitializeLeafWrapper(req, new_w, args, num_args, 1);
}
static void
InitializeLeafWrapper2(
Widget req, Widget new_w, ArgList args, Cardinal *num_args)
{
InitializeLeafWrapper(req, new_w, args, num_args, 2);
}
static void
InitializeLeafWrapper3(
Widget req, Widget new_w, ArgList args, Cardinal *num_args)
{
InitializeLeafWrapper(req, new_w, args, num_args, 3);
}
static void
InitializeLeafWrapper4(
Widget req, Widget new_w, ArgList args, Cardinal *num_args)
{
InitializeLeafWrapper(req, new_w, args, num_args, 4);
}
static void
InitializeLeafWrapper5(
Widget req, Widget new_w, ArgList args, Cardinal *num_args)
{
InitializeLeafWrapper(req, new_w, args, num_args, 5);
}
static void
InitializeLeafWrapper6(
Widget req, Widget new_w, ArgList args, Cardinal *num_args)
{
InitializeLeafWrapper(req, new_w, args, num_args, 6);
}
static void
InitializeLeafWrapper7(
Widget req, Widget new_w, ArgList args, Cardinal *num_args)
{
InitializeLeafWrapper(req, new_w, args, num_args, 7);
}
static void
InitializeLeafWrapper8(
Widget req, Widget new_w, ArgList args, Cardinal *num_args)
{
InitializeLeafWrapper(req, new_w, args, num_args, 8);
}
static void
InitializeLeafWrapper9(
Widget req, Widget new_w, ArgList args, Cardinal *num_args)
{
InitializeLeafWrapper(req, new_w, args, num_args, 9);
}
static void
CInitializeLeafWrapper0(
Widget req, Widget new_w, ArgList args, Cardinal *num_args)
{
CInitializeLeafWrapper(req, new_w, args, num_args,0);
}
static void
CInitializeLeafWrapper1(
Widget req, Widget new_w, ArgList args, Cardinal *num_args)
{
CInitializeLeafWrapper(req, new_w, args, num_args,1);
}
static void
CInitializeLeafWrapper2(
Widget req, Widget new_w, ArgList args, Cardinal *num_args)
{
CInitializeLeafWrapper(req, new_w, args, num_args,2);
}
static void
CInitializeLeafWrapper3(
Widget req, Widget new_w, ArgList args, Cardinal *num_args)
{
CInitializeLeafWrapper(req, new_w, args, num_args,3);
}
static void
CInitializeLeafWrapper4(
Widget req, Widget new_w, ArgList args, Cardinal *num_args)
{
CInitializeLeafWrapper(req, new_w, args, num_args,4);
}
static void
CInitializeLeafWrapper5(
Widget req, Widget new_w, ArgList args, Cardinal *num_args)
{
CInitializeLeafWrapper(req, new_w, args, num_args,5);
}
static void
CInitializeLeafWrapper6(
Widget req, Widget new_w, ArgList args, Cardinal *num_args)
{
CInitializeLeafWrapper(req, new_w, args, num_args,6);
}
static void
CInitializeLeafWrapper7(
Widget req, Widget new_w, ArgList args, Cardinal *num_args)
{
CInitializeLeafWrapper(req, new_w, args, num_args,7);
}
static void
CInitializeLeafWrapper8(
Widget req, Widget new_w, ArgList args, Cardinal *num_args)
{
CInitializeLeafWrapper(req, new_w, args, num_args,8);
}
static void
CInitializeLeafWrapper9(
Widget req, Widget new_w, ArgList args, Cardinal *num_args)
{
CInitializeLeafWrapper(req, new_w, args, num_args,9);
}
static XtSetValuesFunc SetValuesLeafWrappers[] = {
SetValuesLeafWrapper0,
SetValuesLeafWrapper1,
SetValuesLeafWrapper2,
SetValuesLeafWrapper3,
SetValuesLeafWrapper4,
SetValuesLeafWrapper5,
SetValuesLeafWrapper6,
SetValuesLeafWrapper7,
SetValuesLeafWrapper8,
SetValuesLeafWrapper9
};
static XtSetValuesFunc CSetValuesLeafWrappers[] = {
CSetValuesLeafWrapper0,
CSetValuesLeafWrapper1,
CSetValuesLeafWrapper2,
CSetValuesLeafWrapper3,
CSetValuesLeafWrapper4,
CSetValuesLeafWrapper5,
CSetValuesLeafWrapper6,
CSetValuesLeafWrapper7,
CSetValuesLeafWrapper8,
CSetValuesLeafWrapper9
};
/*
* This function replaces the objectClass set_values slot and is
* called at the start of every XtSetValues invocation.
*/
static Boolean
SetValuesRootWrapper(
Widget current,
Widget req,
Widget new_w,
ArgList args,
Cardinal *num_args)
{
WidgetClass wc = XtClass(new_w);
XmBaseClassExt *wcePtr;
Boolean returnVal = False;
wcePtr = _XmGetBaseClassExtPtr(wc, XmQmotif);
if (wcePtr && *wcePtr) {
if ((*wcePtr)->setValuesPrehook)
returnVal |= (*((*wcePtr)->setValuesPrehook))
(current, req, new_w, args, num_args);
if ((*wcePtr)->setValuesPosthook) {
XmWrapperData wrapperData;
_XmProcessLock();
if (!XtIsShell(new_w) && XtParent(new_w)
&& XtIsConstraint(XtParent(new_w))) {
ConstraintWidgetClass cwc;
cwc = (ConstraintWidgetClass) XtClass(XtParent(new_w));
wrapperData = GetWrapperData((WidgetClass) cwc);
if (wrapperData->constraintSetValuesLeafCount ==0)
{
wrapperData->constraintSetValuesLeaf =
cwc->constraint_class.set_values;
cwc->constraint_class.set_values =
CSetValuesLeafWrappers[
GetDepth((WidgetClass) cwc)];
}
(wrapperData->constraintSetValuesLeafCount)++;
}
else {
wrapperData = GetWrapperData(wc);
if (wrapperData->setValuesLeafCount ==0) {
wrapperData->setValuesLeaf =
wc->core_class.set_values;
wc->core_class.set_values =
SetValuesLeafWrappers[
GetDepth(wc)];
}
(wrapperData->setValuesLeafCount)++;
}
_XmProcessUnlock();
}
}
if (objectClassWrapper.setValues)
returnVal |= (*objectClassWrapper.setValues)
(current, req, new_w, args, num_args);
return returnVal;
}
static Boolean
SetValuesLeafWrapper(
Widget current,
Widget req,
Widget new_w,
ArgList args,
Cardinal *num_args,
int depth)
{
WidgetClass wc = XtClass(new_w);
XtSetValuesFunc setvalues_proc = NULL;
XtSetValuesFunc post_proc = NULL;
Boolean returnVal = False;
int leafDepth = GetDepth(wc);
XmWrapperData wrapperData;
_XmProcessLock();
if (leafDepth == depth) { /* Correct depth */
wrapperData = GetWrapperData(wc);
if (!XtIsShell(new_w) && XtParent(new_w) &&
XtIsConstraint(XtParent(new_w))) {
setvalues_proc = wrapperData->setValuesLeaf;
}
else {
/* We're home ! */
XmBaseClassExt *wcePtr = _XmGetBaseClassExtPtr(wc, XmQmotif);
setvalues_proc = wrapperData->setValuesLeaf;
post_proc = (*wcePtr)->setValuesPosthook;
#ifdef FIX_1392
if (post_proc) {
#endif
if ((--(wrapperData->setValuesLeafCount)) ==0)
wc->core_class.set_values =
wrapperData->setValuesLeaf;
#ifdef FIX_1392
}
#endif
}
}
else {
int depthDiff = leafDepth - depth;
for ( ; depthDiff;
depthDiff--, wc = wc->core_class.superclass)
{};
wrapperData = GetWrapperData(wc);
setvalues_proc = wrapperData->setValuesLeaf;
}
_XmProcessUnlock();
if (setvalues_proc)
returnVal |= (*setvalues_proc)
(current, req, new_w, args, num_args);
if (post_proc)
returnVal |= (*post_proc)
(current, req, new_w, args, num_args);
return returnVal;
}
static Boolean
CSetValuesLeafWrapper(
Widget current,
Widget req,
Widget new_w,
ArgList args,
Cardinal *num_args,
int depth)
{
WidgetClass wc = XtClass(new_w);
ConstraintWidgetClass cwc = (ConstraintWidgetClass)
XtClass(XtParent(new_w));
XtSetValuesFunc setvalues_proc = NULL;
XtSetValuesFunc post_proc = NULL;
Boolean returnVal = False;
int leafDepth = GetDepth((WidgetClass) cwc);
XmWrapperData wrapperData;
_XmProcessLock();
if (leafDepth == depth) {
XmBaseClassExt *wcePtr = _XmGetBaseClassExtPtr(wc, XmQmotif);
wrapperData = GetWrapperData((WidgetClass) cwc);
setvalues_proc = wrapperData->constraintSetValuesLeaf;
post_proc = (*wcePtr)->setValuesPosthook;
#ifdef FIX_1392
if (post_proc) {
#endif
if ((--(wrapperData->constraintSetValuesLeafCount)) ==0)
cwc->constraint_class.set_values =
wrapperData->constraintSetValuesLeaf;
#ifdef FIX_1392
}
#endif
}
else {
int depthDiff = leafDepth - depth;
for ( ; depthDiff;
depthDiff--, cwc = (ConstraintWidgetClass)
cwc->core_class.superclass)
{};
wrapperData = GetWrapperData((WidgetClass) cwc);
setvalues_proc = wrapperData->constraintSetValuesLeaf;
}
_XmProcessUnlock();
if (setvalues_proc)
returnVal |= (*setvalues_proc)
(current, req, new_w, args, num_args);
if (post_proc)
returnVal |= (*post_proc)
(current, req, new_w, args, num_args);
return returnVal;
}
static Boolean
SetValuesLeafWrapper0(
Widget current, Widget req, Widget new_w, ArgList args,
Cardinal *num_args )
{
return SetValuesLeafWrapper(current, req, new_w, args, num_args, 0);
}
static Boolean
SetValuesLeafWrapper1(
Widget current, Widget req, Widget new_w, ArgList args,
Cardinal *num_args)
{
return SetValuesLeafWrapper(current, req, new_w, args, num_args, 1);
}
static Boolean
SetValuesLeafWrapper2(
Widget current, Widget req, Widget new_w, ArgList args,
Cardinal *num_args)
{
return SetValuesLeafWrapper(current, req, new_w, args, num_args, 2);
}
static Boolean
SetValuesLeafWrapper3(
Widget current, Widget req, Widget new_w, ArgList args,
Cardinal *num_args)
{
return SetValuesLeafWrapper(current, req, new_w, args, num_args, 3);
}
static Boolean
SetValuesLeafWrapper4(
Widget current, Widget req, Widget new_w, ArgList args,
Cardinal *num_args)
{
return SetValuesLeafWrapper(current, req, new_w, args, num_args, 4);
}
static Boolean
SetValuesLeafWrapper5(
Widget current, Widget req, Widget new_w, ArgList args,
Cardinal *num_args)
{
return SetValuesLeafWrapper(current, req, new_w, args, num_args, 5);
}
static Boolean
SetValuesLeafWrapper6(
Widget current, Widget req, Widget new_w, ArgList args,
Cardinal *num_args)
{
return SetValuesLeafWrapper(current, req, new_w, args, num_args, 6);
}
static Boolean
SetValuesLeafWrapper7(
Widget current, Widget req, Widget new_w, ArgList args,
Cardinal *num_args)
{
return SetValuesLeafWrapper(current, req, new_w, args, num_args, 7);
}
static Boolean
SetValuesLeafWrapper8(
Widget current, Widget req, Widget new_w, ArgList args,
Cardinal *num_args)
{
return SetValuesLeafWrapper(current, req, new_w, args, num_args, 8);
}
static Boolean
SetValuesLeafWrapper9(
Widget current, Widget req, Widget new_w, ArgList args,
Cardinal *num_args)
{
return SetValuesLeafWrapper(current, req, new_w, args, num_args, 9);
}
static Boolean
CSetValuesLeafWrapper0(
Widget current, Widget req, Widget new_w, ArgList args,
Cardinal *num_args)
{
return CSetValuesLeafWrapper(current, req, new_w, args, num_args, 0);
}
static Boolean
CSetValuesLeafWrapper1(
Widget current, Widget req, Widget new_w, ArgList args,
Cardinal *num_args)
{
return CSetValuesLeafWrapper(current, req, new_w, args, num_args, 1);
}
static Boolean
CSetValuesLeafWrapper2(
Widget current, Widget req, Widget new_w, ArgList args,
Cardinal *num_args)
{
return CSetValuesLeafWrapper(current, req, new_w, args, num_args, 2);
}
static Boolean
CSetValuesLeafWrapper3(
Widget current, Widget req, Widget new_w, ArgList args,
Cardinal *num_args)
{
return CSetValuesLeafWrapper(current, req, new_w, args, num_args, 3);
}
static Boolean
CSetValuesLeafWrapper4(
Widget current, Widget req, Widget new_w, ArgList args,
Cardinal *num_args)
{
return CSetValuesLeafWrapper(current, req, new_w, args, num_args, 4);
}
static Boolean
CSetValuesLeafWrapper5(
Widget current, Widget req, Widget new_w, ArgList args,
Cardinal *num_args)
{
return CSetValuesLeafWrapper(current, req, new_w, args, num_args, 5);
}
static Boolean
CSetValuesLeafWrapper6(
Widget current, Widget req, Widget new_w, ArgList args,
Cardinal *num_args)
{
return CSetValuesLeafWrapper(current, req, new_w, args, num_args, 6);
}
static Boolean
CSetValuesLeafWrapper7(
Widget current, Widget req, Widget new_w, ArgList args,
Cardinal *num_args)
{
return CSetValuesLeafWrapper(current, req, new_w, args, num_args, 7);
}
static Boolean
CSetValuesLeafWrapper8(
Widget current, Widget req, Widget new_w, ArgList args,
Cardinal *num_args)
{
return CSetValuesLeafWrapper(current, req, new_w, args, num_args, 8);
}
static Boolean
CSetValuesLeafWrapper9(
Widget current, Widget req, Widget new_w, ArgList args,
Cardinal *num_args)
{
return CSetValuesLeafWrapper(current, req, new_w, args, num_args, 9);
}
static XtArgsProc GetValuesLeafWrappers[] = {
GetValuesLeafWrapper0,
GetValuesLeafWrapper1,
GetValuesLeafWrapper2,
GetValuesLeafWrapper3,
GetValuesLeafWrapper4,
GetValuesLeafWrapper5,
GetValuesLeafWrapper6,
GetValuesLeafWrapper7,
GetValuesLeafWrapper8,
GetValuesLeafWrapper9
};
/*
* This function replaces the objectClass get_values slot and is
* called at the start of every XtGetValues invocation.
*/
static void
GetValuesRootWrapper(
Widget new_w,
ArgList args,
Cardinal *num_args)
{
WidgetClass wc = XtClass(new_w);
XmBaseClassExt *wcePtr;
wcePtr = _XmGetBaseClassExtPtr(wc, XmQmotif);
if (wcePtr && *wcePtr) {
if ((*wcePtr)->getValuesPrehook)
(*((*wcePtr)->getValuesPrehook))(new_w, args, num_args);
if ((*wcePtr)->getValuesPosthook) {
XmWrapperData wrapperData;
_XmProcessLock();
wrapperData = GetWrapperData(wc);
if (wrapperData->getValuesLeafCount == 0) {
wrapperData->getValuesLeaf =
wc->core_class.get_values_hook;
wc->core_class.get_values_hook =
GetValuesLeafWrappers[GetDepth(wc)];
}
(wrapperData->getValuesLeafCount)++;
_XmProcessUnlock();
}
}
if (objectClassWrapper.getValues)
(*objectClassWrapper.getValues) (new_w, args, num_args);
}
static void
GetValuesLeafWrapper(
Widget new_w,
ArgList args,
Cardinal *num_args,
int depth)
{
WidgetClass wc = XtClass(new_w);
XtArgsProc getvalues_proc = NULL;
XtArgsProc post_proc = NULL;
int leafDepth = GetDepth(wc);
XmWrapperData wrapperData;
_XmProcessLock();
if (leafDepth == depth) { /* Correct depth */
XmBaseClassExt *wcePtr = _XmGetBaseClassExtPtr(wc, XmQmotif);
wrapperData = GetWrapperData(wc);
getvalues_proc = wrapperData->getValuesLeaf;
post_proc = ((*wcePtr)->getValuesPosthook);
#ifdef FIX_1392
if (post_proc) {
#endif
if ((--(wrapperData->getValuesLeafCount)) == 0)
wc->core_class.get_values_hook =
wrapperData->getValuesLeaf;
#ifdef FIX_1392
}
#endif
}
else {
int depthDiff = leafDepth - depth;
for ( ; depthDiff;
depthDiff--, wc = wc->core_class.superclass)
{};
wrapperData = GetWrapperData(wc);
getvalues_proc = wrapperData->getValuesLeaf;
}
_XmProcessUnlock();
if (getvalues_proc)
(*getvalues_proc)(new_w, args, num_args);
if (post_proc)
(*post_proc)(new_w, args, num_args);
}
static void
GetValuesLeafWrapper0( Widget new_w, ArgList args,Cardinal *num_args)
{
GetValuesLeafWrapper(new_w, args, num_args, 0);
}
static void
GetValuesLeafWrapper1( Widget new_w, ArgList args,Cardinal *num_args)
{
GetValuesLeafWrapper(new_w, args, num_args, 1);
}
static void
GetValuesLeafWrapper2( Widget new_w, ArgList args,Cardinal *num_args)
{
GetValuesLeafWrapper(new_w, args, num_args, 2);
}
static void
GetValuesLeafWrapper3( Widget new_w, ArgList args,Cardinal *num_args)
{
GetValuesLeafWrapper(new_w, args, num_args, 3);
}
static void
GetValuesLeafWrapper4( Widget new_w, ArgList args,Cardinal *num_args)
{
GetValuesLeafWrapper(new_w, args, num_args, 4);
}
static void
GetValuesLeafWrapper5( Widget new_w, ArgList args,Cardinal *num_args)
{
GetValuesLeafWrapper(new_w, args, num_args, 5);
}
static void
GetValuesLeafWrapper6( Widget new_w, ArgList args,Cardinal *num_args)
{
GetValuesLeafWrapper(new_w, args, num_args, 6);
}
static void
GetValuesLeafWrapper7( Widget new_w, ArgList args,Cardinal *num_args)
{
GetValuesLeafWrapper(new_w, args, num_args, 7);
}
static void
GetValuesLeafWrapper8( Widget new_w, ArgList args,Cardinal *num_args)
{
GetValuesLeafWrapper(new_w, args, num_args, 8);
}
static void
GetValuesLeafWrapper9( Widget new_w, ArgList args,Cardinal *num_args)
{
GetValuesLeafWrapper(new_w, args, num_args, 9);
}
static int
GetDepth(WidgetClass wc)
{
int i;
for (i = 0;
wc && wc != rectObjClass;
i++, wc = wc->core_class.superclass) {};
if (wc)
return i;
else
return 0;
}
/*
* These symbols must always be present so applications compiling with
* -DXTHREADS can still link against libraries built without it. How
* those applications recognize non MT-safe libraries is a different
* issue.
*/
#ifndef XTHREADS
# undef _XmFastSubclassInit
# undef _XmIsFastSubclass
#endif
void
_XmFastSubclassInit(WidgetClass wc, unsigned int bit)
{
XmBaseClassExt *basePtr = _XmGetBaseClassExtPtr(wc, XmQmotif);
if (basePtr && (*basePtr))
_XmSetFlagsBit(((*basePtr)->flags), bit);
}
Boolean
_XmIsFastSubclass(WidgetClass wc, unsigned int bit)
{
XmBaseClassExt *basePtr = _XmGetBaseClassExtPtr(wc, XmQmotif);
if (!basePtr || !(*basePtr))
return False;
if (_XmGetFlagsBit(((*basePtr)->flags), bit))
return True;
else
return False;
}
|