mir: Removed mir client support. Fixes Bugzilla #4288.
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
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0128c7a..13df80e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -326,8 +326,6 @@ set_option(VIDEO_X11 "Use X11 video driver" ${UNIX_SYS})
set_option(VIDEO_WAYLAND "Use Wayland video driver" ${UNIX_SYS})
dep_option(WAYLAND_SHARED "Dynamically load Wayland support" ON "VIDEO_WAYLAND" OFF)
dep_option(VIDEO_WAYLAND_QT_TOUCH "QtWayland server support for Wayland video driver" ON "VIDEO_WAYLAND" OFF)
-set_option(VIDEO_MIR "Use Mir video driver" ${UNIX_SYS})
-dep_option(MIR_SHARED "Dynamically load Mir support" ON "VIDEO_MIR" OFF)
set_option(VIDEO_RPI "Use Raspberry Pi video driver" ${UNIX_SYS})
dep_option(X11_SHARED "Dynamically load X11 support" ON "VIDEO_X11" OFF)
set(SDL_X11_OPTIONS Xcursor Xinerama XInput Xrandr Xscrnsaver XShape Xvm)
@@ -997,7 +995,6 @@ elseif(UNIX AND NOT APPLE AND NOT ANDROID)
# Need to check for Raspberry PI first and add platform specific compiler flags, otherwise the test for GLES fails!
CheckRPI()
CheckX11()
- CheckMir()
CheckDirectFB()
CheckOpenGLX11()
CheckOpenGLESX11()
diff --git a/build-scripts/raspberrypi-buildbot.sh b/build-scripts/raspberrypi-buildbot.sh
index e81fbb5..85124bc 100755
--- a/build-scripts/raspberrypi-buildbot.sh
+++ b/build-scripts/raspberrypi-buildbot.sh
@@ -42,7 +42,7 @@ SYSROOT="/opt/rpi-sysroot"
export CC="ccache /opt/rpi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc --sysroot=$SYSROOT -I$SYSROOT/opt/vc/include -I$SYSROOT/usr/include -I$SYSROOT/opt/vc/include/interface/vcos/pthreads -I$SYSROOT/opt/vc/include/interface/vmcs_host/linux -L$SYSROOT/opt/vc/lib"
# -L$SYSROOT/usr/lib/arm-linux-gnueabihf"
# !!! FIXME: shouldn't have to --disable-* things here.
-../configure --with-sysroot=$SYSROOT --host=arm-raspberry-linux-gnueabihf --prefix=$PWD/rpi-sdl2-installed --disable-pulseaudio --disable-esd --disable-video-mir --disable-video-wayland
+../configure --with-sysroot=$SYSROOT --host=arm-raspberry-linux-gnueabihf --prefix=$PWD/rpi-sdl2-installed --disable-pulseaudio --disable-esd --disable-video-wayland
$MAKE
$MAKE install
# Fix up a few things to a real install path on a real Raspberry Pi...
diff --git a/cmake/sdlchecks.cmake b/cmake/sdlchecks.cmake
index 4a2c3ed..f71b3d4 100644
--- a/cmake/sdlchecks.cmake
+++ b/cmake/sdlchecks.cmake
@@ -564,46 +564,6 @@ macro(CheckX11)
endif()
endmacro()
-# Requires:
-# - EGL
-# - PkgCheckModules
-# Optional:
-# - MIR_SHARED opt
-# - HAVE_DLOPEN opt
-macro(CheckMir)
- if(VIDEO_MIR)
- find_library(MIR_LIB mirclient mircommon egl)
- pkg_check_modules(MIR_TOOLKIT mirclient>=0.26 mircommon)
- pkg_check_modules(EGL egl)
- pkg_check_modules(XKB xkbcommon)
-
- if (MIR_LIB AND MIR_TOOLKIT_FOUND AND EGL_FOUND AND XKB_FOUND)
- set(HAVE_VIDEO_MIR TRUE)
- set(HAVE_SDL_VIDEO TRUE)
-
- file(GLOB MIR_SOURCES ${SDL2_SOURCE_DIR}/src/video/mir/*.c)
- set(SOURCE_FILES ${SOURCE_FILES} ${MIR_SOURCES})
- set(SDL_VIDEO_DRIVER_MIR 1)
-
- list(APPEND EXTRA_CFLAGS ${MIR_TOOLKIT_CFLAGS} ${EGL_CFLAGS} ${XKB_CFLAGS})
-
- if(MIR_SHARED)
- if(NOT HAVE_DLOPEN)
- message_warn("You must have SDL_LoadObject() support for dynamic Mir loading")
- else()
- FindLibraryAndSONAME(mirclient)
- FindLibraryAndSONAME(xkbcommon)
- set(SDL_VIDEO_DRIVER_MIR_DYNAMIC "\"${MIRCLIENT_LIB_SONAME}\"")
- set(SDL_VIDEO_DRIVER_MIR_DYNAMIC_XKBCOMMON "\"${XKBCOMMON_LIB_SONAME}\"")
- set(HAVE_MIR_SHARED TRUE)
- endif()
- else()
- set(EXTRA_LIBS ${MIR_TOOLKIT_LIBRARIES} ${EXTRA_LIBS})
- endif()
- endif()
- endif()
-endmacro()
-
macro(WaylandProtocolGen _SCANNER _XML _PROTL)
set(_WAYLAND_PROT_C_CODE "${CMAKE_CURRENT_BINARY_DIR}/wayland-generated-protocols/${_PROTL}-protocol.c")
set(_WAYLAND_PROT_H_CODE "${CMAKE_CURRENT_BINARY_DIR}/wayland-generated-protocols/${_PROTL}-client-protocol.h")
diff --git a/configure b/configure
index db15105..86aff9d 100755
--- a/configure
+++ b/configure
@@ -831,8 +831,6 @@ enable_libsamplerate_shared
enable_video_wayland
enable_video_wayland_qt_touch
enable_wayland_shared
-enable_video_mir
-enable_mir_shared
enable_video_rpi
enable_video_x11
with_x
@@ -1576,8 +1574,6 @@ Optional Features:
QtWayland server support for Wayland video driver
[[default=yes]]
--enable-wayland-shared dynamically load Wayland support [[default=maybe]]
- --enable-video-mir use Mir video driver [[default=no]]
- --enable-mir-shared dynamically load Mir support [[default=maybe]]
--enable-video-rpi use Raspberry Pi video driver [[default=yes]]
--enable-video-x11 use X11 video driver [[default=yes]]
--enable-x11-shared dynamically load X11 support [[default=maybe]]
@@ -19422,152 +19418,6 @@ _ACEOF
fi
}
-CheckMir()
-{
- # Check whether --enable-video-mir was given.
-if test "${enable_video_mir+set}" = set; then :
- enableval=$enable_video_mir;
-else
- enable_video_mir=no
-fi
-
-
- if test x$enable_video = xyes -a x$enable_video_mir = xyes; then
- # Extract the first word of "pkg-config", so it can be a program name with args.
-set dummy pkg-config; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_PKG_CONFIG+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $PKG_CONFIG in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
- test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
- ;;
-esac
-fi
-PKG_CONFIG=$ac_cv_path_PKG_CONFIG
-if test -n "$PKG_CONFIG"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
-$as_echo "$PKG_CONFIG" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Mir support" >&5
-$as_echo_n "checking for Mir support... " >&6; }
- video_mir=no
- if test x$PKG_CONFIG != xno; then
- if $PKG_CONFIG --exists mirclient egl xkbcommon ; then
- MIR_CFLAGS=`$PKG_CONFIG --cflags mirclient egl xkbcommon`
- MIR_LIBS=`$PKG_CONFIG --libs mirclient egl xkbcommon`
- save_CFLAGS="$CFLAGS"
- CFLAGS="$save_CFLAGS $MIR_CFLAGS"
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
- #include <mir_toolkit/mir_client_library.h>
-
-int
-main ()
-{
-
- MirWindowAttrib attrib = mir_window_attrib_state
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
- video_mir=yes
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- CFLAGS="$save_CFLAGS"
- fi
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $video_mir" >&5
-$as_echo "$video_mir" >&6; }
-
- if test x$video_mir = xyes; then
-
-$as_echo "#define SDL_VIDEO_DRIVER_MIR 1" >>confdefs.h
-
- SOURCES="$SOURCES $srcdir/src/video/mir/*.c"
- EXTRA_CFLAGS="$EXTRA_CFLAGS $MIR_CFLAGS"
- # Check whether --enable-mir-shared was given.
-if test "${enable_mir_shared+set}" = set; then :
- enableval=$enable_mir_shared;
-else
- enable_mir_shared=maybe
-fi
-
-
- case "$host" in
- *)
- mirclient_lib=`find_lib "libmirclient.so.*" "$MIR_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`
- xkbcommon_lib=`find_lib "libxkbcommon.so.*" "$MIR_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`
- ;;
- esac
-
- if test x$enable_mir_shared = xmaybe; then
- enable_mir_shared=yes
- fi
- if test x$have_loadso != xyes && \
- test x$enable_mir_shared = xyes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You must have SDL_LoadObject() support for dynamic Mir loading" >&5
-$as_echo "$as_me: WARNING: You must have SDL_LoadObject() support for dynamic Mir loading" >&2;}
- enable_mir_shared=no
- fi
- if test x$have_loadso = xyes && \
- test x$enable_mir_shared = xyes && \
- test x$mirclient_lib != x && \
- test x$xkbcommon_lib != x; then
- echo "-- dynamic libmirclient -> $mirclient_lib"
- echo "-- dynamic libxkbcommon -> $xkbcommon_lib"
-
-cat >>confdefs.h <<_ACEOF
-#define SDL_VIDEO_DRIVER_MIR_DYNAMIC "$mirclient_lib"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define SDL_VIDEO_DRIVER_MIR_DYNAMIC_XKBCOMMON "$xkbcommon_lib"
-_ACEOF
-
- SUMMARY_video="${SUMMARY_video} mir(dynamic)"
- else
- enable_mir_shared=no
- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $MIR_LIBS"
- SUMMARY_video="${SUMMARY_video} mir"
- fi
- have_video=yes
- fi
- fi
-}
-
CheckNativeClient()
{
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -24153,7 +24003,6 @@ case "$host" in
CheckOpenGLX11
CheckOpenGLESX11
CheckVulkan
- CheckMir
CheckWayland
CheckLibUDev
CheckDBus
diff --git a/configure.in b/configure.in
index 91b45d3..7f12b12 100644
--- a/configure.in
+++ b/configure.in
@@ -1528,79 +1528,6 @@ AC_HELP_STRING([--enable-wayland-shared], [dynamically load Wayland support [[de
fi
}
-dnl Check for Mir
-CheckMir()
-{
- AC_ARG_ENABLE(video-mir,
-AC_HELP_STRING([--enable-video-mir], [use Mir video driver [[default=no]]]),
- ,enable_video_mir=no)
-
- if test x$enable_video = xyes -a x$enable_video_mir = xyes; then
- AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
- AC_MSG_CHECKING(for Mir support)
- video_mir=no
- if test x$PKG_CONFIG != xno; then
- if $PKG_CONFIG --exists mirclient egl xkbcommon ; then
- MIR_CFLAGS=`$PKG_CONFIG --cflags mirclient egl xkbcommon`
- MIR_LIBS=`$PKG_CONFIG --libs mirclient egl xkbcommon`
- save_CFLAGS="$CFLAGS"
- CFLAGS="$save_CFLAGS $MIR_CFLAGS"
-
- dnl This will disable Mir if >= v0.26 is not available
- AC_TRY_COMPILE([
- #include <mir_toolkit/mir_client_library.h>
- ],[
- MirWindowAttrib attrib = mir_window_attrib_state
- ],[
- video_mir=yes
- ])
- CFLAGS="$save_CFLAGS"
- fi
- fi
- AC_MSG_RESULT($video_mir)
-
- if test x$video_mir = xyes; then
- AC_DEFINE(SDL_VIDEO_DRIVER_MIR, 1, [ ])
- SOURCES="$SOURCES $srcdir/src/video/mir/*.c"
- EXTRA_CFLAGS="$EXTRA_CFLAGS $MIR_CFLAGS"
- AC_ARG_ENABLE(mir-shared,
-AC_HELP_STRING([--enable-mir-shared], [dynamically load Mir support [[default=maybe]]]),
- , enable_mir_shared=maybe)
-
- dnl FIXME: Do BSD and OS X need special cases?
- case "$host" in
- *)
- mirclient_lib=[`find_lib "libmirclient.so.*" "$MIR_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
- xkbcommon_lib=[`find_lib "libxkbcommon.so.*" "$MIR_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
- ;;
- esac
-
- if test x$enable_mir_shared = xmaybe; then
- enable_mir_shared=yes
- fi
- if test x$have_loadso != xyes && \
- test x$enable_mir_shared = xyes; then
- AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic Mir loading])
- enable_mir_shared=no
- fi
- if test x$have_loadso = xyes && \
- test x$enable_mir_shared = xyes && \
- test x$mirclient_lib != x && \
- test x$xkbcommon_lib != x; then
- echo "-- dynamic libmirclient -> $mirclient_lib"
- echo "-- dynamic libxkbcommon -> $xkbcommon_lib"
- AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_MIR_DYNAMIC, "$mirclient_lib", [ ])
- AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_MIR_DYNAMIC_XKBCOMMON, "$xkbcommon_lib", [ ])
- SUMMARY_video="${SUMMARY_video} mir(dynamic)"
- else
- enable_mir_shared=no
- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $MIR_LIBS"
- SUMMARY_video="${SUMMARY_video} mir"
- fi
- have_video=yes
- fi
- fi
-}
dnl Check for Native Client stuff
CheckNativeClient()
@@ -3476,7 +3403,6 @@ case "$host" in
CheckOpenGLX11
CheckOpenGLESX11
CheckVulkan
- CheckMir
CheckWayland
CheckLibUDev
CheckDBus
diff --git a/docs/README-linux.md b/docs/README-linux.md
index fdc06a0..10f80b9 100644
--- a/docs/README-linux.md
+++ b/docs/README-linux.md
@@ -25,9 +25,6 @@ fcitx-libs-dev libsamplerate0-dev libsndio-dev
Ubuntu 16.04+ can also add "libwayland-dev libxkbcommon-dev wayland-protocols"
to that command line for Wayland support.
-Ubuntu 16.10 can also add "libmirclient-dev libxkbcommon-dev" to that command
-line for Mir support.
-
NOTES:
- This includes all the audio targets except arts, because Ubuntu pulled the
artsc0-dev package, but in theory SDL still supports it.
diff --git a/include/SDL_config.h.cmake b/include/SDL_config.h.cmake
index 48dd2d4..ab56471 100644
--- a/include/SDL_config.h.cmake
+++ b/include/SDL_config.h.cmake
@@ -339,9 +339,6 @@
#cmakedefine SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR @SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR@
#cmakedefine SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON @SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON@
-#cmakedefine SDL_VIDEO_DRIVER_MIR @SDL_VIDEO_DRIVER_MIR@
-#cmakedefine SDL_VIDEO_DRIVER_MIR_DYNAMIC @SDL_VIDEO_DRIVER_MIR_DYNAMIC@
-#cmakedefine SDL_VIDEO_DRIVER_MIR_DYNAMIC_XKBCOMMON @SDL_VIDEO_DRIVER_MIR_DYNAMIC_XKBCOMMON@
#cmakedefine SDL_VIDEO_DRIVER_EMSCRIPTEN @SDL_VIDEO_DRIVER_EMSCRIPTEN@
#cmakedefine SDL_VIDEO_DRIVER_X11 @SDL_VIDEO_DRIVER_X11@
#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC @SDL_VIDEO_DRIVER_X11_DYNAMIC@
diff --git a/include/SDL_config.h.in b/include/SDL_config.h.in
index 883b6f4..373d1d8 100644
--- a/include/SDL_config.h.in
+++ b/include/SDL_config.h.in
@@ -327,9 +327,6 @@
#undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL
#undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR
#undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON
-#undef SDL_VIDEO_DRIVER_MIR
-#undef SDL_VIDEO_DRIVER_MIR_DYNAMIC
-#undef SDL_VIDEO_DRIVER_MIR_DYNAMIC_XKBCOMMON
#undef SDL_VIDEO_DRIVER_X11
#undef SDL_VIDEO_DRIVER_RPI
#undef SDL_VIDEO_DRIVER_KMSDRM
diff --git a/include/SDL_syswm.h b/include/SDL_syswm.h
index f1c4021..0748b92 100644
--- a/include/SDL_syswm.h
+++ b/include/SDL_syswm.h
@@ -122,7 +122,7 @@ typedef enum
SDL_SYSWM_COCOA,
SDL_SYSWM_UIKIT,
SDL_SYSWM_WAYLAND,
- SDL_SYSWM_MIR,
+ SDL_SYSWM_MIR, /* no longer available, left for API/ABI compatibility. Remove in 2.1! */
SDL_SYSWM_WINRT,
SDL_SYSWM_ANDROID,
SDL_SYSWM_VIVANTE,
@@ -257,11 +257,11 @@ struct SDL_SysWMinfo
struct wl_shell_surface *shell_surface; /**< Wayland shell_surface (window manager handle) */
} wl;
#endif
-#if defined(SDL_VIDEO_DRIVER_MIR)
+#if defined(SDL_VIDEO_DRIVER_MIR) /* no longer available, left for API/ABI compatibility. Remove in 2.1! */
struct
{
- struct MirConnection *connection; /**< Mir display server connection */
- struct MirSurface *surface; /**< Mir surface */
+ void *connection; /**< Mir display server connection */
+ void *surface; /**< Mir surface */
} mir;
#endif
diff --git a/src/video/SDL_sysvideo.h b/src/video/SDL_sysvideo.h
index 25862ca..f43742d 100644
--- a/src/video/SDL_sysvideo.h
+++ b/src/video/SDL_sysvideo.h
@@ -405,7 +405,6 @@ typedef struct VideoBootStrap
/* Not all of these are available in a given build. Use #ifdefs, etc. */
extern VideoBootStrap COCOA_bootstrap;
extern VideoBootStrap X11_bootstrap;
-extern VideoBootStrap MIR_bootstrap;
extern VideoBootStrap DirectFB_bootstrap;
extern VideoBootStrap WINDOWS_bootstrap;
extern VideoBootStrap WINRT_bootstrap;
diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c
index 336fdaa..7d9bb1d 100644
--- a/src/video/SDL_video.c
+++ b/src/video/SDL_video.c
@@ -64,9 +64,6 @@ static VideoBootStrap *bootstrap[] = {
#if SDL_VIDEO_DRIVER_X11
&X11_bootstrap,
#endif
-#if SDL_VIDEO_DRIVER_MIR
- &MIR_bootstrap,
-#endif
#if SDL_VIDEO_DRIVER_WAYLAND
&Wayland_bootstrap,
#endif
diff --git a/src/video/SDL_vulkan_internal.h b/src/video/SDL_vulkan_internal.h
index cdf464e..261fc9c 100644
--- a/src/video/SDL_vulkan_internal.h
+++ b/src/video/SDL_vulkan_internal.h
@@ -38,9 +38,6 @@
#if SDL_VIDEO_DRIVER_COCOA
#define VK_USE_PLATFORM_MACOS_MVK
#endif
-#if SDL_VIDEO_DRIVER_MIR
-#define VK_USE_PLATFORM_MIR_KHR
-#endif
#if SDL_VIDEO_DRIVER_UIKIT
#define VK_USE_PLATFORM_IOS_MVK
#endif
diff --git a/src/video/mir/SDL_mirdyn.c b/src/video/mir/SDL_mirdyn.c
deleted file mode 100644
index 71dc73c..0000000
--- a/src/video/mir/SDL_mirdyn.c
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-#include "../../SDL_internal.h"
-
-#if SDL_VIDEO_DRIVER_MIR
-
-#define DEBUG_DYNAMIC_MIR 0
-
-#include "SDL_mirdyn.h"
-
-#if DEBUG_DYNAMIC_MIR
-#include "SDL_log.h"
-#endif
-
-#ifdef SDL_VIDEO_DRIVER_MIR_DYNAMIC
-
-#include "SDL_name.h"
-#include "SDL_loadso.h"
-
-typedef struct
-{
- void *lib;
- const char *libname;
-} mirdynlib;
-
-#ifndef SDL_VIDEO_DRIVER_MIR_DYNAMIC
-#define SDL_VIDEO_DRIVER_MIR_DYNAMIC NULL
-#endif
-#ifndef SDL_VIDEO_DRIVER_MIR_DYNAMIC_XKBCOMMON
-#define SDL_VIDEO_DRIVER_MIR_DYNAMIC_XKBCOMMON NULL
-#endif
-
-static mirdynlib mirlibs[] = {
- {NULL, SDL_VIDEO_DRIVER_MIR_DYNAMIC},
- {NULL, SDL_VIDEO_DRIVER_MIR_DYNAMIC_XKBCOMMON}
-};
-
-static void *
-MIR_GetSym(const char *fnname, int *pHasModule)
-{
- int i;
- void *fn = NULL;
- for (i = 0; i < SDL_TABLESIZE(mirlibs); i++) {
- if (mirlibs[i].lib != NULL) {
- fn = SDL_LoadFunction(mirlibs[i].lib, fnname);
- if (fn != NULL)
- break;
- }
- }
-
-#if DEBUG_DYNAMIC_MIR
- if (fn != NULL)
- SDL_Log("MIR: Found '%s' in %s (%p)\n", fnname, mirlibs[i].libname, fn);
- else
- SDL_Log("MIR: Symbol '%s' NOT FOUND!\n", fnname);
-#endif
-
- if (fn == NULL)
- *pHasModule = 0; /* kill this module. */
-
- return fn;
-}
-
-#endif /* SDL_VIDEO_DRIVER_MIR_DYNAMIC */
-
-/* Define all the function pointers and wrappers... */
-#define SDL_MIR_MODULE(modname) int SDL_MIR_HAVE_##modname = 0;
-#define SDL_MIR_SYM(rc,fn,params) SDL_DYNMIRFN_##fn MIR_##fn = NULL;
-#define SDL_MIR_SYM_CONST(type,name) SDL_DYMMIRCONST_##name MIR_##name = NULL;
-#include "SDL_mirsym.h"
-
-static int mir_load_refcount = 0;
-
-void
-SDL_MIR_UnloadSymbols(void)
-{
- /* Don't actually unload if more than one module is using the libs... */
- if (mir_load_refcount > 0) {
- if (--mir_load_refcount == 0) {
-#ifdef SDL_VIDEO_DRIVER_MIR_DYNAMIC
- int i;
-#endif
-
- /* set all the function pointers to NULL. */
-#define SDL_MIR_MODULE(modname) SDL_MIR_HAVE_##modname = 0;
-#define SDL_MIR_SYM(rc,fn,params) MIR_##fn = NULL;
-#define SDL_MIR_SYM_CONST(type,name) MIR_##name = NULL;
-#include "SDL_mirsym.h"
-
-
-#ifdef SDL_VIDEO_DRIVER_MIR_DYNAMIC
- for (i = 0; i < SDL_TABLESIZE(mirlibs); i++) {
- if (mirlibs[i].lib != NULL) {
- SDL_UnloadObject(mirlibs[i].lib);
- mirlibs[i].lib = NULL;
- }
- }
-#endif
- }
- }
-}
-
-/* returns non-zero if all needed symbols were loaded. */
-int
-SDL_MIR_LoadSymbols(void)
-{
- int rc = 1; /* always succeed if not using Dynamic MIR stuff. */
-
- /* deal with multiple modules (dga, wayland, mir, etc) needing these symbols... */
- if (mir_load_refcount++ == 0) {
-#ifdef SDL_VIDEO_DRIVER_MIR_DYNAMIC
- int i;
- int *thismod = NULL;
- for (i = 0; i < SDL_TABLESIZE(mirlibs); i++) {
- if (mirlibs[i].libname != NULL) {
- mirlibs[i].lib = SDL_LoadObject(mirlibs[i].libname);
- }
- }
-
-#define SDL_MIR_MODULE(modname) SDL_MIR_HAVE_##modname = 1; /* default yes */
-#include "SDL_mirsym.h"
-
-#define SDL_MIR_MODULE(modname) thismod = &SDL_MIR_HAVE_##modname;
-#define SDL_MIR_SYM(rc,fn,params) MIR_##fn = (SDL_DYNMIRFN_##fn) MIR_GetSym(#fn,thismod);
-#define SDL_MIR_SYM_CONST(type,name) MIR_##name = *(SDL_DYMMIRCONST_##name*) MIR_GetSym(#name,thismod);
-#include "SDL_mirsym.h"
-
- if ((SDL_MIR_HAVE_MIR_CLIENT) && (SDL_MIR_HAVE_XKBCOMMON)) {
- /* all required symbols loaded. */
- SDL_ClearError();
- } else {
- /* in case something got loaded... */
- SDL_MIR_UnloadSymbols();
- rc = 0;
- }
-
-#else /* no dynamic MIR */
-
-#define SDL_MIR_MODULE(modname) SDL_MIR_HAVE_##modname = 1; /* default yes */
-#define SDL_MIR_SYM(rc,fn,params) MIR_##fn = fn;
-#define SDL_MIR_SYM_CONST(type,name) MIR_##name = name;
-#include "SDL_mirsym.h"
-
-#endif
- }
-
- return rc;
-}
-
-#endif /* SDL_VIDEO_DRIVER_MIR */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/src/video/mir/SDL_mirdyn.h b/src/video/mir/SDL_mirdyn.h
deleted file mode 100644
index 32364aa..0000000
--- a/src/video/mir/SDL_mirdyn.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef SDL_mirdyn_h_
-#define SDL_mirdyn_h_
-
-#include "../../SDL_internal.h"
-
-#include <EGL/egl.h>
-#include <mir_toolkit/mir_client_library.h>
-#include <xkbcommon/xkbcommon.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-int SDL_MIR_LoadSymbols(void);
-void SDL_MIR_UnloadSymbols(void);
-
-/* Declare all the function pointers and wrappers... */
-#define SDL_MIR_SYM(rc,fn,params) \
- typedef rc (*SDL_DYNMIRFN_##fn) params; \
- extern SDL_DYNMIRFN_##fn MIR_##fn;
-#define SDL_MIR_SYM_CONST(type, name) \
- typedef type SDL_DYMMIRCONST_##name; \
- extern SDL_DYMMIRCONST_##name MIR_##name;
-#include "SDL_mirsym.h"
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* !defined SDL_mirdyn_h_ */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/src/video/mir/SDL_mirevents.c b/src/video/mir/SDL_mirevents.c
deleted file mode 100644
index df92799..0000000
--- a/src/video/mir/SDL_mirevents.c
+++ /dev/null
@@ -1,321 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-
-/*
- Contributed by Brandon Schaefer, <brandon.schaefer@canonical.com>
-*/
-
-#include "../../SDL_internal.h"
-
-#if SDL_VIDEO_DRIVER_MIR
-
-#include "../../events/SDL_events_c.h"
-#include "../../events/SDL_keyboard_c.h"
-#include "../../events/SDL_touch_c.h"
-#include "../../events/scancodes_xfree86.h"
-
-#include "SDL_mirevents.h"
-#include "SDL_mirwindow.h"
-
-#include <xkbcommon/xkbcommon.h>
-
-#include "SDL_mirdyn.h"
-
-static void
-HandleKeyText(int32_t key_code)
-{
- char text[8];
- int size = 0;
-
- size = MIR_xkb_keysym_to_utf8(key_code, text, sizeof text);
-
- if (size > 0) {
- text[size] = '\0';
- SDL_SendKeyboardText(text);
- }
-}
-
-/* FIXME
- Mir still needs to implement its IM API, for now we assume
- a single key press produces a character.
-*/
-static void
-HandleKeyEvent(MirKeyboardEvent const* key_event, SDL_Window* window)
-{
- xkb_keysym_t key_code;
- Uint8 key_state;
- int event_scancode;
- uint32_t sdl_scancode = SDL_SCANCODE_UNKNOWN;
-
- MirKeyboardAction action = MIR_mir_keyboard_event_action(key_event);
-
- key_state = SDL_PRESSED;
- key_code = MIR_mir_keyboard_event_key_code(key_event);
- event_scancode = MIR_mir_keyboard_event_scan_code(key_event);
-
- if (action == mir_keyboard_action_up)
- key_state = SDL_RELEASED;
-
- if (event_scancode < SDL_arraysize(xfree86_scancode_table2))
- sdl_scancode = xfree86_scancode_table2[event_scancode];
-
- if (sdl_scancode != SDL_SCANCODE_UNKNOWN)
- SDL_SendKeyboardKey(key_state, sdl_scancode);
-
- if (key_state == SDL_PRESSED)
- HandleKeyText(key_code);
-}
-
-static void
-HandleMouseButton(SDL_Window* sdl_window, Uint8 state, MirPointerEvent const* pointer)
-{
- uint32_t sdl_button = SDL_BUTTON_LEFT;
- MirPointerButton button_state = mir_pointer_button_primary;
-
- static uint32_t old_button_states = 0;
- uint32_t new_button_states = MIR_mir_pointer_event_buttons(pointer);
-
- // XOR on our old button states vs our new states to get the newley pressed/released button
- button_state = new_button_states ^ old_button_states;
-
- switch (button_state) {
- case mir_pointer_button_primary:
- sdl_button = SDL_BUTTON_LEFT;
- break;
- case mir_pointer_button_secondary:
- sdl_button = SDL_BUTTON_RIGHT;
- break;
- case mir_pointer_button_tertiary:
- sdl_button = SDL_BUTTON_MIDDLE;
- break;
- case mir_pointer_button_forward:
- sdl_button = SDL_BUTTON_X1;
- break;
- case mir_pointer_button_back:
- sdl_button = SDL_BUTTON_X2;
- break;
- default:
- break;
- }
-
- old_button_states = new_button_states;
-
- SDL_SendMouseButton(sdl_window, 0, state, sdl_button);
-}
-
-static void
-HandleMouseMotion(SDL_Window* sdl_window, int x, int y)
-{
- SDL_Mouse* mouse = SDL_GetMouse();
- SDL_SendMouseMotion(sdl_window, 0, mouse->relative_mode, x, y);
-}
-
-static void
-HandleTouchPress(int device_id, int source_id, SDL_bool down, float x, float y, float pressure)
-{
- SDL_SendTouch(device_id, source_id, down, x, y, pressure);
-}
-
-static void
-HandleTouchMotion(int device_id, int source_id, float x, float y, float pressure)
-{
- SDL_SendTouchMotion(device_id, source_id, x, y, pressure);
-}
-
-static void
-HandleMouseScroll(SDL_Window* sdl_window, float hscroll, float vscroll)
-{
- SDL_SendMouseWheel(sdl_window, 0, hscroll, vscroll, SDL_MOUSEWHEEL_NORMAL);
-}
-
-static void
-AddTouchDevice(int device_id)
-{
- if (SDL_AddTouch(device_id, "") < 0)
- SDL_SetError("Error: can't add touch %s, %d", __FILE__, __LINE__);
-}
-
-static void
-HandleTouchEvent(MirTouchEvent const* touch, int device_id, SDL_Window* sdl_window)
-{
- int i, point_count;
- point_count = MIR_mir_touch_event_point_count(touch);
-
- AddTouchDevice(device_id);
-
- for (i = 0; i < point_count; i++) {
- int id = MIR_mir_touch_event_id(touch, i);
-
- int width = sdl_window->w;
- int height = sdl_window->h;
-
- float x = MIR_mir_touch_event_axis_value(touch, i, mir_touch_axis_x);
- float y = MIR_mir_touch_event_axis_value(touch, i, mir_touch_axis_y);
-
- float n_x = x / width;
- float n_y = y / height;
-
- float pressure = MIR_mir_touch_event_axis_value(touch, i, mir_touch_axis_pressure);
-
- switch (MIR_mir_touch_event_action(touch, i)) {
- case mir_touch_action_up:
- HandleTouchPress(device_id, id, SDL_FALSE, n_x, n_y, pressure);
- break;
- case mir_touch_action_down:
- HandleTouchPress(device_id, id, SDL_TRUE, n_x, n_y, pressure);
- break;
- case mir_touch_action_change:
- HandleTouchMotion(device_id, id, n_x, n_y, pressure);
- break;
- case mir_touch_actions:
- break;
- }
- }
-}
-
-static void
-HandleMouseEvent(MirPointerEvent const* pointer, SDL_Window* sdl_window)
-{
- SDL_SetMouseFocus(sdl_window);
-
- switch (MIR_mir_pointer_event_action(pointer)) {
- case mir_pointer_action_button_down:
- HandleMouseButton(sdl_window, SDL_PRESSED, pointer);
- break;
- case mir_pointer_action_button_up:
- HandleMouseButton(sdl_window, SDL_RELEASED, pointer);
- break;
- case mir_pointer_action_motion: {
- int x, y;
- float hscroll, vscroll;
- SDL_Mouse* mouse = SDL_GetMouse();
- x = MIR_mir_pointer_event_axis_value(pointer, mir_pointer_axis_x);
- y = MIR_mir_pointer_event_axis_value(pointer, mir_pointer_axis_y);
-
- if (mouse) {
- if (mouse->relative_mode) {
- int relative_x = MIR_mir_pointer_event_axis_value(pointer, mir_pointer_axis_relative_x);
- int relative_y = MIR_mir_pointer_event_axis_value(pointer, mir_pointer_axis_relative_y);
- HandleMouseMotion(sdl_window, relative_x, relative_y);
- }
- else if (mouse->x != x || mouse->y != y) {
- HandleMouseMotion(sdl_window, x, y);
- }
- }
-
- hscroll = MIR_mir_pointer_event_axis_value(pointer, mir_pointer_axis_hscroll);
- vscroll = MIR_mir_pointer_event_axis_value(pointer, mir_pointer_axis_vscroll);
- if (vscroll != 0 || hscroll != 0)
- HandleMouseScroll(sdl_window, hscroll, vscroll);
- }
- break;
- case mir_pointer_action_leave:
- SDL_SetMouseFocus(NULL);
- break;
- case mir_pointer_action_enter:
- default:
- break;
- }
-}
-
-static void
-HandleInput(MirInputEvent const* input_event, SDL_Window* window)
-{
- switch (MIR_mir_input_event_get_type(input_event)) {
- case (mir_input_event_type_key):
- HandleKeyEvent(MIR_mir_input_event_get_keyboard_event(input_event), window);
- break;
- case (mir_input_event_type_pointer):
- HandleMouseEvent(MIR_mir_input_event_get_pointer_event(input_event), window);
- break;
- case (mir_input_event_type_touch):
- HandleTouchEvent(MIR_mir_input_event_get_touch_event(input_event),
- MIR_mir_input_event_get_device_id(input_event),
- window);
- break;
- default:
- break;
- }
-}
-
-static void
-HandleResize(MirResizeEvent const* resize_event, SDL_Window* window)
-{
- int new_w = MIR_mir_resize_event_get_width (resize_event);
- int new_h = MIR_mir_resize_event_get_height(resize_event);
-
- int old_w = window->w;
- int old_h = window->h;
-
- if (new_w != old_w || new_h != old_h)
- SDL_SendWindowEvent(window, SDL_WINDOWEVENT_RESIZED, new_w, new_h);
-}
-
-static void
-HandleWindow(MirWindowEvent const* event, SDL_Window* window)
-{
- MirWindowAttrib attrib = MIR_mir_window_event_get_attribute(event);
- int value = MIR_mir_window_event_get_attribute_value(event);
-
- if (attrib == mir_window_attrib_focus) {
- if (value == mir_window_focus_state_focused) {
- SDL_SetKeyboardFocus(window);
- }
- else if (value == mir_window_focus_state_unfocused) {
- SDL_SetKeyboardFocus(NULL);
- }
- }
-}
-
-static void
-MIR_HandleClose(SDL_Window* window) {
- SDL_SendWindowEvent(window, SDL_WINDOWEVENT_CLOSE, 0, 0);
-}
-
-void
-MIR_HandleEvent(MirWindow* mirwindow, MirEvent const* ev, void* context)
-{
- MirEventType event_type = MIR_mir_event_get_type(ev);
- SDL_Window* window = (SDL_Window*)context;
-
- if (window) {
- switch (event_type) {
- case (mir_event_type_input):
- HandleInput(MIR_mir_event_get_input_event(ev), window);
- break;
- case (mir_event_type_resize):
- HandleResize(MIR_mir_event_get_resize_event(ev), window);
- break;
- case (mir_event_type_window):
- HandleWindow(MIR_mir_event_get_window_event(ev), window);
- break;
- case (mir_event_type_close_window):
- MIR_HandleClose(window);
- break;
- default:
- break;
- }
- }
-}
-
-#endif /* SDL_VIDEO_DRIVER_MIR */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/src/video/mir/SDL_mirevents.h b/src/video/mir/SDL_mirevents.h
deleted file mode 100644
index 4b0f209..0000000
--- a/src/video/mir/SDL_mirevents.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-
-/*
- Contributed by Brandon Schaefer, <brandon.schaefer@canonical.com>
-*/
-
-#ifndef SDL_mirevents_h_
-#define SDL_mirevents_h_
-
-#include <mir_toolkit/mir_client_library.h>
-
-extern void
-MIR_HandleEvent(MirWindow*, MirEvent const* ev, void* context);
-
-#endif /* SDL_mirevents_h_ */
-
-/* vi: set ts=4 sw=4 expandtab: */
-
diff --git a/src/video/mir/SDL_mirframebuffer.c b/src/video/mir/SDL_mirframebuffer.c
deleted file mode 100644
index d678fff..0000000
--- a/src/video/mir/SDL_mirframebuffer.c
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-
-/*
- Contributed by Brandon Schaefer, <brandon.schaefer@canonical.com>
-*/
-
-#include "../../SDL_internal.h"
-
-#if SDL_VIDEO_DRIVER_MIR
-
-#include "SDL_mirevents.h"
-#include "SDL_mirframebuffer.h"
-#include "SDL_mirwindow.h"
-
-#include "SDL_mirdyn.h"
-
-int
-MIR_CreateWindowFramebuffer(_THIS, SDL_Window* window, Uint32* format,
- void** pixels, int* pitch)
-{
- MIR_Data* mir_data = _this->driverdata;
-
- mir_data->software = SDL_TRUE;
-
- if (MIR_CreateWindow(_this, window) < 0)
- return SDL_SetError("Failed to create a mir window.");
-
- *format = MIR_GetSDLPixelFormat(mir_data->pixel_format);
- if (*format == SDL_PIXELFORMAT_UNKNOWN)
- return SDL_SetError("Unknown pixel format");
-
- *pitch = (((window->w * SDL_BYTESPERPIXEL(*format)) + 3) & ~3);
-
- *pixels = SDL_malloc(window->h*(*pitch));
- if (*pixels == NULL)
- return SDL_OutOfMemory();
-
- return 0;
-}
-
-int
-MIR_UpdateWindowFramebuffer(_THIS, SDL_Window* window,
- const SDL_Rect* rects, int numrects)
-{
- MIR_Window* mir_window = window->driverdata;
-
- MirGraphicsRegion region;
- MirBufferStream* bs;
- int i, j, x, y, w, h, start;
- int bytes_per_pixel, bytes_per_row, s_stride, d_stride;
- char* s_dest;
- char* pixels;
-
- bs = MIR_mir_window_get_buffer_stream(mir_window->window);
- MIR_mir_buffer_stream_get_graphics_region(bs, ®ion);
-
- s_dest = region.vaddr;
- pixels = (char*)window->surface->pixels;
-
- s_stride = window->surface->pitch;
- d_stride = region.stride;
- bytes_per_pixel = window->surface->format->BytesPerPixel;
-
- for (i = 0; i < numrects; i++) {
- s_dest = region.vaddr;
- pixels = (char*)window->surface->pixels;
-
- x = rects[i].x;
- y = rects[i].y;
- w = rects[i].w;
- h = rects[i].h;
-
- if (w <= 0 || h <= 0 || (x + w) <= 0 || (y + h) <= 0)
- continue;
-
- if (x < 0) {
- x += w;
- w += rects[i].x;
- }
-
- if (y < 0) {
- y += h;
- h += rects[i].y;
- }
-
- if (x + w > window->w)
- w = window->w - x;
- if (y + h > window->h)
- h = window->h - y;
-
- start = y * s_stride + x;
- pixels += start;
- s_dest += start;
-
- bytes_per_row = bytes_per_pixel * w;
- for (j = 0; j < h; j++) {
- SDL_memcpy(s_dest, pixels, bytes_per_row);
- pixels += s_stride;
- s_dest += d_stride;
- }
- }
-
- MIR_mir_buffer_stream_swap_buffers_sync(bs);
-
- return 0;
-}
-
-void
-MIR_DestroyWindowFramebuffer(_THIS, SDL_Window* window)
-{
-}
-
-#endif /* SDL_VIDEO_DRIVER_MIR */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/src/video/mir/SDL_mirframebuffer.h b/src/video/mir/SDL_mirframebuffer.h
deleted file mode 100644
index 502337c..0000000
--- a/src/video/mir/SDL_mirframebuffer.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-
-/*
- Contributed by Brandon Schaefer, <brandon.schaefer@canonical.com>
-*/
-
-#ifndef SDL_mirframebuffer_h_
-#define SDL_mirframebuffer_h_
-
-#include "../SDL_sysvideo.h"
-
-#include "SDL_mirvideo.h"
-
-extern int
-MIR_CreateWindowFramebuffer(_THIS, SDL_Window* sdl_window, Uint32* format,
- void** pixels, int* pitch);
-
-extern int
-MIR_UpdateWindowFramebuffer(_THIS, SDL_Window* sdl_window,
- const SDL_Rect* rects, int numrects);
-
-extern void
-MIR_DestroyWindowFramebuffer(_THIS, SDL_Window* sdl_window);
-
-#endif /* SDL_mirframebuffer_h_ */
-
-/* vi: set ts=4 sw=4 expandtab: */
-
diff --git a/src/video/mir/SDL_mirmouse.c b/src/video/mir/SDL_mirmouse.c
deleted file mode 100644
index 5f6e38c..0000000
--- a/src/video/mir/SDL_mirmouse.c
+++ /dev/null
@@ -1,292 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-
-/*
- Contributed by Brandon Schaefer, <brandon.schaefer@canonical.com>
-*/
-
-#include "../../SDL_internal.h"
-
-#if SDL_VIDEO_DRIVER_MIR
-
-#include "../../events/SDL_mouse_c.h"
-#include "../SDL_sysvideo.h"
-#include "SDL_assert.h"
-
-#include "SDL_mirdyn.h"
-
-#include "SDL_mirvideo.h"
-#include "SDL_mirmouse.h"
-#include "SDL_mirwindow.h"
-
-typedef struct
-{
- MirCursorConfiguration* conf;
- MirBufferStream* stream;
- char const* name;
-} MIR_Cursor;
-
-static SDL_Cursor*
-MIR_CreateDefaultCursor()
-{
- SDL_Cursor* cursor;
-
- cursor = SDL_calloc(1, sizeof(SDL_Cursor));
- if (cursor) {
-
- MIR_Cursor* mir_cursor = SDL_calloc(1, sizeof(MIR_Cursor));
- if (mir_cursor) {
- mir_cursor->conf = NULL;
- mir_cursor->stream = NULL;
- mir_cursor->name = NULL;
- cursor->driverdata = mir_cursor;
- }
- else {
- SDL_OutOfMemory();
- SDL_free(cursor);
- cursor = NULL;
- }
- }
- else {
- SDL_OutOfMemory();
- }
-
- return cursor;
-}
-
-static void
-CopySurfacePixelsToMirStream(SDL_Surface* surface, MirBufferStream* stream)
-{
- char* dest, *pixels;
- int i, s_w, s_h, r_stride, p_stride, bytes_per_pixel, bytes_per_row;
-
- MirGraphicsRegion region;
- MIR_mir_buffer_stream_get_graphics_region(stream, ®ion);
-
- s_w = surface->w;
- s_h = surface->h;
-
- bytes_per_pixel = surface->format->BytesPerPixel;
- bytes_per_row = bytes_per_pixel * s_w;
-
- dest = region.vaddr;
- pixels = (char*)surface->pixels;
-
- r_stride = region.stride;
- p_stride = surface->pitch;
-
- for (i = 0; i < s_h; i++)
- {
- SDL_memcpy(dest, pixels, bytes_per_row);
- dest += r_stride;
- pixels += p_stride;
- }
-}
-
-static SDL_Cursor*
-MIR_CreateCursor(SDL_Surface* surface, int hot_x, int hot_y)
-{
- MirCursorConfiguration* conf;
- MirBufferStream* stream;
-
- int s_w = surface->w;
- int s_h = surface->h;
-
- MIR_Data* mir_data = (MIR_Data*)SDL_GetVideoDevice()->driverdata;
- SDL_Cursor* cursor = MIR_CreateDefaultCursor();
- MIR_Cursor* mir_cursor;
-
- if (!cursor) {
- return NULL;
- }
-
- mir_cursor = (MIR_Cursor*)cursor->driverdata;
-
- stream = MIR_mir_connection_create_buffer_stream_sync(mir_data->connection,
- s_w, s_h, mir_data->pixel_format,
- mir_buffer_usage_software);
-
- conf = MIR_mir_cursor_configuration_from_buffer_stream(stream, hot_x, hot_y);
-
- CopySurfacePixelsToMirStream(surface, stream);
- MIR_mir_buffer_stream_swap_buffers_sync(stream);
-
- mir_cursor->conf = conf;
- mir_cursor->stream = stream;
-
- return cursor;
-}
-
-static SDL_Cursor*
-MIR_CreateSystemCursor(SDL_SystemCursor id)
-{
- char const* cursor_name = NULL;
- SDL_Cursor* cursor;
- MIR_Cursor* mir_cursor;
-
- switch(id) {
- case SDL_SYSTEM_CURSOR_ARROW:
- cursor_name = MIR_mir_arrow_cursor_name;
- break;
- case SDL_SYSTEM_CURSOR_IBEAM:
- cursor_name = MIR_mir_caret_cursor_name;
- break;
- case SDL_SYSTEM_CURSOR_WAIT:
- cursor_name = MIR_mir_busy_cursor_name;
- break;
- case SDL_SYSTEM_CURSOR_CROSSHAIR:
- /* Unsupported */
- cursor_name = MIR_mir_arrow_cursor_name;
- break;
- case SDL_SYSTEM_CURSOR_WAITARROW:
- cursor_name = MIR_mir_busy_cursor_name;
- break;
- case SDL_SYSTEM_CURSOR_SIZENWSE:
- cursor_name = MIR_mir_omnidirectional_resize_cursor_name;
- break;
- case SDL_SYSTEM_CURSOR_SIZENESW:
- cursor_name = MIR_mir_omnidirectional_resize_cursor_name;
- break;
- case SDL_SYSTEM_CURSOR_SIZEWE:
- cursor_name = MIR_mir_horizontal_resize_cursor_name;
- break;
- case SDL_SYSTEM_CURSOR_SIZENS:
- cursor_name = MIR_mir_vertical_resize_cursor_name;
- break;
- case SDL_SYSTEM_CURSOR_SIZEALL:
- cursor_name = MIR_mir_omnidirectional_resize_cursor_name;
- break;
- case SDL_SYSTEM_CURSOR_NO:
- /* Unsupported */
- cursor_name = MIR_mir_closed_hand_cursor_name;
- break;
- case SDL_SYSTEM_CURSOR_HAND:
- cursor_name = MIR_mir_open_hand_cursor_name;
- break;
- default:
- SDL_assert(0);
- return NULL;
- }
-
- cursor = MIR_CreateDefaultCursor();
- if (!cursor) {
- return NULL;
- }
-
- mir_cursor = (MIR_Cursor*)cursor->driverdata;
- mir_cursor->name = cursor_name;
-
- return cursor;
-}
-
-static void
-MIR_FreeCursor(SDL_Cursor* cursor)
-{
- if (cursor) {
-
- if (cursor->driverdata) {
- MIR_Cursor* mir_cursor = (MIR_Cursor*)cursor->driverdata;
-
- if (mir_cursor->conf)
- MIR_mir_cursor_configuration_destroy(mir_cursor->conf);
- if (mir_cursor->stream)
- MIR_mir_buffer_stream_release_sync(mir_cursor->stream);
-
- SDL_free(mir_cursor);
- }
-
- SDL_free(cursor);
- }
-}
-
-static int
-MIR_ShowCursor(SDL_Cursor* cursor)
-{
- MIR_Data* mir_data = (MIR_Data*)SDL_GetVideoDevice()->driverdata;
- MIR_Window* mir_window = mir_data->current_window;
-
- if (cursor && cursor->driverdata) {
- if (mir_window && MIR_mir_window_is_valid(mir_window->window)) {
- MIR_Cursor* mir_cursor = (MIR_Cursor*)cursor->driverdata;
-
- if (mir_cursor->name != NULL) {
- MirWindowSpec* spec = MIR_mir_create_window_spec(mir_data->connection);
- MIR_mir_window_spec_set_cursor_name(spec, mir_cursor->name);
- MIR_mir_window_apply_spec(mir_window->window, spec);
- MIR_mir_window_spec_release(spec);
- }
-
- if (mir_cursor->conf) {
- MIR_mir_window_configure_cursor(mir_window->window, mir_cursor->conf);
- }
- }
- }
- else if(mir_window && MIR_mir_window_is_valid(mir_window->window)) {
- MIR_mir_window_configure_cursor(mir_window->window, NULL);
- }
-
- return 0;
-}
-
-static void
-MIR_WarpMouse(SDL_Window* window, int x, int y)
-{
- SDL_Unsupported();
-}
-
-static int
-MIR_WarpMouseGlobal(int x, int y)
-{
- return SDL_Unsupported();
-}
-
-static int
-MIR_SetRelativeMouseMode(SDL_bool enabled)
-{
- return 0;
-}
-
-/* TODO Actually implement the cursor, need to wait for mir support */
-void
-MIR_InitMouse()
-{
- SDL_Mouse* mouse = SDL_GetMouse();
-
- mouse->CreateCursor = MIR_CreateCursor;
- mouse->ShowCursor = MIR_ShowCursor;
- mouse->FreeCursor = MIR_FreeCursor;
- mouse->WarpMouse = MIR_WarpMouse;
- mouse->WarpMouseGlobal = MIR_WarpMouseGlobal;
- mouse->CreateSystemCursor = MIR_CreateSystemCursor;
- mouse->SetRelativeMouseMode = MIR_SetRelativeMouseMode;
-
- SDL_SetDefaultCursor(MIR_CreateDefaultCursor());
-}
-
-void
-MIR_FiniMouse()
-{
-}
-
-#endif /* SDL_VIDEO_DRIVER_MIR */
-
-/* vi: set ts=4 sw=4 expandtab: */
-
diff --git a/src/video/mir/SDL_mirmouse.h b/src/video/mir/SDL_mirmouse.h
deleted file mode 100644
index de32610..0000000
--- a/src/video/mir/SDL_mirmouse.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-
-/*
- Contributed by Brandon Schaefer, <brandon.schaefer@canonical.com>
-*/
-
-#ifndef SDL_mirmouse_h_
-#define SDL_mirmouse_h_
-
-extern void
-MIR_InitMouse();
-
-extern void
-MIR_FiniMouse();
-
-#endif /* SDL_mirmouse_h_ */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/src/video/mir/SDL_miropengl.c b/src/video/mir/SDL_miropengl.c
deleted file mode 100644
index 7795f97..0000000
--- a/src/video/mir/SDL_miropengl.c
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-
-/*
- Contributed by Brandon Schaefer, <brandon.schaefer@canonical.com>
-*/
-
-#include "../../SDL_internal.h"
-
-#if SDL_VIDEO_DRIVER_MIR
-
-#include "SDL_miropengl.h"
-
-#include "SDL_mirdyn.h"
-
-int
-MIR_GL_SwapWindow(_THIS, SDL_Window* window)
-{
- MIR_Window* mir_wind = window->driverdata;
-
- return SDL_EGL_SwapBuffers(_this, mir_wind->egl_surface);
-}
-
-int
-MIR_GL_MakeCurrent(_THIS, SDL_Window* window, SDL_GLContext context)
-{
- if (window) {
- EGLSurface egl_surface = ((MIR_Window*)window->driverdata)->egl_surface;
- return SDL_EGL_MakeCurrent(_this, egl_surface, context);
- }
-
- return SDL_EGL_MakeCurrent(_this, NULL, NULL);
-}
-
-SDL_GLContext
-MIR_GL_CreateContext(_THIS, SDL_Window* window)
-{
- MIR_Window* mir_window = window->driverdata;
-
- SDL_GLContext context;
- context = SDL_EGL_CreateContext(_this, mir_window->egl_surface);
-
- return context;
-}
-
-int
-MIR_GL_LoadLibrary(_THIS, const char* path)
-{
- MIR_Data* mir_data = _this->driverdata;
-
- SDL_EGL_LoadLibrary(_this, path, MIR_mir_connection_get_egl_native_display(mir_data->connection), 0);
-
- SDL_EGL_ChooseConfig(_this);
-
- return 0;
-}
-
-#endif /* SDL_VIDEO_DRIVER_MIR */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/src/video/mir/SDL_miropengl.h b/src/video/mir/SDL_miropengl.h
deleted file mode 100644
index 2168f96..0000000
--- a/src/video/mir/SDL_miropengl.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-
-/*
- Contributed by Brandon Schaefer, <brandon.schaefer@canonical.com>
-*/
-
-#ifndef SDL_miropengl_h_
-#define SDL_miropengl_h_
-
-#include "SDL_mirwindow.h"
-
-#include "../SDL_egl_c.h"
-
-#define MIR_GL_DeleteContext SDL_EGL_DeleteContext
-#define MIR_GL_GetSwapInterval SDL_EGL_GetSwapInterval
-#define MIR_GL_SetSwapInterval SDL_EGL_SetSwapInterval
-#define MIR_GL_UnloadLibrary SDL_EGL_UnloadLibrary
-#define MIR_GL_GetProcAddress SDL_EGL_GetProcAddress
-
-extern int
-MIR_GL_SwapWindow(_THIS, SDL_Window* window);
-
-extern int
-MIR_GL_MakeCurrent(_THIS, SDL_Window* window, SDL_GLContext context);
-
-extern SDL_GLContext
-MIR_GL_CreateContext(_THIS, SDL_Window* window);
-
-extern int
-MIR_GL_LoadLibrary(_THIS, const char* path);
-
-#endif /* SDL_miropengl_h_ */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/src/video/mir/SDL_mirsym.h b/src/video/mir/SDL_mirsym.h
deleted file mode 100644
index 6e18b53..0000000
--- a/src/video/mir/SDL_mirsym.h
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-
-/* *INDENT-OFF* */
-
-#ifndef SDL_MIR_MODULE
-#define SDL_MIR_MODULE(modname)
-#endif
-
-#ifndef SDL_MIR_SYM
-#define SDL_MIR_SYM(rc,fn,params)
-#endif
-
-#ifndef SDL_MIR_SYM_CONST
-#define SDL_MIR_SYM_CONST(type, name)
-#endif
-
-SDL_MIR_MODULE(MIR_CLIENT)
-SDL_MIR_SYM(MirWindow *,mir_create_window_sync,(MirWindowSpec* spec))
-SDL_MIR_SYM(MirEGLNativeWindowType,mir_buffer_stream_get_egl_native_window,(MirBufferStream *surface))
-SDL_MIR_SYM(bool,mir_buffer_stream_get_graphics_region,(MirBufferStream *stream, MirGraphicsRegion *graphics_region))
-SDL_MIR_SYM(void,mir_buffer_stream_swap_buffers_sync,(MirBufferStream *stream))
-SDL_MIR_SYM(void,mir_window_set_event_handler,(MirWindow* window, MirWindowEventCallback callback, void* context))
-SDL_MIR_SYM(MirWindowSpec*,mir_create_normal_window_spec,(MirConnection *connection, int width, int height))
-SDL_MIR_SYM(MirWindowSpec*,mir_create_window_spec,(MirConnection *connection))
-SDL_MIR_SYM(void,mir_window_spec_set_buffer_usage,(MirWindowSpec *spec, MirBufferUsage usage))
-SDL_MIR_SYM(void,mir_window_spec_set_name,(MirWindowSpec *spec, char const *name))
-SDL_MIR_SYM(void,mir_window_spec_release,(MirWindowSpec *spec))
-SDL_MIR_SYM(void,mir_window_spec_set_width,(MirWindowSpec *spec, unsigned width))
-SDL_MIR_SYM(void,mir_window_spec_set_height,(MirWindowSpec *spec, unsigned height))
-SDL_MIR_SYM(void,mir_window_spec_set_min_width,(MirWindowSpec *spec, unsigned min_width))
-SDL_MIR_SYM(void,mir_window_spec_set_min_height,(MirWindowSpec *spec, unsigned min_height))
-SDL_MIR_SYM(void,mir_window_spec_set_max_width,(MirWindowSpec *spec, unsigned max_width))
-SDL_MIR_SYM(void,mir_window_spec_set_max_height,(MirWindowSpec *spec, unsigned max_height))
-SDL_MIR_SYM(void,mir_window_spec_set_type,(MirWindowSpec *spec, MirWindowType type))
-SDL_MIR_SYM(void,mir_window_spec_set_state,(MirWindowSpec *spec, MirWindowState state))
-SDL_MIR_SYM(void,mir_window_spec_set_pointer_confinement,(MirWindowSpec *spec, MirPointerConfinementState state))
-SDL_MIR_SYM(void,mir_window_spec_set_pixel_format,(MirWindowSpec *spec, MirPixelFormat pixel_format))
-SDL_MIR_SYM(void,mir_window_spec_set_cursor_name,(MirWindowSpec *spec, char const* cursor_name))
-SDL_MIR_SYM(void,mir_window_apply_spec,(MirWindow* window, MirWindowSpec* spec))
-SDL_MIR_SYM(void,mir_window_get_parameters,(MirWindow *window, MirWindowParameters *params))
-SDL_MIR_SYM(MirBufferStream*,mir_window_get_buffer_stream,(MirWindow* window))
-SDL_MIR_SYM(MirCursorConfiguration*,mir_cursor_configuration_from_buffer_stream,(MirBufferStream const* stream, int hot_x, int hot_y))
-SDL_MIR_SYM(MirBufferStream*,mir_connection_create_buffer_stream_sync,(MirConnection *connection, int w, int h, MirPixelFormat format, MirBufferUsage usage))
-SDL_MIR_SYM(MirKeyboardAction,mir_keyboard_event_action,(MirKeyboardEvent const *event))
-SDL_MIR_SYM(xkb_keysym_t,mir_keyboard_event_key_code,(MirKeyboardEvent const *event))
-SDL_MIR_SYM(int,mir_keyboard_event_scan_code,(MirKeyboardEvent const *event))
-SDL_MIR_SYM(bool,mir_pointer_event_button_state,(MirPointerEvent const *event, MirPointerButton button))
-SDL_MIR_SYM(MirPointerButtons,mir_pointer_event_buttons,(MirPointerEvent const *event))
-SDL_MIR_SYM(MirInputDeviceId,mir_input_event_get_device_id,(MirInputEvent const* ev))
-SDL_MIR_SYM(MirTouchId,mir_touch_event_id,(MirTouchEvent const *event, size_t touch_index))
-SDL_MIR_SYM(float,mir_touch_event_axis_value,(MirTouchEvent const *event, size_t touch_index, MirTouchAxis axis))
-SDL_MIR_SYM(MirTouchAction,mir_touch_event_action,(MirTouchEvent const *event, size_t touch_index))
-SDL_MIR_SYM(MirPointerAction,mir_pointer_event_action,(MirPointerEvent const *event))
-SDL_MIR_SYM(float,mir_pointer_event_axis_value,(MirPointerEvent const *event, MirPointerAxis))
-SDL_MIR_SYM(MirEventType,mir_event_get_type,(MirEvent const *event))
-SDL_MIR_SYM(MirInputEventType,mir_input_event_get_type,(MirInputEvent const *event))
-SDL_MIR_SYM(MirInputEvent const*,mir_event_get_input_event,(MirEvent const *event))
-SDL_MIR_SYM(MirResizeEvent const*,mir_event_get_resize_event,(MirEvent const *event))
-SDL_MIR_SYM(MirKeyboardEvent const*,mir_input_event_get_keyboard_event,(MirInputEvent const *event))
-SDL_MIR_SYM(MirPointerEvent const*,mir_input_event_get_pointer_event,(MirInputEvent const *event))
-SDL_MIR_SYM(MirTouchEvent const*,mir_input_event_get_touch_event,(MirInputEvent const *event))
-SDL_MIR_SYM(MirWindowEvent const*,mir_event_get_window_event,(MirEvent const *event))
-SDL_MIR_SYM(unsigned int,mir_touch_event_point_count,(MirTouchEvent const *event))
-SDL_MIR_SYM(void,mir_connection_get_available_surface_formats,(MirConnection* connection, MirPixelFormat* formats, unsigned const int format_size, unsigned int *num_valid_formats))
-SDL_MIR_SYM(MirEGLNativeDisplayType,mir_connection_get_egl_native_display,(MirConnection *connection))
-SDL_MIR_SYM(bool,mir_connection_is_valid,(MirConnection *connection))
-SDL_MIR_SYM(void,mir_connection_release,(MirConnection *connection))
-SDL_MIR_SYM(MirPixelFormat,mir_connection_get_egl_pixel_format,(MirConnection* connection, void* egldisplay, void* eglconfig))
-SDL_MIR_SYM(MirConnection *,mir_connect_sync,(char const *server, char const *app_name))
-SDL_MIR_SYM(char const *,mir_window_get_error_message,(MirWindow *window))
-SDL_MIR_SYM(bool,mir_window_is_valid,(MirWindow *window))
-SDL_MIR_SYM(void,mir_window_release_sync,(MirWindow* window))
-SDL_MIR_SYM(void,mir_buffer_stream_release_sync,(MirBufferStream *stream))
-SDL_MIR_SYM(void,mir_window_configure_cursor,(MirWindow* window, MirCursorConfiguration const* conf))
-SDL_MIR_SYM(void,mir_cursor_configuration_destroy,(MirCursorConfiguration* conf))
-SDL_MIR_SYM(int,mir_resize_event_get_width,(MirResizeEvent const* resize_event))
-SDL_MIR_SYM(int,mir_resize_event_get_height,(MirResizeEvent const* resize_event))
-SDL_MIR_SYM(char const*,mir_connection_get_error_message,(MirConnection* connection))
-SDL_MIR_SYM(MirWindowAttrib,mir_window_event_get_attribute,(MirWindowEvent const* event))
-SDL_MIR_SYM(int,mir_window_event_get_attribute_value,(MirWindowEvent const* window_event))
-SDL_MIR_SYM(MirDisplayConfig*,mir_connection_create_display_configuration,(MirConnection* connection))
-SDL_MIR_SYM(void,mir_display_config_release,(MirDisplayConfig* config))
-SDL_MIR_SYM(int,mir_display_config_get_num_outputs,(MirDisplayConfig const* config))
-SDL_MIR_SYM(MirOutput*,mir_display_config_get_mutable_output,(MirDisplayConfig* config, size_t index))
-SDL_MIR_SYM(int,mir_output_get_num_modes,(MirOutput const* output))
-SDL_MIR_SYM(MirOutputMode const*,mir_output_get_current_mode,(MirOutput const* output))
-SDL_MIR_SYM(MirPixelFormat,mir_output_get_current_pixel_format,(MirOutput const* output))
-SDL_MIR_SYM(int,mir_output_get_position_x,(MirOutput const* output))
-SDL_MIR_SYM(int,mir_output_get_position_y,(MirOutput const* output))
-SDL_MIR_SYM(bool,mir_output_is_enabled,(MirOutput const* output))
-SDL_MIR_SYM(MirOutputConnectionState,mir_output_get_connection_state,(MirOutput const* output))
-SDL_MIR_SYM(size_t,mir_output_get_preferred_mode_index,(MirOutput const* output))
-SDL_MIR_SYM(MirOutputType,mir_output_get_type,(MirOutput const* output))
-SDL_MIR_SYM(char const*,mir_output_type_name,(MirOutputType type))
-SDL_MIR_SYM(void,mir_output_set_current_mode,(MirOutput* output, MirOutputMode const* mode))
-SDL_MIR_SYM(MirOutputMode const*,mir_output_get_mode,(MirOutput const* output, size_t index))
-SDL_MIR_SYM(int,mir_output_mode_get_width,(MirOutputMode const* mode))
-SDL_MIR_SYM(int,mir_output_mode_get_height,(MirOutputMode const* mode))
-SDL_MIR_SYM(double,mir_output_mode_get_refresh_rate,(MirOutputMode const* mode))
-SDL_MIR_SYM(bool,mir_output_is_gamma_supported,(MirOutput const* output))
-SDL_MIR_SYM(uint32_t,mir_output_get_gamma_size,(MirOutput const* output))
-SDL_MIR_SYM(void,mir_output_get_gamma,(MirOutput const* output, uint16_t* red, uint16_t* green, uint16_t* blue, uint32_t size))
-SDL_MIR_SYM(void,mir_output_set_gamma,(MirOutput* output, uint16_t const* red, uint16_t const* green, uint16_t const* blue, uint32_t size))
-
-SDL_MIR_SYM_CONST(char const*,mir_omnidirectional_resize_cursor_name)
-SDL_MIR_SYM_CONST(char const*,mir_busy_cursor_name)
-SDL_MIR_SYM_CONST(char const*,mir_arrow_cursor_name)
-SDL_MIR_SYM_CONST(char const*,mir_caret_cursor_name)
-SDL_MIR_SYM_CONST(char const*,mir_vertical_resize_cursor_name)
-SDL_MIR_SYM_CONST(char const*,mir_horizontal_resize_cursor_name)
-SDL_MIR_SYM_CONST(char const*,mir_open_hand_cursor_name)
-SDL_MIR_SYM_CONST(char const*,mir_closed_hand_cursor_name)
-SDL_MIR_SYM_CONST(char const*,mir_disabled_cursor_name)
-
-SDL_MIR_MODULE(XKBCOMMON)
-SDL_MIR_SYM(int,xkb_keysym_to_utf8,(xkb_keysym_t keysym, char *buffer, size_t size))
-
-#undef SDL_MIR_MODULE
-#undef SDL_MIR_SYM
-#undef SDL_MIR_SYM_CONST
-
-/* *INDENT-ON* */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/src/video/mir/SDL_mirvideo.c b/src/video/mir/SDL_mirvideo.c
deleted file mode 100644
index 8f3a368..0000000
--- a/src/video/mir/SDL_mirvideo.c
+++ /dev/null
@@ -1,423 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-
-/*
- Contributed by Brandon Schaefer, <brandon.schaefer@canonical.com>
-*/
-
-#include "../../SDL_internal.h"
-
-#if SDL_VIDEO_DRIVER_MIR
-
-#include "SDL_assert.h"
-#include "SDL_log.h"
-
-#include "SDL_mirwindow.h"
-#include "SDL_video.h"
-
-#include "SDL_mirframebuffer.h"
-#include "SDL_mirmouse.h"
-#include "SDL_miropengl.h"
-#include "SDL_mirvideo.h"
-#include "SDL_mirvulkan.h"
-
-#include "SDL_mirdyn.h"
-
-#define MIR_DRIVER_NAME "mir"
-
-static const Uint32 mir_pixel_format_to_sdl_format[] = {
- SDL_PIXELFORMAT_UNKNOWN, /* mir_pixel_format_invalid */
- SDL_PIXELFORMAT_ABGR8888, /* mir_pixel_format_abgr_8888 */
- SDL_PIXELFORMAT_BGR888, /* mir_pixel_format_xbgr_8888 */
- SDL_PIXELFORMAT_ARGB8888, /* mir_pixel_format_argb_8888 */
- SDL_PIXELFORMAT_RGB888, /* mir_pixel_format_xrgb_8888 */
- SDL_PIXELFORMAT_BGR24, /* mir_pixel_format_bgr_888 */
- SDL_PIXELFORMAT_RGB24, /* mir_pixel_format_rgb_888 */
- SDL_PIXELFORMAT_RGB565, /* mir_pixel_format_rgb_565 */
- SDL_PIXELFORMAT_RGBA5551, /* mir_pixel_format_rgba_5551 */
- SDL_PIXELFORMAT_RGBA4444 /* mir_pixel_format_rgba_4444 */
-};
-
-Uint32
-MIR_GetSDLPixelFormat(MirPixelFormat format)
-{
- return mir_pixel_format_to_sdl_format[format];
-}
-
-static int
-MIR_VideoInit(_THIS);
-
-static void
-MIR_VideoQuit(_THIS);
-
-static int
-MIR_GetDisplayBounds(_THIS, SDL_VideoDisplay* display, SDL_Rect* rect);
-
-static void
-MIR_GetDisplayModes(_THIS, SDL_VideoDisplay* sdl_display);
-
-static int
-MIR_SetDisplayMode(_THIS, SDL_VideoDisplay* sdl_display, SDL_DisplayMode* mode);
-
-static SDL_WindowShaper*
-MIR_CreateShaper(SDL_Window* window)
-{
- /* FIXME Im not sure if mir support this atm, will have to come back to this */
- return NULL;
-}
-
-static int
-MIR_SetWindowShape(SDL_WindowShaper* shaper, SDL_Surface* shape, SDL_WindowShapeMode* shape_mode)
-{
- return SDL_Unsupported();
-}
-
-static int
-MIR_ResizeWindowShape(SDL_Window* window)
-{
- return SDL_Unsupported();
-}
-
-static int
-MIR_Available()
-{
- int available = 0;
-
- if (SDL_MIR_LoadSymbols()) {
-
- /* Lets ensure we can connect to the mir server */
- MirConnection* connection = MIR_mir_connect_sync(NULL, SDL_FUNCTION);
-
- if (!MIR_mir_connection_is_valid(connection)) {
- SDL_LogWarn(SDL_LOG_CATEGORY_VIDEO, "Unable to connect to the mir server %s",
- MIR_mir_connection_get_error_message(connection));
-
- return available;
- }
-
- MIR_mir_connection_release(connection);
-
- available = 1;
- SDL_MIR_UnloadSymbols();
- }
-
- return available;
-}
-
-static void
-MIR_DeleteDevice(SDL_VideoDevice* device)
-{
- SDL_free(device);
- SDL_MIR_UnloadSymbols();
-}
-
-static void
-MIR_PumpEvents(_THIS)
-{
-}
-
-static SDL_VideoDevice*
-MIR_CreateDevice(int device_index)
-{
- MIR_Data* mir_data;
- SDL_VideoDevice* device = NULL;
-
- if (!SDL_MIR_LoadSymbols()) {
- return NULL;
- }
-
- device = SDL_calloc(1, sizeof(SDL_VideoDevice));
- if (!device) {
- SDL_MIR_UnloadSymbols();
- SDL_OutOfMemory();
- return NULL;
- }
-
- mir_data = SDL_calloc(1, sizeof(MIR_Data));
- if (!mir_data) {
- SDL_free(device);
- SDL_MIR_UnloadSymbols();
- SDL_OutOfMemory();
- return NULL;
- }
-
- device->driverdata = mir_data;
-
- /* mirvideo */
- device->VideoInit = MIR_VideoInit;
- device->VideoQuit = MIR_VideoQuit;
- device->GetDisplayBounds = MIR_GetDisplayBounds;
- device->GetDisplayModes = MIR_GetDisplayModes;
- device->SetDisplayMode = MIR_SetDisplayMode;
- device->free = MIR_DeleteDevice;
-
- /* miropengles */
- device->GL_SwapWindow = MIR_GL_SwapWindow;
- device->GL_MakeCurrent = MIR_GL_MakeCurrent;
- device->GL_CreateContext = MIR_GL_CreateContext;
- device->GL_DeleteContext = MIR_GL_DeleteContext;
- device->GL_LoadLibrary = MIR_GL_LoadLibrary;
- device->GL_UnloadLibrary = MIR_GL_UnloadLibrary;
- device->GL_GetSwapInterval = MIR_GL_GetSwapInterval;
- device->GL_SetSwapInterval = MIR_GL_SetSwapInterval;
- device->GL_GetProcAddress = MIR_GL_GetProcAddress;
-
- /* mirwindow */
- device->CreateSDLWindow = MIR_CreateWindow;
- device->DestroyWindow = MIR_DestroyWindow;
- device->GetWindowWMInfo = MIR_GetWindowWMInfo;
- device->SetWindowFullscreen = MIR_SetWindowFullscreen;
- device->MaximizeWindow = MIR_MaximizeWindow;
- device->MinimizeWindow = MIR_MinimizeWindow;
- device->RestoreWindow = MIR_RestoreWindow;
- device->ShowWindow = MIR_RestoreWindow;
- device->HideWindow = MIR_HideWindow;
- device->SetWindowSize = MIR_SetWindowSize;
- device->SetWindowMinimumSize = MIR_SetWindowMinimumSize;
- device->SetWindowMaximumSize = MIR_SetWindowMaximumSize;
- device->SetWindowTitle = MIR_SetWindowTitle;
- device->SetWindowGrab = MIR_SetWindowGrab;
- device->SetWindowGammaRamp = MIR_SetWindowGammaRamp;
- device->GetWindowGammaRamp = MIR_GetWindowGammaRamp;
-
- device->CreateSDLWindowFrom = NULL;
- device->SetWindowIcon = NULL;
- device->RaiseWindow = NULL;
- device->SetWindowBordered = NULL;
- device->SetWindowResizable = NULL;
- device->OnWindowEnter = NULL;
- device->SetWindowPosition = NULL;
-
- /* mirframebuffer */
- device->CreateWindowFramebuffer = MIR_CreateWindowFramebuffer;
- device->UpdateWindowFramebuffer = MIR_UpdateWindowFramebuffer;
- device->DestroyWindowFramebuffer = MIR_DestroyWindowFramebuffer;
-
- device->shape_driver.CreateShaper = MIR_CreateShaper;
- device->shape_driver.SetWindowShape = MIR_SetWindowShape;
- device->shape_driver.ResizeWindowShape = MIR_ResizeWindowShape;
-
- device->PumpEvents = MIR_PumpEvents;
-
- device->SuspendScreenSaver = NULL;
-
- device->StartTextInput = NULL;
- device->StopTextInput = NULL;
- device->SetTextInputRect = NULL;
-
- device->HasScreenKeyboardSupport = NULL;
- device->ShowScreenKeyboard = NULL;
- device->HideScreenKeyboard = NULL;
- device->IsScreenKeyboardShown = NULL;
-
- device->SetClipboardText = NULL;
- device->GetClipboardText = NULL;
- device->HasClipboardText = NULL;
-
- device->ShowMessageBox = NULL;
-
-#if SDL_VIDEO_VULKAN
- device->Vulkan_LoadLibrary = MIR_Vulkan_LoadLibrary;
- device->Vulkan_UnloadLibrary = MIR_Vulkan_UnloadLibrary;
- device->Vulkan_GetInstanceExtensions = MIR_Vulkan_GetInstanceExtensions;
- device->Vulkan_CreateSurface = MIR_Vulkan_CreateSurface;
-#endif
-
- return device;
-}
-
-VideoBootStrap MIR_bootstrap = {
- MIR_DRIVER_NAME, "SDL Mir video driver",
- MIR_Available, MIR_CreateDevice
-};
-
-static SDL_DisplayMode
-MIR_ConvertModeToSDLMode(MirOutputMode const* mode, MirPixelFormat format)
-{
- SDL_DisplayMode sdl_mode = {
- .format = MIR_GetSDLPixelFormat(format),
- .w = MIR_mir_output_mode_get_width(mode),
- .h = MIR_mir_output_mode_get_height(mode),
- .refresh_rate = MIR_mir_output_mode_get_refresh_rate(mode),
- .driverdata = NULL
- };
-
- return sdl_mode;
-}
-
-static void
-MIR_AddModeToDisplay(SDL_VideoDisplay* display, MirOutputMode const* mode, MirPixelFormat format)
-{
- SDL_DisplayMode sdl_mode = MIR_ConvertModeToSDLMode(mode, format);
- SDL_AddDisplayMode(display, &sdl_mode);
-}
-
-static void
-MIR_InitDisplayFromOutput(_THIS, MirOutput* output)
-{
- SDL_VideoDisplay display;
- int m;
-
- MirPixelFormat format = MIR_mir_output_get_current_pixel_format(output);
- int num_modes = MIR_mir_output_get_num_modes(output);
- SDL_DisplayMode current_mode = MIR_ConvertModeToSDLMode(MIR_mir_output_get_current_mode(output), format);
-
- SDL_zero(display);
-
- // Unfortunate cast, but SDL_AddVideoDisplay will strdup this pointer so its read-only in this case.
- display.name = (char*)MIR_mir_output_type_name(MIR_mir_output_get_type(output));
-
- for (m = 0; m < num_modes; m++) {
- MirOutputMode const* mode = MIR_mir_output_get_mode(output, m);
- MIR_AddModeToDisplay(&display, mode, format);
- }
-
- display.desktop_mode = current_mode;
- display.current_mode = current_mode;
-
- display.driverdata = output;
- SDL_AddVideoDisplay(&display);
-}
-
-static void
-MIR_InitDisplays(_THIS)
-{
- MIR_Data* mir_data = _this->driverdata;
- int num_outputs = MIR_mir_display_config_get_num_outputs(mir_data->display_config);
- int d;
-
- for (d = 0; d < num_outputs; d++) {
- MirOutput* output = MIR_mir_display_config_get_mutable_output(mir_data->display_config, d);
- SDL_bool enabled = MIR_mir_output_is_enabled(output);
- MirOutputConnectionState state = MIR_mir_output_get_connection_state(output);
-
- if (enabled && state == mir_output_connection_state_connected) {
- MIR_InitDisplayFromOutput(_this, output);
- }
- }
-}
-
-static int
-MIR_VideoInit(_THIS)
-{
- MIR_Data* mir_data = _this->driverdata;
-
- mir_data->connection = MIR_mir_connect_sync(NULL, SDL_FUNCTION);
- mir_data->current_window = NULL;
- mir_data->software = SDL_FALSE;
- mir_data->pixel_format = mir_pixel_format_invalid;
-
- if (!MIR_mir_connection_is_valid(mir_data->connection)) {
- return SDL_SetError("Failed to connect to the mir server: %s",
- MIR_mir_connection_get_error_message(mir_data->connection));
- }
-
- mir_data->display_config = MIR_mir_connection_create_display_configuration(mir_data->connection);
-
- MIR_InitDisplays(_this);
- MIR_InitMouse();
-
- return 0;
-}
-
-static void
-MIR_CleanUpDisplayConfig(_THIS)
-{
- MIR_Data* mir_data = _this->driverdata;
- int i;
-
- // SDL_VideoQuit frees the display driverdata, we own it not them
- for (i = 0; i < _this->num_displays; ++i) {
- _this->displays[i].driverdata = NULL;
- }
-
- MIR_mir_display_config_release(mir_data->display_config);
-}
-
-static void
-MIR_VideoQuit(_THIS)
-{
- MIR_Data* mir_data = _this->driverdata;
-
- MIR_CleanUpDisplayConfig(_this);
-
- MIR_FiniMouse();
-
- MIR_GL_DeleteContext(_this, NULL);
- MIR_GL_UnloadLibrary(_this);
-
- MIR_mir_connection_release(mir_data->connection);
-
- SDL_free(mir_data);
- _this->driverdata = NULL;
-}
-
-static int
-MIR_GetDisplayBounds(_THIS, SDL_VideoDisplay* display, SDL_Rect* rect)
-{
- MirOutput const* output = display->driverdata;
-
- rect->x = MIR_mir_output_get_position_x(output);
- rect->y = MIR_mir_output_get_position_y(output);
- rect->w = display->current_mode.w;
- rect->h = display->current_mode.h;
-
- return 0;
-}
-
-static void
-MIR_GetDisplayModes(_THIS, SDL_VideoDisplay* display)
-{
-}
-
-static int
-MIR_SetDisplayMode(_THIS, SDL_VideoDisplay* display, SDL_DisplayMode* mode)
-{
- int m;
- MirOutput* output = display->driverdata;
- int num_modes = MIR_mir_output_get_num_modes(output);
- Uint32 sdl_format = MIR_GetSDLPixelFormat(
- MIR_mir_output_get_current_pixel_format(output));
-
- for (m = 0; m < num_modes; m++) {
- MirOutputMode const* mir_mode = MIR_mir_output_get_mode(output, m);
- int width = MIR_mir_output_mode_get_width(mir_mode);
- int height = MIR_mir_output_mode_get_height(mir_mode);
- double refresh_rate = MIR_mir_output_mode_get_refresh_rate(mir_mode);
-
- if (mode->format == sdl_format &&
- mode->w == width &&
- mode->h == height &&
- mode->refresh_rate == refresh_rate) {
-
- // FIXME Currently wont actually *set* anything. Need to wait for applying display changes
- MIR_mir_output_set_current_mode(output, mir_mode);
- return 0;
- }
- }
-
- return -1;
-}
-
-#endif /* SDL_VIDEO_DRIVER_MIR */
-
-/* vi: set ts=4 sw=4 expandtab: */
-
diff --git a/src/video/mir/SDL_mirvideo.h b/src/video/mir/SDL_mirvideo.h
deleted file mode 100644
index 6850bac..0000000
--- a/src/video/mir/SDL_mirvideo.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-
-/*
- Contributed by Brandon Schaefer, <brandon.schaefer@canonical.com>
-*/
-
-#ifndef SDL_mirvideo_h__
-#define SDL_mirvideo_h__
-
-#include <EGL/egl.h>
-#include <mir_toolkit/mir_client_library.h>
-#include "SDL_stdinc.h"
-
-typedef struct MIR_Window MIR_Window;
-
-typedef struct
-{
- MirConnection* connection;
- MirDisplayConfig* display_config;
- MIR_Window* current_window;
- SDL_bool software;
- MirPixelFormat pixel_format;
-} MIR_Data;
-
-extern Uint32
-MIR_GetSDLPixelFormat(MirPixelFormat format);
-
-#endif /* SDL_mirvideo_h__ */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/src/video/mir/SDL_mirvulkan.c b/src/video/mir/SDL_mirvulkan.c
deleted file mode 100644
index 6ba3fa3..0000000
--- a/src/video/mir/SDL_mirvulkan.c
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-
-/*
- * @author Mark Callow, www.edgewise-consulting.com. Based on Jacob Lifshay's
- * SDL_x11vulkan.c.
- */
-
-#include "../../SDL_internal.h"
-
-#if SDL_VIDEO_VULKAN && SDL_VIDEO_DRIVER_MIR
-
-#include "SDL_mirvideo.h"
-#include "SDL_mirwindow.h"
-#include "SDL_assert.h"
-
-#include "SDL_loadso.h"
-#include "SDL_mirvulkan.h"
-#include "SDL_syswm.h"
-
-int MIR_Vulkan_LoadLibrary(_THIS, const char *path)
-{
- VkExtensionProperties *extensions = NULL;
- Uint32 extensionCount = 0;
- SDL_bool hasSurfaceExtension = SDL_FALSE;
- SDL_bool hasMIRSurfaceExtension = SDL_FALSE;
- PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr = NULL;
- if(_this->vulkan_config.loader_handle)
- return SDL_SetError("Vulkan already loaded");
-
- /* Load the Vulkan loader library */
- if(!path)
- path = SDL_getenv("SDL_VULKAN_LIBRARY");
- if(!path)
- path = "libvulkan.so.1";
- _this->vulkan_config.loader_handle = SDL_LoadObject(path);
- if(!_this->vulkan_config.loader_handle)
- return -1;
- SDL_strlcpy(_this->vulkan_config.loader_path, path,
- SDL_arraysize(_this->vulkan_config.loader_path));
- vkGetInstanceProcAddr = (PFN_vkGetInstanceProcAddr)SDL_LoadFunction(
- _this->vulkan_config.loader_handle, "vkGetInstanceProcAddr");
- if(!vkGetInstanceProcAddr)
- goto fail;
- _this->vulkan_config.vkGetInstanceProcAddr = (void *)vkGetInstanceProcAddr;
- _this->vulkan_config.vkEnumerateInstanceExtensionProperties =
- (void *)((PFN_vkGetInstanceProcAddr)_this->vulkan_config.vkGetInstanceProcAddr)(
- VK_NULL_HANDLE, "vkEnumerateInstanceExtensionProperties");
- if(!_this->vulkan_config.vkEnumerateInstanceExtensionProperties)
- goto fail;
- extensions = SDL_Vulkan_CreateInstanceExtensionsList(
- (PFN_vkEnumerateInstanceExtensionProperties)
- _this->vulkan_config.vkEnumerateInstanceExtensionProperties,
- &extensionCount);
- if(!extensions)
- goto fail;
- for(Uint32 i = 0; i < extensionCount; i++)
- {
- if(SDL_strcmp(VK_KHR_SURFACE_EXTENSION_NAME, extensions[i].extensionName) == 0)
- hasSurfaceExtension = SDL_TRUE;
- else if(SDL_strcmp(VK_KHR_MIR_SURFACE_EXTENSION_NAME, extensions[i].extensionName) == 0)
- hasMIRSurfaceExtension = SDL_TRUE;
- }
- SDL_free(extensions);
- if(!hasSurfaceExtension)
- {
- SDL_SetError("Installed Vulkan doesn't implement the "
- VK_KHR_SURFACE_EXTENSION_NAME " extension");
- goto fail;
- }
- else if(!hasMIRSurfaceExtension)
- {
- SDL_SetError("Installed Vulkan doesn't implement the "
- VK_KHR_MIR_SURFACE_EXTENSION_NAME "extension");
- goto fail;
- }
- return 0;
-
-fail:
- SDL_UnloadObject(_this->vulkan_config.loader_handle);
- _this->vulkan_config.loader_handle = NULL;
- return -1;
-}
-
-void MIR_Vulkan_UnloadLibrary(_THIS)
-{
- if(_this->vulkan_config.loader_handle)
- {
- SDL_UnloadObject(_this->vulkan_config.loader_handle);
- _this->vulkan_config.loader_handle = NULL;
- }
-}
-
-SDL_bool MIR_Vulkan_GetInstanceExtensions(_THIS,
- SDL_Window *window,
- unsigned *count,
- const char **names)
-{
- static const char *const extensionsForMir[] = {
- VK_KHR_SURFACE_EXTENSION_NAME, VK_KHR_MIR_SURFACE_EXTENSION_NAME
- };
- if(!_this->vulkan_config.loader_handle)
- {
- SDL_SetError("Vulkan is not loaded");
- return SDL_FALSE;
- }
- return SDL_Vulkan_GetInstanceExtensions_Helper(
- count, names, SDL_arraysize(extensionsForMir),
- extensionsForMir);
-}
-
-SDL_bool MIR_Vulkan_CreateSurface(_THIS,
- SDL_Window *window,
- VkInstance instance,
- VkSurfaceKHR *surface)
-{
- MIR_Window *windowData = (MIR_Window *)window->driverdata;
- PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr =
- (PFN_vkGetInstanceProcAddr)_this->vulkan_config.vkGetInstanceProcAddr;
- PFN_vkCreateMirSurfaceKHR vkCreateMirSurfaceKHR =
- (PFN_vkCreateMirSurfaceKHR)vkGetInstanceProcAddr(
- (VkInstance)instance,
- "vkCreateMirSurfaceKHR");
- VkMirSurfaceCreateInfoKHR createInfo;
- VkResult result;
-
- if(!_this->vulkan_config.loader_handle)
- {
- SDL_SetError("Vulkan is not loaded");
- return SDL_FALSE;
- }
-
- if(!vkCreateMirSurfaceKHR)
- {
- SDL_SetError(VK_KHR_MIR_SURFACE_EXTENSION_NAME
- " extension is not enabled in the Vulkan instance.");
- return SDL_FALSE;
- }
- SDL_zero(createInfo);
- createInfo.sType = VK_STRUCTURE_TYPE_MIR_SURFACE_CREATE_INFO_KHR;
- createInfo.pNext = NULL;
- createInfo.flags = 0;
- createInfo.connection = windowData->mir_data->connection;
- createInfo.mirSurface = windowData->window;
- result = vkCreateMirSurfaceKHR(instance, &createInfo,
- NULL, surface);
- if(result != VK_SUCCESS)
- {
- SDL_SetError("vkCreateMirSurfaceKHR failed: %s",
- SDL_Vulkan_GetResultString(result));
- return SDL_FALSE;
- }
- return SDL_TRUE;
-}
-
-#endif
-
-/* vim: set ts=4 sw=4 expandtab: */
diff --git a/src/video/mir/SDL_mirvulkan.h b/src/video/mir/SDL_mirvulkan.h
deleted file mode 100644
index 6f40d5b..0000000
--- a/src/video/mir/SDL_mirvulkan.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-
-/*
- * @author Mark Callow, www.edgewise-consulting.com. Based on Jacob Lifshay's
- * SDL_x11vulkan.h.
- */
-
-#include "../../SDL_internal.h"
-
-#ifndef SDL_mirvulkan_h_
-#define SDL_mirvulkan_h_
-
-#include "../SDL_vulkan_internal.h"
-#include "../SDL_sysvideo.h"
-
-#if SDL_VIDEO_VULKAN && SDL_VIDEO_DRIVER_MIR
-
-int MIR_Vulkan_LoadLibrary(_THIS, const char *path);
-void MIR_Vulkan_UnloadLibrary(_THIS);
-SDL_bool MIR_Vulkan_GetInstanceExtensions(_THIS,
- SDL_Window *window,
- unsigned *count,
- const char **names);
-SDL_bool MIR_Vulkan_CreateSurface(_THIS,
- SDL_Window *window,
- VkInstance instance,
- VkSurfaceKHR *surface);
-
-#endif
-
-#endif /* SDL_mirvulkan_h_ */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/src/video/mir/SDL_mirwindow.c b/src/video/mir/SDL_mirwindow.c
deleted file mode 100644
index 80877ee..0000000
--- a/src/video/mir/SDL_mirwindow.c
+++ /dev/null
@@ -1,374 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-
-/*
- Contributed by Brandon Schaefer, <brandon.schaefer@canonical.com>
-*/
-
-#include "../../SDL_internal.h"
-
-#if SDL_VIDEO_DRIVER_MIR
-
-#include "../SDL_egl_c.h"
-#include "../SDL_sysvideo.h"
-#include "../../events/SDL_keyboard_c.h"
-
-#include "SDL_mirevents.h"
-#include "SDL_mirwindow.h"
-
-#include "SDL_mirdyn.h"
-
-static int
-IsMirWindowValid(MIR_Window* mir_window)
-{
- if (!MIR_mir_window_is_valid(mir_window->window)) {
- const char* error = MIR_mir_window_get_error_message(mir_window->window);
- return SDL_SetError("Failed to create a mir surface: %s", error);
- }
-
- return 1;
-}
-
-static MirPixelFormat
-FindValidPixelFormat(MIR_Data* mir_data)
-{
- unsigned int pf_size = 32;
- unsigned int valid_formats;
- unsigned int f;
-
- MirPixelFormat formats[pf_size];
- MIR_mir_connection_get_available_surface_formats(mir_data->connection, formats,
- pf_size, &valid_formats);
-
- for (f = 0; f < valid_formats; f++) {
- MirPixelFormat cur_pf = formats[f];
-
- if (cur_pf == mir_pixel_format_abgr_8888 ||
- cur_pf == mir_pixel_format_xbgr_8888 ||
- cur_pf == mir_pixel_format_argb_8888 ||
- cur_pf == mir_pixel_format_xrgb_8888) {
-
- return cur_pf;
- }
- }
-
- return mir_pixel_format_invalid;
-}
-
-int
-MIR_CreateWindow(_THIS, SDL_Window* window)
-{
- MIR_Window* mir_window;
- MIR_Data* mir_data;
- MirPixelFormat pixel_format;
- MirBufferUsage buffer_usage;
-
- MirWindowSpec* spec;
-
- mir_window = SDL_calloc(1, sizeof(MIR_Window));
- if (!mir_window)
- return SDL_OutOfMemory();
-
- mir_data = _this->driverdata;
- window->driverdata = mir_window;
-
- if (window->x == SDL_WINDOWPOS_UNDEFINED)
- window->x = 0;
-
- if (window->y == SDL_WINDOWPOS_UNDEFINED)
- window->y = 0;
-
- mir_window->mir_data = mir_data;
- mir_window->sdl_window = window;
-
- if (window->flags & SDL_WINDOW_OPENGL) {
- pixel_format = MIR_mir_connection_get_egl_pixel_format(mir_data->connection,
- _this->egl_data->egl_display,
- _this->egl_data->egl_config);
- }
- else {
- pixel_format = FindValidPixelFormat(mir_data);
- }
-
- mir_data->pixel_format = pixel_format;
- if (pixel_format == mir_pixel_format_invalid) {
- return SDL_SetError("Failed to find a valid pixel format.");
- }
-
- buffer_usage = mir_buffer_usage_hardware;
- if (mir_data->software)
- buffer_usage = mir_buffer_usage_software;
-
- spec = MIR_mir_create_normal_window_spec(mir_data->connection,
- window->w,
- window->h);
-
- MIR_mir_window_spec_set_buffer_usage(spec, buffer_usage);
- MIR_mir_window_spec_set_name(spec, "Mir surface");
- MIR_mir_window_spec_set_pixel_format(spec, pixel_format);
-
- if (window->flags & SDL_WINDOW_INPUT_FOCUS)
- SDL_SetKeyboardFocus(window);
-
- mir_window->window = MIR_mir_create_window_sync(spec);
- MIR_mir_window_set_event_handler(mir_window->window, MIR_HandleEvent, window);
-
- MIR_mir_window_spec_release(spec);
-
- if (!MIR_mir_window_is_valid(mir_window->window)) {
- return SDL_SetError("Failed to create a mir surface: %s",
- MIR_mir_window_get_error_message(mir_window->window));
- }
-
- if (window->flags & SDL_WINDOW_OPENGL) {
- EGLNativeWindowType egl_native_window =
- (EGLNativeWindowType)MIR_mir_buffer_stream_get_egl_native_window(
- MIR_mir_window_get_buffer_stream(mir_window->window));
-
- mir_window->egl_surface = SDL_EGL_CreateSurface(_this, egl_native_window);
-
- if (mir_window->egl_surface == EGL_NO_SURFACE) {
- return SDL_SetError("Failed to create a window surface %p",
- _this->egl_data->egl_display);
- }
- }
- else {
- mir_window->egl_surface = EGL_NO_SURFACE;
- }
-
- mir_data->current_window = mir_window;
-
- return 0;
-}
-
-void
-MIR_DestroyWindow(_THIS, SDL_Window* window)
-{
- MIR_Data* mir_data = _this->driverdata;
- MIR_Window* mir_window = window->driverdata;
-
- if (mir_data) {
- SDL_EGL_DestroySurface(_this, mir_window->egl_surface);
- MIR_mir_window_release_sync(mir_window->window);
-
- mir_data->current_window = NULL;
-
- SDL_free(mir_window);
- }
- window->driverdata = NULL;
-}
-
-SDL_bool
-MIR_GetWindowWMInfo(_THIS, SDL_Window* window, SDL_SysWMinfo* info)
-{
- if (info->version.major == SDL_MAJOR_VERSION &&
- info->version.minor == SDL_MINOR_VERSION) {
- MIR_Window* mir_window = window->driverdata;
-
- info->subsystem = SDL_SYSWM_MIR;
- info->info.mir.connection = mir_window->mir_data->connection;
- // Cannot change this to window due to it being in the public API
- info->info.mir.surface = mir_window->window;
-
- return SDL_TRUE;
- }
-
- return SDL_FALSE;
-}
-
-static void
-UpdateMirWindowState(MIR_Data* mir_data, MIR_Window* mir_window, MirWindowState window_state)
-{
- if (IsMirWindowValid(mir_window)) {
- MirWindowSpec* spec = MIR_mir_create_window_spec(mir_data->connection);
- MIR_mir_window_spec_set_state(spec, window_state);
-
- MIR_mir_window_apply_spec(mir_window->window, spec);
- MIR_mir_window_spec_release(spec);
- }
-}
-
-void
-MIR_SetWindowFullscreen(_THIS, SDL_Window* window,
- SDL_VideoDisplay* display,
- SDL_bool fullscreen)
-{
- if (IsMirWindowValid(window->driverdata)) {
- MirWindowState state;
-
- if (fullscreen) {
- state = mir_window_state_fullscreen;
- }
- else {
- state = mir_window_state_restored;
- }
-
- UpdateMirWindowState(_this->driverdata, window->driverdata, state);
- }
-}
-
-void
-MIR_MaximizeWindow(_THIS, SDL_Window* window)
-{
- UpdateMirWindowState(_this->driverdata, window->driverdata, mir_window_state_maximized);
-}
-
-void
-MIR_MinimizeWindow(_THIS, SDL_Window* window)
-{
- UpdateMirWindowState(_this->driverdata, window->driverdata, mir_window_state_minimized);
-}
-
-void
-MIR_RestoreWindow(_THIS, SDL_Window * window)
-{
- UpdateMirWindowState(_this->driverdata, window->driverdata, mir_window_state_restored);
-}
-
-void
-MIR_HideWindow(_THIS, SDL_Window* window)
-{
- UpdateMirWindowState(_this->driverdata, window->driverdata, mir_window_state_hidden);
-}
-
-void
-MIR_SetWindowSize(_THIS, SDL_Window* window)
-{
- MIR_Data* mir_data = _this->driverdata;
- MIR_Window* mir_window = window->driverdata;
-
- if (IsMirWindowValid(mir_window)) {
- MirWindowSpec* spec = MIR_mir_create_window_spec(mir_data->connection);
- MIR_mir_window_spec_set_width (spec, window->w);
- MIR_mir_window_spec_set_height(spec, window->h);
-
- MIR_mir_window_apply_spec(mir_window->window, spec);
- }
-}
-
-void
-MIR_SetWindowMinimumSize(_THIS, SDL_Window* window)
-{
- MIR_Data* mir_data = _this->driverdata;
- MIR_Window* mir_window = window->driverdata;
-
- if (IsMirWindowValid(mir_window)) {
- MirWindowSpec* spec = MIR_mir_create_window_spec(mir_data->connection);
- MIR_mir_window_spec_set_min_width (spec, window->min_w);
- MIR_mir_window_spec_set_min_height(spec, window->min_h);
-
- MIR_mir_window_apply_spec(mir_window->window, spec);
- }
-}
-
-void
-MIR_SetWindowMaximumSize(_THIS, SDL_Window* window)
-{
- MIR_Data* mir_data = _this->driverdata;
- MIR_Window* mir_window = window->driverdata;
-
- if (IsMirWindowValid(mir_window)) {
- MirWindowSpec* spec = MIR_mir_create_window_spec(mir_data->connection);
- MIR_mir_window_spec_set_max_width (spec, window->max_w);
- MIR_mir_window_spec_set_max_height(spec, window->max_h);
-
- MIR_mir_window_apply_spec(mir_window->window, spec);
- }
-}
-
-void
-MIR_SetWindowTitle(_THIS, SDL_Window* window)
-{
- MIR_Data* mir_data = _this->driverdata;
- MIR_Window* mir_window = window->driverdata;
- char const* title = window->title ? window->title : "";
- MirWindowSpec* spec;
-
- if (IsMirWindowValid(mir_window) < 0)
- return;
-
- spec = MIR_mir_create_window_spec(mir_data->connection);
- MIR_mir_window_spec_set_name(spec, title);
-
- MIR_mir_window_apply_spec(mir_window->window, spec);
- MIR_mir_window_spec_release(spec);
-}
-
-void
-MIR_SetWindowGrab(_THIS, SDL_Window* window, SDL_bool grabbed)
-{
- MIR_Data* mir_data = _this->driverdata;
- MIR_Window* mir_window = window->driverdata;
- MirPointerConfinementState confined = mir_pointer_unconfined;
- MirWindowSpec* spec;
-
- if (grabbed)
- confined = mir_pointer_confined_to_window;
-
- spec = MIR_mir_create_window_spec(mir_data->connection);
- MIR_mir_window_spec_set_pointer_confinement(spec, confined);
-
- MIR_mir_window_apply_spec(mir_window->window, spec);
- MIR_mir_window_spec_release(spec);
-}
-
-int
-MIR_SetWindowGammaRamp(_THIS, SDL_Window* window, Uint16 const* ramp)
-{
- MirOutput* output = SDL_GetDisplayForWindow(window)->driverdata;
- Uint32 ramp_size = 256;
-
- // FIXME Need to apply the changes to the output, once that public API function is around
- if (MIR_mir_output_is_gamma_supported(output) == mir_output_gamma_supported) {
- MIR_mir_output_set_gamma(output,
- ramp + ramp_size * 0,
- ramp + ramp_size * 1,
- ramp + ramp_size * 2,
- ramp_size);
- return 0;
- }
-
- return -1;
-}
-
-int
-MIR_GetWindowGammaRamp(_THIS, SDL_Window* window, Uint16* ramp)
-{
- MirOutput* output = SDL_GetDisplayForWindow(window)->driverdata;
- Uint32 ramp_size = 256;
-
- if (MIR_mir_output_is_gamma_supported(output) == mir_output_gamma_supported) {
- if (MIR_mir_output_get_gamma_size(output) == ramp_size) {
- MIR_mir_output_get_gamma(output,
- ramp + ramp_size * 0,
- ramp + ramp_size * 1,
- ramp + ramp_size * 2,
- ramp_size);
- return 0;
- }
- }
-
- return -1;
-}
-
-#endif /* SDL_VIDEO_DRIVER_MIR */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/src/video/mir/SDL_mirwindow.h b/src/video/mir/SDL_mirwindow.h
deleted file mode 100644
index af618f5..0000000
--- a/src/video/mir/SDL_mirwindow.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-
-/*
- Contributed by Brandon Schaefer, <brandon.schaefer@canonical.com>
-*/
-
-#ifndef SDL_mirwindow_h_
-#define SDL_mirwindow_h_
-
-#include "../SDL_sysvideo.h"
-#include "SDL_syswm.h"
-
-#include "SDL_mirvideo.h"
-
-struct MIR_Window {
- SDL_Window* sdl_window;
- MIR_Data* mir_data;
-
- MirWindow* window;
- EGLSurface egl_surface;
-};
-
-
-extern int
-MIR_CreateWindow(_THIS, SDL_Window* window);
-
-extern void
-MIR_DestroyWindow(_THIS, SDL_Window* window);
-
-extern void
-MIR_SetWindowFullscreen(_THIS, SDL_Window* window,
- SDL_VideoDisplay* display,
- SDL_bool fullscreen);
-
-extern void
-MIR_MaximizeWindow(_THIS, SDL_Window* window);
-
-extern void
-MIR_MinimizeWindow(_THIS, SDL_Window* window);
-
-extern void
-MIR_RestoreWindow(_THIS, SDL_Window* window);
-
-extern void
-MIR_HideWindow(_THIS, SDL_Window* window);
-
-extern SDL_bool
-MIR_GetWindowWMInfo(_THIS, SDL_Window* window, SDL_SysWMinfo* info);
-
-extern void
-MIR_SetWindowSize(_THIS, SDL_Window* window);
-
-extern void
-MIR_SetWindowMinimumSize(_THIS, SDL_Window* window);
-
-extern void
-MIR_SetWindowMaximumSize(_THIS, SDL_Window* window);
-
-extern void
-MIR_SetWindowTitle(_THIS, SDL_Window* window);
-
-extern void
-MIR_SetWindowGrab(_THIS, SDL_Window* window, SDL_bool grabbed);
-
-extern int
-MIR_SetWindowGammaRamp(_THIS, SDL_Window* window, Uint16 const* ramp);
-
-extern int
-MIR_GetWindowGammaRamp(_THIS, SDL_Window* window, Uint16* ramp);
-
-#endif /* SDL_mirwindow_h_ */
-
-/* vi: set ts=4 sw=4 expandtab: */
-