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
|
-------------------------------------------------------------------------------
-- --
-- Ada Interface to the X Window System and Motif(tm)/Lesstif --
-- Copyright (c) 1996-2002 Hans-Frieder Vogt --
-- --
-- Adabindx is free software; you can redistribute it and/or modify it --
-- under the terms of the GNU General Public License as published by the --
-- Free Software Foundation; either version 2 of the License, or (at your --
-- option) any later version. --
-- --
-- This program is distributed in the hope that it will be useful, but --
-- WITHOUT ANY WARRANTY; without even the implied warranty of --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --
-- See the GNU General Public License for more details. --
-- --
-- You should have received a copy of the GNU General Public License --
-- along with this program; if not, write to the --
-- Free Software Foundation, Inc., --
-- 59 Temple Place - Suite 330, --
-- Boston, MA 02111-1307, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU General Public License. --
-- --
-- X Window System is copyrighted by the X Consortium --
-- Motif(tm) is copyrighted by the Open Software Foundation, Inc. --
-- and by The Open Group --
-- --
-- --
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
--
-- HISTORY:
-- June 20, 1998 begin of history
-- July 07, 1998 HFVogt: changed Boolean_Type to X_Boolean to prevent
-- confusion
-- changed IM_Type to Input_Method, OM_Type to
-- Output_Method, IC_Type to Input_Context and
-- OC_Type to Output_Context
-- September 5, 1998 extract X_Lib.Extensions
-- November 8, 1998 HFVogt: added X11R6.3 conditional defines
-- June 14, 2000: included additions from Joerg Schaefer:
-- type Char_Struct, X_Query_Text_Extents,
-- X_Resize_Window, X_Query_Pointer
-- 19 May 2001 Vadim Godunko: error handling procs
-- 17 Nov 2001 Vadim Godunko: add X_Create_Simple_Window
-- 09 Feb 2002 H.-F. Vogt: moved X_*_Event representative clause into
-- private area to satisfy GNAT 3.14p
-- add No_Connection_Error exception
--
-------------------------------------------------------------------------------
with Interfaces.C,
System,
String_List,
Generic_List_Types;
package X_Lib is
use type Interfaces.C.short;
Null_Address : System.Address renames System.Null_Address;
type Long_Array is array (Natural range <>) of Interfaces.C.long;
-- ----------------------------------------------------------------------------
--
-- Type-Definitions
--
-- -------------------------------------------------------------------------
--
-- E R R O R S
--
type Error_Code_Type is new Interfaces.C.unsigned_char;
Success : constant Error_Code_Type := 0;
Bad_Request : constant Error_Code_Type := 1;
Bad_Value : constant Error_Code_Type := 2;
Bad_Window : constant Error_Code_Type := 3;
Bad_Pixmap : constant Error_Code_Type := 4;
Bad_Atom : constant Error_Code_Type := 5;
Bad_Cursor : constant Error_Code_Type := 6;
Bad_Font : constant Error_Code_Type := 7;
Bad_Match : constant Error_Code_Type := 8;
Bad_Drawable : constant Error_Code_Type := 9;
Bad_Access : constant Error_Code_Type := 10;
Bad_Alloc : constant Error_Code_Type := 11;
Bad_Color : constant Error_Code_Type := 12;
Bad_GC : constant Error_Code_Type := 13;
Bad_ID_Choice : constant Error_Code_Type := 14;
Bad_Name : constant Error_Code_Type := 15;
Bad_Length : constant Error_Code_Type := 16;
Bad_Implementation : constant Error_Code_Type := 17;
First_Extension_Error : constant Error_Code_Type := 128;
Last_Extension_Error : constant Error_Code_Type := 255;
X_Error : exception;
type Opcode_Type is new Integer;
-- -------------------------------------------------------------------------
--
-- server resource IDs
--
type XID is new Interfaces.C.unsigned_long;
Null_XID : constant XID;
type Drawable_ID is new XID;
Null_Drawable_ID : constant Drawable_ID;
subtype Window_ID is Drawable_ID;
Null_Window_ID : constant Window_ID;
subtype Pixmap_ID is Drawable_ID;
Null_Pixmap_ID : constant Pixmap_ID;
type Font_ID is new XID;
Null_Font_ID : constant Font_ID;
type Cursor_ID is new XID;
Null_Cursor_ID : constant Cursor_ID;
type Colormap_ID is new XID;
Null_Colormap_ID : constant Colormap_ID;
type GContext_ID is new XID;
Null_GContext_ID : constant GContext_ID;
type Key_Sym_ID is new XID;
Null_Key_Sym_ID : constant Key_Sym_ID;
type Visual_ID is new XID;
Null_Visual_ID : constant Visual_ID;
type Window_ID_Array_Type is array (Natural range <>) of Window_ID;
-- -------------------------------------------------------------------------
--
-- key code (representation of a physical or logical key on the keyboard)
--
type Key_Code_Type is new Interfaces.C.unsigned_char;
-- specifies the index into the vector of key codes
subtype Key_Codes_Vector_Index_Type is Natural;
-- -------------------------------------------------------------------------
--
-- Atom
--
type Atom is new Interfaces.C.unsigned_long;
Null_Atom : constant Atom;
-- -------------------------------------------------------------------------
--
-- Region
--
type Region is private;
Null_Region : constant Region;
type X_Font_Struct_Pointer is new System.Address;
Null_Font_Struct_Pointer : constant X_Font_Struct_Pointer
:= X_Font_Struct_Pointer (Null_Address);
type Display_Pointer is private;
Null_Display_Pointer : constant Display_Pointer;
type Screen_Pointer is private;
Null_Screen_Pointer : constant Screen_Pointer;
type GC_Pointer is private;
Null_GC_Pointer : constant GC_Pointer;
type X_Pointer is private;
Null_X_Pointer : constant X_Pointer;
-- normally this is declared in Xt, but it is already used in Xlib
type Pixel is new Interfaces.C.unsigned_long;
type Screen_Number is
new Interfaces.C.int range 0 .. Interfaces.C.int'Last;
type Color_Depth is
new Interfaces.C.int range 0 .. Interfaces.C.int'Last;
type Color_Plane_Mask is mod 2 ** Pixel'Size;
-- in Xlib this is simply called TIME, but I rename it here for not
-- to become confused
type Server_Time is new Interfaces.C.unsigned_long;
Current_Server_Time : constant Server_Time := Server_Time (0);
-- return status for Xlib functions, used only internally
type Status_Type is new Interfaces.C.int;
Error_Status : constant Status_Type := Status_Type (0);
-- Xlib's own boolean type
type X_Boolean is (False, True);
for X_Boolean use (False => 0, True => 1);
for X_Boolean'Size use Interfaces.C.int'Size;
function To_X_Boolean (Val : in Boolean) return X_Boolean;
function To_Boolean (Val : in X_Boolean) return Boolean;
-- general 8 bit, 16 bit and 32 bit types
--
type Data_Format_Type is (Invalid, Bits_8, Bits_16, Bits_32);
for Data_Format_Type use (Invalid => 0, Bits_8 => 8, Bits_16 => 16, Bits_32 => 32);
for Data_Format_Type'Size use Interfaces.C.int'Size;
type Bits_8_Type is mod 2**Interfaces.C.signed_char'Size;
type Bits_16_Type is mod 2**Interfaces.C.short'Size;
type Bits_32_Type is mod 2**Interfaces.C.long'Size; -- not necessarily 32 bits!
type Bits_8_Array_Type is array (Natural range <>) of aliased Bits_8_Type;
type Bits_16_Array_Type is array (Natural range <>) of aliased Bits_16_Type;
type Bits_32_Array_Type is array (Natural range <>) of aliased Bits_32_Type;
function To_Bits_32_Type (Source : in XID) return Bits_32_Type;
function To_XID (Source : in Bits_32_Type) return XID;
function To_Bits_32_Type (Source : in X_Pointer) return Bits_32_Type;
function To_X_Pointer (Source : in Bits_32_Type) return X_Pointer;
-- opaque types used for internationalization
--
-- input method
type Input_Method is private;
Null_Input_Method : constant Input_Method;
-- output method
type Output_Method is private;
Null_Output_Method : constant Output_Method;
-- input context
type Input_Context is private;
Null_Input_Context : constant Input_Context;
-- output context
type Output_Context is private;
Null_Output_Context : constant Output_Context;
-- font set
type Font_Set_Type is private;
Null_Font_Set : constant Font_Set_Type;
function X_Protocol_Version (Display : in Display_Pointer)
return Integer;
function X_Protocol_Revision (Display : in Display_Pointer)
return Integer;
function X_Server_Vendor (Display : in Display_Pointer)
return String;
function X_Vendor_Release (Display : in Display_Pointer)
return Integer;
function X_Max_Request_Size (Display : in Display_Pointer)
return Interfaces.C.long;
function X_Extended_Max_Request_Size (Display : in Display_Pointer)
return Interfaces.C.long;
function X_Display_Motion_Buffer_Size (Display : in Display_Pointer)
return Interfaces.C.unsigned_long;
-- -------------------------------------------------------------------------
--
-- Classes
--
type Window_Class is (Copy_From_Parent, Input_Output, Input_Only);
for Window_Class use (Copy_From_Parent => 0,
Input_Output => 1,
Input_Only => 2);
for Window_Class'Size use Interfaces.C.unsigned'Size;
type Visual_Class is (Static_Gray,
Gray_Scale,
Static_Color,
Pseudo_Color,
True_Color,
Direct_Color);
for Visual_Class use (Static_Gray => 0,
Gray_Scale => 1,
Static_Color => 2,
Pseudo_Color => 3,
True_Color => 4,
Direct_Color => 5);
for Visual_Class'Size use Interfaces.C.int'Size;
-- -------------------------------------------------------------------------
--
-- Hook for additional Information
--
type X_Ext_Data_Pointer is new System.Address;
Null_Ext_Data_Pointer : constant X_Ext_Data_Pointer := X_Ext_Data_Pointer (Null_Address);
-- -------------------------------------------------------------------------
--
-- geometry definition
--
-- previously (and originally) defined in the Intrinsics, but already
-- needed here
-- Use64Bit
--! subtype Dimension is Interfaces.C.unsigned;
--! subtype Position is Interfaces.C.int;
-- Not64Bit
subtype Dimension is Interfaces.C.unsigned_short;
subtype Position is Interfaces.C.short;
-- End64Bit
subtype Natural_Position is Position range 0 .. Position'Last;
type Angle is digits 6; -- this is enough for angles
type Arc is record
X, Y : Position;
Width, Height : Dimension;
Angle1, Angle2 : Angle;
end record;
type Arc_Access is access all Arc;
type Arc_Array is array (Natural range <>) of aliased Arc;
type Point is record
X, Y : Position;
end record;
type Point_Access is access all Point;
type Point_Array is array (Natural range <>) of aliased Point;
type Rectangle is record
X, Y : Position;
Width, Height : Dimension;
end record;
type Rectangle_Access is access all Rectangle;
type Rectangle_Array is array (Natural range <>) of aliased Rectangle;
type Segment is record
X1, Y1, X2, Y2 : Position;
end record;
type Segment_Access is access all Segment;
type Segment_Array is array (Natural range <>) of aliased Segment;
--
-- XID List
--
package XID_Lists is
new Generic_List_Types (XID);
type XID_List is new XID_Lists.Unbounded_List;
Null_XID_List : constant XID_List := XID_List (XID_Lists.Null_Unbounded_List);
function Length (List : in XID_List) return Natural;
function Element
(List : in XID_List;
Index : in Natural)
return XID;
function "=" (Left, Right : in XID_List) return Boolean;
function "&" (Left, Right : in XID_List) return XID_List;
function "&" (Left : in XID_List;
Right : in XID) return XID_List;
procedure Append (List : in out XID_List;
W : in XID_List);
procedure Append (List : in out XID_List;
W : in XID);
subtype Window_ID_List is XID_List;
procedure X_Query_Tree
(Display : in Display_Pointer;
W : in Window_ID;
Root : out Window_ID;
Parent : out Window_ID;
Children : out Window_ID_List);
-- -------------------------------------------------------------------------
--
-- keyboard
--
function X_String_To_Keysym (Keysym_Name : in String) return Key_Sym_ID;
function X_Keysym_To_String (Keysym : in Key_Sym_ID) return String;
function X_Keycode_To_Keysym
(Display : in Display_Pointer;
Keycode : in Key_Code_Type;
Index : in Key_Codes_Vector_Index_Type)
return Key_Sym_ID;
function X_Keysym_To_Keycode
(Display : in Display_Pointer;
Keysym : in Key_Sym_ID)
return Key_Code_Type;
procedure X_Convert_Case
(Keysym : in Key_Sym_ID;
Lower : out Key_Sym_ID;
Upper : out Key_Sym_ID);
-- -------------------------------------------------------------------------
--
-- Graphics Context
--
type GX_Functions is (GX_Clear, GX_And, GX_And_Reverse, GX_Copy,
GX_And_Inverted, GX_Noop, GX_Xor, GX_Or,
GX_Nor, GX_Equiv, GX_Invert, GX_Or_Reverse,
GX_Copy_Inverted, GX_Or_Inverted, GX_Nand, GX_Set);
for GX_Functions use (GX_Clear => 0, GX_And => 1, GX_And_Reverse => 2, GX_Copy => 3,
GX_And_Inverted => 4, GX_Noop => 5, GX_Xor => 6, GX_Or => 7,
GX_Nor => 8, GX_Equiv => 9, GX_Invert => 10, GX_Or_Reverse => 11,
GX_Copy_Inverted => 12, GX_Or_Inverted => 13, GX_Nand => 14, GX_Set => 15);
for GX_Functions'Size use Interfaces.C.int'Size;
type Line_Styles is (Solid, On_Off_Dash, Double_Dash);
for Line_Styles use (Solid => 0, On_Off_Dash => 1, Double_Dash => 2);
for Line_Styles'Size use Interfaces.C.int'Size;
type Cap_Styles is (Not_Last, Butt, Round, Projecting);
for Cap_Styles use (Not_Last => 0, Butt => 1, Round => 2, Projecting => 3);
for Cap_Styles'Size use Interfaces.C.int'Size;
type Join_Styles is (Miter, Round, Bevel);
for Join_Styles use (Miter => 0, Round => 1, Bevel => 2);
for Join_Styles'Size use Interfaces.C.int'Size;
type Fill_Styles is (Solid, Tiled, Stippled, Opaque_Stippled);
for Fill_Styles use (Solid => 0, Tiled => 1, Stippled => 2, Opaque_Stippled => 3);
for Fill_Styles'Size use Interfaces.C.int'Size;
type Fill_Rules is (Even_Odd_Rule, Winding_Rule);
for Fill_Rules use (Even_Odd_Rule => 0, Winding_Rule => 1);
for Fill_Rules'Size use Interfaces.C.int'Size;
type Arc_Modes is (Chord, Pie_Slice);
for Arc_Modes use (Chord => 0, Pie_Slice => 1);
for Arc_Modes'Size use Interfaces.C.int'Size;
type Subwindow_Modes is (Clip_By_Children, Include_Inferiors);
for Subwindow_Modes use (Clip_By_Children => 0, Include_Inferiors => 1);
for Subwindow_Modes'Size use Interfaces.C.int'Size;
type X_GC_Values is record
GX_Function : GX_Functions;
Plane_Mask : Color_Plane_Mask;
Foreground,
Background : Pixel;
Line_Width : Interfaces.C.unsigned;
Line_Style : Line_Styles;
Cap_Style : Cap_Styles;
Join_Style : Join_Styles;
Fill_Style : Fill_Styles;
Fill_Rule : Fill_Rules;
Arc_Mode : Arc_Modes;
Tile : Pixmap_ID;
Stipple : Pixmap_ID;
TS_X_Origin,
TS_Y_Origin : Interfaces.C.int;
Font : Font_ID;
Subwindow_Mode : Subwindow_Modes;
Graphics_Exposures : X_Boolean;
Clip_X_Origin,
Clip_Y_Origin : Interfaces.C.int;
Clip_Mask : Pixmap_ID;
Dash_Offset : Interfaces.C.int;
Dashes : Interfaces.C.signed_char;
end record;
for X_GC_Values use record
GX_Function at 0 range 0 .. 31;
Plane_Mask at 4 range 0 .. 31;
Foreground at 8 range 0 .. 31;
Background at 12 range 0 .. 31;
Line_Width at 16 range 0 .. 31;
Line_Style at 20 range 0 .. 31;
Cap_Style at 24 range 0 .. 31;
Join_Style at 28 range 0 .. 31;
Fill_Style at 32 range 0 .. 31;
Fill_Rule at 36 range 0 .. 31;
Arc_Mode at 40 range 0 .. 31;
Tile at 44 range 0 .. 31;
Stipple at 48 range 0 .. 31;
TS_X_Origin at 52 range 0 .. 31;
TS_Y_Origin at 56 range 0 .. 31;
Font at 60 range 0 .. 31;
Subwindow_Mode at 64 range 0 .. 31;
Graphics_Exposures at 68 range 0 .. 31;
Clip_X_Origin at 72 range 0 .. 31;
Clip_Y_Origin at 76 range 0 .. 31;
Clip_Mask at 80 range 0 .. 31;
Dash_Offset at 84 range 0 .. 31;
Dashes at 88 range 0 .. 31;
end record;
pragma Convention (C, X_GC_Values);
type X_GC_Valuemask is record
GC_Function : Boolean;
GC_Plane_Mask : Boolean;
GC_Foreground : Boolean;
GC_Background : Boolean;
GC_Line_Width : Boolean;
GC_Line_Style : Boolean;
GC_Cap_Style : Boolean;
GC_Join_Style : Boolean;
GC_Fill_Style : Boolean;
GC_Fill_Rule : Boolean;
GC_Tile : Boolean;
GC_Stipple : Boolean;
GC_Tile_Stip_X_Origin : Boolean;
GC_Tile_Stip_Y_Origin : Boolean;
GC_Font : Boolean;
GC_Subwindow_Mode : Boolean;
GC_Graphics_Exposures : Boolean;
GC_Clip_X_Origin : Boolean;
GC_Clip_Y_Origin : Boolean;
GC_Clip_Mask : Boolean;
GC_Dash_Offset : Boolean;
GC_Dashes : Boolean;
GC_Arc_Mode : Boolean;
end record;
for X_GC_Valuemask use record
-- UseLittleEndian
GC_Function at 0 range 0 .. 0;
GC_Plane_Mask at 0 range 1 .. 1;
GC_Foreground at 0 range 2 .. 2;
GC_Background at 0 range 3 .. 3;
GC_Line_Width at 0 range 4 .. 4;
GC_Line_Style at 0 range 5 .. 5;
GC_Cap_Style at 0 range 6 .. 6;
GC_Join_Style at 0 range 7 .. 7;
GC_Fill_Style at 0 range 8 .. 8;
GC_Fill_Rule at 0 range 9 .. 9;
GC_Tile at 0 range 10 .. 10;
GC_Stipple at 0 range 11 .. 11;
GC_Tile_Stip_X_Origin at 0 range 12 .. 12;
GC_Tile_Stip_Y_Origin at 0 range 13 .. 13;
GC_Font at 0 range 14 .. 14;
GC_Subwindow_Mode at 0 range 15 .. 15;
GC_Graphics_Exposures at 0 range 16 .. 16;
GC_Clip_X_Origin at 0 range 17 .. 17;
GC_Clip_Y_Origin at 0 range 18 .. 18;
GC_Clip_Mask at 0 range 19 .. 19;
GC_Dash_Offset at 0 range 20 .. 20;
GC_Dashes at 0 range 21 .. 21;
GC_Arc_Mode at 0 range 22 .. 22;
-- NotLittleEndian
--! GC_Function at 0 range 22 .. 22;
--! GC_Plane_Mask at 0 range 21 .. 21;
--! GC_Foreground at 0 range 20 .. 20;
--! GC_Background at 0 range 19 .. 19;
--! GC_Line_Width at 0 range 18 .. 18;
--! GC_Line_Style at 0 range 17 .. 17;
--! GC_Cap_Style at 0 range 16 .. 16;
--! GC_Join_Style at 0 range 15 .. 15;
--! GC_Fill_Style at 0 range 14 .. 14;
--! GC_Fill_Rule at 0 range 13 .. 13;
--! GC_Tile at 0 range 12 .. 12;
--! GC_Stipple at 0 range 11 .. 11;
--! GC_Tile_Stip_X_Origin at 0 range 10 .. 10;
--! GC_Tile_Stip_Y_Origin at 0 range 9 .. 9;
--! GC_Font at 0 range 8 .. 8;
--! GC_Subwindow_Mode at 0 range 7 .. 7;
--! GC_Graphics_Exposures at 0 range 6 .. 6;
--! GC_Clip_X_Origin at 0 range 5 .. 5;
--! GC_Clip_Y_Origin at 0 range 4 .. 4;
--! GC_Clip_Mask at 0 range 3 .. 3;
--! GC_Dash_Offset at 0 range 2 .. 2;
--! GC_Dashes at 0 range 1 .. 1;
--! GC_Arc_Mode at 0 range 0 .. 0;
-- EndLittleEndian
end record;
pragma Pack (X_GC_Valuemask);
for X_GC_Valuemask'Size use 23;
function X_Default_GC
(Display : in Display_Pointer;
Screen_No : in Screen_Number)
return GC_Pointer;
function X_Default_GC_Of_Screen (Screen : in Screen_Pointer)
return GC_Pointer;
function X_Create_GC
(Display : in Display_Pointer;
Drawable : in Drawable_ID;
Valuemask : in X_GC_Valuemask;
Values : in X_GC_Values)
return GC_Pointer;
function X_Create_GC
(Display : in Display_Pointer;
Drawable : in Drawable_ID)
return GC_Pointer;
procedure X_Free_GC
(Display : in Display_Pointer;
GC : in GC_Pointer);
procedure X_Flush_GC
(Display : in Display_Pointer;
GC : in GC_Pointer);
procedure X_Change_GC
(Display : in Display_Pointer;
GC : in GC_Pointer;
Valuemask : in X_GC_Valuemask;
Values : in X_GC_Values);
procedure X_Copy_GC
(Display : in Display_Pointer;
Source : in GC_Pointer;
Valuemask : in X_GC_Valuemask;
Dest : in GC_Pointer);
function X_GContext_From_GC (GC : in GC_Pointer) return GContext_ID;
procedure X_Get_GC_Values
(Display : in Display_Pointer;
GC : in GC_Pointer;
Valuemask : in X_GC_Valuemask;
Values : out X_GC_Values);
-- -------------------------------------------------------------------------
--
-- Convenience functions
--
procedure X_Set_Function
(Display : in Display_Pointer;
GC : in GC_Pointer;
Func : in GX_Functions);
procedure X_Set_Plane_Mask
(Display : in Display_Pointer;
GC : in GC_Pointer;
Plane_Mask : in Color_Plane_Mask);
procedure X_Set_Foreground
(Display : in Display_Pointer;
GC : in GC_Pointer;
Foreground : in Pixel);
procedure X_Set_Background
(Display : in Display_Pointer;
GC : in GC_Pointer;
Background : in Pixel);
procedure X_Set_Line_Attributes
(Display : in Display_Pointer;
GC : in GC_Pointer;
Line_Width : in Interfaces.C.unsigned;
Line_Style : in Line_Styles;
Cap_Style : in Cap_Styles;
Join_Style : in Join_Styles);
procedure X_Set_Fill_Style
(Display : in Display_Pointer;
GC : in GC_Pointer;
Fill_Style : in Fill_Styles);
procedure X_Set_Fill_Rule
(Display : in Display_Pointer;
GC : in GC_Pointer;
Fill_Rule : in Fill_Rules);
procedure X_Set_Arc_Mode
(Display : in Display_Pointer;
GC : in GC_Pointer;
Arc_Mode : in Arc_Modes);
procedure X_Set_Tile
(Display : in Display_Pointer;
GC : in GC_Pointer;
Tile : in Pixmap_ID);
procedure X_Set_Stipple
(Display : in Display_Pointer;
GC : in GC_Pointer;
Stipple : in Pixmap_ID);
procedure X_Set_TS_Origin
(Display : in Display_Pointer;
GC : in GC_Pointer;
TS_X_Origin,
TS_Y_Origin : in Integer);
procedure X_Set_Font
(Display : in Display_Pointer;
GC : in GC_Pointer;
Font : in Font_ID);
procedure X_Set_Subwindow_Mode
(Display : in Display_Pointer;
GC : in GC_Pointer;
Subwindow_Mode : in Subwindow_Modes);
procedure X_Set_Graphics_Exposures
(Display : in Display_Pointer;
GC : in GC_Pointer;
Graphics_Exposures : in Boolean);
procedure X_Set_Clip_Origin
(Display : in Display_Pointer;
GC : in GC_Pointer;
Clip_X_Origin,
Clip_Y_Origin : in Integer);
procedure X_Set_Clip_Mask
(Display : in Display_Pointer;
GC : in GC_Pointer;
Clip_Mask : in Pixmap_ID);
type Rectangle_Ordering is (Unsorted, Y_Sorted, YX_Sorted, YX_Banded);
for Rectangle_Ordering use (Unsorted => 0, Y_Sorted => 1,
YX_Sorted => 2, YX_Banded => 3);
procedure X_Set_Clip_Rectangles
(Display : in Display_Pointer;
GC : in GC_Pointer;
Clip_X_Origin,
Clip_Y_Origin : in Integer;
Rectangles : in Rectangle_Array;
Ordering : in Rectangle_Ordering);
type Dash_List_Type is array (Natural range <>) of Interfaces.C.signed_char;
procedure X_Set_Dashes
(Display : in Display_Pointer;
GC : in GC_Pointer;
Dash_Offset : in Integer;
Dash_List : in Dash_List_Type);
procedure X_Set_State
(Display : in Display_Pointer;
GC : in GC_Pointer;
Foreground,
Background : in Pixel;
Func : in GX_Functions;
Plane_Mask : in Color_Plane_Mask);
-- -------------------------------------------------------------------------
--
-- Display
--
-- error which is raised if no connection to the X Server could
-- be established
--
No_Connection_Error : exception;
-- open a connection to an X Server. if it fails, No_Connection_Error
-- is raised
--
function X_Open_Display (Display_Name : in String := "")
return Display_Pointer;
procedure X_Close_Display (Display : in Display_Pointer);
function X_Display_Of_Screen (Screen : in Screen_Pointer)
return Display_Pointer;
function X_Display_Name (Display_Name : in String := "")
return String;
function X_Display_String (Display : in Display_Pointer)
return String;
function X_Resource_Manager_String (Display : in Display_Pointer)
return String;
type Volume_Percentage_Type is range -100 .. 100;
for Volume_Percentage_Type'Size use Interfaces.C.int'Size;
procedure X_Bell
(Display : in Display_Pointer;
Percent : in Volume_Percentage_Type);
-- -------------------------------------------------------------------------
--
-- Visual
--
type Visual is record
Ext_Data : X_Ext_Data_Pointer;
VisualID : Visual_ID;
Class : Visual_Class;
Red_Mask,
Green_Mask,
Blue_Mask : Color_Plane_Mask;
Bits_Per_Rgb : Interfaces.C.int; -- >= 0
Map_Entries : Interfaces.C.int; -- >= 0
end record;
pragma Convention (C, Visual);
type Visual_Pointer is access all Visual;
type X_Visual_Info is record
Visual : Visual_Pointer;
VisualID : Visual_ID;
Screen : Screen_Number;
Depth : Color_Depth;
Class : Visual_Class;
Red_Mask,
Green_Mask,
Blue_Mask : Color_Plane_Mask;
Colormap_Size : Interfaces.C.int; -- >= 0
Bits_Per_Rgb : Interfaces.C.int; -- >= 0
end record;
pragma Convention (C, X_Visual_Info);
type X_Visual_Info_Array is array (Positive range <>) of aliased X_Visual_Info;
type X_Visual_Info_Mask is record
ID : Boolean;
Screen : Boolean;
Depth : Boolean;
Class : Boolean;
Red_Mask : Boolean;
Green_Mask : Boolean;
Blue_Mask : Boolean;
Colormap_Size : Boolean;
Bits_Per_Rgb : Boolean;
end record;
for X_Visual_Info_Mask use record
-- UseLittleEndian
ID at 0 range 0 .. 0;
Screen at 0 range 1 .. 1;
Depth at 0 range 2 .. 2;
Class at 0 range 3 .. 3;
Red_Mask at 0 range 4 .. 4;
Green_Mask at 0 range 5 .. 5;
Blue_Mask at 0 range 6 .. 6;
Colormap_Size at 0 range 7 .. 7;
Bits_Per_Rgb at 0 range 8 .. 8;
-- NotLittleEndian
--! ID at 0 range 8 .. 8;
--! Screen at 0 range 7 .. 7;
--! Depth at 0 range 6 .. 6;
--! Class at 0 range 5 .. 5;
--! Red_Mask at 0 range 4 .. 4;
--! Green_Mask at 0 range 3 .. 3;
--! Blue_Mask at 0 range 2 .. 2;
--! Colormap_Size at 0 range 1 .. 1;
--! Bits_Per_Rgb at 0 range 0 .. 0;
-- EndLittleEndian
end record;
for X_Visual_Info_Mask'Size use 9;
Visual_No_Mask : constant X_Visual_Info_Mask := (others => False);
Visual_All_Mask : constant X_Visual_Info_Mask := (others => True);
function X_Default_Visual
(Display : in Display_Pointer;
Screen : in Screen_Number)
return Visual_Pointer;
function X_Default_Visual_Of_Screen (Screen : in Screen_Pointer)
return Visual_Pointer;
function X_Visual_ID_From_Visual (Visual : in Visual_Pointer)
return Visual_ID;
function X_Get_Visual_Info
(Display : in Display_Pointer;
Vinfo_Mask : in X_Visual_Info_Mask;
Vinfo_Template : in X_Visual_Info)
return X_Visual_Info_Array;
function X_Match_Visual_Info
(Display : in Display_Pointer;
Screen : in Screen_Number;
Depth : in Color_Depth;
Class : in Visual_Class)
return X_Visual_Info;
-- -------------------------------------------------------------------------
--
-- XImage
--
-- forward declaration
type X_Image;
type X_Image_Pointer is access all X_Image;
-- functions for modifying XImages
type X_Image_Create_Image is
access function return X_Image_Pointer;
type X_Image_Destroy_Image is
access procedure (Xi : in X_Image_Pointer);
type X_Image_Get_Pixel is
access function
(Xi : in X_Image_Pointer;
X, Y : in Integer)
return Pixel;
type X_Image_Put_Pixel is
access procedure
(Xi : in X_Image_Pointer;
X, Y : in Integer;
Pix : in Pixel);
type X_Image_Sub_Image is
access function
(Xi : in X_Image_Pointer;
From_X, From_Y : in Integer;
Width, Height : in Natural)
return X_Image_Pointer;
type X_Image_Add_Pixel is
access procedure
(Xi : in X_Image_Pointer;
Pix : in Pixel);
type X_Image_Funcs is record
Create_Image : X_Image_Create_Image;
Destroy_Image : X_Image_Destroy_Image;
Get_Pixel : X_Image_Get_Pixel;
Put_Pixel : X_Image_Put_Pixel;
Sub_Image : X_Image_Sub_Image;
Add_Pixel : X_Image_Add_Pixel;
end record;
pragma Convention (C, X_Image_Funcs);
type Image_Format is (XY_Bitmap, XY_Pixmap, Z_Pixmap);
for Image_Format use (XY_Bitmap => 0, XY_Pixmap => 1, Z_Pixmap => 2);
for Image_Format'Size use Interfaces.C.int'Size;
type Data_Order is (LSB_First, MSB_First);
for Data_Order use (LSB_First => 0, MSB_First => 1);
for Data_Order'Size use Interfaces.C.int'Size;
type Data_Unit is (Unit_Char, Unit_Short, Unit_Long);
for Data_Unit use (Unit_Char => 8, Unit_Short => 16, Unit_Long => 32);
for Data_Unit'Size use Interfaces.C.int'Size;
type X_Image is record
Width, Height : Interfaces.C.int; -- >= 0
Offset : Interfaces.C.int;
Format : Image_Format;
Data : X_Pointer;
Byte_Order : Data_Order;
Bitmap_Unit : Data_Unit;
Bitmap_Bit_Order : Data_Order;
Bitmap_Pad : Data_Unit;
Depth : Color_Depth;
Bytes_Per_Line : Interfaces.C.int; -- >= 0
Bits_Per_Pixel : Interfaces.C.int; -- >= 0 only for Z_Pixmap
Red_Mask : Color_Plane_Mask;
Green_Mask : Color_Plane_Mask;
Blue_Mask : Color_Plane_Mask;
Ob_Data_Hook : X_Pointer;
F : X_Image_Funcs;
end record;
pragma Convention (C, X_Image);
function X_Create_Image
(Display : in Display_Pointer;
Visual : in Visual_Pointer;
Depth : in Color_Depth;
Format : in Image_Format;
Offset : in Integer;
Data : in X_Pointer;
Width, Height : in Natural;
Bitmap_Pad : in Data_Unit;
Bytes_Per_Line : in Natural)
return X_Image_Pointer;
-- UseX11R6 X11R6.3
procedure X_Init_Image (Image : in X_Image_Pointer);
-- EndX11R6 X11R6.3
function X_Get_Image
(Display : in Display_Pointer;
D : in Drawable_ID;
X, Y : in Integer;
Width, Height : in Natural;
Plane_Mask : in Color_Plane_Mask;
Format : in Image_Format)
return X_Image_Pointer;
function X_Get_Sub_Image
(Display : in Display_Pointer;
D : in Drawable_ID;
X, Y : in Integer;
Width, Height : in Natural;
Plane_Mask : in Color_Plane_Mask;
Format : in Image_Format;
Dest_Image : in X_Image_Pointer;
Dest_X, Dest_Y : in Integer)
return X_Image_Pointer;
procedure X_Destroy_Image (Image : in X_Image_Pointer);
function X_Get_Pixel
(Image : in X_Image_Pointer;
X, Y : in Integer)
return Pixel;
procedure X_Put_Image
(Display : in Display_Pointer;
D : in Drawable_ID;
GC : in GC_Pointer;
Image : in X_Image_Pointer;
Src_X, Src_Y : in Integer;
Dest_X, Dest_Y : in Integer;
Width, Height : in Natural);
procedure X_Put_Pixel
(Image : in X_Image_Pointer;
X, Y : in Integer;
Pix : in Pixel);
function X_Sub_Image
(Image : in X_Image_Pointer;
X, Y : in Integer;
Width, Height : in Integer)
return X_Image_Pointer;
procedure X_Add_Pixel
(Image : in X_Image_Pointer;
Pix : in Pixel);
-- -------------------------------------------------------------------------
--
-- drawing functions
--
-- draw an arc, centered at (X, Y), with half-axis of length Width in
-- X-Direction and half-axis of length Height in Y-Direction, from
-- Angle1 to Angle2 (3 o'clock is 0)
--
procedure X_Draw_Arc
(Display : in Display_Pointer;
D : in Drawable_ID;
GC : in GC_Pointer;
X, Y : in Position;
Width,
Height : in Dimension;
Angle1,
Angle2 : in Angle);
procedure X_Draw_Arcs
(Display : in Display_Pointer;
D : in Drawable_ID;
GC : in GC_Pointer;
Arcs : in Arc_Array);
-- draw a line from Point (X1, Y1) to Point (X2, Y2)
--
procedure X_Draw_Line
(Display : in Display_Pointer;
D : in Drawable_ID;
GC : in GC_Pointer;
X1, Y1,
X2, Y2 : in Position);
type Coord_Mode is (Origin, Previous);
for Coord_Mode use (Origin => 0, Previous => 1);
type Shape_Mode is (Complex, Nonconvex, Convex);
for Shape_Mode use (Complex => 0, Nonconvex => 1, Convex => 2);
procedure X_Draw_Lines
(Display : in Display_Pointer;
D : in Drawable_ID;
GC : in GC_Pointer;
Points : in Point_Array;
Mode : in Coord_Mode);
procedure X_Draw_Point
(Display : in Display_Pointer;
D : in Drawable_ID;
GC : in GC_Pointer;
X, Y : in Position);
procedure X_Draw_Points
(Display : in Display_Pointer;
D : in Drawable_ID;
GC : in GC_Pointer;
Points : in Point_Array;
Mode : in Coord_Mode);
procedure X_Draw_Rectangle
(Display : in Display_Pointer;
D : in Drawable_ID;
GC : in GC_Pointer;
X, Y : in Position;
Width,
Height : in Dimension);
procedure X_Draw_Rectangles
(Display : in Display_Pointer;
D : in Drawable_ID;
GC : in GC_Pointer;
Rectangles : in Rectangle_Array);
procedure X_Draw_Segments
(Display : in Display_Pointer;
D : in Drawable_ID;
GC : in GC_Pointer;
Segments : in Segment_Array);
procedure X_Draw_String
(Display : in Display_Pointer;
D : in Drawable_ID;
GC : in GC_Pointer;
X, Y : in Position;
Str : in String);
procedure X_Draw_Image_String
(Display : in Display_Pointer;
D : in Drawable_ID;
GC : in GC_Pointer;
X, Y : in Position;
Str : in String);
procedure X_Fill_Arc
(Display : in Display_Pointer;
D : in Drawable_ID;
GC : in GC_Pointer;
X, Y : in Position;
Width,
Height : in Dimension;
Angle1,
Angle2 : in Angle);
procedure X_Fill_Arcs
(Display : in Display_Pointer;
D : in Drawable_ID;
GC : in GC_Pointer;
Arcs : in Arc_Array);
procedure X_Fill_Polygon
(Display : in Display_Pointer;
D : in Drawable_ID;
GC : in GC_Pointer;
Points : in Point_Array;
Shape : in Shape_Mode;
Mode : in Coord_Mode);
procedure X_Fill_Rectangle
(Display : in Display_Pointer;
D : in Drawable_ID;
GC : in GC_Pointer;
X, Y : in Position;
Width,
Height : in Dimension);
procedure X_Fill_Rectangles
(Display : in Display_Pointer;
D : in Drawable_ID;
GC : in GC_Pointer;
Rectangles : in Rectangle_Array);
procedure X_Copy_Area
(Display : in Display_Pointer;
Src : in Drawable_ID;
Dest : in Drawable_ID;
GC : in GC_Pointer;
Src_X, Src_Y : in Position;
Width,
Height : in Dimension;
Dest_X, Dest_Y : in Position);
procedure X_Copy_Plane
(Display : in Display_Pointer;
Src : in Drawable_ID;
Dest : in Drawable_ID;
GC : in GC_Pointer;
Src_X, Src_Y : in Position;
Width,
Height : in Dimension;
Dest_X, Dest_Y : in Position;
Plane : in Color_Plane_Mask);
procedure X_Clear_Area
(Display : in Display_Pointer;
Window : in Window_ID;
X, Y : in Position;
Width,
Height : in Dimension;
Exposures : in Boolean);
procedure X_Clear_Window
(Display : in Display_Pointer;
Window : in Window_ID);
-- -------------------------------------------------------------------------
--
-- Depth
--
function X_Default_Depth
(Display : in Display_Pointer;
Screen_No : in Screen_Number)
return Color_Depth;
function X_Default_Depth_Of_Screen (Screen : in Screen_Pointer)
return Color_Depth;
-- -------------------------------------------------------------------------
--
-- Screen and screen number
--
function X_Screen_Count (Display : in Display_Pointer)
return Screen_Number;
function X_Default_Screen (Display : in Display_Pointer)
return Screen_Number;
function X_Default_Screen_Of_Display (Display : in Display_Pointer)
return Screen_Pointer;
function X_Screen_Of_Display
(Display : in Display_Pointer;
Screen_No : in Screen_Number)
return Screen_Pointer;
function X_Screen_Number_Of_Screen (Screen : in Screen_Pointer)
return Screen_Number;
function X_Screen_Resource_String (Screen : in Screen_Pointer)
return String;
type Backing_Store is (Never, When_Mapped, Always);
for Backing_Store use (Never => 0, When_Mapped => 1, Always => 2);
for Backing_Store'Size use Interfaces.C.int'Size;
function X_Does_Backing_Store (Screen : in Screen_Pointer)
return Backing_Store;
function X_Does_Save_Unders (Screen : in Screen_Pointer)
return Boolean;
-- -------------------------------------------------------------------------
--
-- Colormap
--
function X_Default_Colormap
(Display : in Display_Pointer;
Screen_No : in Screen_Number)
return Colormap_ID;
function X_Default_Colormap_Of_Screen (Screen : in Screen_Pointer)
return Colormap_ID;
type Alloc_Mode is (Alloc_None, Alloc_All);
for Alloc_Mode use (Alloc_None => 0, Alloc_All => 1);
for Alloc_Mode'Size use Interfaces.C.int'Size;
function X_Create_Colormap
(Display : in Display_Pointer;
W : in Window_ID;
Visual : in Visual_Pointer;
Alloc : in Alloc_Mode)
return Colormap_ID;
function X_Copy_Colormap_And_Free
(Display : in Display_Pointer;
Cmap : in Colormap_ID)
return Colormap_ID;
procedure X_Free_Colormap
(Display : in Display_Pointer;
Cmap : in Colormap_ID);
procedure X_Install_Colormap
(Display : in Display_Pointer;
Cmap : in Colormap_ID);
procedure X_Uninstall_Colormap
(Display : in Display_Pointer;
Cmap : in Colormap_ID);
-- -------------------------------------------------------------------------
--
-- Color
--
--
-- Info routines
--
function X_Display_Cells
(Display : in Display_Pointer;
Screen_No : in Screen_Number)
return Natural;
function X_Cells_Of_Screen
(Screen : in Screen_Pointer)
return Natural;
function X_Display_Planes
(Display : in Display_Pointer;
Screen_No : in Screen_Number)
return Natural;
function X_Planes_Of_Screen
(Screen : in Screen_Pointer)
return Natural;
type Color_Component_Mask is record
Do_Red : Boolean;
Do_Green : Boolean;
Do_Blue : Boolean;
end record;
for Color_Component_Mask use record
-- UseLittleEndian
Do_Red at 0 range 0 .. 0;
Do_Green at 0 range 1 .. 1;
Do_Blue at 0 range 2 .. 2;
-- NotLittleEndian
--! Do_Red at 0 range 2 .. 2;
--! Do_Green at 0 range 1 .. 1;
--! Do_Blue at 0 range 0 .. 0;
-- EndLittleEndian
end record;
for Color_Component_Mask'Size use 3;
type X_Color is record
Pix : Pixel;
Red,
Green,
Blue : Interfaces.C.unsigned_short;
Flags : Color_Component_Mask;
Pad : Interfaces.C.signed_char;
end record;
for X_Color use record
Pix at 0 range 0 .. 31;
Red at 4 range 0 .. 15;
Green at 6 range 0 .. 15;
Blue at 8 range 0 .. 15;
-- UseLittleEndian
Flags at 10 range 0 .. 2;
-- NotLittleEndian
--! Flags at 10 range 5 .. 7;
-- EndLittleEndian
Pad at 11 range 0 .. 7;
end record;
for X_Color'Size use 3*Interfaces.C.int'Size;
type X_Color_Array is array (Natural range <>) of aliased X_Color;
type Pixel_Array_Type is array (Natural range <>) of Pixel;
type Color_Plane_Mask_Array_Type is
array (Natural range <>) of Color_Plane_Mask;
X_Color_Error : exception;
-- allocate shared color cells (i.e. color cells allocated with these
-- routines musn't be modified)
--
procedure X_Alloc_Color
(Display : in Display_Pointer;
C_Map : in Colormap_ID;
Colorcell_Def : in out X_Color);
procedure X_Alloc_Named_Color
(Display : in Display_Pointer;
C_Map : in Colormap_ID;
Colorname : in String;
Colorcell_Def : out X_Color;
RGB_DB_Def : out X_Color);
-- allocate private color cells
--
procedure X_Alloc_Color_Cells
(Display : in Display_Pointer;
C_Map : in Colormap_ID;
Contig : in Boolean;
Plane_Masks : out Color_Plane_Mask_Array_Type;
Pixels : out Pixel_Array_Type);
procedure X_Alloc_Color_Planes
(Display : in Display_Pointer;
C_Map : in Colormap_ID;
Contig : in Boolean;
Pixels : out Pixel_Array_Type;
N_Red_Planes,
N_Green_Planes,
N_Blue_Planes : in Natural;
Red_Mask : out Color_Plane_Mask;
Green_Mask : out Color_Plane_Mask;
Blue_Mask : out Color_Plane_Mask);
-- store color definition in private color cells
--
procedure X_Store_Color
(Display : in Display_Pointer;
C_Map : in Colormap_ID;
Color : in out X_Color);
procedure X_Store_Colors
(Display : in Display_Pointer;
C_Map : in Colormap_ID;
Colors : in out X_Color_Array);
procedure X_Store_Named_Color
(Display : in Display_Pointer;
C_Map : in Colormap_ID;
Colorname : in String;
Pix : in Pixel;
Flags : in Color_Component_Mask);
procedure X_Lookup_Color
(Display : in Display_Pointer;
C_Map : in Colormap_ID;
Colorname : in String;
RGB_DB_Def : out X_Color;
Hardware_Def : out X_Color);
procedure X_Parse_Color
(Display : in Display_Pointer;
C_Map : in Colormap_ID;
Spec : in String;
RGB_DB_Def : out X_Color);
procedure X_Query_Color
(Display : in Display_Pointer;
C_Map : in Colormap_ID;
Colorcell_Def : in out X_Color);
procedure X_Query_Colors
(Display : in Display_Pointer;
C_Map : in Colormap_ID;
Colorcell_Def : in out X_Color_Array);
-- free color cells obtained by X_Alloc_Color, X_Alloc_Named_Color,
-- X_Alloc_Color_Cells and X_Alloc_Color_Planes
--
procedure X_Free_Colors
(Display : in Display_Pointer;
C_Map : in Colormap_ID;
Pixels : in Pixel_Array_Type;
Planes : in Color_Plane_Mask := Color_Plane_Mask'(0));
-- -------------------------------------------------------------------------
--
-- define how to handle resources after the program has finished
--
type Close_Mode_Type is (Destroy_All, Retain_Permanent, Retain_Temporary);
for Close_Mode_Type use (Destroy_All => 0, Retain_Permanent => 1, Retain_Temporary => 2);
for Close_Mode_Type'Size use Interfaces.C.int'Size;
procedure X_Set_Close_Down_Mode
(Display : in Display_Pointer;
Close_Mode : in Close_Mode_Type := Destroy_All);
-- -------------------------------------------------------------------------
--
-- detroy a client or its remaining resources
--
-- special XID. When passed to X_Kill_Client all temporary resources
-- will be killed
All_Temporary : constant XID;
procedure X_Kill_Client
(Display : in Display_Pointer;
Resource : in X_Lib.XID);
-- -------------------------------------------------------------------------
--
-- Window
--
procedure X_Add_To_Save_Set
(Display : in Display_Pointer;
Window : in Window_ID);
procedure X_Remove_From_Save_Set
(Display : in Display_Pointer;
Window : in Window_ID);
-- -------------------------------------------------------------------------
--
-- function returning root windows
--
function X_Root_Window
(Display : in Display_Pointer;
Screen_No : in Screen_Number)
return Window_ID;
function X_Default_Root_Window (Display : in Display_Pointer)
return Window_ID;
function X_Root_Window_Of_Screen (Screen : in Screen_Pointer)
return Window_ID;
-- -------------------------------------------------------------------------
--
-- Window appearance
--
procedure X_Set_Window_Background
(Display : in Display_Pointer;
W : in Window_ID;
Background_Pixel : in Pixel);
procedure X_Set_Window_Background_Pixmap
(Display : in Display_Pointer;
W : in Window_ID;
Background_Pixmap : in Pixmap_ID);
procedure X_Set_Window_Border
(Display : in Display_Pointer;
W : in Window_ID;
Border_Pixel : in Pixel);
procedure X_Set_Window_Border_Pixmap
(Display : in Display_Pointer;
W : in Window_ID;
Border_Pixmap : in Pixmap_ID);
procedure X_Set_Window_Border_Width
(Display : in Display_Pointer;
W : in Window_ID;
Width : in Natural);
procedure X_Set_Window_Colormap
(Display : in Display_Pointer;
W : in Window_ID;
Cmap : in Colormap_ID);
procedure X_Iconify_Window
(Display : in Display_Pointer;
W : in Window_ID;
Screen_No : in Screen_Number);
procedure X_Withdraw_Window
(Display : in Display_Pointer;
W : in Window_ID;
Screen_No : in Screen_Number);
procedure X_Raise_Window
(Display : in Display_Pointer;
W : in Window_ID);
procedure X_Lower_Window
(Display : in Display_Pointer;
W : in Window_ID);
procedure X_Destroy_Window
(Display : in Display_Pointer;
W : in Window_ID);
procedure X_Destroy_Subwindows
(Display : in Display_Pointer;
W : in Window_ID);
procedure X_Map_Window
(Display : in Display_Pointer;
W : in Window_ID);
procedure X_Unmap_Window
(Display : in Display_Pointer;
W : in Window_ID);
procedure X_Map_Raised
(Display : in Display_Pointer;
W : in Window_ID);
procedure X_Map_Subwindows
(Display : in Display_Pointer;
W : in Window_ID);
procedure X_Unmap_Subwindows
(Display : in Display_Pointer;
W : in Window_ID);
type Circulate_Direction is (Raise_Lowest, Lower_Highest);
for Circulate_Direction use (Raise_Lowest => 0, Lower_Highest => 1);
for Circulate_Direction'Size use Interfaces.C.int'Size;
procedure X_Circulate_Subwindows
(Display : in Display_Pointer;
W : in Window_ID;
Direction : in Circulate_Direction);
procedure X_Circulate_Subwindows_Up
(Display : in Display_Pointer;
W : in Window_ID);
procedure X_Circulate_Subwindows_Down
(Display : in Display_Pointer;
W : in Window_ID);
procedure X_Restack_Windows
(Display : in Display_Pointer;
Windows : in Window_ID_Array_Type);
-- obtain geometry of window or drawable
--
procedure X_Get_Geometry
(Display : in Display_Pointer;
D : in Drawable_ID;
Root_Win : out Window_ID;
X, Y : out Integer;
Width, Height : out Natural;
Border_Width : out Natural;
Depth : out Color_Depth);
-- -------------------------------------------------------------------------
--
-- predefined Pixel values
--
function X_Black_Pixel (Display : in Display_Pointer;
Screen_No : in Screen_Number) return Pixel;
function X_White_Pixel (Display : in Display_Pointer;
Screen_No : in Screen_Number) return Pixel;
function X_Black_Pixel_Of_Screen (Screen : in Screen_Pointer) return Pixel;
function X_White_Pixel_Of_Screen (Screen : in Screen_Pointer) return Pixel;
function X_All_Planes return Color_Plane_Mask;
-- -------------------------------------------------------------------------
--
-- Font routines
--
type Char_Struct is record
Lbearing : Dimension; -- origin to left edge of raster
Rbearing : Dimension; -- origin to right edge of raster
Width : Dimension; -- advance to next char's origin
Ascent : Dimension; -- baseline to top edge of raster
Descent : Dimension; -- baseline to bottom edge of raster
Attributes : Interfaces.C.unsigned_short; -- per char flags
end record;
type Char_Struct_Access is access Char_Struct;
function X_Load_Font (Display : in Display_Pointer;
Name : in String)
return Font_ID;
function X_Load_Query_Font (Display : in Display_Pointer;
Name : in String)
return X_Font_Struct_Pointer;
type Draw_Direction is (Left_To_Right, Right_To_Left, Direction_Change);
procedure X_Query_Text_Extents
(Display : in Display_Pointer;
FontId : in Font_Id;
Text : in String;
Direction : out Draw_Direction;
Ascent : out Dimension;
Descent : out Dimension;
Overall : out Char_Struct);
-- -------------------------------------------------------------------------
--
-- Pixmaps
--
X_Error_Open_Failed : exception;
X_Error_File_Invalid : exception;
X_Error_No_Memory : exception;
function X_Create_Pixmap
(Display : in Display_Pointer;
D : in Drawable_ID;
Width,
Height : in Dimension;
Depth : in Color_Depth)
return Pixmap_ID;
procedure X_Free_Pixmap
(Display : in Display_Pointer;
Pixmap : in Pixmap_ID);
-- general bitmap type (1 bit/pixel):
-- the bitmap has the size 'Length (1) by 'Length (2)*8
--
type Bitmap_Type is
array (Natural range <>, Natural range <>) of Bits_8_Type;
function X_Create_Bitmap_From_Data
(Display : in Display_Pointer;
D : in Drawable_ID;
Data : in Bitmap_Type)
return Pixmap_ID;
function X_Create_Pixmap_From_Bitmap_Data
(Display : in Display_Pointer;
D : in Drawable_ID;
Data : in Bitmap_Type;
FG, BG : in Pixel;
Depth : in Color_Depth)
return Pixmap_ID;
procedure X_Read_Bitmap_File
(Display : in Display_Pointer;
Drawable : in Drawable_ID;
Filename : in String;
Width : out Dimension;
Height : out Dimension;
Bitmap : out Pixmap_ID;
X_Hot : out Position;
Y_Hot : out Position);
procedure X_Write_Bitmap_File
(Display : in Display_Pointer;
Filename : in String;
Bitmap : in Pixmap_ID;
Width : in Dimension;
Height : in Dimension;
X_Hot : in Position := Position'(-1);
Y_Hot : in Position := Position'(-1));
-- -------------------------------------------------------------------------
--
-- I N F O
--
-- -------------------------------------------------------------------------
--
-- best size
--
procedure X_Query_Best_Stipple
(Display : in Display_Pointer;
D : in Drawable_ID;
Width,
Height : in Dimension;
Best_Width,
Best_Height : out Dimension);
procedure X_Query_Best_Tile
(Display : in Display_Pointer;
D : in Drawable_ID;
Width,
Height : in Dimension;
Best_Width,
Best_Height : out Dimension);
-- -------------------------------------------------------------------------
--
-- fonts
--
function X_List_Fonts (Display : in X_Lib.Display_Pointer;
Pattern : in String;
Max_Names : in Natural)
return String_List.Element_Access_List;
-- -------------------------------------------------------------------------
--
-- pixmap formats
--
type X_Pixmap_Format_Values is record
Depth : Color_Depth;
Bits_Per_Pixel : Interfaces.C.int; -- >= 0
Scanline_Pad : Interfaces.C.int; -- >= 0
end record;
pragma Convention (C, X_Pixmap_Format_Values);
type X_Pixmap_Format_Values_Array is
array (Natural range <>) of aliased X_Pixmap_Format_Values;
function X_List_Pixmap_Formats (Display : in Display_Pointer)
return X_Pixmap_Format_Values_Array;
-- -------------------------------------------------------------------------
--
-- installed colormaps
--
type Colormap_ID_Array is
array (Natural range <>) of aliased Colormap_ID;
function X_List_Installed_Colormaps
(Display : in Display_Pointer;
W : in Window_ID)
return Colormap_ID_Array;
-- -------------------------------------------------------------------------
--
-- atoms
--
type Atom_Array is
array (Natural range <>) of aliased Atom;
function X_List_Properties
(Display : in Display_Pointer;
W : in Window_ID)
return Atom_Array;
-- -------------------------------------------------------------------------
--
-- depth of screen
--
type Color_Depth_Array is
array (Natural range <>) of aliased Color_Depth;
function X_List_Depths
(Display : in Display_Pointer;
Screen_No : in Screen_Number)
return Color_Depth_Array;
-- -------------------------------------------------------------------------
--
-- dimension of screen
--
function X_Display_Height
(Display : in Display_Pointer;
Screen_No : in Screen_Number)
return Integer;
function X_Display_Height_MM
(Display : in Display_Pointer;
Screen_No : in Screen_Number)
return Integer;
function X_Height_Of_Screen (Screen : in Screen_Pointer) return Integer;
function X_Height_MM_Of_Screen (Screen : in Screen_Pointer) return Integer;
function X_Display_Width
(Display : in Display_Pointer;
Screen_No : in Screen_Number)
return Integer;
function X_Display_Width_MM
(Display : in Display_Pointer;
Screen_No : in Screen_Number)
return Integer;
function X_Width_Of_Screen (Screen : in Screen_Pointer) return Integer;
function X_Width_MM_Of_Screen (Screen : in Screen_Pointer) return Integer;
-- -------------------------------------------------------------------------
--
-- bit/byte order
--
function X_Image_Byte_Order (Display : in Display_Pointer)
return Data_Order;
function X_Bitmap_Bit_Order (Display : in Display_Pointer)
return Data_Order;
function X_Bitmap_Pad (Display : in Display_Pointer)
return Integer;
function X_Bitmap_Unit (Display : in Display_Pointer)
return Integer;
-- ----------------------------------------------------------------------------
--
-- I N T E R N A T I O N A L I Z A T I O N
--
type Font_Set_Extents_Type is record
Max_Ink_Extent : Rectangle;
Max_Logical_Extent : Rectangle;
end record;
function X_Extents_Of_Font_Set
(Font_Set : in Font_Set_Type)
return Font_Set_Extents_Type;
-- UseX11R6 X11R6.3
-- ----------------------------------------------------------------------------
--
-- T H R E A D S
--
-- from Release 6 onward
X_Error_No_Threads : exception;
procedure X_Init_Threads;
procedure X_Lock_Display (Display : in Display_Pointer);
procedure X_Unlock_Display (Display : in Display_Pointer);
-- EndX11R6 X11R6.3
-- -------------------------------------------------------------------------
--
-- E V E N T _ M A S K
--
-- this type is defined in the Intrinsics, but the defines are
-- already defined in X11/X.h, therefore I define it here
--
type Event_Mask is record
Key_Press : Boolean;
Key_Release : Boolean;
Button_Press : Boolean;
Button_Release : Boolean;
Enter_Window : Boolean;
Leave_Window : Boolean;
Pointer_Motion : Boolean;
Pointer_Motion_Hint : Boolean;
Button1_Motion : Boolean;
Button2_Motion : Boolean;
Button3_Motion : Boolean;
Button4_Motion : Boolean;
Button5_Motion : Boolean;
Button_Motion : Boolean;
Keymap_State : Boolean;
Exposure : Boolean;
Visibility_Change : Boolean;
Structure_Notify : Boolean;
Resize_Redirect : Boolean;
Substructure_Notify : Boolean;
Substructure_Redirect : Boolean;
Focus_Change : Boolean;
Property_Change : Boolean;
Colormap_Change : Boolean;
Owner_Grab_Button : Boolean;
Pad_25, Pad_26, Pad_27, Pad_28, Pad_29, Pad_30, Pad_31 : Boolean;
end record;
for Event_Mask use record
-- UseLittleEndian
Key_Press at 0 range 0 .. 0;
Key_Release at 0 range 1 .. 1;
Button_Press at 0 range 2 .. 2;
Button_Release at 0 range 3 .. 3;
Enter_Window at 0 range 4 .. 4;
Leave_Window at 0 range 5 .. 5;
Pointer_Motion at 0 range 6 .. 6;
Pointer_Motion_Hint at 0 range 7 .. 7;
Button1_Motion at 0 range 8 .. 8;
Button2_Motion at 0 range 9 .. 9;
Button3_Motion at 0 range 10 .. 10;
Button4_Motion at 0 range 11 .. 11;
Button5_Motion at 0 range 12 .. 12;
Button_Motion at 0 range 13 .. 13;
Keymap_State at 0 range 14 .. 14;
Exposure at 0 range 15 .. 15;
Visibility_Change at 0 range 16 .. 16;
Structure_Notify at 0 range 17 .. 17;
Resize_Redirect at 0 range 18 .. 18;
Substructure_Notify at 0 range 19 .. 19;
Substructure_Redirect at 0 range 20 .. 20;
Focus_Change at 0 range 21 .. 21;
Property_Change at 0 range 22 .. 22;
Colormap_Change at 0 range 23 .. 23;
Owner_Grab_Button at 0 range 24 .. 24;
Pad_25 at 0 range 25 .. 25;
Pad_26 at 0 range 26 .. 26;
Pad_27 at 0 range 27 .. 27;
Pad_28 at 0 range 28 .. 28;
Pad_29 at 0 range 29 .. 29;
Pad_30 at 0 range 30 .. 30;
Pad_31 at 0 range 31 .. 31;
-- NotLittleEndian
--! Key_Press at 0 range 31 .. 31;
--! Key_Release at 0 range 30 .. 30;
--! Button_Press at 0 range 29 .. 29;
--! Button_Release at 0 range 28 .. 28;
--! Enter_Window at 0 range 27 .. 27;
--! Leave_Window at 0 range 26 .. 26;
--! Pointer_Motion at 0 range 25 .. 25;
--! Pointer_Motion_Hint at 0 range 24 .. 24;
--! Button1_Motion at 0 range 23 .. 23;
--! Button2_Motion at 0 range 22 .. 22;
--! Button3_Motion at 0 range 21 .. 21;
--! Button4_Motion at 0 range 20 .. 20;
--! Button5_Motion at 0 range 19 .. 19;
--! Button_Motion at 0 range 18 .. 18;
--! Keymap_State at 0 range 17 .. 17;
--! Exposure at 0 range 16 .. 16;
--! Visibility_Change at 0 range 15 .. 15;
--! Structure_Notify at 0 range 14 .. 14;
--! Resize_Redirect at 0 range 13 .. 13;
--! Substructure_Notify at 0 range 12 .. 12;
--! Substructure_Redirect at 0 range 11 .. 11;
--! Focus_Change at 0 range 10 .. 10;
--! Property_Change at 0 range 9 .. 9;
--! Colormap_Change at 0 range 8 .. 8;
--! Owner_Grab_Button at 0 range 7 .. 7;
--! Pad_25 at 0 range 6 .. 6;
--! Pad_26 at 0 range 5 .. 5;
--! Pad_27 at 0 range 4 .. 4;
--! Pad_28 at 0 range 3 .. 3;
--! Pad_29 at 0 range 2 .. 2;
--! Pad_30 at 0 range 1 .. 1;
--! Pad_31 at 0 range 0 .. 0;
-- EndLittleEndian
end record;
for Event_Mask'Size use Interfaces.C.long'Size;
No_Events : constant Event_Mask := (others => False);
All_Events : constant Event_Mask := (others => True);
-- -------------------------------------------------------------------------
--
-- Window Attributes
--
type Gravity_Type is (Forget,
North_West, North, North_East,
West, Center, East,
South_West, South, South_East,
Static);
for Gravity_Type use (Forget => 0,
North_West => 1, North => 2, North_East => 3,
West => 4, Center => 5, East => 6,
South_West => 7, South => 8, South_East => 9,
Static => 10);
for Gravity_Type'Size use Interfaces.C.int'Size;
Unmap_Gravity : constant Gravity_Type := Forget;
type Set_Window_Attributes_Type is record
Background_Pixmap : Pixmap_ID;
Background_Pixel : Pixel;
Border_Pixmap : Pixmap_ID;
Border_Pixel : Pixel;
Bit_Gravity : Gravity_Type;
Win_Gravity : Gravity_Type;
Backing_Store : X_Lib.Backing_Store;
Backing_Planes : Color_Plane_Mask;
Backing_Pixel : Pixel;
Save_Under : Boolean;
Ev_Mask : Event_Mask;
Do_Not_Propagate_Mask : Event_Mask;
Override_Redirect : Boolean;
Colormap : Colormap_ID;
Cursor : Cursor_ID;
end record;
for Set_Window_Attributes_Type use record
Background_Pixmap at 0 range 0 .. 31;
Background_Pixel at 4 range 0 .. 31;
Border_Pixmap at 8 range 0 .. 31;
Border_Pixel at 12 range 0 .. 31;
Bit_Gravity at 16 range 0 .. 31;
Win_Gravity at 20 range 0 .. 31;
Backing_Store at 24 range 0 .. 31;
Backing_Planes at 28 range 0 .. 31;
Backing_Pixel at 32 range 0 .. 31;
Save_Under at 36 range 0 .. 31;
Ev_Mask at 40 range 0 .. 31;
Do_Not_Propagate_Mask at 44 range 0 .. 31;
Override_Redirect at 48 range 0 .. 31;
Colormap at 52 range 0 .. 31;
Cursor at 56 range 0 .. 31;
end record;
for Set_Window_Attributes_Type'Size use 15 * Interfaces.C.int'Size;
pragma Convention (C, Set_Window_Attributes_Type);
type Set_Window_Attributes_Mask is record
Back_Pixmap : Boolean;
Back_Pixel : Boolean;
Border_Pixmap : Boolean;
Border_Pixel : Boolean;
Bit_Gravity : Boolean;
Win_Gravity : Boolean;
Backing_Store : Boolean;
Backing_Planes : Boolean;
Backing_Pixel : Boolean;
Override_Redirect : Boolean;
Save_Under : Boolean;
Ev_Mask : Boolean;
Dont_Propagate : Boolean;
Colormap : Boolean;
Cursor : Boolean;
end record;
for Set_Window_Attributes_Mask use record
-- UseLittleEndian
Back_Pixmap at 0 range 0 .. 0;
Back_Pixel at 0 range 1 .. 1;
Border_Pixmap at 0 range 2 .. 2;
Border_Pixel at 0 range 3 .. 3;
Bit_Gravity at 0 range 4 .. 4;
Win_Gravity at 0 range 5 .. 5;
Backing_Store at 0 range 6 .. 6;
Backing_Planes at 0 range 7 .. 7;
Backing_Pixel at 0 range 8 .. 8;
Override_Redirect at 0 range 9 .. 9;
Save_Under at 0 range 10 .. 10;
Ev_Mask at 0 range 11 .. 11;
Dont_Propagate at 0 range 12 .. 12;
Colormap at 0 range 13 .. 13;
Cursor at 0 range 14 .. 14;
-- NotLittleEndian
--! Back_Pixmap at 0 range 14 .. 14;
--! Back_Pixel at 0 range 13 .. 13;
--! Border_Pixmap at 0 range 12 .. 12;
--! Border_Pixel at 0 range 11 .. 11;
--! Bit_Gravity at 0 range 10 .. 10;
--! Win_Gravity at 0 range 9 .. 9;
--! Backing_Store at 0 range 8 .. 8;
--! Backing_Planes at 0 range 7 .. 7;
--! Backing_Pixel at 0 range 6 .. 6;
--! Override_Redirect at 0 range 5 .. 5;
--! Save_Under at 0 range 4 .. 4;
--! Ev_Mask at 0 range 3 .. 3;
--! Dont_Propagate at 0 range 2 .. 2;
--! Colormap at 0 range 1 .. 1;
--! Cursor at 0 range 0 .. 0;
-- EndLittleEndian
end record;
for Set_Window_Attributes_Mask'Size use 15;
procedure X_Change_Window_Attributes
(Display : in Display_Pointer;
W : in Window_ID;
Valuemask : in Set_Window_Attributes_Mask;
Attributes : in Set_Window_Attributes_Type);
function X_Create_Window
(Display : in Display_Pointer;
Parent : in Window_ID;
X, Y : in Position;
Width, Height : in Dimension;
Border_Width : in Natural;
Depth : in Color_Depth;
Class : in Window_Class;
Visual : in Visual_Pointer;
Valuemask : in Set_Window_Attributes_Mask;
Attributes : in Set_Window_Attributes_Type)
return Window_ID;
function X_Create_Simple_Window
(Display : in Display_Pointer;
Parent : in Window_ID;
X, Y : in Position;
Width, Height : in Dimension;
Border_Width : in Natural;
Border : in Pixel;
Background : in Pixel)
return Window_ID;
type Window_Stacking_Mode_Type is (Above, Below, Top_If, Bottom_If, Opposite);
for Window_Stacking_Mode_Type use (Above => 0, Below => 1, Top_If => 2,
Bottom_If => 3, Opposite => 4);
for Window_Stacking_Mode_Type'Size use Interfaces.C.int'Size;
type Window_Changes_Type is record
X, Y : Interfaces.C.int;
Width,
Height : Interfaces.C.int;
Border_Width : Interfaces.C.int;
Sibling : Window_ID;
Stack_Mode : Window_Stacking_Mode_Type;
end record;
pragma Convention (C, Window_Changes_Type);
type Window_Changes_Mask is record
X : Boolean;
Y : Boolean;
Width : Boolean;
Height : Boolean;
Border_Width : Boolean;
Sibling : Boolean;
Stack_Mode : Boolean;
end record;
for Window_Changes_Mask use record
-- UseLittleEndian
X at 0 range 0 .. 0;
Y at 0 range 1 .. 1;
Width at 0 range 2 .. 2;
Height at 0 range 3 .. 3;
Border_Width at 0 range 4 .. 4;
Sibling at 0 range 5 .. 5;
Stack_Mode at 0 range 6 .. 6;
-- NotLittleEndian
--! X at 0 range 6 .. 6;
--! Y at 0 range 5 .. 5;
--! Width at 0 range 4 .. 4;
--! Height at 0 range 3 .. 3;
--! Border_Width at 0 range 2 .. 2;
--! Sibling at 0 range 1 .. 1;
--! Stack_Mode at 0 range 0 .. 0;
-- EndLittleEndian
end record;
pragma Pack (Window_Changes_Mask);
for Window_Changes_Mask'Size use 7;
procedure X_Configure_Window
(Display : in Display_Pointer;
W : in Window_ID;
Value_Mask : in Window_Changes_Mask;
Values : in Window_Changes_Type);
procedure X_Resize_Window
(Display : in Display_Pointer;
W : in Window_ID;
Width,
Height : in Dimension);
-- -------------------------------------------------------------------------
--
-- G R A B F U N C T I O N S
--
X_Error_Already_Grabbed : exception;
X_Error_Grab_Invalid_Time : exception;
X_Error_Grab_Not_Viewable : exception;
X_Error_Grab_Frozen : exception;
type Grab_Mode_Type is (Sync, Async);
for Grab_Mode_Type use (Sync => 0, Async => 1);
for Grab_Mode_Type'Size use Interfaces.C.int'Size;
type Button_Type is (Any_Button, Button_1, Button_2, Button_3, Button_4, Button_5);
for Button_Type use (Any_Button => 0, Button_1 => 1, Button_2 => 2,
Button_3 => 3, Button_4 => 4, Button_5 => 5);
for Button_Type'Size use Interfaces.C.unsigned'Size;
type Modifiers_Mask_Type is record
Shift : Boolean;
Lock : Boolean;
Control : Boolean;
Modifier_1 : Boolean;
Modifier_2 : Boolean;
Modifier_3 : Boolean;
Modifier_4 : Boolean;
Modifier_5 : Boolean;
end record;
for Modifiers_Mask_Type use record
-- UseLittleEndian
Shift at 0 range 0 .. 0;
Lock at 0 range 1 .. 1;
Control at 0 range 2 .. 2;
Modifier_1 at 0 range 3 .. 3;
Modifier_2 at 0 range 4 .. 4;
Modifier_3 at 0 range 5 .. 5;
Modifier_4 at 0 range 6 .. 6;
Modifier_5 at 0 range 7 .. 7;
-- NotLittleEndian
--! Shift at 0 range 7 .. 7;
--! Lock at 0 range 6 .. 6;
--! Control at 0 range 5 .. 5;
--! Modifier_1 at 0 range 4 .. 4;
--! Modifier_2 at 0 range 3 .. 3;
--! Modifier_3 at 0 range 2 .. 2;
--! Modifier_4 at 0 range 1 .. 1;
--! Modifier_5 at 0 range 0 .. 0;
-- EndLittleEndian
end record;
pragma Pack (Modifiers_Mask_Type);
for Modifiers_Mask_Type'Size use 8;
procedure X_Grab_Button
(Display : in Display_Pointer;
Button : in Button_Type;
Modifiers : in Modifiers_Mask_Type;
Grab_Window : in Window_ID;
Owner_Events : in Boolean;
Ev_Mask : in Event_Mask;
Pointer_Mode : in Grab_Mode_Type;
Keyboard_Mode : in Grab_Mode_Type;
Confine_To : in Window_ID := Null_Window_ID;
Cursor : in Cursor_ID := Null_Cursor_ID);
procedure X_Ungrab_Button
(Display : in Display_Pointer;
Button : in Button_Type;
Modifiers : in Modifiers_Mask_Type;
Grab_Window : in Window_ID);
procedure X_Grab_Pointer
(Display : in Display_Pointer;
Grab_Window : in Window_ID;
Owner_Events : in Boolean;
Ev_Mask : in Event_Mask;
Pointer_Mode : in Grab_Mode_Type;
Keyboard_Mode : in Grab_Mode_Type;
Confine_To : in Window_ID := Null_Window_ID;
Cursor : in Cursor_ID := Null_Cursor_ID;
Time : in Server_Time);
procedure X_Ungrab_Pointer
(Display : in Display_Pointer;
Time : in Server_Time);
procedure X_Change_Active_Pointer_Grab
(Display : in Display_Pointer;
Ev_Mask : in Event_Mask;
Cursor : in Cursor_ID := Null_Cursor_ID;
Time : in Server_Time);
procedure X_Grab_Key
(Display : in Display_Pointer;
Keycode : in Key_Code_Type;
Modifiers : in Modifiers_Mask_Type;
Grab_Window : in Window_ID;
Owner_Events : in Boolean;
Pointer_Mode : in Grab_Mode_Type;
Keyboard_Mode : in Grab_Mode_Type);
procedure X_Ungrab_Key
(Display : in Display_Pointer;
Keycode : in Key_Code_Type;
Modifiers : in Modifiers_Mask_Type;
Grab_Window : in Window_ID);
procedure X_Grab_Keyboard
(Display : in Display_Pointer;
Grab_Window : in Window_ID;
Owner_Events : in Boolean;
Pointer_Mode : in Grab_Mode_Type;
Keyboard_Mode : in Grab_Mode_Type;
Time : in Server_Time);
procedure X_Ungrab_Keyboard
(Display : in Display_Pointer;
Time : in Server_Time);
procedure X_Grab_Server (Display : in Display_Pointer);
procedure X_Ungrab_Server (Display : in Display_Pointer);
-- ----------------------------------------------------------------------------
--
-- EVENTS
--
type Event_Type is new Interfaces.C.int;
Reserved_For_Errors : constant Event_Type := 0;
Reserved_For_Replies : constant Event_Type := 1;
Key_Press : constant Event_Type := 2;
Key_Release : constant Event_Type := 3;
Button_Press : constant Event_Type := 4;
Button_Release : constant Event_Type := 5;
Motion_Notify : constant Event_Type := 6;
Enter_Notify : constant Event_Type := 7;
Leave_Notify : constant Event_Type := 8;
Focus_In : constant Event_Type := 9;
Focus_Out : constant Event_Type := 10;
Keymap_Notify : constant Event_Type := 11;
Expose : constant Event_Type := 12;
Graphics_Expose : constant Event_Type := 13;
No_Expose : constant Event_Type := 14;
Visibility_Notify : constant Event_Type := 15;
Create_Notify : constant Event_Type := 16;
Destroy_Notify : constant Event_Type := 17;
Unmap_Notify : constant Event_Type := 18;
Map_Notify : constant Event_Type := 19;
Map_Request : constant Event_Type := 20;
Reparent_Notify : constant Event_Type := 21;
Configure_Notify : constant Event_Type := 22;
Configure_Request : constant Event_Type := 23;
Gravity_Notify : constant Event_Type := 24;
Resize_Request : constant Event_Type := 25;
Circulate_Notify : constant Event_Type := 26;
Circulate_Request : constant Event_Type := 27;
Property_Notify : constant Event_Type := 28;
Selection_Clear : constant Event_Type := 29;
Selection_Request : constant Event_Type := 30;
Selection_Notify : constant Event_Type := 31;
Colormap_Notify : constant Event_Type := 32;
Client_Message : constant Event_Type := 33;
Mapping_Notify : constant Event_Type := 34;
type Modifier_And_Button_Mask is record
Shift : Boolean;
Lock : Boolean;
Control : Boolean;
Mod1 : Boolean;
Mod2 : Boolean;
Mod3 : Boolean;
Mod4 : Boolean;
Mod5 : Boolean;
Button1 : Boolean;
Button2 : Boolean;
Button3 : Boolean;
Button4 : Boolean;
Button5 : Boolean;
end record;
for Modifier_And_Button_Mask use record
-- UseLittleEndian
Shift at 0 range 0 .. 0;
Lock at 0 range 1 .. 1;
Control at 0 range 2 .. 2;
Mod1 at 0 range 3 .. 3;
Mod2 at 0 range 4 .. 4;
Mod3 at 0 range 5 .. 5;
Mod4 at 0 range 6 .. 6;
Mod5 at 0 range 7 .. 7;
Button1 at 0 range 8 .. 8;
Button2 at 0 range 9 .. 9;
Button3 at 0 range 10 .. 10;
Button4 at 0 range 11 .. 11;
Button5 at 0 range 12 .. 12;
-- NotLittleEndian
--! Shift at 0 range 12 .. 12;
--! Lock at 0 range 11 .. 11;
--! Control at 0 range 10 .. 10;
--! Mod1 at 0 range 9 .. 9;
--! Mod2 at 0 range 8 .. 8;
--! Mod3 at 0 range 7 .. 7;
--! Mod4 at 0 range 6 .. 6;
--! Mod5 at 0 range 5 .. 5;
--! Button1 at 0 range 4 .. 4;
--! Button2 at 0 range 3 .. 3;
--! Button3 at 0 range 2 .. 2;
--! Button4 at 0 range 1 .. 1;
--! Button5 at 0 range 0 .. 0;
-- EndLittleEndian
end record;
for Modifier_And_Button_Mask'Size use 13;
subtype Physical_Button_Type is Button_Type range Button_1 .. Button_5;
type X_Button_Event is record
Serial : Interfaces.C.unsigned_long;
Send_Event : Boolean;
Display : Display_Pointer;
Window : Window_ID;
Root : Window_ID;
SubWindow : Window_ID;
Time : Server_Time;
X, Y : Position;
X_Root, Y_Root : Position;
State : Modifier_And_Button_Mask;
Button : Physical_Button_Type;
Same_Screen : Boolean;
end record;
subtype X_Button_Pressed_Event is X_Button_Event;
subtype X_Button_Released_Event is X_Button_Event;
type Circulate_Placement is (Place_On_Top, Place_On_Bottom);
for Circulate_Placement use (Place_On_Top => 0, Place_On_Bottom => 1);
for Circulate_Placement'Size use Interfaces.C.int'Size;
type X_Circulate_Event is record
Serial : Interfaces.C.unsigned_long;
Send_Event : Boolean;
Display : Display_Pointer;
Event : Window_ID;
Window : Window_ID;
Place : Circulate_Placement;
end record;
type X_Circulate_Request_Event is record
Serial : Interfaces.C.unsigned_long;
Send_Event : Boolean;
Display : Display_Pointer;
Parent : Window_ID;
Window : Window_ID;
Place : Circulate_Placement;
end record;
type Client_Message_Format is (Char_Format, Short_Format, Long_Format);
for Client_Message_Format use (Char_Format => 8,
Short_Format => 16,
Long_Format => 32);
for Client_Message_Format'Size use Interfaces.C.int'Size;
type X_Client_Message_Event is record
Serial : Interfaces.C.unsigned_long;
Send_Event : Boolean;
Display : Display_Pointer;
Window : Window_ID;
Message_Type : Atom;
Format : Client_Message_Format;
Data : Long_Array (1 .. 5);
end record;
type Colormap_State is (Uninstalled, Installed);
for Colormap_State use (Uninstalled => 0, Installed => 1);
for Colormap_State'Size use Interfaces.C.int'Size;
type X_Colormap_Event is record
Serial : Interfaces.C.unsigned_long;
Send_Event : Boolean;
Display : Display_Pointer;
Window : Window_ID;
Colormap : Colormap_ID;
Is_New : Boolean;
State : Colormap_State;
end record;
type X_Configure_Event is record
Serial : Interfaces.C.unsigned_long;
Send_Event : Boolean;
Display : Display_Pointer;
Event : Window_ID;
Window : Window_ID;
X, Y : Position;
Width, Height : Dimension;
Border_Width : Dimension;
Window_Above : Window_ID;
Override_Redirect : Boolean;
end record;
type X_Configure_Request_Event is record
Serial : Interfaces.C.unsigned_long;
Send_Event : Boolean;
Display : Display_Pointer;
Parent : Window_ID;
Window : Window_ID;
X, Y : Position;
Width, Height : Dimension;
Border_Width : Dimension;
Window_Above : Window_ID;
Detail : Window_Stacking_Mode_Type;
Value_Mask : Window_Changes_Mask;
end record;
type X_Create_Window_Event is record
Serial : Interfaces.C.unsigned_long;
Send_Event : Boolean;
Display : Display_Pointer;
Parent : Window_ID;
Window : Window_ID;
X, Y : Position;
Width, Height : Dimension;
Border_Width : Dimension;
Window_Above : Window_ID;
Override_Redirect : Boolean;
end record;
type X_Destroy_Window_Event is record
Serial : Interfaces.C.unsigned_long;
Send_Event : Boolean;
Display : Display_Pointer;
Event : Window_ID;
Window : Window_ID;
end record;
type Notify_Mode is (Notify_Normal, Notify_Grab, Notify_Ungrab);
for Notify_Mode use (Notify_Normal => 0, Notify_Grab => 1, Notify_Ungrab => 2);
for Notify_Mode'Size use Interfaces.C.int'Size;
type Notify_Detail is (Notify_Ancestor,
Notify_Virtual,
Notify_Inferior,
Notify_Nonlinear,
Notify_Nonlinear_Virtual,
Notify_Pointer,
Notify_Pointer_Root,
Notify_Detail_None);
for Notify_Detail use (Notify_Ancestor => 0,
Notify_Virtual => 1,
Notify_Inferior => 2,
Notify_Nonlinear => 3,
Notify_Nonlinear_Virtual => 4,
Notify_Pointer => 5,
Notify_Pointer_Root => 6,
Notify_Detail_None => 7);
for Notify_Detail'Size use Interfaces.C.int'Size;
subtype Crossing_Detail is Notify_Detail range Notify_Ancestor .. Notify_Nonlinear_Virtual;
type X_Crossing_Event is record
Serial : Interfaces.C.unsigned_long;
Send_Event : Boolean;
Display : Display_Pointer;
Window : Window_ID;
Root : Window_ID;
SubWindow : Window_ID;
Time : Server_Time;
X, Y : Position;
X_Root, Y_Root : Position;
Mode : Notify_Mode;
Detail : Crossing_Detail;
Same_Screen : Boolean;
Focus : Boolean;
State : Modifier_And_Button_Mask;
end record;
subtype X_Enter_Window_Event is X_Crossing_Event;
subtype X_Leave_Window_Event is X_Crossing_Event;
type X_Focus_Change_Event is record
Serial : Interfaces.C.unsigned_long;
Send_Event : Boolean;
Display : Display_Pointer;
Window : Window_ID;
Mode : Notify_Mode;
Detail : Notify_Detail;
end record;
subtype X_Focus_In_Event is X_Focus_Change_Event;
subtype X_Focus_Out_Event is X_Focus_Change_Event;
type X_Error_Event is record
Display : Display_Pointer;
ResourceId : XID;
Serial : Interfaces.C.unsigned_long;
Error_Code : Error_Code_Type;
Request_Code : Interfaces.C.unsigned_char;
Minor_Code : Interfaces.C.unsigned_char;
end record;
type X_Expose_Event is record
Serial : Interfaces.C.unsigned_long;
Send_Event : Boolean;
Display : Display_Pointer;
Window : Window_ID;
X, Y : Position;
Width, Height : Dimension;
Count : Integer;
end record;
type X_Graphics_Expose_Event is record
Serial : Interfaces.C.unsigned_long;
Send_Event : Boolean;
Display : Display_Pointer;
Drawable : Drawable_ID;
X, Y : Position;
Width, Height : Dimension;
Count : Integer;
Major_Code : Integer;
Minor_Code : Integer;
end record;
type X_No_Expose_Event is record
Serial : Interfaces.C.unsigned_long;
Send_Event : Boolean;
Display : Display_Pointer;
Drawable : Drawable_ID;
Major_Code : Integer;
Minor_Code : Integer;
end record;
type X_Gravity_Event is record
Serial : Interfaces.C.unsigned_long;
Send_Event : Boolean;
Display : Display_Pointer;
Event : Drawable_ID;
Window : Window_ID;
X, Y : Position;
end record;
type Boolean_Array_Type is array (Natural range <>) of Boolean;
pragma Pack (Boolean_Array_Type);
type X_Keymap_Event is record
Serial : Interfaces.C.unsigned_long;
Send_Event : Boolean;
Display : Display_Pointer;
Window : Window_ID;
Key_Vector : Boolean_Array_Type (1 .. 256);
end record;
type X_Key_Event is record
Serial : Interfaces.C.unsigned_long;
Send_Event : Boolean;
Display : Display_Pointer;
Window : Window_ID;
Root : Window_ID;
SubWindow : Window_ID;
Time : Server_Time;
X, Y : Position;
X_Root, Y_Root : Position;
State : Modifier_And_Button_Mask;
Key_Code : Interfaces.C.unsigned;
Same_Screen : Boolean;
end record;
subtype X_Key_Pressed_Event is X_Key_Event;
subtype X_Key_Released_Event is X_Key_Event;
type X_Map_Event is record
Serial : Interfaces.C.unsigned_long;
Send_Event : Boolean;
Display : Display_Pointer;
Event : Window_ID;
Window : Window_ID;
Override_Redirect : Boolean;
end record;
type X_Unmap_Event is record
Serial : Interfaces.C.unsigned_long;
Send_Event : Boolean;
Display : Display_Pointer;
Event : Window_ID;
Window : Window_ID;
From_Configure : Boolean;
end record;
type Mapping_Change_Type is (Mapping_Modifier,
Mapping_Keyboard,
Mapping_Pointer);
for Mapping_Change_Type use (Mapping_Modifier => 0,
Mapping_Keyboard => 1,
Mapping_Pointer => 2);
for Mapping_Change_Type'Size use Interfaces.C.int'Size;
type X_Mapping_Event is record
Serial : Interfaces.C.unsigned_long;
Send_Event : Boolean;
Display : Display_Pointer;
Window : Window_ID;
Request : Mapping_Change_Type;
First_Keycode : Integer;
Count : Integer;
end record;
type X_Map_Request_Event is record
Serial : Interfaces.C.unsigned_long;
Send_Event : Boolean;
Display : Display_Pointer;
Parent : Window_ID;
Window : Window_ID;
end record;
type Motion_Hint_Type is (Notify_Normal, Notify_Hint);
for Motion_Hint_Type use (Notify_Normal => 0, Notify_Hint => 1);
for Motion_Hint_Type'Size use Interfaces.C.signed_char'Size;
type X_Motion_Event is record
Serial : Interfaces.C.unsigned_long;
Send_Event : Boolean;
Display : Display_Pointer;
Window : Window_ID;
Root : Window_ID;
SubWindow : Window_ID;
Time : Server_Time;
X, Y : Position;
X_Root, Y_Root : Position;
State : Modifier_And_Button_Mask;
Is_Hint : Motion_Hint_Type;
Same_Screen : Boolean;
end record;
subtype X_Pointer_Moved_Event is X_Motion_Event;
type Property_State_Type is (Property_New_Value, Property_Delete);
for Property_State_Type use (Property_New_Value => 0, Property_Delete => 1);
for Property_State_Type'Size use Interfaces.C.int'Size;
type X_Property_Event is record
Serial : Interfaces.C.unsigned_long;
Send_Event : Boolean;
Display : Display_Pointer;
Window : Window_ID;
Property : Atom;
Time : Server_Time;
State : Property_State_Type;
end record;
type X_Reparent_Event is record
Serial : Interfaces.C.unsigned_long;
Send_Event : Boolean;
Display : Display_Pointer;
Event : Window_ID;
Window : Window_ID;
Parent : Window_ID;
X, Y : Position;
Override_Redirect : Boolean;
end record;
type X_Resize_Request_Event is record
Serial : Interfaces.C.unsigned_long;
Send_Event : Boolean;
Display : Display_Pointer;
Window : Window_ID;
Width, Height : Dimension;
end record;
type X_Selection_Clear_Event is record
Serial : Interfaces.C.unsigned_long;
Send_Event : Boolean;
Display : Display_Pointer;
Window : Window_ID;
Selection : Atom;
Time : Server_Time;
end record;
type X_Selection_Event is record
Serial : Interfaces.C.unsigned_long;
Send_Event : Boolean;
Display : Display_Pointer;
Requestor : Window_ID;
Selection : Atom;
Target : Atom;
Property : Atom;
Time : Server_Time;
end record;
type X_Selection_Request_Event is record
Serial : Interfaces.C.unsigned_long;
Send_Event : Boolean;
Display : Display_Pointer;
Owner : Window_ID;
Requestor : Window_ID;
Selection : Atom;
Target : Atom;
Property : Atom;
Time : Server_Time;
end record;
type Visibility_State_Type is (Visibility_Unobscured,
Visibility_Partially_Obscured,
Visibility_Fully_Obscured);
for Visibility_State_Type use (Visibility_Unobscured => 0,
Visibility_Partially_Obscured => 1,
Visibility_Fully_Obscured => 2);
for Visibility_State_Type'Size use Interfaces.C.int'Size;
type X_Visibility_Event is record
Serial : Interfaces.C.unsigned_long;
Send_Event : Boolean;
Display : Display_Pointer;
Window : Window_ID;
State : Visibility_State_Type;
end record;
type X_Event (Ev_Type : Event_Type) is record
case Ev_Type is
when Button_Press | Button_Release =>
X_Button : X_Button_Event;
when Circulate_Notify =>
X_Circulate : X_Circulate_Event;
when Circulate_Request =>
X_Circulate_Request : X_Circulate_Request_Event;
when Client_Message =>
X_Client : X_Client_Message_Event;
when Colormap_Notify =>
X_Colormap : X_Colormap_Event;
when Configure_Notify =>
X_Configure : X_Configure_Event;
when Configure_Request =>
X_Configure_Request : X_Configure_Request_Event;
when Create_Notify =>
X_Create_Window : X_Create_Window_Event;
when Enter_Notify | Leave_Notify =>
X_Crossing : X_Crossing_Event;
when Destroy_Notify =>
X_Destroy_Window : X_Destroy_Window_Event;
when Reserved_For_Errors | Reserved_For_Replies =>
X_Error : X_Error_Event;
when Expose =>
X_Expose : X_Expose_Event;
when Focus_In | Focus_Out =>
X_Focus_Change : X_Focus_Change_Event;
when Graphics_Expose =>
X_Graphics_Expose : X_Graphics_Expose_Event;
when No_Expose =>
X_No_Expose : X_No_Expose_Event;
when Gravity_Notify =>
X_Gravity : X_Gravity_Event;
when Keymap_Notify =>
X_Keymap : X_Keymap_Event;
when Key_Press | Key_Release =>
X_Key : X_Key_Event;
when Map_Notify =>
X_Map : X_Map_Event;
when Unmap_Notify =>
X_Unmap : X_Unmap_Event;
when Mapping_Notify =>
X_Mapping : X_Mapping_Event;
when Map_Request =>
X_Map_Request : X_Map_Request_Event;
when Motion_Notify =>
X_Motion : X_Motion_Event;
when Property_Notify =>
X_Property : X_Property_Event;
when Reparent_Notify =>
X_Reparent : X_Reparent_Event;
when Resize_Request =>
X_Resize_Request : X_Resize_Request_Event;
when Selection_Clear =>
X_Selection_Clear : X_Selection_Clear_Event;
when Selection_Notify =>
X_Selection : X_Selection_Event;
when Selection_Request =>
X_Selection_Request : X_Selection_Request_Event;
when Visibility_Notify =>
X_Visibility : X_Visibility_Event;
when others =>
Pad : Long_Array (1 .. 23);
end case;
end record;
type X_Event_Pointer is access all X_Event;
function X_Event_Mask_Of_Screen (Screen : in Screen_Pointer)
return Event_Mask;
-- -------------------------------------------------------------------------
--
-- flush the request buffer, i.e. display all queued events
--
procedure X_Flush (Display : in Display_Pointer);
-- -------------------------------------------------------------------------
--
-- flush the output buffer and wait, until all events have been received
-- AND PROCESSED by the X-Server
--
procedure X_Sync
(Display : in Display_Pointer;
Discard_Events : in Boolean := False);
type Allow_Events_Type is (Async_Pointer, Sync_Pointer, Replay_Pointer,
Async_Keyboard, Sync_Keyboard, Replay_Keyboard,
Async_Both, Sync_Both);
for Allow_Events_Type use (Async_Pointer => 0, Sync_Pointer => 1, Replay_Pointer => 2,
Async_Keyboard => 3, Sync_Keyboard => 4, Replay_Keyboard => 5,
Async_Both => 6, Sync_Both => 7);
for Allow_Events_Type'Size use Interfaces.C.int'Size;
procedure X_Allow_Events
(Display : in Display_Pointer;
Ev_Mode : in Allow_Events_Type;
Time : in Server_Time);
type Events_Count_Type is (Queued_Already, Queued_After_Reading,
Queued_Afted_Flush);
for Events_Count_Type use (Queued_Already => 0, Queued_After_Reading => 1,
Queued_Afted_Flush => 2);
for Events_Count_Type'Size use Interfaces.C.int'Size;
function X_Events_Queued
(Display : in Display_Pointer;
Mode : in Events_Count_Type)
return Natural;
procedure X_Select_Input
(Display : in Display_Pointer;
W : in Window_ID;
Ev_Mask : in Event_Mask);
procedure X_Send_Event
(Display : in Display_Pointer;
W : in Window_ID;
Propagate : in Boolean;
Ev_Mask : in Event_Mask;
Event : in X_Event);
function X_Pending (Display : in Display_Pointer) return Natural;
procedure X_Next_Event
(Display : in Display_Pointer;
Event : out X_Event);
procedure X_Peek_Event
(Display : in Display_Pointer;
Event : out X_Event);
procedure X_Window_Event
(Display : in Display_Pointer;
W : in Window_ID;
Ev_Mask : in Event_Mask;
Event : out X_Event);
procedure X_Mask_Event
(Display : in Display_Pointer;
Ev_Mask : in Event_Mask;
Event : out X_Event);
procedure X_Check_Window_Event
(Display : in Display_Pointer;
W : in Window_ID;
Ev_Mask : in Event_Mask;
Event : out X_Event;
Found : out Boolean);
procedure X_Check_Mask_Event
(Display : in Display_Pointer;
Ev_Mask : in Event_Mask;
Event : out X_Event;
Found : out Boolean);
procedure X_Check_Typed_Event
(Display : in Display_Pointer;
Event : out X_Event;
Found : out Boolean);
procedure X_Check_Typed_Window_Event
(Display : in Display_Pointer;
W : in Window_ID;
Event : out X_Event;
Found : out Boolean);
procedure X_Put_Back_Event
(Display : in Display_Pointer;
Event : in X_Event);
type Revert_To_Type is (None, Pointer_Root, Parent);
for Revert_To_Type use (None => 0, Pointer_Root => 1, Parent => 2);
for Revert_To_Type'Size use Interfaces.C.int'Size;
Pointer_Root_Window_ID : constant Window_ID;
procedure X_Set_Input_Focus
(Display : in Display_Pointer;
Focus : in Window_ID;
Revert_To : in Revert_To_Type;
Time : in Server_Time);
procedure X_Get_Input_Focus
(Display : in Display_Pointer;
Focus : out Window_ID;
Revert_To : out Revert_To_Type);
-- new interface for better convenience
--
procedure Wait_For_Event
(Display : in Display_Pointer;
Event : out X_Event);
procedure Wait_For_Event
(Display : in Display_Pointer;
Ev_Mask : in Event_Mask;
Event : out X_Event);
procedure Wait_For_Event
(Display : in Display_Pointer;
W : in Window_ID;
Ev_Mask : in Event_Mask;
Event : out X_Event);
procedure Look_For_Event
(Display : in Display_Pointer;
W : in Window_ID;
Ev_Mask : in Event_Mask;
Event : out X_Event;
Found : out Boolean);
procedure Look_For_Event
(Display : in Display_Pointer;
Ev_Mask : in Event_Mask;
Event : out X_Event;
Found : out Boolean);
procedure Look_For_Event
(Display : in Display_Pointer;
Event : out X_Event;
Found : out Boolean);
procedure Look_For_Event
(Display : in Display_Pointer;
W : in Window_ID;
Event : out X_Event;
Found : out Boolean);
procedure X_Query_Pointer
(Display : in Display_Pointer;
W : in Window_Id;
Root, Child : out Window_Id;
Root_X, Root_Y : out Position;
Win_X, Win_Y : out Position;
Keys_Buttons : out Modifier_And_Button_Mask;
Valid : out Boolean);
-- ----------------------------------------------------------------------------
--
-- error handling
--
type X_Error_Handler_Proc is
access function (Display : in Display_Pointer;
Error_Event : in X_Event_Pointer)
return Integer;
pragma Convention (C, X_Error_Handler_Proc);
Null_X_Error_Handler_Proc : constant X_Error_Handler_Proc := null;
function X_Set_Error_Handler (Proc : in X_Error_Handler_Proc)
return X_Error_Handler_Proc;
procedure X_Set_Error_Handler (Proc : in X_Error_Handler_Proc);
type X_IO_Error_Handler_Proc is
access procedure (Display : in Display_Pointer);
pragma Convention (C, X_IO_Error_Handler_Proc);
Null_X_IO_Error_Handler_Proc : constant X_IO_Error_Handler_Proc := null;
function X_Set_IO_Error_Handler (Proc : in X_IO_Error_Handler_Proc)
return X_IO_Error_Handler_Proc;
procedure X_Set_IO_Error_Handler (Proc : in X_IO_Error_Handler_Proc);
-- ----------------------------------------------------------------------------
--
-- conversion functions
--
function To_Address (Source: in Display_Pointer) return System.Address;
function To_Address (Source: in Screen_Pointer) return System.Address;
function To_Address (Source: in GC_Pointer) return System.Address;
function To_Address (Source: in X_Pointer) return System.Address;
function To_Display_Pointer (Source : in System.Address) return Display_Pointer;
function To_Screen_Pointer (Source : in System.Address) return Screen_Pointer;
function To_GC_Pointer (Source : in System.Address) return GC_Pointer;
function To_X_Pointer (Source : in System.Address) return X_Pointer;
-- needeed in X_Toolkit
type C_X_GC_Valuemask is new Interfaces.C.unsigned_long;
function To_Long (Mask : in X_GC_Valuemask) return C_X_GC_Valuemask;
function To_Mask (C_Mask : in C_X_GC_Valuemask) return X_GC_Valuemask;
private
Null_XID : constant XID := XID (0);
Null_Drawable_ID : constant Drawable_ID := Drawable_ID (Null_XID);
Null_Window_ID : constant Window_ID := Window_ID(Null_Drawable_ID);
Null_Pixmap_ID : constant Pixmap_ID := Pixmap_ID(Null_Drawable_ID);
Null_Font_ID : constant Font_ID := Font_ID (Null_XID);
Null_Cursor_ID : constant Cursor_ID := Cursor_ID (Null_XID);
Null_Colormap_ID : constant Colormap_ID := Colormap_ID (Null_XID);
Null_GContext_ID : constant GContext_ID := GContext_ID (Null_XID);
Null_Key_Sym_ID : constant Key_Sym_ID := Key_Sym_ID (Null_XID);
Null_Visual_ID : constant Visual_ID := Visual_ID (Null_XID);
Null_Atom : constant Atom := Atom (0);
type Region is new System.Address;
Null_Region : constant Region := Region (Null_Address);
type Display_Pointer is new System.Address;
Null_Display_Pointer : constant Display_Pointer := Display_Pointer (Null_Address);
type Screen_Pointer is new System.Address;
Null_Screen_Pointer : constant Screen_Pointer := Screen_Pointer (Null_Address);
type GC_Pointer is new System.Address;
Null_GC_Pointer : constant GC_Pointer := GC_Pointer (Null_Address);
type X_Pointer is new System.Address;
Null_X_Pointer : constant X_Pointer := X_Pointer (Null_Address);
-- used for X_Set/Get_Input_Focus
Pointer_Root_Window_ID : constant Window_ID := Window_ID(1);
-- opaque types used for internationalization
--
-- input method
type Input_Method is new System.Address;
Null_Input_Method : constant Input_Method := Input_Method (Null_Address);
-- output method
type Output_Method is new System.Address;
Null_Output_Method : constant Output_Method := Output_Method (Null_Address);
-- input context
type Input_Context is new System.Address;
Null_Input_Context : constant Input_Context := Input_Context (Null_Address);
-- output context
type Output_Context is new System.Address;
Null_Output_Context : constant Output_Context := Output_Context (Null_Address);
-- font set
type Font_Set_Type is new System.Address;
Null_Font_Set : constant Font_Set_Type := Font_Set_Type (Null_Address);
for X_Button_Event use record
Serial at 0 range 0 .. 31;
Send_Event at 4 range 0 .. 31;
Display at 8 range 0 .. 31;
Window at 12 range 0 .. 31;
Root at 16 range 0 .. 31;
SubWindow at 20 range 0 .. 31;
Time at 24 range 0 .. 31;
X at 28 range 0 .. 31;
Y at 32 range 0 .. 31;
X_Root at 36 range 0 .. 31;
Y_Root at 40 range 0 .. 31;
-- UseLittleEndian
State at 44 range 0 .. 12;
-- NotLittleEndian
--! State at 44 range 19 .. 31;
-- EndLittleEndian
Button at 48 range 0 .. 31;
Same_Screen at 52 range 0 .. 31;
end record;
for X_Circulate_Event use record
Serial at 0 range 0 .. 31;
Send_Event at 4 range 0 .. 31;
Display at 8 range 0 .. 31;
Event at 12 range 0 .. 31;
Window at 16 range 0 .. 31;
Place at 20 range 0 .. 31;
end record;
for X_Circulate_Request_Event use record
Serial at 0 range 0 .. 31;
Send_Event at 4 range 0 .. 31;
Display at 8 range 0 .. 31;
Parent at 12 range 0 .. 31;
Window at 16 range 0 .. 31;
Place at 20 range 0 .. 31;
end record;
for X_Client_Message_Event use record
Serial at 0 range 0 .. 31;
Send_Event at 4 range 0 .. 31;
Display at 8 range 0 .. 31;
Window at 12 range 0 .. 31;
Message_Type at 16 range 0 .. 31;
Format at 20 range 0 .. 31;
Data at 24 range 0 .. 159;
end record;
for X_Colormap_Event use record
Serial at 0 range 0 .. 31;
Send_Event at 4 range 0 .. 31;
Display at 8 range 0 .. 31;
Window at 12 range 0 .. 31;
Colormap at 16 range 0 .. 31;
Is_New at 20 range 0 .. 31;
State at 24 range 0 .. 31;
end record;
for X_Configure_Event use record
Serial at 0 range 0 .. 31;
Send_Event at 4 range 0 .. 31;
Display at 8 range 0 .. 31;
Event at 12 range 0 .. 31;
Window at 16 range 0 .. 31;
X at 20 range 0 .. 31;
Y at 24 range 0 .. 31;
Width at 28 range 0 .. 31;
Height at 32 range 0 .. 31;
Border_Width at 36 range 0 .. 31;
Window_Above at 40 range 0 .. 31;
Override_Redirect at 44 range 0 .. 31;
end record;
for X_Configure_Request_Event use record
Serial at 0 range 0 .. 31;
Send_Event at 4 range 0 .. 31;
Display at 8 range 0 .. 31;
Parent at 12 range 0 .. 31;
Window at 16 range 0 .. 31;
X at 20 range 0 .. 31;
Y at 24 range 0 .. 31;
Width at 28 range 0 .. 31;
Height at 32 range 0 .. 31;
Border_Width at 36 range 0 .. 31;
Window_Above at 40 range 0 .. 31;
Detail at 44 range 0 .. 31;
-- UseLittleEndian
Value_Mask at 48 range 0 .. 6;
-- NotLittleEndian
--! Value_Mask at 48 range 25 .. 31;
-- EndLittleEndian
end record;
for X_Configure_Request_Event'Size use 416;
for X_Create_Window_Event use record
Serial at 0 range 0 .. 31;
Send_Event at 4 range 0 .. 31;
Display at 8 range 0 .. 31;
Parent at 12 range 0 .. 31;
Window at 16 range 0 .. 31;
X at 20 range 0 .. 31;
Y at 24 range 0 .. 31;
Width at 28 range 0 .. 31;
Height at 32 range 0 .. 31;
Border_Width at 36 range 0 .. 31;
Window_Above at 40 range 0 .. 31;
Override_Redirect at 44 range 0 .. 31;
end record;
for X_Destroy_Window_Event use record
Serial at 0 range 0 .. 31;
Send_Event at 4 range 0 .. 31;
Display at 8 range 0 .. 31;
Event at 12 range 0 .. 31;
Window at 16 range 0 .. 31;
end record;
for X_Crossing_Event use record
Serial at 0 range 0 .. 31;
Send_Event at 4 range 0 .. 31;
Display at 8 range 0 .. 31;
Window at 12 range 0 .. 31;
Root at 16 range 0 .. 31;
SubWindow at 20 range 0 .. 31;
Time at 24 range 0 .. 31;
X at 28 range 0 .. 31;
Y at 32 range 0 .. 31;
X_Root at 36 range 0 .. 31;
Y_Root at 40 range 0 .. 31;
Mode at 44 range 0 .. 31;
Detail at 48 range 0 .. 31;
Same_Screen at 52 range 0 .. 31;
Focus at 56 range 0 .. 31;
-- UseLittleEndian
State at 60 range 0 .. 12;
-- NotLittleEndian
--! State at 60 range 19 .. 31;
-- EndLittleEndian
end record;
for X_Focus_Change_Event use record
Serial at 0 range 0 .. 31;
Send_Event at 4 range 0 .. 31;
Display at 8 range 0 .. 31;
Window at 12 range 0 .. 31;
Mode at 16 range 0 .. 31;
Detail at 20 range 0 .. 31;
end record;
for X_Error_Event use record
Display at 0 range 0 .. 31;
ResourceId at 4 range 0 .. 31;
Serial at 8 range 0 .. 31;
Error_Code at 12 range 0 .. 7;
Request_Code at 13 range 0 .. 7;
Minor_Code at 14 range 0 .. 7;
end record;
for X_Expose_Event use record
Serial at 0 range 0 .. 31;
Send_Event at 4 range 0 .. 31;
Display at 8 range 0 .. 31;
Window at 12 range 0 .. 31;
X at 16 range 0 .. 31;
Y at 20 range 0 .. 31;
Width at 24 range 0 .. 31;
Height at 28 range 0 .. 31;
Count at 32 range 0 .. 31;
end record;
for X_Graphics_Expose_Event use record
Serial at 0 range 0 .. 31;
Send_Event at 4 range 0 .. 31;
Display at 8 range 0 .. 31;
Drawable at 12 range 0 .. 31;
X at 16 range 0 .. 31;
Y at 20 range 0 .. 31;
Width at 24 range 0 .. 31;
Height at 28 range 0 .. 31;
Count at 32 range 0 .. 31;
Major_Code at 36 range 0 .. 31;
Minor_Code at 40 range 0 .. 31;
end record;
for X_No_Expose_Event use record
Serial at 0 range 0 .. 31;
Send_Event at 4 range 0 .. 31;
Display at 8 range 0 .. 31;
Drawable at 12 range 0 .. 31;
Major_Code at 16 range 0 .. 31;
Minor_Code at 20 range 0 .. 31;
end record;
for X_Gravity_Event use record
Serial at 0 range 0 .. 31;
Send_Event at 4 range 0 .. 31;
Display at 8 range 0 .. 31;
Event at 12 range 0 .. 31;
Window at 16 range 0 .. 31;
X at 20 range 0 .. 31;
Y at 24 range 0 .. 31;
end record;
for X_Keymap_Event use record
Serial at 0 range 0 .. 31;
Send_Event at 4 range 0 .. 31;
Display at 8 range 0 .. 31;
Window at 12 range 0 .. 31;
Key_Vector at 16 range 0 .. 255;
end record;
for X_Keymap_Event'Size use 12*Interfaces.C.int'Size;
for X_Key_Event use record
Serial at 0 range 0 .. 31;
Send_Event at 4 range 0 .. 31;
Display at 8 range 0 .. 31;
Window at 12 range 0 .. 31;
Root at 16 range 0 .. 31;
SubWindow at 20 range 0 .. 31;
Time at 24 range 0 .. 31;
X at 28 range 0 .. 31;
Y at 32 range 0 .. 31;
X_Root at 36 range 0 .. 31;
Y_Root at 40 range 0 .. 31;
-- UseLittleEndian
State at 44 range 0 .. 12;
-- NotLittleEndian
--! State at 44 range 19 .. 31;
-- EndLittleEndian
Key_Code at 48 range 0 .. 31;
Same_Screen at 52 range 0 .. 31;
end record;
for X_Map_Event use record
Serial at 0 range 0 .. 31;
Send_Event at 4 range 0 .. 31;
Display at 8 range 0 .. 31;
Event at 12 range 0 .. 31;
Window at 16 range 0 .. 31;
Override_Redirect at 20 range 0 .. 31;
end record;
for X_Unmap_Event use record
Serial at 0 range 0 .. 31;
Send_Event at 4 range 0 .. 31;
Display at 8 range 0 .. 31;
Event at 12 range 0 .. 31;
Window at 16 range 0 .. 31;
From_Configure at 20 range 0 .. 31;
end record;
for X_Mapping_Event use record
Serial at 0 range 0 .. 31;
Send_Event at 4 range 0 .. 31;
Display at 8 range 0 .. 31;
Window at 12 range 0 .. 31;
Request at 16 range 0 .. 31;
First_Keycode at 20 range 0 .. 31;
Count at 24 range 0 .. 31;
end record;
for X_Map_Request_Event use record
Serial at 0 range 0 .. 31;
Send_Event at 4 range 0 .. 31;
Display at 8 range 0 .. 31;
Parent at 12 range 0 .. 31;
Window at 16 range 0 .. 31;
end record;
for X_Motion_Event use record
Serial at 0 range 0 .. 31;
Send_Event at 4 range 0 .. 31;
Display at 8 range 0 .. 31;
Window at 12 range 0 .. 31;
Root at 16 range 0 .. 31;
SubWindow at 20 range 0 .. 31;
Time at 24 range 0 .. 31;
X at 28 range 0 .. 31;
Y at 32 range 0 .. 31;
X_Root at 36 range 0 .. 31;
Y_Root at 40 range 0 .. 31;
-- UseLittleEndian
State at 44 range 0 .. 12;
-- NotLittleEndian
--! State at 44 range 19 .. 31;
-- EndLittleEndian
Is_Hint at 48 range 0 .. 31;
Same_Screen at 52 range 0 .. 31;
end record;
for X_Property_Event use record
Serial at 0 range 0 .. 31;
Send_Event at 4 range 0 .. 31;
Display at 8 range 0 .. 31;
Window at 12 range 0 .. 31;
Property at 16 range 0 .. 31;
Time at 20 range 0 .. 31;
State at 24 range 0 .. 31;
end record;
for X_Reparent_Event use record
Serial at 0 range 0 .. 31;
Send_Event at 4 range 0 .. 31;
Display at 8 range 0 .. 31;
Event at 12 range 0 .. 31;
Window at 16 range 0 .. 31;
Parent at 20 range 0 .. 31;
X at 24 range 0 .. 31;
Y at 28 range 0 .. 31;
Override_Redirect at 32 range 0 .. 31;
end record;
for X_Resize_Request_Event use record
Serial at 0 range 0 .. 31;
Send_Event at 4 range 0 .. 31;
Display at 8 range 0 .. 31;
Window at 12 range 0 .. 31;
Width at 16 range 0 .. 31;
Height at 20 range 0 .. 31;
end record;
for X_Selection_Clear_Event use record
Serial at 0 range 0 .. 31;
Send_Event at 4 range 0 .. 31;
Display at 8 range 0 .. 31;
Window at 12 range 0 .. 31;
Selection at 16 range 0 .. 31;
Time at 20 range 0 .. 31;
end record;
for X_Selection_Event use record
Serial at 0 range 0 .. 31;
Send_Event at 4 range 0 .. 31;
Display at 8 range 0 .. 31;
Requestor at 12 range 0 .. 31;
Selection at 16 range 0 .. 31;
Target at 20 range 0 .. 31;
Property at 24 range 0 .. 31;
Time at 28 range 0 .. 31;
end record;
for X_Selection_Request_Event use record
Serial at 0 range 0 .. 31;
Send_Event at 4 range 0 .. 31;
Display at 8 range 0 .. 31;
Owner at 12 range 0 .. 31;
Requestor at 16 range 0 .. 31;
Selection at 20 range 0 .. 31;
Target at 24 range 0 .. 31;
Property at 28 range 0 .. 31;
Time at 32 range 0 .. 31;
end record;
for X_Visibility_Event use record
Serial at 0 range 0 .. 31;
Send_Event at 4 range 0 .. 31;
Display at 8 range 0 .. 31;
Window at 12 range 0 .. 31;
State at 16 range 0 .. 31;
end record;
for X_Event'Size use 768;
pragma Convention (C, X_Event);
pragma Import (C, X_Bell, "XBell");
pragma Import (C, X_Protocol_Version, "XProtocolVersion");
pragma Import (C, X_Protocol_Revision, "XProtocolRevision");
pragma Import (C, X_Vendor_Release, "XVendorRelease");
pragma Import (C, X_Max_Request_Size, "XMaxRequestSize");
pragma Import (C, X_Extended_Max_Request_Size, "XExtendedMaxRequestSize");
pragma Import (C, X_Display_Motion_Buffer_Size, "XDisplayMotionBufferSize");
pragma Import (C, X_Keycode_To_Keysym, "XKeycodeToKeysym");
pragma Import (C, X_Keysym_To_Keycode, "XKeysymToKeycode");
pragma Import (C, X_Convert_Case, "XConvertCase");
pragma Import (C, X_Default_GC, "XDefaultGC");
pragma Import (C, X_Default_GC_Of_Screen, "XDefaultGCOfScreen");
pragma Import (C, X_Free_GC, "XFreeGC");
pragma Import (C, X_Flush_GC, "XFlushGC");
pragma Import (C, X_GContext_From_GC, "XGContextFromGC");
pragma Import (C, X_Set_Function, "XSetFunction");
pragma Import (C, X_Set_Plane_Mask, "XSetPlaneMask");
pragma Import (C, X_Set_Foreground, "XSetForeground");
pragma Import (C, X_Set_Background, "XSetBackground");
pragma Import (C, X_Set_Line_Attributes, "XSetLineAttributes");
pragma Import (C, X_Set_Fill_Style, "XSetFillStyle");
pragma Import (C, X_Set_Fill_Rule, "XSetFillRule");
pragma Import (C, X_Set_Arc_Mode, "XSetArcMode");
pragma Import (C, X_Set_Tile, "XSetTile");
pragma Import (C, X_Set_Stipple, "XSetStipple");
pragma Import (C, X_Set_TS_Origin, "XSetTSOrigin");
pragma Import (C, X_Set_Font, "XSetFont");
pragma Import (C, X_Set_Subwindow_Mode, "XSetSubwindowMode");
pragma Import (C, X_Set_Clip_Origin, "XSetClipOrigin");
pragma Import (C, X_Set_Clip_Mask, "XSetClipMask");
pragma Import (C, X_Set_State, "XSetState");
pragma Import (C, X_Create_Simple_Window, "XCreateSimpleWindow");
pragma Import (C, X_Create_Image, "XCreateImage");
pragma Import (C, X_Get_Image, "XGetImage");
pragma Import (C, X_Get_Sub_Image, "XGetSubImage");
pragma Import (C, X_Put_Image, "XPutImage");
pragma Import (C, X_Clear_Window, "XClearWindow");
pragma Import (C, X_Query_Color, "XQueryColor");
pragma Import (C, X_Default_Depth, "XDefaultDepth");
pragma Import (C, X_Default_Depth_Of_Screen, "XDefaultDepthOfScreen");
pragma Import (C, X_Screen_Count, "XScreenCount");
pragma Import (C, X_Default_Screen, "XDefaultScreen");
pragma Import (C, X_Default_Screen_Of_Display, "XDefaultScreenOfDisplay");
pragma Import (C, X_Screen_Of_Display, "XScreenOfDisplay");
pragma Import (C, X_Screen_Number_Of_Screen, "XScreenNumberOfScreen");
pragma Import (C, X_Does_Backing_Store, "XDoesBackingStore");
pragma Import (C, X_Event_Mask_Of_Screen, "XEventMaskOfScreen");
pragma Import (C, X_Default_Colormap, "XDefaultColormap");
pragma Import (C, X_Default_Colormap_Of_Screen, "XDefaultColormapOfScreen");
pragma Import (C, X_Create_Colormap, "XCreateColormap");
pragma Import (C, X_Copy_Colormap_And_Free, "XCopyColormapAndFree");
pragma Import (C, X_Free_Colormap, "XFreeColormap");
pragma Import (C, X_Install_Colormap, "XInstallColormap");
pragma Import (C, X_Uninstall_Colormap, "XUninstallColormap");
pragma Import (C, X_Display_Cells, "XDisplayCells");
pragma Import (C, X_Display_Planes, "XDisplayPlanes");
pragma Import (C, X_Cells_Of_Screen, "XCellsOfScreen");
pragma Import (C, X_Planes_Of_Screen, "XPlanesOfScreen");
All_Temporary : constant XID := Null_XID;
pragma Import (C, X_Kill_Client, "XKillClient");
pragma Import (C, X_Add_To_Save_Set, "XAddToSaveSet");
pragma Import (C, X_Remove_From_Save_Set, "XRemoveFromSaveSet");
pragma Import (C, X_Root_Window, "XRootWindow");
pragma Import (C, X_Default_Root_Window, "XDefaultRootWindow");
pragma Import (C, X_Root_Window_Of_Screen, "XRootWindowOfScreen");
pragma Import (C, X_Set_Window_Background, "XSetWindowBackground");
pragma Import (C, X_Set_Window_Background_Pixmap, "XSetWindowBackgroundPixmap");
pragma Import (C, X_Set_Window_Border, "XSetWindowBorder");
pragma Import (C, X_Set_Window_Border_Pixmap, "XSetWindowBorderPixmap");
pragma Import (C, X_Set_Window_Border_Width, "XSetWindowBorderWidth");
pragma Import (C, X_Set_Window_Colormap, "XSetWindowColormap");
pragma Import (C, X_Raise_Window, "XRaiseWindow");
pragma Import (C, X_Lower_Window, "XLowerWindow");
pragma Import (C, X_Destroy_Window, "XDestroyWindow");
pragma Import (C, X_Destroy_Subwindows, "XDestroySubwindows");
pragma Import (C, X_Circulate_Subwindows, "XCirculateSubwindows");
pragma Import (C, X_Circulate_Subwindows_Up, "XCirculateSubwindowsUp");
pragma Import (C, X_Circulate_Subwindows_Down, "XCirculateSubwindowsDown");
pragma Import (C, X_Map_Window, "XMapWindow");
pragma Import (C, X_Unmap_Window, "XUnmapWindow");
pragma Import (C, X_Map_Raised, "XMapRaised");
pragma Import (C, X_Map_Subwindows, "XMapSubwindows");
pragma Import (C, X_Unmap_Subwindows, "XUnmapSubwindows");
pragma Import (C, X_Close_Display, "XCloseDisplay");
pragma Import (C, X_Display_Of_Screen, "XDisplayOfScreen");
pragma Import (C, X_Default_Visual, "XDefaultVisual");
pragma Import (C, X_Default_Visual_Of_Screen, "XDefaultVisualOfScreen");
pragma Import (C, X_Visual_ID_From_Visual, "XVisualIDFromVisual");
pragma Import (C, X_Black_Pixel, "XBlackPixel");
pragma Import (C, X_White_Pixel, "XWhitePixel");
pragma Import (C, X_Black_Pixel_Of_Screen, "XBlackPixelOfScreen");
pragma Import (C, X_White_Pixel_Of_Screen, "XWhitePixelOfScreen");
pragma Import (C, X_All_Planes, "XAllPlanes");
-- for font routines
--
for Draw_Direction use (Left_To_Right => 0, Right_To_Left => 1,
Direction_Change => 255);
for Draw_Direction'Size use Interfaces.C.int'Size;
pragma Import (C, X_Create_Pixmap, "XCreatePixmap");
pragma Import (C, X_Free_Pixmap, "XFreePixmap");
-- UseX11R6 X11R6.3
pragma Import (C, X_Lock_Display, "XLockDisplay");
pragma Import (C, X_Unlock_Display, "XUnlockDisplay");
-- EndX11R6 X11R6.3
pragma Import (C, X_Display_Height, "XDisplayHeight");
pragma Import (C, X_Display_Height_MM, "XDisplayHeightMM");
pragma Import (C, X_Height_Of_Screen, "XHeightOfScreen");
pragma Import (C, X_Height_MM_Of_Screen, "XHeightMMOfScreen");
pragma Import (C, X_Display_Width, "XDisplayWidth");
pragma Import (C, X_Display_Width_MM, "XDisplayWidthMM");
pragma Import (C, X_Width_Of_Screen, "XWidthOfScreen");
pragma Import (C, X_Width_MM_Of_Screen, "XWidthMMOfScreen");
pragma Import (C, X_Image_Byte_Order, "XImageByteOrder");
pragma Import (C, X_Bitmap_Bit_Order, "XBitmapBitOrder");
pragma Import (C, X_Bitmap_Pad, "XBitmapPad");
pragma Import (C, X_Bitmap_Unit, "XBitmapUnit");
pragma Import (C, X_Ungrab_Keyboard, "XUngrabKeyboard");
pragma Import (C, X_Grab_Server, "XGrabServer");
pragma Import (C, X_Ungrab_Server, "XUngrabServer");
pragma Import (C, X_Flush, "XFlush");
pragma Import (C, X_Pending, "XPending");
pragma Import (C, X_Allow_Events, "XAllowEvents");
pragma Import (C, X_Events_Queued, "XEventsQueued");
pragma Import (C, X_Set_Input_Focus, "XSetInputFocus");
pragma Import (C, X_Get_Input_Focus, "XGetInputFocus");
pragma Import (C, X_Set_Error_Handler, "XSetErrorHandler");
pragma Import (C, X_Set_IO_Error_Handler, "XSetIOErrorHandler");
-- procedure needed in sub-packages
--
procedure XFree (What : in System.Address);
pragma Import (C, XFree, "XFree");
-- things needed in sub-packages
--
type C_Window_Changes_Mask is new Interfaces.C.unsigned;
function To_Int (Mask : in Window_Changes_Mask)
return C_Window_Changes_Mask;
end X_Lib;
|