waynest 0.0.26

Core wayland stuff
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8676
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705
8706
8707
8708
8709
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
8805
8806
8807
8808
8809
8810
8811
8812
8813
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
8834
8835
8836
8837
8838
8839
8840
8841
8842
8843
8844
8845
8846
8847
8848
8849
8850
8851
8852
8853
8854
8855
8856
8857
8858
8859
8860
8861
8862
8863
8864
8865
8866
8867
8868
8869
8870
8871
8872
8873
8874
8875
8876
8877
8878
8879
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
8890
8891
8892
8893
8894
8895
8896
8897
8898
8899
8900
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
8911
8912
8913
8914
8915
8916
8917
8918
8919
8920
8921
8922
8923
8924
8925
8926
8927
8928
8929
8930
8931
8932
8933
8934
8935
8936
8937
8938
8939
8940
8941
8942
8943
8944
8945
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956
8957
8958
8959
8960
8961
8962
8963
8964
8965
8966
8967
8968
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986
8987
8988
8989
8990
8991
8992
8993
8994
8995
8996
8997
8998
8999
9000
9001
9002
9003
9004
9005
9006
9007
9008
9009
9010
9011
9012
9013
9014
9015
9016
9017
9018
9019
9020
9021
9022
9023
9024
9025
9026
9027
9028
9029
9030
9031
9032
9033
9034
9035
9036
9037
9038
9039
9040
9041
9042
9043
9044
9045
9046
9047
9048
9049
9050
9051
9052
9053
9054
9055
9056
9057
9058
9059
9060
9061
9062
9063
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073
9074
9075
9076
9077
9078
9079
9080
9081
9082
9083
9084
9085
9086
9087
9088
9089
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
9125
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154
9155
9156
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179
9180
9181
9182
9183
9184
9185
9186
9187
9188
9189
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204
9205
9206
9207
9208
9209
9210
9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
9357
9358
9359
9360
9361
9362
9363
9364
9365
9366
9367
9368
9369
9370
9371
9372
9373
9374
9375
9376
9377
9378
9379
9380
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
9391
9392
9393
9394
9395
9396
9397
9398
9399
9400
9401
9402
9403
9404
9405
9406
9407
9408
9409
9410
9411
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
9487
9488
9489
9490
9491
9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
9516
9517
9518
9519
9520
9521
9522
9523
9524
9525
9526
9527
9528
9529
9530
9531
9532
9533
9534
9535
9536
9537
9538
9539
9540
9541
9542
9543
9544
9545
9546
9547
9548
9549
9550
9551
9552
9553
9554
9555
9556
9557
9558
9559
9560
9561
9562
9563
9564
9565
9566
9567
9568
9569
9570
9571
9572
9573
9574
9575
9576
9577
9578
9579
9580
9581
9582
9583
9584
9585
9586
9587
9588
9589
9590
9591
9592
9593
9594
9595
9596
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
9628
9629
9630
9631
9632
9633
9634
9635
9636
9637
9638
9639
9640
9641
9642
9643
9644
9645
9646
9647
9648
9649
9650
9651
9652
9653
9654
9655
9656
9657
9658
9659
9660
9661
9662
9663
9664
9665
9666
9667
9668
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
9679
9680
9681
9682
9683
9684
9685
9686
9687
9688
9689
9690
9691
9692
9693
9694
9695
9696
9697
9698
9699
9700
9701
9702
9703
9704
9705
9706
9707
9708
9709
9710
9711
9712
9713
9714
9715
9716
9717
9718
9719
9720
9721
9722
9723
9724
9725
9726
9727
9728
9729
9730
9731
9732
9733
9734
9735
9736
9737
9738
9739
9740
9741
9742
9743
9744
9745
9746
9747
9748
9749
9750
9751
9752
9753
9754
9755
9756
9757
9758
9759
9760
9761
9762
9763
9764
9765
9766
9767
9768
9769
9770
9771
9772
9773
9774
9775
9776
9777
9778
9779
9780
9781
9782
9783
9784
9785
9786
9787
9788
9789
9790
9791
9792
9793
9794
9795
9796
9797
9798
9799
9800
9801
9802
9803
9804
9805
9806
9807
9808
9809
9810
9811
9812
9813
9814
9815
9816
9817
9818
9819
9820
9821
9822
9823
9824
9825
9826
9827
9828
9829
9830
9831
9832
9833
9834
9835
9836
9837
9838
9839
9840
9841
9842
9843
9844
9845
9846
9847
9848
9849
9850
9851
9852
9853
9854
9855
9856
9857
9858
9859
9860
9861
9862
9863
9864
9865
9866
9867
9868
9869
9870
9871
9872
9873
9874
9875
9876
9877
9878
9879
9880
9881
9882
9883
9884
9885
9886
9887
9888
9889
9890
9891
9892
9893
9894
9895
9896
9897
9898
9899
9900
9901
9902
9903
9904
9905
9906
9907
9908
9909
9910
9911
9912
9913
9914
9915
9916
9917
9918
9919
9920
9921
9922
9923
9924
9925
9926
9927
9928
9929
9930
9931
9932
9933
9934
9935
9936
9937
9938
9939
9940
9941
9942
9943
9944
9945
9946
9947
9948
9949
9950
9951
9952
9953
9954
9955
9956
9957
9958
9959
9960
9961
9962
9963
9964
9965
9966
9967
9968
9969
9970
9971
9972
9973
9974
9975
9976
9977
9978
9979
9980
9981
9982
9983
9984
9985
9986
9987
9988
9989
9990
9991
9992
9993
9994
9995
9996
9997
9998
9999
10000
10001
10002
10003
10004
10005
10006
10007
10008
10009
10010
10011
10012
10013
10014
10015
10016
10017
10018
10019
10020
10021
10022
10023
10024
10025
10026
10027
10028
10029
10030
10031
10032
10033
10034
10035
10036
10037
10038
10039
10040
10041
10042
10043
10044
10045
10046
10047
10048
10049
10050
10051
10052
10053
10054
10055
10056
10057
10058
10059
10060
10061
10062
10063
10064
10065
10066
10067
10068
10069
10070
10071
10072
10073
10074
10075
10076
10077
10078
10079
10080
10081
10082
10083
10084
10085
10086
10087
10088
10089
10090
10091
10092
10093
10094
10095
10096
10097
10098
10099
10100
10101
10102
10103
10104
10105
10106
10107
10108
10109
10110
10111
10112
10113
10114
10115
10116
10117
10118
10119
10120
10121
10122
10123
10124
10125
10126
10127
10128
10129
10130
10131
10132
10133
10134
10135
10136
10137
10138
10139
10140
10141
10142
10143
10144
10145
10146
10147
10148
10149
10150
10151
10152
10153
10154
10155
10156
10157
10158
10159
10160
10161
10162
10163
10164
10165
10166
10167
10168
10169
10170
10171
10172
10173
10174
10175
10176
10177
10178
10179
10180
10181
10182
10183
10184
10185
10186
10187
10188
10189
10190
10191
10192
10193
10194
10195
10196
10197
10198
10199
10200
10201
10202
10203
10204
10205
10206
10207
10208
10209
10210
10211
10212
10213
10214
10215
10216
10217
10218
10219
10220
10221
10222
10223
10224
10225
10226
10227
10228
10229
10230
10231
10232
10233
10234
10235
10236
10237
10238
10239
10240
10241
10242
10243
10244
10245
10246
10247
10248
10249
10250
10251
10252
10253
10254
10255
10256
10257
10258
10259
10260
10261
10262
10263
10264
10265
10266
10267
10268
10269
10270
10271
10272
10273
10274
10275
10276
10277
10278
10279
10280
10281
10282
10283
10284
10285
10286
10287
10288
10289
10290
10291
10292
10293
10294
10295
10296
10297
10298
10299
10300
10301
10302
10303
10304
10305
10306
10307
10308
10309
10310
10311
10312
10313
10314
10315
10316
10317
10318
10319
10320
10321
10322
10323
10324
10325
10326
10327
10328
10329
10330
10331
10332
10333
10334
10335
10336
10337
10338
10339
10340
10341
10342
10343
10344
10345
10346
10347
10348
10349
10350
10351
10352
10353
10354
10355
10356
10357
10358
10359
10360
10361
10362
10363
10364
10365
10366
10367
10368
10369
10370
10371
10372
10373
10374
10375
10376
10377
10378
10379
10380
10381
10382
10383
10384
10385
10386
10387
10388
10389
10390
10391
10392
10393
10394
10395
10396
10397
10398
10399
10400
10401
10402
10403
10404
10405
10406
10407
10408
10409
10410
10411
10412
10413
10414
10415
10416
10417
10418
10419
10420
10421
10422
10423
10424
10425
10426
10427
10428
10429
10430
10431
10432
10433
10434
10435
10436
10437
10438
10439
10440
10441
10442
10443
10444
10445
10446
10447
10448
10449
10450
10451
10452
10453
10454
10455
10456
10457
10458
10459
10460
10461
10462
10463
10464
10465
10466
10467
10468
10469
10470
10471
10472
10473
10474
10475
10476
10477
10478
10479
10480
10481
10482
10483
10484
10485
10486
10487
10488
10489
10490
10491
10492
10493
10494
10495
10496
10497
10498
10499
10500
10501
10502
10503
10504
10505
10506
10507
10508
10509
10510
10511
10512
10513
10514
10515
10516
10517
10518
10519
10520
10521
10522
10523
10524
10525
10526
10527
10528
10529
10530
10531
10532
10533
10534
10535
10536
10537
10538
10539
10540
10541
10542
10543
10544
10545
10546
10547
10548
10549
10550
10551
10552
10553
10554
10555
10556
10557
10558
10559
10560
10561
10562
10563
10564
10565
10566
10567
10568
10569
10570
10571
10572
10573
10574
10575
10576
10577
10578
10579
10580
10581
10582
10583
10584
10585
10586
10587
10588
10589
10590
10591
10592
10593
10594
10595
10596
10597
10598
10599
10600
10601
10602
10603
10604
10605
10606
10607
10608
10609
10610
10611
10612
10613
10614
10615
10616
10617
10618
10619
10620
10621
10622
10623
10624
10625
10626
10627
10628
10629
10630
10631
10632
10633
10634
10635
10636
10637
10638
10639
10640
10641
10642
10643
10644
10645
10646
10647
10648
10649
10650
10651
10652
10653
10654
10655
10656
10657
10658
10659
10660
10661
10662
10663
10664
10665
10666
10667
10668
10669
10670
10671
10672
10673
10674
10675
10676
10677
10678
10679
10680
10681
10682
10683
10684
10685
10686
10687
10688
10689
10690
10691
10692
10693
10694
10695
10696
10697
10698
10699
10700
10701
10702
10703
10704
10705
10706
10707
10708
10709
10710
10711
10712
10713
10714
10715
10716
10717
10718
10719
10720
10721
10722
10723
10724
10725
10726
10727
10728
10729
10730
10731
10732
10733
10734
10735
10736
10737
10738
10739
10740
10741
10742
10743
10744
10745
10746
10747
10748
10749
10750
10751
10752
10753
10754
10755
10756
10757
10758
10759
10760
10761
10762
10763
10764
10765
10766
10767
10768
10769
10770
10771
10772
10773
10774
10775
10776
10777
10778
10779
10780
10781
10782
10783
10784
10785
10786
10787
10788
10789
10790
10791
10792
10793
10794
10795
10796
10797
10798
10799
10800
10801
10802
10803
10804
10805
10806
10807
10808
10809
10810
10811
10812
10813
10814
10815
10816
10817
10818
10819
10820
10821
10822
10823
10824
10825
10826
10827
10828
10829
10830
10831
10832
10833
10834
10835
10836
10837
10838
10839
10840
10841
10842
10843
10844
10845
10846
10847
10848
10849
10850
10851
10852
10853
10854
10855
10856
10857
10858
10859
10860
10861
10862
10863
10864
10865
10866
10867
10868
10869
10870
10871
10872
10873
10874
10875
10876
10877
10878
10879
10880
10881
10882
10883
10884
10885
10886
10887
10888
10889
10890
10891
10892
10893
10894
10895
10896
10897
10898
10899
10900
10901
10902
10903
10904
10905
10906
10907
10908
10909
10910
10911
10912
10913
10914
10915
10916
10917
10918
10919
10920
10921
10922
10923
10924
10925
10926
10927
10928
10929
10930
10931
10932
10933
10934
10935
10936
10937
10938
10939
10940
10941
10942
10943
10944
10945
10946
10947
10948
10949
10950
10951
10952
10953
10954
10955
10956
10957
10958
10959
10960
10961
10962
10963
10964
10965
10966
10967
10968
10969
10970
10971
10972
10973
10974
10975
10976
10977
10978
10979
10980
10981
10982
10983
10984
10985
10986
10987
10988
10989
10990
10991
10992
10993
10994
10995
10996
10997
10998
10999
11000
11001
11002
11003
11004
11005
11006
11007
11008
11009
11010
11011
11012
11013
11014
11015
11016
11017
11018
11019
11020
11021
11022
11023
11024
11025
11026
11027
11028
11029
11030
11031
11032
11033
11034
11035
11036
11037
11038
11039
11040
11041
11042
11043
11044
11045
11046
11047
11048
11049
11050
11051
11052
11053
11054
11055
11056
11057
11058
11059
11060
11061
11062
11063
11064
11065
11066
11067
11068
11069
11070
11071
11072
11073
11074
11075
11076
11077
11078
11079
11080
11081
11082
11083
11084
11085
11086
11087
11088
11089
11090
11091
11092
11093
11094
11095
11096
11097
11098
11099
11100
11101
11102
11103
11104
11105
11106
11107
11108
11109
11110
11111
11112
11113
11114
11115
11116
11117
11118
11119
11120
11121
11122
11123
11124
11125
11126
11127
11128
11129
11130
11131
11132
11133
11134
11135
11136
11137
11138
11139
11140
11141
11142
11143
11144
11145
11146
11147
11148
11149
11150
11151
11152
11153
11154
11155
11156
11157
11158
11159
11160
11161
11162
11163
11164
11165
11166
11167
11168
11169
11170
11171
11172
11173
11174
11175
11176
11177
11178
11179
11180
11181
11182
11183
11184
11185
11186
11187
11188
11189
11190
11191
11192
11193
11194
11195
11196
11197
11198
11199
11200
11201
11202
11203
11204
11205
11206
11207
11208
11209
11210
11211
11212
11213
11214
11215
11216
11217
11218
11219
11220
11221
11222
11223
11224
11225
11226
11227
11228
11229
11230
11231
11232
11233
11234
11235
11236
11237
11238
11239
11240
11241
11242
11243
11244
11245
11246
11247
11248
11249
11250
11251
11252
11253
11254
11255
11256
11257
11258
11259
11260
11261
11262
11263
11264
11265
11266
11267
11268
11269
11270
11271
11272
11273
11274
11275
11276
11277
11278
11279
11280
11281
11282
11283
11284
11285
11286
11287
11288
11289
11290
11291
11292
11293
11294
11295
11296
11297
11298
11299
11300
11301
11302
11303
11304
11305
11306
11307
11308
11309
11310
11311
11312
11313
11314
11315
11316
11317
11318
11319
11320
11321
11322
11323
11324
11325
11326
11327
11328
11329
11330
11331
11332
11333
11334
11335
11336
11337
11338
11339
11340
11341
11342
11343
11344
11345
11346
11347
11348
11349
11350
11351
11352
11353
11354
11355
11356
11357
11358
11359
11360
11361
11362
11363
11364
11365
11366
11367
11368
11369
11370
11371
11372
11373
11374
11375
11376
11377
11378
11379
11380
11381
11382
11383
11384
11385
11386
11387
11388
11389
11390
11391
11392
11393
11394
11395
11396
11397
11398
11399
11400
11401
11402
11403
11404
11405
11406
11407
11408
11409
11410
11411
11412
11413
11414
11415
11416
11417
11418
11419
11420
11421
11422
11423
11424
11425
11426
11427
11428
11429
11430
11431
11432
11433
11434
11435
11436
11437
11438
11439
11440
11441
11442
11443
11444
11445
11446
11447
11448
11449
11450
11451
11452
11453
11454
11455
11456
11457
11458
11459
11460
11461
11462
11463
11464
11465
11466
11467
11468
11469
11470
11471
11472
11473
11474
11475
11476
11477
11478
11479
11480
11481
11482
11483
11484
11485
11486
11487
11488
11489
11490
11491
11492
11493
11494
11495
11496
11497
11498
11499
11500
11501
11502
11503
11504
11505
11506
11507
11508
11509
11510
11511
11512
11513
11514
11515
11516
11517
11518
11519
11520
11521
11522
11523
11524
11525
11526
11527
11528
11529
11530
11531
11532
11533
11534
11535
11536
11537
11538
11539
11540
11541
11542
11543
11544
11545
11546
11547
11548
11549
11550
11551
11552
11553
11554
11555
11556
11557
11558
11559
11560
11561
11562
11563
11564
11565
11566
11567
11568
11569
11570
11571
11572
11573
11574
11575
11576
11577
11578
11579
11580
11581
11582
11583
11584
11585
11586
11587
11588
11589
11590
11591
11592
11593
11594
11595
11596
11597
11598
11599
11600
11601
11602
11603
11604
11605
11606
11607
11608
11609
11610
11611
11612
11613
11614
11615
11616
11617
11618
11619
11620
11621
11622
11623
11624
11625
11626
11627
11628
11629
11630
11631
11632
11633
11634
11635
11636
11637
11638
11639
11640
11641
11642
11643
11644
11645
11646
11647
11648
11649
11650
11651
11652
11653
11654
11655
11656
11657
11658
11659
11660
11661
11662
11663
11664
11665
11666
11667
11668
11669
11670
11671
11672
11673
11674
11675
11676
11677
11678
11679
11680
11681
11682
11683
11684
11685
11686
11687
11688
11689
11690
11691
11692
11693
11694
11695
11696
11697
11698
11699
11700
11701
11702
11703
11704
11705
11706
11707
11708
11709
11710
11711
11712
11713
11714
11715
11716
11717
11718
11719
11720
11721
11722
11723
11724
11725
11726
11727
11728
11729
11730
11731
11732
11733
11734
11735
11736
11737
11738
11739
11740
11741
11742
11743
11744
11745
11746
11747
11748
11749
11750
11751
11752
11753
11754
11755
11756
11757
11758
11759
11760
11761
11762
11763
11764
11765
11766
11767
11768
11769
11770
11771
11772
11773
11774
11775
11776
11777
11778
11779
11780
11781
11782
11783
11784
11785
11786
11787
11788
11789
11790
11791
11792
11793
11794
11795
11796
11797
11798
11799
11800
11801
11802
11803
11804
11805
11806
11807
11808
11809
11810
11811
11812
11813
11814
11815
11816
11817
11818
11819
11820
11821
11822
11823
11824
11825
11826
11827
11828
11829
11830
11831
11832
11833
11834
11835
11836
11837
11838
11839
11840
11841
11842
11843
11844
11845
11846
11847
11848
11849
11850
11851
11852
11853
11854
11855
11856
11857
11858
11859
11860
11861
11862
11863
11864
11865
11866
11867
11868
11869
11870
11871
11872
11873
11874
11875
11876
11877
11878
11879
11880
11881
11882
11883
11884
11885
11886
11887
11888
11889
11890
11891
11892
11893
11894
11895
11896
11897
11898
11899
11900
11901
11902
11903
11904
11905
11906
11907
11908
11909
11910
11911
11912
11913
11914
11915
11916
11917
11918
11919
11920
11921
11922
11923
11924
11925
11926
11927
11928
11929
11930
11931
11932
11933
11934
11935
11936
11937
11938
11939
11940
11941
11942
11943
11944
11945
11946
11947
11948
11949
11950
11951
11952
11953
11954
11955
11956
11957
11958
11959
11960
11961
11962
11963
11964
11965
11966
11967
11968
11969
11970
11971
11972
11973
11974
11975
11976
11977
11978
11979
11980
11981
11982
11983
11984
11985
11986
11987
11988
11989
11990
11991
11992
11993
11994
11995
11996
11997
11998
11999
12000
12001
12002
12003
12004
12005
12006
12007
12008
12009
12010
12011
12012
12013
12014
12015
12016
12017
12018
12019
12020
12021
12022
12023
12024
12025
12026
12027
12028
12029
12030
12031
12032
12033
12034
12035
12036
12037
12038
12039
12040
12041
12042
12043
12044
12045
12046
12047
12048
12049
12050
12051
12052
12053
12054
12055
12056
12057
12058
12059
12060
12061
12062
12063
12064
12065
12066
12067
12068
12069
12070
12071
12072
12073
12074
12075
12076
12077
12078
12079
12080
12081
12082
12083
12084
12085
12086
12087
12088
12089
12090
12091
12092
12093
12094
12095
12096
12097
12098
12099
12100
12101
12102
12103
12104
12105
12106
12107
12108
12109
12110
12111
12112
12113
12114
12115
12116
12117
12118
12119
12120
12121
12122
12123
12124
12125
12126
12127
12128
12129
12130
12131
12132
12133
12134
12135
12136
12137
12138
12139
12140
12141
12142
12143
12144
12145
12146
12147
12148
12149
12150
12151
12152
12153
12154
12155
12156
12157
12158
12159
12160
12161
12162
12163
12164
12165
12166
12167
12168
12169
12170
12171
12172
12173
12174
12175
12176
12177
12178
12179
12180
12181
12182
12183
12184
12185
12186
12187
12188
12189
12190
12191
12192
12193
12194
12195
12196
12197
12198
12199
12200
12201
12202
12203
12204
12205
12206
12207
12208
12209
12210
12211
12212
12213
12214
12215
12216
12217
12218
12219
12220
12221
12222
12223
12224
12225
12226
12227
12228
12229
12230
12231
12232
12233
12234
12235
12236
12237
12238
12239
12240
12241
12242
12243
12244
12245
12246
12247
12248
12249
12250
12251
12252
12253
12254
12255
12256
12257
12258
12259
12260
12261
12262
12263
12264
12265
12266
12267
12268
12269
12270
12271
12272
12273
12274
12275
12276
12277
12278
12279
12280
12281
12282
12283
12284
12285
12286
12287
12288
12289
12290
12291
12292
12293
12294
12295
12296
12297
12298
12299
12300
12301
12302
12303
12304
12305
12306
12307
12308
12309
12310
12311
12312
12313
12314
12315
12316
12317
12318
12319
12320
12321
12322
12323
12324
12325
12326
12327
12328
12329
12330
12331
12332
12333
12334
12335
12336
12337
12338
12339
12340
12341
12342
12343
12344
12345
12346
12347
12348
12349
12350
12351
12352
12353
12354
12355
12356
12357
12358
12359
12360
12361
12362
12363
12364
12365
12366
12367
12368
12369
12370
12371
12372
12373
12374
12375
12376
12377
12378
12379
12380
12381
12382
12383
12384
12385
12386
12387
12388
12389
12390
12391
12392
12393
12394
12395
12396
12397
12398
12399
12400
12401
12402
12403
12404
12405
12406
12407
12408
12409
12410
12411
12412
12413
12414
12415
12416
12417
12418
12419
12420
12421
12422
12423
12424
12425
12426
12427
12428
12429
12430
12431
12432
12433
12434
12435
12436
12437
12438
12439
12440
12441
12442
12443
12444
12445
12446
12447
12448
12449
12450
12451
12452
12453
12454
12455
12456
12457
12458
12459
12460
12461
12462
12463
12464
12465
12466
12467
12468
12469
12470
12471
12472
12473
12474
12475
12476
12477
12478
12479
12480
12481
12482
12483
12484
12485
12486
12487
12488
12489
12490
12491
12492
12493
12494
12495
12496
12497
12498
12499
12500
12501
12502
12503
12504
12505
12506
12507
12508
12509
12510
12511
12512
12513
12514
12515
12516
12517
12518
12519
12520
12521
12522
12523
12524
12525
12526
12527
12528
12529
12530
12531
12532
12533
12534
12535
12536
12537
12538
12539
12540
12541
12542
12543
12544
12545
12546
12547
12548
12549
12550
12551
12552
12553
12554
12555
12556
12557
12558
12559
12560
12561
12562
12563
12564
12565
12566
12567
12568
12569
12570
12571
12572
12573
12574
12575
12576
12577
12578
12579
12580
12581
12582
12583
12584
12585
12586
12587
12588
12589
12590
12591
12592
12593
12594
12595
12596
12597
12598
12599
12600
12601
12602
12603
12604
12605
12606
12607
12608
12609
12610
12611
12612
12613
12614
12615
12616
12617
12618
12619
12620
12621
12622
12623
12624
12625
12626
12627
12628
12629
12630
12631
12632
12633
12634
12635
12636
12637
12638
12639
12640
12641
12642
12643
12644
12645
12646
12647
12648
12649
12650
12651
12652
12653
12654
12655
12656
12657
12658
12659
12660
12661
12662
12663
12664
12665
12666
12667
12668
12669
12670
12671
12672
12673
12674
12675
12676
12677
12678
12679
12680
12681
12682
12683
12684
12685
12686
12687
12688
12689
12690
12691
12692
12693
12694
12695
12696
12697
12698
12699
12700
12701
12702
12703
12704
12705
12706
12707
12708
12709
12710
12711
12712
12713
12714
12715
12716
12717
12718
12719
12720
12721
12722
12723
12724
12725
12726
12727
12728
12729
12730
12731
12732
12733
12734
12735
12736
12737
12738
12739
12740
12741
12742
12743
12744
12745
12746
12747
12748
12749
12750
12751
12752
12753
12754
12755
12756
12757
12758
12759
12760
12761
12762
12763
12764
12765
12766
12767
12768
12769
12770
12771
12772
12773
12774
12775
12776
12777
12778
12779
12780
12781
12782
12783
12784
12785
12786
12787
12788
12789
12790
12791
12792
12793
12794
12795
12796
12797
12798
12799
12800
12801
12802
12803
12804
12805
12806
12807
12808
12809
12810
12811
12812
12813
12814
12815
12816
12817
12818
12819
12820
12821
12822
12823
12824
12825
12826
12827
12828
12829
12830
12831
12832
12833
12834
12835
12836
12837
12838
12839
12840
12841
12842
12843
12844
12845
12846
12847
12848
12849
12850
12851
12852
12853
12854
12855
12856
12857
12858
12859
12860
12861
12862
12863
12864
12865
12866
12867
12868
12869
12870
12871
12872
12873
12874
12875
12876
12877
12878
12879
12880
12881
12882
12883
12884
12885
12886
12887
12888
12889
12890
12891
12892
12893
12894
12895
12896
12897
12898
12899
12900
12901
12902
12903
12904
12905
12906
12907
12908
12909
12910
12911
12912
12913
12914
12915
12916
12917
12918
12919
12920
12921
12922
12923
12924
12925
12926
12927
12928
12929
12930
12931
12932
12933
12934
12935
12936
12937
12938
12939
12940
12941
12942
12943
12944
12945
12946
12947
12948
12949
12950
12951
12952
12953
12954
12955
12956
12957
12958
12959
12960
12961
12962
12963
12964
12965
12966
12967
12968
12969
12970
12971
12972
12973
12974
12975
12976
12977
12978
12979
12980
12981
12982
12983
12984
12985
12986
12987
12988
12989
12990
12991
12992
12993
12994
12995
12996
12997
12998
12999
13000
13001
13002
13003
13004
13005
13006
13007
13008
13009
13010
13011
13012
13013
13014
13015
13016
13017
13018
13019
13020
13021
13022
13023
13024
13025
13026
13027
13028
13029
13030
13031
13032
13033
13034
13035
13036
13037
13038
13039
13040
13041
13042
13043
13044
13045
13046
13047
13048
13049
13050
13051
13052
13053
13054
13055
13056
13057
13058
13059
13060
13061
13062
13063
13064
13065
13066
13067
13068
13069
13070
13071
13072
13073
13074
13075
13076
13077
13078
13079
13080
13081
13082
13083
13084
13085
13086
13087
13088
13089
13090
13091
13092
13093
13094
13095
13096
13097
13098
13099
13100
13101
13102
13103
13104
13105
13106
13107
13108
13109
13110
13111
13112
13113
13114
13115
13116
13117
13118
13119
13120
13121
13122
13123
13124
13125
13126
13127
13128
13129
13130
13131
13132
13133
13134
13135
13136
13137
13138
13139
13140
13141
13142
13143
13144
13145
13146
13147
13148
13149
13150
13151
13152
13153
13154
13155
13156
13157
13158
13159
13160
13161
13162
13163
13164
13165
13166
13167
13168
13169
13170
13171
13172
13173
13174
13175
13176
13177
13178
13179
13180
13181
13182
13183
13184
13185
13186
13187
13188
13189
13190
13191
13192
13193
13194
13195
13196
13197
13198
13199
13200
13201
13202
13203
13204
13205
13206
13207
13208
13209
13210
13211
13212
13213
13214
13215
13216
13217
13218
13219
13220
13221
13222
13223
13224
13225
13226
13227
13228
13229
13230
13231
13232
13233
13234
13235
13236
13237
13238
13239
13240
13241
13242
13243
13244
13245
13246
13247
13248
13249
13250
13251
13252
13253
13254
13255
13256
13257
13258
13259
13260
13261
13262
#![allow(async_fn_in_trait)]
#[allow(clippy::module_inception)]
pub mod fullscreen_shell_unstable_v1 {
    #[doc = ""]
    #[doc = "Displays a single surface per output."]
    #[doc = ""]
    #[doc = "This interface provides a mechanism for a single client to display"]
    #[doc = "simple full-screen surfaces.  While there technically may be multiple"]
    #[doc = "clients bound to this interface, only one of those clients should be"]
    #[doc = "shown at a time."]
    #[doc = ""]
    #[doc = "To present a surface, the client uses either the present_surface or"]
    #[doc = "present_surface_for_mode requests.  Presenting a surface takes effect"]
    #[doc = "on the next wl_surface.commit.  See the individual requests for"]
    #[doc = "details about scaling and mode switches."]
    #[doc = ""]
    #[doc = "The client can have at most one surface per output at any time."]
    #[doc = "Requesting a surface to be presented on an output that already has a"]
    #[doc = "surface replaces the previously presented surface.  Presenting a null"]
    #[doc = "surface removes its content and effectively disables the output."]
    #[doc = "Exactly what happens when an output is \"disabled\" is"]
    #[doc = "compositor-specific.  The same surface may be presented on multiple"]
    #[doc = "outputs simultaneously."]
    #[doc = ""]
    #[doc = "Once a surface is presented on an output, it stays on that output"]
    #[doc = "until either the client removes it or the compositor destroys the"]
    #[doc = "output.  This way, the client can update the output's contents by"]
    #[doc = "simply attaching a new buffer."]
    #[doc = ""]
    #[doc = "Warning! The protocol described in this file is experimental and"]
    #[doc = "backward incompatible changes may be made. Backward compatible changes"]
    #[doc = "may be added together with the corresponding interface version bump."]
    #[doc = "Backward incompatible changes are done by bumping the version number in"]
    #[doc = "the protocol and interface names and resetting the interface version."]
    #[doc = "Once the protocol is to be declared stable, the 'z' prefix and the"]
    #[doc = "version number in the protocol and interface names are removed and the"]
    #[doc = "interface version number is reset."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zwp_fullscreen_shell_v1 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[doc = ""]
        #[doc = "Various capabilities that can be advertised by the compositor.  They"]
        #[doc = "are advertised one-at-a-time when the wl_fullscreen_shell interface is"]
        #[doc = "bound.  See the wl_fullscreen_shell.capability event for more details."]
        #[doc = ""]
        #[doc = "ARBITRARY_MODES:"]
        #[doc = "This is a hint to the client that indicates that the compositor is"]
        #[doc = "capable of setting practically any mode on its outputs.  If this"]
        #[doc = "capability is provided, wl_fullscreen_shell.present_surface_for_mode"]
        #[doc = "will almost never fail and clients should feel free to set whatever"]
        #[doc = "mode they like.  If the compositor does not advertise this, it may"]
        #[doc = "still support some modes that are not advertised through wl_global.mode"]
        #[doc = "but it is less likely."]
        #[doc = ""]
        #[doc = "CURSOR_PLANE:"]
        #[doc = "This is a hint to the client that indicates that the compositor can"]
        #[doc = "handle a cursor surface from the client without actually compositing."]
        #[doc = "This may be because of a hardware cursor plane or some other mechanism."]
        #[doc = "If the compositor does not advertise this capability then setting"]
        #[doc = "wl_pointer.cursor may degrade performance or be ignored entirely.  If"]
        #[doc = "CURSOR_PLANE is not advertised, it is recommended that the client draw"]
        #[doc = "its own cursor and set wl_pointer.cursor(NULL)."]
        #[doc = ""]
        #[repr(u32)]
        #[non_exhaustive]
        #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)]
        pub enum Capability {
            #[doc = "compositor is capable of almost any output mode"]
            ArbitraryModes = 1u32,
            #[doc = "compositor has a separate cursor plane"]
            CursorPlane = 2u32,
        }
        impl TryFrom<u32> for Capability {
            type Error = crate::wire::DecodeError;
            fn try_from(v: u32) -> Result<Self, Self::Error> {
                match v {
                    1u32 => Ok(Self::ArbitraryModes),
                    2u32 => Ok(Self::CursorPlane),
                    _ => Err(crate::wire::DecodeError::MalformedPayload),
                }
            }
        }
        impl std::fmt::Display for Capability {
            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
                (*self as u32).fmt(f)
            }
        }
        #[doc = ""]
        #[doc = "Hints to indicate to the compositor how to deal with a conflict"]
        #[doc = "between the dimensions of the surface and the dimensions of the"]
        #[doc = "output. The compositor is free to ignore this parameter."]
        #[doc = ""]
        #[repr(u32)]
        #[non_exhaustive]
        #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)]
        pub enum PresentMethod {
            #[doc = "no preference, apply default policy"]
            Default = 0u32,
            #[doc = "center the surface on the output"]
            Center = 1u32,
            #[doc = "scale the surface, preserving aspect ratio, to the largest size that will fit on the output"]
            Zoom = 2u32,
            #[doc = "scale the surface, preserving aspect ratio, to fully fill the output cropping if needed"]
            ZoomCrop = 3u32,
            #[doc = "scale the surface to the size of the output ignoring aspect ratio"]
            Stretch = 4u32,
        }
        impl TryFrom<u32> for PresentMethod {
            type Error = crate::wire::DecodeError;
            fn try_from(v: u32) -> Result<Self, Self::Error> {
                match v {
                    0u32 => Ok(Self::Default),
                    1u32 => Ok(Self::Center),
                    2u32 => Ok(Self::Zoom),
                    3u32 => Ok(Self::ZoomCrop),
                    4u32 => Ok(Self::Stretch),
                    _ => Err(crate::wire::DecodeError::MalformedPayload),
                }
            }
        }
        impl std::fmt::Display for PresentMethod {
            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
                (*self as u32).fmt(f)
            }
        }
        #[doc = ""]
        #[doc = "These errors can be emitted in response to wl_fullscreen_shell requests."]
        #[doc = ""]
        #[repr(u32)]
        #[non_exhaustive]
        #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)]
        pub enum Error {
            #[doc = "present_method is not known"]
            InvalidMethod = 0u32,
            #[doc = "given wl_surface has another role"]
            Role = 1u32,
        }
        impl TryFrom<u32> for Error {
            type Error = crate::wire::DecodeError;
            fn try_from(v: u32) -> Result<Self, Self::Error> {
                match v {
                    0u32 => Ok(Self::InvalidMethod),
                    1u32 => Ok(Self::Role),
                    _ => Err(crate::wire::DecodeError::MalformedPayload),
                }
            }
        }
        impl std::fmt::Display for Error {
            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
                (*self as u32).fmt(f)
            }
        }
        #[doc = "Trait to implement the zwp_fullscreen_shell_v1 interface. See the module level documentation for more info"]
        pub trait ZwpFullscreenShellV1 {
            const INTERFACE: &'static str = "zwp_fullscreen_shell_v1";
            const VERSION: u32 = 1u32;
            async fn handle_event(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    0u16 => {
                        let capability = message.uint()?;
                        tracing::debug!(
                            "zwp_fullscreen_shell_v1#{}.capability({})",
                            sender_id,
                            capability
                        );
                        self.capability(client, sender_id, capability.try_into()?)
                            .await
                    }
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "Release the binding from the wl_fullscreen_shell interface."]
            #[doc = ""]
            #[doc = "This destroys the server-side object and frees this binding.  If"]
            #[doc = "the client binds to wl_fullscreen_shell multiple times, it may wish"]
            #[doc = "to free some of those bindings."]
            #[doc = ""]
            async fn release(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_fullscreen_shell_v1#{}.release()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Present a surface on the given output."]
            #[doc = ""]
            #[doc = "If the output is null, the compositor will present the surface on"]
            #[doc = "whatever display (or displays) it thinks best.  In particular, this"]
            #[doc = "may replace any or all surfaces currently presented so it should"]
            #[doc = "not be used in combination with placing surfaces on specific"]
            #[doc = "outputs."]
            #[doc = ""]
            #[doc = "The method parameter is a hint to the compositor for how the surface"]
            #[doc = "is to be presented.  In particular, it tells the compositor how to"]
            #[doc = "handle a size mismatch between the presented surface and the"]
            #[doc = "output.  The compositor is free to ignore this parameter."]
            #[doc = ""]
            #[doc = "The \"zoom\", \"zoom_crop\", and \"stretch\" methods imply a scaling"]
            #[doc = "operation on the surface.  This will override any kind of output"]
            #[doc = "scaling, so the buffer_scale property of the surface is effectively"]
            #[doc = "ignored."]
            #[doc = ""]
            #[doc = "This request gives the surface the role of a fullscreen shell surface."]
            #[doc = "If the surface already has another role, it raises a role protocol"]
            #[doc = "error."]
            #[doc = ""]
            async fn present_surface(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                surface: Option<crate::wire::ObjectId>,
                method: PresentMethod,
                output: Option<crate::wire::ObjectId>,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_fullscreen_shell_v1#{}.present_surface()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_object(surface)
                    .put_uint(method as u32)
                    .put_object(output)
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 1u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Presents a surface on the given output for a particular mode."]
            #[doc = ""]
            #[doc = "If the current size of the output differs from that of the surface,"]
            #[doc = "the compositor will attempt to change the size of the output to"]
            #[doc = "match the surface.  The result of the mode-switch operation will be"]
            #[doc = "returned via the provided wl_fullscreen_shell_mode_feedback object."]
            #[doc = ""]
            #[doc = "If the current output mode matches the one requested or if the"]
            #[doc = "compositor successfully switches the mode to match the surface,"]
            #[doc = "then the mode_successful event will be sent and the output will"]
            #[doc = "contain the contents of the given surface.  If the compositor"]
            #[doc = "cannot match the output size to the surface size, the mode_failed"]
            #[doc = "will be sent and the output will contain the contents of the"]
            #[doc = "previously presented surface (if any).  If another surface is"]
            #[doc = "presented on the given output before either of these has a chance"]
            #[doc = "to happen, the present_cancelled event will be sent."]
            #[doc = ""]
            #[doc = "Due to race conditions and other issues unknown to the client, no"]
            #[doc = "mode-switch operation is guaranteed to succeed.  However, if the"]
            #[doc = "mode is one advertised by wl_output.mode or if the compositor"]
            #[doc = "advertises the ARBITRARY_MODES capability, then the client should"]
            #[doc = "expect that the mode-switch operation will usually succeed."]
            #[doc = ""]
            #[doc = "If the size of the presented surface changes, the resulting output"]
            #[doc = "is undefined.  The compositor may attempt to change the output mode"]
            #[doc = "to compensate.  However, there is no guarantee that a suitable mode"]
            #[doc = "will be found and the client has no way to be notified of success"]
            #[doc = "or failure."]
            #[doc = ""]
            #[doc = "The framerate parameter specifies the desired framerate for the"]
            #[doc = "output in mHz.  The compositor is free to ignore this parameter.  A"]
            #[doc = "value of 0 indicates that the client has no preference."]
            #[doc = ""]
            #[doc = "If the value of wl_output.scale differs from wl_surface.buffer_scale,"]
            #[doc = "then the compositor may choose a mode that matches either the buffer"]
            #[doc = "size or the surface size.  In either case, the surface will fill the"]
            #[doc = "output."]
            #[doc = ""]
            #[doc = "This request gives the surface the role of a fullscreen shell surface."]
            #[doc = "If the surface already has another role, it raises a role protocol"]
            #[doc = "error."]
            #[doc = ""]
            async fn present_surface_for_mode(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                surface: crate::wire::ObjectId,
                output: crate::wire::ObjectId,
                framerate: i32,
                feedback: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!(
                    "-> zwp_fullscreen_shell_v1#{}.present_surface_for_mode()",
                    sender_id
                );
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_object(Some(surface))
                    .put_object(Some(output))
                    .put_int(framerate)
                    .put_object(Some(feedback))
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 2u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Advertises a single capability of the compositor."]
            #[doc = ""]
            #[doc = "When the wl_fullscreen_shell interface is bound, this event is emitted"]
            #[doc = "once for each capability advertised.  Valid capabilities are given by"]
            #[doc = "the wl_fullscreen_shell.capability enum.  If clients want to take"]
            #[doc = "advantage of any of these capabilities, they should use a"]
            #[doc = "wl_display.sync request immediately after binding to ensure that they"]
            #[doc = "receive all the capability events."]
            #[doc = ""]
            async fn capability(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                capability: Capability,
            ) -> crate::client::Result<()>;
        }
    }
    #[allow(clippy::too_many_arguments)]
    pub mod zwp_fullscreen_shell_mode_feedback_v1 {
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[doc = "Trait to implement the zwp_fullscreen_shell_mode_feedback_v1 interface. See the module level documentation for more info"]
        pub trait ZwpFullscreenShellModeFeedbackV1 {
            const INTERFACE: &'static str = "zwp_fullscreen_shell_mode_feedback_v1";
            const VERSION: u32 = 1u32;
            async fn handle_event(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    0u16 => {
                        tracing::debug!(
                            "zwp_fullscreen_shell_mode_feedback_v1#{}.mode_successful()",
                            sender_id,
                        );
                        let result = self.mode_successful(client, sender_id).await;
                        client.remove(sender_id);
                        result
                    }
                    1u16 => {
                        tracing::debug!(
                            "zwp_fullscreen_shell_mode_feedback_v1#{}.mode_failed()",
                            sender_id,
                        );
                        let result = self.mode_failed(client, sender_id).await;
                        client.remove(sender_id);
                        result
                    }
                    2u16 => {
                        tracing::debug!(
                            "zwp_fullscreen_shell_mode_feedback_v1#{}.present_cancelled()",
                            sender_id,
                        );
                        let result = self.present_cancelled(client, sender_id).await;
                        client.remove(sender_id);
                        result
                    }
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "This event indicates that the attempted mode switch operation was"]
            #[doc = "successful.  A surface of the size requested in the mode switch"]
            #[doc = "will fill the output without scaling."]
            #[doc = ""]
            #[doc = "Upon receiving this event, the client should destroy the"]
            #[doc = "wl_fullscreen_shell_mode_feedback object."]
            #[doc = ""]
            async fn mode_successful(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "This event indicates that the attempted mode switch operation"]
            #[doc = "failed.  This may be because the requested output mode is not"]
            #[doc = "possible or it may mean that the compositor does not want to allow it."]
            #[doc = ""]
            #[doc = "Upon receiving this event, the client should destroy the"]
            #[doc = "wl_fullscreen_shell_mode_feedback object."]
            #[doc = ""]
            async fn mode_failed(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "This event indicates that the attempted mode switch operation was"]
            #[doc = "cancelled.  Most likely this is because the client requested a"]
            #[doc = "second mode switch before the first one completed."]
            #[doc = ""]
            #[doc = "Upon receiving this event, the client should destroy the"]
            #[doc = "wl_fullscreen_shell_mode_feedback object."]
            #[doc = ""]
            async fn present_cancelled(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()>;
        }
    }
}
#[allow(clippy::module_inception)]
pub mod idle_inhibit_unstable_v1 {
    #[doc = ""]
    #[doc = "This interface permits inhibiting the idle behavior such as screen"]
    #[doc = "blanking, locking, and screensaving.  The client binds the idle manager"]
    #[doc = "globally, then creates idle-inhibitor objects for each surface."]
    #[doc = ""]
    #[doc = "Warning! The protocol described in this file is experimental and"]
    #[doc = "backward incompatible changes may be made. Backward compatible changes"]
    #[doc = "may be added together with the corresponding interface version bump."]
    #[doc = "Backward incompatible changes are done by bumping the version number in"]
    #[doc = "the protocol and interface names and resetting the interface version."]
    #[doc = "Once the protocol is to be declared stable, the 'z' prefix and the"]
    #[doc = "version number in the protocol and interface names are removed and the"]
    #[doc = "interface version number is reset."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zwp_idle_inhibit_manager_v1 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[doc = "Trait to implement the zwp_idle_inhibit_manager_v1 interface. See the module level documentation for more info"]
        pub trait ZwpIdleInhibitManagerV1 {
            const INTERFACE: &'static str = "zwp_idle_inhibit_manager_v1";
            const VERSION: u32 = 1u32;
            async fn handle_event(
                &self,
                _client: &mut crate::server::Client,
                _sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "Destroy the inhibit manager."]
            #[doc = ""]
            async fn destroy(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_idle_inhibit_manager_v1#{}.destroy()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Create a new inhibitor object associated with the given surface."]
            #[doc = ""]
            async fn create_inhibitor(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                id: crate::wire::ObjectId,
                surface: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!(
                    "-> zwp_idle_inhibit_manager_v1#{}.create_inhibitor()",
                    sender_id
                );
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_object(Some(id))
                    .put_object(Some(surface))
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 1u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
        }
    }
    #[doc = ""]
    #[doc = "An idle inhibitor prevents the output that the associated surface is"]
    #[doc = "visible on from being set to a state where it is not visually usable due"]
    #[doc = "to lack of user interaction (e.g. blanked, dimmed, locked, set to power"]
    #[doc = "save, etc.)  Any screensaver processes are also blocked from displaying."]
    #[doc = ""]
    #[doc = "If the surface is destroyed, unmapped, becomes occluded, loses"]
    #[doc = "visibility, or otherwise becomes not visually relevant for the user, the"]
    #[doc = "idle inhibitor will not be honored by the compositor; if the surface"]
    #[doc = "subsequently regains visibility the inhibitor takes effect once again."]
    #[doc = "Likewise, the inhibitor isn't honored if the system was already idled at"]
    #[doc = "the time the inhibitor was established, although if the system later"]
    #[doc = "de-idles and re-idles the inhibitor will take effect."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zwp_idle_inhibitor_v1 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[doc = "Trait to implement the zwp_idle_inhibitor_v1 interface. See the module level documentation for more info"]
        pub trait ZwpIdleInhibitorV1 {
            const INTERFACE: &'static str = "zwp_idle_inhibitor_v1";
            const VERSION: u32 = 1u32;
            async fn handle_event(
                &self,
                _client: &mut crate::server::Client,
                _sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "Remove the inhibitor effect from the associated wl_surface."]
            #[doc = ""]
            async fn destroy(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_idle_inhibitor_v1#{}.destroy()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
        }
    }
}
#[allow(clippy::module_inception)]
pub mod input_method_unstable_v1 {
    #[doc = ""]
    #[doc = "Corresponds to a text input on the input method side. An input method context"]
    #[doc = "is created on text input activation on the input method side. It allows"]
    #[doc = "receiving information about the text input from the application via events."]
    #[doc = "Input method contexts do not keep state after deactivation and should be"]
    #[doc = "destroyed after deactivation is handled."]
    #[doc = ""]
    #[doc = "Text is generally UTF-8 encoded, indices and lengths are in bytes."]
    #[doc = ""]
    #[doc = "Serials are used to synchronize the state between the text input and"]
    #[doc = "an input method. New serials are sent by the text input in the"]
    #[doc = "commit_state request and are used by the input method to indicate"]
    #[doc = "the known text input state in events like preedit_string, commit_string,"]
    #[doc = "and keysym. The text input can then ignore events from the input method"]
    #[doc = "which are based on an outdated state (for example after a reset)."]
    #[doc = ""]
    #[doc = "Warning! The protocol described in this file is experimental and"]
    #[doc = "backward incompatible changes may be made. Backward compatible changes"]
    #[doc = "may be added together with the corresponding interface version bump."]
    #[doc = "Backward incompatible changes are done by bumping the version number in"]
    #[doc = "the protocol and interface names and resetting the interface version."]
    #[doc = "Once the protocol is to be declared stable, the 'z' prefix and the"]
    #[doc = "version number in the protocol and interface names are removed and the"]
    #[doc = "interface version number is reset."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zwp_input_method_context_v1 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[doc = "Trait to implement the zwp_input_method_context_v1 interface. See the module level documentation for more info"]
        pub trait ZwpInputMethodContextV1 {
            const INTERFACE: &'static str = "zwp_input_method_context_v1";
            const VERSION: u32 = 1u32;
            async fn handle_event(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    0u16 => {
                        let text = message
                            .string()?
                            .ok_or(crate::wire::DecodeError::MalformedPayload)?;
                        let cursor = message.uint()?;
                        let anchor = message.uint()?;
                        tracing::debug!(
                            "zwp_input_method_context_v1#{}.surrounding_text(\"{}\", {}, {})",
                            sender_id,
                            text,
                            cursor,
                            anchor
                        );
                        self.surrounding_text(client, sender_id, text, cursor, anchor)
                            .await
                    }
                    1u16 => {
                        tracing::debug!("zwp_input_method_context_v1#{}.reset()", sender_id,);
                        self.reset(client, sender_id).await
                    }
                    2u16 => {
                        let hint = message.uint()?;
                        let purpose = message.uint()?;
                        tracing::debug!(
                            "zwp_input_method_context_v1#{}.content_type({}, {})",
                            sender_id,
                            hint,
                            purpose
                        );
                        self.content_type(client, sender_id, hint, purpose).await
                    }
                    3u16 => {
                        let button = message.uint()?;
                        let index = message.uint()?;
                        tracing::debug!(
                            "zwp_input_method_context_v1#{}.invoke_action({}, {})",
                            sender_id,
                            button,
                            index
                        );
                        self.invoke_action(client, sender_id, button, index).await
                    }
                    4u16 => {
                        let serial = message.uint()?;
                        tracing::debug!(
                            "zwp_input_method_context_v1#{}.commit_state({})",
                            sender_id,
                            serial
                        );
                        self.commit_state(client, sender_id, serial).await
                    }
                    5u16 => {
                        let language = message
                            .string()?
                            .ok_or(crate::wire::DecodeError::MalformedPayload)?;
                        tracing::debug!(
                            "zwp_input_method_context_v1#{}.preferred_language(\"{}\")",
                            sender_id,
                            language
                        );
                        self.preferred_language(client, sender_id, language).await
                    }
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            async fn destroy(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_input_method_context_v1#{}.destroy()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Send the commit string text for insertion to the application."]
            #[doc = ""]
            #[doc = "The text to commit could be either just a single character after a key"]
            #[doc = "press or the result of some composing (pre-edit). It could be also an"]
            #[doc = "empty text when some text should be removed (see"]
            #[doc = "delete_surrounding_text) or when the input cursor should be moved (see"]
            #[doc = "cursor_position)."]
            #[doc = ""]
            #[doc = "Any previously set composing text will be removed."]
            #[doc = ""]
            async fn commit_string(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                serial: u32,
                text: String,
            ) -> crate::client::Result<()> {
                tracing::debug!(
                    "-> zwp_input_method_context_v1#{}.commit_string()",
                    sender_id
                );
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_uint(serial)
                    .put_string(Some(text))
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 1u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Send the pre-edit string text to the application text input."]
            #[doc = ""]
            #[doc = "The commit text can be used to replace the pre-edit text on reset (for"]
            #[doc = "example on unfocus)."]
            #[doc = ""]
            #[doc = "Previously sent preedit_style and preedit_cursor requests are also"]
            #[doc = "processed by the text_input."]
            #[doc = ""]
            async fn preedit_string(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                serial: u32,
                text: String,
                commit: String,
            ) -> crate::client::Result<()> {
                tracing::debug!(
                    "-> zwp_input_method_context_v1#{}.preedit_string()",
                    sender_id
                );
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_uint(serial)
                    .put_string(Some(text))
                    .put_string(Some(commit))
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 2u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Set the styling information on composing text. The style is applied for"]
            #[doc = "length in bytes from index relative to the beginning of"]
            #[doc = "the composing text (as byte offset). Multiple styles can"]
            #[doc = "be applied to a composing text."]
            #[doc = ""]
            #[doc = "This request should be sent before sending a preedit_string request."]
            #[doc = ""]
            async fn preedit_styling(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                index: u32,
                length: u32,
                style: u32,
            ) -> crate::client::Result<()> {
                tracing::debug!(
                    "-> zwp_input_method_context_v1#{}.preedit_styling()",
                    sender_id
                );
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_uint(index)
                    .put_uint(length)
                    .put_uint(style)
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 3u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Set the cursor position inside the composing text (as byte offset)"]
            #[doc = "relative to the start of the composing text."]
            #[doc = ""]
            #[doc = "When index is negative no cursor should be displayed."]
            #[doc = ""]
            #[doc = "This request should be sent before sending a preedit_string request."]
            #[doc = ""]
            async fn preedit_cursor(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                index: i32,
            ) -> crate::client::Result<()> {
                tracing::debug!(
                    "-> zwp_input_method_context_v1#{}.preedit_cursor()",
                    sender_id
                );
                let (payload, fds) = crate::wire::PayloadBuilder::new().put_int(index).build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 4u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Remove the surrounding text."]
            #[doc = ""]
            #[doc = "This request will be handled on the text_input side directly following"]
            #[doc = "a commit_string request."]
            #[doc = ""]
            async fn delete_surrounding_text(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                index: i32,
                length: u32,
            ) -> crate::client::Result<()> {
                tracing::debug!(
                    "-> zwp_input_method_context_v1#{}.delete_surrounding_text()",
                    sender_id
                );
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_int(index)
                    .put_uint(length)
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 5u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Set the cursor and anchor to a new position. Index is the new cursor"]
            #[doc = "position in bytes (when >= 0 this is relative to the end of the inserted text,"]
            #[doc = "otherwise it is relative to the beginning of the inserted text). Anchor is"]
            #[doc = "the new anchor position in bytes (when >= 0 this is relative to the end of the"]
            #[doc = "inserted text, otherwise it is relative to the beginning of the inserted"]
            #[doc = "text). When there should be no selected text, anchor should be the same"]
            #[doc = "as index."]
            #[doc = ""]
            #[doc = "This request will be handled on the text_input side directly following"]
            #[doc = "a commit_string request."]
            #[doc = ""]
            async fn cursor_position(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                index: i32,
                anchor: i32,
            ) -> crate::client::Result<()> {
                tracing::debug!(
                    "-> zwp_input_method_context_v1#{}.cursor_position()",
                    sender_id
                );
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_int(index)
                    .put_int(anchor)
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 6u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            async fn modifiers_map(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                map: Vec<u8>,
            ) -> crate::client::Result<()> {
                tracing::debug!(
                    "-> zwp_input_method_context_v1#{}.modifiers_map()",
                    sender_id
                );
                let (payload, fds) = crate::wire::PayloadBuilder::new().put_array(map).build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 7u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Notify when a key event was sent. Key events should not be used for"]
            #[doc = "normal text input operations, which should be done with commit_string,"]
            #[doc = "delete_surrounding_text, etc. The key event follows the wl_keyboard key"]
            #[doc = "event convention. Sym is an XKB keysym, state is a wl_keyboard key_state."]
            #[doc = ""]
            async fn keysym(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                serial: u32,
                time: u32,
                sym: u32,
                state: u32,
                modifiers: u32,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_input_method_context_v1#{}.keysym()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_uint(serial)
                    .put_uint(time)
                    .put_uint(sym)
                    .put_uint(state)
                    .put_uint(modifiers)
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 8u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Allow an input method to receive hardware keyboard input and process"]
            #[doc = "key events to generate text events (with pre-edit) over the wire. This"]
            #[doc = "allows input methods which compose multiple key events for inputting"]
            #[doc = "text like it is done for CJK languages."]
            #[doc = ""]
            async fn grab_keyboard(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                keyboard: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!(
                    "-> zwp_input_method_context_v1#{}.grab_keyboard()",
                    sender_id
                );
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_object(Some(keyboard))
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 9u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Forward a wl_keyboard::key event to the client that was not processed"]
            #[doc = "by the input method itself. Should be used when filtering key events"]
            #[doc = "with grab_keyboard.  The arguments should be the ones from the"]
            #[doc = "wl_keyboard::key event."]
            #[doc = ""]
            #[doc = "For generating custom key events use the keysym request instead."]
            #[doc = ""]
            async fn key(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                serial: u32,
                time: u32,
                key: u32,
                state: u32,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_input_method_context_v1#{}.key()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_uint(serial)
                    .put_uint(time)
                    .put_uint(key)
                    .put_uint(state)
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 10u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Forward a wl_keyboard::modifiers event to the client that was not"]
            #[doc = "processed by the input method itself.  Should be used when filtering"]
            #[doc = "key events with grab_keyboard. The arguments should be the ones"]
            #[doc = "from the wl_keyboard::modifiers event."]
            #[doc = ""]
            async fn modifiers(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                serial: u32,
                mods_depressed: u32,
                mods_latched: u32,
                mods_locked: u32,
                group: u32,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_input_method_context_v1#{}.modifiers()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_uint(serial)
                    .put_uint(mods_depressed)
                    .put_uint(mods_latched)
                    .put_uint(mods_locked)
                    .put_uint(group)
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 11u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            async fn language(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                serial: u32,
                language: String,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_input_method_context_v1#{}.language()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_uint(serial)
                    .put_string(Some(language))
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 12u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            async fn text_direction(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                serial: u32,
                direction: u32,
            ) -> crate::client::Result<()> {
                tracing::debug!(
                    "-> zwp_input_method_context_v1#{}.text_direction()",
                    sender_id
                );
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_uint(serial)
                    .put_uint(direction)
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 13u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "The plain surrounding text around the input position. Cursor is the"]
            #[doc = "position in bytes within the surrounding text relative to the beginning"]
            #[doc = "of the text. Anchor is the position in bytes of the selection anchor"]
            #[doc = "within the surrounding text relative to the beginning of the text. If"]
            #[doc = "there is no selected text then anchor is the same as cursor."]
            #[doc = ""]
            async fn surrounding_text(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                text: String,
                cursor: u32,
                anchor: u32,
            ) -> crate::client::Result<()>;
            async fn reset(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()>;
            async fn content_type(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                hint: u32,
                purpose: u32,
            ) -> crate::client::Result<()>;
            async fn invoke_action(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                button: u32,
                index: u32,
            ) -> crate::client::Result<()>;
            async fn commit_state(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                serial: u32,
            ) -> crate::client::Result<()>;
            async fn preferred_language(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                language: String,
            ) -> crate::client::Result<()>;
        }
    }
    #[doc = ""]
    #[doc = "An input method object is responsible for composing text in response to"]
    #[doc = "input from hardware or virtual keyboards. There is one input method"]
    #[doc = "object per seat. On activate there is a new input method context object"]
    #[doc = "created which allows the input method to communicate with the text input."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zwp_input_method_v1 {
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[doc = "Trait to implement the zwp_input_method_v1 interface. See the module level documentation for more info"]
        pub trait ZwpInputMethodV1 {
            const INTERFACE: &'static str = "zwp_input_method_v1";
            const VERSION: u32 = 1u32;
            async fn handle_event(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    0u16 => {
                        let id = message
                            .object()?
                            .ok_or(crate::wire::DecodeError::MalformedPayload)?;
                        tracing::debug!("zwp_input_method_v1#{}.activate({})", sender_id, id);
                        self.activate(client, sender_id, id).await
                    }
                    1u16 => {
                        let context = message
                            .object()?
                            .ok_or(crate::wire::DecodeError::MalformedPayload)?;
                        tracing::debug!(
                            "zwp_input_method_v1#{}.deactivate({})",
                            sender_id,
                            context
                        );
                        self.deactivate(client, sender_id, context).await
                    }
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "A text input was activated. Creates an input method context object"]
            #[doc = "which allows communication with the text input."]
            #[doc = ""]
            async fn activate(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                id: crate::wire::ObjectId,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "The text input corresponding to the context argument was deactivated."]
            #[doc = "The input method context should be destroyed after deactivation is"]
            #[doc = "handled."]
            #[doc = ""]
            async fn deactivate(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                context: crate::wire::ObjectId,
            ) -> crate::client::Result<()>;
        }
    }
    #[doc = ""]
    #[doc = "Only one client can bind this interface at a time."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zwp_input_panel_v1 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[doc = "Trait to implement the zwp_input_panel_v1 interface. See the module level documentation for more info"]
        pub trait ZwpInputPanelV1 {
            const INTERFACE: &'static str = "zwp_input_panel_v1";
            const VERSION: u32 = 1u32;
            async fn handle_event(
                &self,
                _client: &mut crate::server::Client,
                _sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            async fn get_input_panel_surface(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                id: crate::wire::ObjectId,
                surface: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!(
                    "-> zwp_input_panel_v1#{}.get_input_panel_surface()",
                    sender_id
                );
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_object(Some(id))
                    .put_object(Some(surface))
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
        }
    }
    #[allow(clippy::too_many_arguments)]
    pub mod zwp_input_panel_surface_v1 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[repr(u32)]
        #[non_exhaustive]
        #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)]
        pub enum Position {
            CenterBottom = 0u32,
        }
        impl TryFrom<u32> for Position {
            type Error = crate::wire::DecodeError;
            fn try_from(v: u32) -> Result<Self, Self::Error> {
                match v {
                    0u32 => Ok(Self::CenterBottom),
                    _ => Err(crate::wire::DecodeError::MalformedPayload),
                }
            }
        }
        impl std::fmt::Display for Position {
            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
                (*self as u32).fmt(f)
            }
        }
        #[doc = "Trait to implement the zwp_input_panel_surface_v1 interface. See the module level documentation for more info"]
        pub trait ZwpInputPanelSurfaceV1 {
            const INTERFACE: &'static str = "zwp_input_panel_surface_v1";
            const VERSION: u32 = 1u32;
            async fn handle_event(
                &self,
                _client: &mut crate::server::Client,
                _sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "Set the input_panel_surface type to keyboard."]
            #[doc = ""]
            #[doc = "A keyboard surface is only shown when a text input is active."]
            #[doc = ""]
            async fn set_toplevel(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                output: crate::wire::ObjectId,
                position: u32,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_input_panel_surface_v1#{}.set_toplevel()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_object(Some(output))
                    .put_uint(position)
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Set the input_panel_surface to be an overlay panel."]
            #[doc = ""]
            #[doc = "This is shown near the input cursor above the application window when"]
            #[doc = "a text input is active."]
            #[doc = ""]
            async fn set_overlay_panel(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!(
                    "-> zwp_input_panel_surface_v1#{}.set_overlay_panel()",
                    sender_id
                );
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 1u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
        }
    }
}
#[doc = ""]
#[doc = "This protocol specifies a way for a client to request and receive"]
#[doc = "high-resolution timestamps for input events."]
#[doc = ""]
#[doc = "Warning! The protocol described in this file is experimental and"]
#[doc = "backward incompatible changes may be made. Backward compatible changes"]
#[doc = "may be added together with the corresponding interface version bump."]
#[doc = "Backward incompatible changes are done by bumping the version number in"]
#[doc = "the protocol and interface names and resetting the interface version."]
#[doc = "Once the protocol is to be declared stable, the 'z' prefix and the"]
#[doc = "version number in the protocol and interface names are removed and the"]
#[doc = "interface version number is reset."]
#[doc = ""]
#[allow(clippy::module_inception)]
pub mod input_timestamps_unstable_v1 {
    #[doc = ""]
    #[doc = "A global interface used for requesting high-resolution timestamps"]
    #[doc = "for input events."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zwp_input_timestamps_manager_v1 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[doc = "Trait to implement the zwp_input_timestamps_manager_v1 interface. See the module level documentation for more info"]
        pub trait ZwpInputTimestampsManagerV1 {
            const INTERFACE: &'static str = "zwp_input_timestamps_manager_v1";
            const VERSION: u32 = 1u32;
            async fn handle_event(
                &self,
                _client: &mut crate::server::Client,
                _sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "Informs the server that the client will no longer be using this"]
            #[doc = "protocol object. Existing objects created by this object are not"]
            #[doc = "affected."]
            #[doc = ""]
            async fn destroy(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_input_timestamps_manager_v1#{}.destroy()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Creates a new input timestamps object that represents a subscription"]
            #[doc = "to high-resolution timestamp events for all wl_keyboard events that"]
            #[doc = "carry a timestamp."]
            #[doc = ""]
            #[doc = "If the associated wl_keyboard object is invalidated, either through"]
            #[doc = "client action (e.g. release) or server-side changes, the input"]
            #[doc = "timestamps object becomes inert and the client should destroy it"]
            #[doc = "by calling zwp_input_timestamps_v1.destroy."]
            #[doc = ""]
            async fn get_keyboard_timestamps(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                id: crate::wire::ObjectId,
                keyboard: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!(
                    "-> zwp_input_timestamps_manager_v1#{}.get_keyboard_timestamps()",
                    sender_id
                );
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_object(Some(id))
                    .put_object(Some(keyboard))
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 1u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Creates a new input timestamps object that represents a subscription"]
            #[doc = "to high-resolution timestamp events for all wl_pointer events that"]
            #[doc = "carry a timestamp."]
            #[doc = ""]
            #[doc = "If the associated wl_pointer object is invalidated, either through"]
            #[doc = "client action (e.g. release) or server-side changes, the input"]
            #[doc = "timestamps object becomes inert and the client should destroy it"]
            #[doc = "by calling zwp_input_timestamps_v1.destroy."]
            #[doc = ""]
            async fn get_pointer_timestamps(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                id: crate::wire::ObjectId,
                pointer: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!(
                    "-> zwp_input_timestamps_manager_v1#{}.get_pointer_timestamps()",
                    sender_id
                );
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_object(Some(id))
                    .put_object(Some(pointer))
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 2u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Creates a new input timestamps object that represents a subscription"]
            #[doc = "to high-resolution timestamp events for all wl_touch events that"]
            #[doc = "carry a timestamp."]
            #[doc = ""]
            #[doc = "If the associated wl_touch object becomes invalid, either through"]
            #[doc = "client action (e.g. release) or server-side changes, the input"]
            #[doc = "timestamps object becomes inert and the client should destroy it"]
            #[doc = "by calling zwp_input_timestamps_v1.destroy."]
            #[doc = ""]
            async fn get_touch_timestamps(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                id: crate::wire::ObjectId,
                touch: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!(
                    "-> zwp_input_timestamps_manager_v1#{}.get_touch_timestamps()",
                    sender_id
                );
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_object(Some(id))
                    .put_object(Some(touch))
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 3u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
        }
    }
    #[doc = ""]
    #[doc = "Provides high-resolution timestamp events for a set of subscribed input"]
    #[doc = "events. The set of subscribed input events is determined by the"]
    #[doc = "zwp_input_timestamps_manager_v1 request used to create this object."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zwp_input_timestamps_v1 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[doc = "Trait to implement the zwp_input_timestamps_v1 interface. See the module level documentation for more info"]
        pub trait ZwpInputTimestampsV1 {
            const INTERFACE: &'static str = "zwp_input_timestamps_v1";
            const VERSION: u32 = 1u32;
            async fn handle_event(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    0u16 => {
                        let tv_sec_hi = message.uint()?;
                        let tv_sec_lo = message.uint()?;
                        let tv_nsec = message.uint()?;
                        tracing::debug!(
                            "zwp_input_timestamps_v1#{}.timestamp({}, {}, {})",
                            sender_id,
                            tv_sec_hi,
                            tv_sec_lo,
                            tv_nsec
                        );
                        self.timestamp(client, sender_id, tv_sec_hi, tv_sec_lo, tv_nsec)
                            .await
                    }
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "Informs the server that the client will no longer be using this"]
            #[doc = "protocol object. After the server processes the request, no more"]
            #[doc = "timestamp events will be emitted."]
            #[doc = ""]
            async fn destroy(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_input_timestamps_v1#{}.destroy()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "The timestamp event is associated with the first subsequent input event"]
            #[doc = "carrying a timestamp which belongs to the set of input events this"]
            #[doc = "object is subscribed to."]
            #[doc = ""]
            #[doc = "The timestamp provided by this event is a high-resolution version of"]
            #[doc = "the timestamp argument of the associated input event. The provided"]
            #[doc = "timestamp is in the same clock domain and is at least as accurate as"]
            #[doc = "the associated input event timestamp."]
            #[doc = ""]
            #[doc = "The timestamp is expressed as tv_sec_hi, tv_sec_lo, tv_nsec triples,"]
            #[doc = "each component being an unsigned 32-bit value. Whole seconds are in"]
            #[doc = "tv_sec which is a 64-bit value combined from tv_sec_hi and tv_sec_lo,"]
            #[doc = "and the additional fractional part in tv_nsec as nanoseconds. Hence,"]
            #[doc = "for valid timestamps tv_nsec must be in [0, 999999999]."]
            #[doc = ""]
            async fn timestamp(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                tv_sec_hi: u32,
                tv_sec_lo: u32,
                tv_nsec: u32,
            ) -> crate::client::Result<()>;
        }
    }
}
#[doc = ""]
#[doc = "This protocol specifies a way for a client to request the compositor"]
#[doc = "to ignore its own keyboard shortcuts for a given seat, so that all"]
#[doc = "key events from that seat get forwarded to a surface."]
#[doc = ""]
#[doc = "Warning! The protocol described in this file is experimental and"]
#[doc = "backward incompatible changes may be made. Backward compatible"]
#[doc = "changes may be added together with the corresponding interface"]
#[doc = "version bump."]
#[doc = "Backward incompatible changes are done by bumping the version"]
#[doc = "number in the protocol and interface names and resetting the"]
#[doc = "interface version. Once the protocol is to be declared stable,"]
#[doc = "the 'z' prefix and the version number in the protocol and"]
#[doc = "interface names are removed and the interface version number is"]
#[doc = "reset."]
#[doc = ""]
#[allow(clippy::module_inception)]
pub mod keyboard_shortcuts_inhibit_unstable_v1 {
    #[doc = ""]
    #[doc = "A global interface used for inhibiting the compositor keyboard shortcuts."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zwp_keyboard_shortcuts_inhibit_manager_v1 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[repr(u32)]
        #[non_exhaustive]
        #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)]
        pub enum Error {
            #[doc = "the shortcuts are already inhibited for this surface"]
            AlreadyInhibited = 0u32,
        }
        impl TryFrom<u32> for Error {
            type Error = crate::wire::DecodeError;
            fn try_from(v: u32) -> Result<Self, Self::Error> {
                match v {
                    0u32 => Ok(Self::AlreadyInhibited),
                    _ => Err(crate::wire::DecodeError::MalformedPayload),
                }
            }
        }
        impl std::fmt::Display for Error {
            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
                (*self as u32).fmt(f)
            }
        }
        #[doc = "Trait to implement the zwp_keyboard_shortcuts_inhibit_manager_v1 interface. See the module level documentation for more info"]
        pub trait ZwpKeyboardShortcutsInhibitManagerV1 {
            const INTERFACE: &'static str = "zwp_keyboard_shortcuts_inhibit_manager_v1";
            const VERSION: u32 = 1u32;
            async fn handle_event(
                &self,
                _client: &mut crate::server::Client,
                _sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "Destroy the keyboard shortcuts inhibitor manager."]
            #[doc = ""]
            async fn destroy(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!(
                    "-> zwp_keyboard_shortcuts_inhibit_manager_v1#{}.destroy()",
                    sender_id
                );
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Create a new keyboard shortcuts inhibitor object associated with"]
            #[doc = "the given surface for the given seat."]
            #[doc = ""]
            #[doc = "If shortcuts are already inhibited for the specified seat and surface,"]
            #[doc = "a protocol error \"already_inhibited\" is raised by the compositor."]
            #[doc = ""]
            async fn inhibit_shortcuts(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                id: crate::wire::ObjectId,
                surface: crate::wire::ObjectId,
                seat: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!(
                    "-> zwp_keyboard_shortcuts_inhibit_manager_v1#{}.inhibit_shortcuts()",
                    sender_id
                );
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_object(Some(id))
                    .put_object(Some(surface))
                    .put_object(Some(seat))
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 1u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
        }
    }
    #[doc = ""]
    #[doc = "A keyboard shortcuts inhibitor instructs the compositor to ignore"]
    #[doc = "its own keyboard shortcuts when the associated surface has keyboard"]
    #[doc = "focus. As a result, when the surface has keyboard focus on the given"]
    #[doc = "seat, it will receive all key events originating from the specified"]
    #[doc = "seat, even those which would normally be caught by the compositor for"]
    #[doc = "its own shortcuts."]
    #[doc = ""]
    #[doc = "The Wayland compositor is however under no obligation to disable"]
    #[doc = "all of its shortcuts, and may keep some special key combo for its own"]
    #[doc = "use, including but not limited to one allowing the user to forcibly"]
    #[doc = "restore normal keyboard events routing in the case of an unwilling"]
    #[doc = "client. The compositor may also use the same key combo to reactivate"]
    #[doc = "an existing shortcut inhibitor that was previously deactivated on"]
    #[doc = "user request."]
    #[doc = ""]
    #[doc = "When the compositor restores its own keyboard shortcuts, an"]
    #[doc = "\"inactive\" event is emitted to notify the client that the keyboard"]
    #[doc = "shortcuts inhibitor is not effectively active for the surface and"]
    #[doc = "seat any more, and the client should not expect to receive all"]
    #[doc = "keyboard events."]
    #[doc = ""]
    #[doc = "When the keyboard shortcuts inhibitor is inactive, the client has"]
    #[doc = "no way to forcibly reactivate the keyboard shortcuts inhibitor."]
    #[doc = ""]
    #[doc = "The user can chose to re-enable a previously deactivated keyboard"]
    #[doc = "shortcuts inhibitor using any mechanism the compositor may offer,"]
    #[doc = "in which case the compositor will send an \"active\" event to notify"]
    #[doc = "the client."]
    #[doc = ""]
    #[doc = "If the surface is destroyed, unmapped, or loses the seat's keyboard"]
    #[doc = "focus, the keyboard shortcuts inhibitor becomes irrelevant and the"]
    #[doc = "compositor will restore its own keyboard shortcuts but no \"inactive\""]
    #[doc = "event is emitted in this case."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zwp_keyboard_shortcuts_inhibitor_v1 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[doc = "Trait to implement the zwp_keyboard_shortcuts_inhibitor_v1 interface. See the module level documentation for more info"]
        pub trait ZwpKeyboardShortcutsInhibitorV1 {
            const INTERFACE: &'static str = "zwp_keyboard_shortcuts_inhibitor_v1";
            const VERSION: u32 = 1u32;
            async fn handle_event(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    0u16 => {
                        tracing::debug!(
                            "zwp_keyboard_shortcuts_inhibitor_v1#{}.active()",
                            sender_id,
                        );
                        self.active(client, sender_id).await
                    }
                    1u16 => {
                        tracing::debug!(
                            "zwp_keyboard_shortcuts_inhibitor_v1#{}.inactive()",
                            sender_id,
                        );
                        self.inactive(client, sender_id).await
                    }
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "Remove the keyboard shortcuts inhibitor from the associated wl_surface."]
            #[doc = ""]
            async fn destroy(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!(
                    "-> zwp_keyboard_shortcuts_inhibitor_v1#{}.destroy()",
                    sender_id
                );
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "This event indicates that the shortcut inhibitor is active."]
            #[doc = ""]
            #[doc = "The compositor sends this event every time compositor shortcuts"]
            #[doc = "are inhibited on behalf of the surface. When active, the client"]
            #[doc = "may receive input events normally reserved by the compositor"]
            #[doc = "(see zwp_keyboard_shortcuts_inhibitor_v1)."]
            #[doc = ""]
            #[doc = "This occurs typically when the initial request \"inhibit_shortcuts\""]
            #[doc = "first becomes active or when the user instructs the compositor to"]
            #[doc = "re-enable and existing shortcuts inhibitor using any mechanism"]
            #[doc = "offered by the compositor."]
            #[doc = ""]
            async fn active(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "This event indicates that the shortcuts inhibitor is inactive,"]
            #[doc = "normal shortcuts processing is restored by the compositor."]
            #[doc = ""]
            async fn inactive(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()>;
        }
    }
}
#[allow(clippy::module_inception)]
pub mod linux_dmabuf_unstable_v1 {
    #[doc = ""]
    #[doc = "Following the interfaces from:"]
    #[doc = "https://www.khronos.org/registry/egl/extensions/EXT/EGL_EXT_image_dma_buf_import.txt"]
    #[doc = "https://www.khronos.org/registry/EGL/extensions/EXT/EGL_EXT_image_dma_buf_import_modifiers.txt"]
    #[doc = "and the Linux DRM sub-system's AddFb2 ioctl."]
    #[doc = ""]
    #[doc = "This interface offers ways to create generic dmabuf-based wl_buffers."]
    #[doc = ""]
    #[doc = "Clients can use the get_surface_feedback request to get dmabuf feedback"]
    #[doc = "for a particular surface. If the client wants to retrieve feedback not"]
    #[doc = "tied to a surface, they can use the get_default_feedback request."]
    #[doc = ""]
    #[doc = "The following are required from clients:"]
    #[doc = ""]
    #[doc = "- Clients must ensure that either all data in the dma-buf is"]
    #[doc = "coherent for all subsequent read access or that coherency is"]
    #[doc = "correctly handled by the underlying kernel-side dma-buf"]
    #[doc = "implementation."]
    #[doc = ""]
    #[doc = "- Don't make any more attachments after sending the buffer to the"]
    #[doc = "compositor. Making more attachments later increases the risk of"]
    #[doc = "the compositor not being able to use (re-import) an existing"]
    #[doc = "dmabuf-based wl_buffer."]
    #[doc = ""]
    #[doc = "The underlying graphics stack must ensure the following:"]
    #[doc = ""]
    #[doc = "- The dmabuf file descriptors relayed to the server will stay valid"]
    #[doc = "for the whole lifetime of the wl_buffer. This means the server may"]
    #[doc = "at any time use those fds to import the dmabuf into any kernel"]
    #[doc = "sub-system that might accept it."]
    #[doc = ""]
    #[doc = "However, when the underlying graphics stack fails to deliver the"]
    #[doc = "promise, because of e.g. a device hot-unplug which raises internal"]
    #[doc = "errors, after the wl_buffer has been successfully created the"]
    #[doc = "compositor must not raise protocol errors to the client when dmabuf"]
    #[doc = "import later fails."]
    #[doc = ""]
    #[doc = "To create a wl_buffer from one or more dmabufs, a client creates a"]
    #[doc = "zwp_linux_dmabuf_params_v1 object with a zwp_linux_dmabuf_v1.create_params"]
    #[doc = "request. All planes required by the intended format are added with"]
    #[doc = "the 'add' request. Finally, a 'create' or 'create_immed' request is"]
    #[doc = "issued, which has the following outcome depending on the import success."]
    #[doc = ""]
    #[doc = "The 'create' request,"]
    #[doc = "- on success, triggers a 'created' event which provides the final"]
    #[doc = "wl_buffer to the client."]
    #[doc = "- on failure, triggers a 'failed' event to convey that the server"]
    #[doc = "cannot use the dmabufs received from the client."]
    #[doc = ""]
    #[doc = "For the 'create_immed' request,"]
    #[doc = "- on success, the server immediately imports the added dmabufs to"]
    #[doc = "create a wl_buffer. No event is sent from the server in this case."]
    #[doc = "- on failure, the server can choose to either:"]
    #[doc = "- terminate the client by raising a fatal error."]
    #[doc = "- mark the wl_buffer as failed, and send a 'failed' event to the"]
    #[doc = "client. If the client uses a failed wl_buffer as an argument to any"]
    #[doc = "request, the behaviour is compositor implementation-defined."]
    #[doc = ""]
    #[doc = "For all DRM formats and unless specified in another protocol extension,"]
    #[doc = "pre-multiplied alpha is used for pixel values."]
    #[doc = ""]
    #[doc = "Unless specified otherwise in another protocol extension, implicit"]
    #[doc = "synchronization is used. In other words, compositors and clients must"]
    #[doc = "wait and signal fences implicitly passed via the DMA-BUF's reservation"]
    #[doc = "mechanism."]
    #[doc = ""]
    #[doc = "Disclaimer: This protocol extension has been marked stable. This copy is"]
    #[doc = "no longer used and only retained for backwards compatibility. The"]
    #[doc = "canonical version can be found in the stable/ directory."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zwp_linux_dmabuf_v1 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[doc = "Trait to implement the zwp_linux_dmabuf_v1 interface. See the module level documentation for more info"]
        pub trait ZwpLinuxDmabufV1 {
            const INTERFACE: &'static str = "zwp_linux_dmabuf_v1";
            const VERSION: u32 = 5u32;
            async fn handle_event(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    0u16 => {
                        let format = message.uint()?;
                        tracing::debug!("zwp_linux_dmabuf_v1#{}.format({})", sender_id, format);
                        self.format(client, sender_id, format).await
                    }
                    1u16 => {
                        let format = message.uint()?;
                        let modifier_hi = message.uint()?;
                        let modifier_lo = message.uint()?;
                        tracing::debug!(
                            "zwp_linux_dmabuf_v1#{}.modifier({}, {}, {})",
                            sender_id,
                            format,
                            modifier_hi,
                            modifier_lo
                        );
                        self.modifier(client, sender_id, format, modifier_hi, modifier_lo)
                            .await
                    }
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "Objects created through this interface, especially wl_buffers, will"]
            #[doc = "remain valid."]
            #[doc = ""]
            async fn destroy(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_linux_dmabuf_v1#{}.destroy()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "This temporary object is used to collect multiple dmabuf handles into"]
            #[doc = "a single batch to create a wl_buffer. It can only be used once and"]
            #[doc = "should be destroyed after a 'created' or 'failed' event has been"]
            #[doc = "received."]
            #[doc = ""]
            async fn create_params(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                params_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_linux_dmabuf_v1#{}.create_params()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_object(Some(params_id))
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 1u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "This request creates a new wp_linux_dmabuf_feedback object not bound"]
            #[doc = "to a particular surface. This object will deliver feedback about dmabuf"]
            #[doc = "parameters to use if the client doesn't support per-surface feedback"]
            #[doc = "(see get_surface_feedback)."]
            #[doc = ""]
            async fn get_default_feedback(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!(
                    "-> zwp_linux_dmabuf_v1#{}.get_default_feedback()",
                    sender_id
                );
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_object(Some(id))
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 2u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "This request creates a new wp_linux_dmabuf_feedback object for the"]
            #[doc = "specified wl_surface. This object will deliver feedback about dmabuf"]
            #[doc = "parameters to use for buffers attached to this surface."]
            #[doc = ""]
            #[doc = "If the surface is destroyed before the wp_linux_dmabuf_feedback object,"]
            #[doc = "the feedback object becomes inert."]
            #[doc = ""]
            async fn get_surface_feedback(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                id: crate::wire::ObjectId,
                surface: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!(
                    "-> zwp_linux_dmabuf_v1#{}.get_surface_feedback()",
                    sender_id
                );
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_object(Some(id))
                    .put_object(Some(surface))
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 3u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "This event advertises one buffer format that the server supports."]
            #[doc = "All the supported formats are advertised once when the client"]
            #[doc = "binds to this interface. A roundtrip after binding guarantees"]
            #[doc = "that the client has received all supported formats."]
            #[doc = ""]
            #[doc = "For the definition of the format codes, see the"]
            #[doc = "zwp_linux_buffer_params_v1::create request."]
            #[doc = ""]
            #[doc = "Starting version 4, the format event is deprecated and must not be"]
            #[doc = "sent by compositors. Instead, use get_default_feedback or"]
            #[doc = "get_surface_feedback."]
            #[doc = ""]
            async fn format(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                format: u32,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "This event advertises the formats that the server supports, along with"]
            #[doc = "the modifiers supported for each format. All the supported modifiers"]
            #[doc = "for all the supported formats are advertised once when the client"]
            #[doc = "binds to this interface. A roundtrip after binding guarantees that"]
            #[doc = "the client has received all supported format-modifier pairs."]
            #[doc = ""]
            #[doc = "For legacy support, DRM_FORMAT_MOD_INVALID (that is, modifier_hi =="]
            #[doc = "0x00ffffff and modifier_lo == 0xffffffff) is allowed in this event."]
            #[doc = "It indicates that the server can support the format with an implicit"]
            #[doc = "modifier. When a plane has DRM_FORMAT_MOD_INVALID as its modifier, it"]
            #[doc = "is as if no explicit modifier is specified. The effective modifier"]
            #[doc = "will be derived from the dmabuf."]
            #[doc = ""]
            #[doc = "A compositor that sends valid modifiers and DRM_FORMAT_MOD_INVALID for"]
            #[doc = "a given format supports both explicit modifiers and implicit modifiers."]
            #[doc = ""]
            #[doc = "For the definition of the format and modifier codes, see the"]
            #[doc = "zwp_linux_buffer_params_v1::create and zwp_linux_buffer_params_v1::add"]
            #[doc = "requests."]
            #[doc = ""]
            #[doc = "Starting version 4, the modifier event is deprecated and must not be"]
            #[doc = "sent by compositors. Instead, use get_default_feedback or"]
            #[doc = "get_surface_feedback."]
            #[doc = ""]
            async fn modifier(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                format: u32,
                modifier_hi: u32,
                modifier_lo: u32,
            ) -> crate::client::Result<()>;
        }
    }
    #[doc = ""]
    #[doc = "This temporary object is a collection of dmabufs and other"]
    #[doc = "parameters that together form a single logical buffer. The temporary"]
    #[doc = "object may eventually create one wl_buffer unless cancelled by"]
    #[doc = "destroying it before requesting 'create'."]
    #[doc = ""]
    #[doc = "Single-planar formats only require one dmabuf, however"]
    #[doc = "multi-planar formats may require more than one dmabuf. For all"]
    #[doc = "formats, an 'add' request must be called once per plane (even if the"]
    #[doc = "underlying dmabuf fd is identical)."]
    #[doc = ""]
    #[doc = "You must use consecutive plane indices ('plane_idx' argument for 'add')"]
    #[doc = "from zero to the number of planes used by the drm_fourcc format code."]
    #[doc = "All planes required by the format must be given exactly once, but can"]
    #[doc = "be given in any order. Each plane index can be set only once."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zwp_linux_buffer_params_v1 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[repr(u32)]
        #[non_exhaustive]
        #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)]
        pub enum Error {
            #[doc = "the dmabuf_batch object has already been used to create a wl_buffer"]
            AlreadyUsed = 0u32,
            #[doc = "plane index out of bounds"]
            PlaneIdx = 1u32,
            #[doc = "the plane index was already set"]
            PlaneSet = 2u32,
            #[doc = "missing or too many planes to create a buffer"]
            Incomplete = 3u32,
            #[doc = "format not supported"]
            InvalidFormat = 4u32,
            #[doc = "invalid width or height"]
            InvalidDimensions = 5u32,
            #[doc = "offset + stride * height goes out of dmabuf bounds"]
            OutOfBounds = 6u32,
            #[doc = "invalid wl_buffer resulted from importing dmabufs via"]
            #[doc = "the create_immed request on given buffer_params"]
            InvalidWlBuffer = 7u32,
        }
        impl TryFrom<u32> for Error {
            type Error = crate::wire::DecodeError;
            fn try_from(v: u32) -> Result<Self, Self::Error> {
                match v {
                    0u32 => Ok(Self::AlreadyUsed),
                    1u32 => Ok(Self::PlaneIdx),
                    2u32 => Ok(Self::PlaneSet),
                    3u32 => Ok(Self::Incomplete),
                    4u32 => Ok(Self::InvalidFormat),
                    5u32 => Ok(Self::InvalidDimensions),
                    6u32 => Ok(Self::OutOfBounds),
                    7u32 => Ok(Self::InvalidWlBuffer),
                    _ => Err(crate::wire::DecodeError::MalformedPayload),
                }
            }
        }
        impl std::fmt::Display for Error {
            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
                (*self as u32).fmt(f)
            }
        }
        bitflags::bitflags! { # [derive (Debug , PartialEq , Eq , PartialOrd , Ord , Hash , Clone , Copy)] pub struct Flags : u32 { # [doc = "contents are y-inverted"] const YInvert = 1u32 ; # [doc = "content is interlaced"] const Interlaced = 2u32 ; # [doc = "bottom field first"] const BottomFirst = 4u32 ; } }
        impl TryFrom<u32> for Flags {
            type Error = crate::wire::DecodeError;
            fn try_from(v: u32) -> Result<Self, Self::Error> {
                Self::from_bits(v).ok_or(crate::wire::DecodeError::MalformedPayload)
            }
        }
        impl std::fmt::Display for Flags {
            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
                self.bits().fmt(f)
            }
        }
        #[doc = "Trait to implement the zwp_linux_buffer_params_v1 interface. See the module level documentation for more info"]
        pub trait ZwpLinuxBufferParamsV1 {
            const INTERFACE: &'static str = "zwp_linux_buffer_params_v1";
            const VERSION: u32 = 5u32;
            async fn handle_event(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    0u16 => {
                        let buffer = message
                            .object()?
                            .ok_or(crate::wire::DecodeError::MalformedPayload)?;
                        tracing::debug!(
                            "zwp_linux_buffer_params_v1#{}.created({})",
                            sender_id,
                            buffer
                        );
                        self.created(client, sender_id, buffer).await
                    }
                    1u16 => {
                        tracing::debug!("zwp_linux_buffer_params_v1#{}.failed()", sender_id,);
                        self.failed(client, sender_id).await
                    }
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "Cleans up the temporary data sent to the server for dmabuf-based"]
            #[doc = "wl_buffer creation."]
            #[doc = ""]
            async fn destroy(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_linux_buffer_params_v1#{}.destroy()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "This request adds one dmabuf to the set in this"]
            #[doc = "zwp_linux_buffer_params_v1."]
            #[doc = ""]
            #[doc = "The 64-bit unsigned value combined from modifier_hi and modifier_lo"]
            #[doc = "is the dmabuf layout modifier. DRM AddFB2 ioctl calls this the"]
            #[doc = "fb modifier, which is defined in drm_mode.h of Linux UAPI."]
            #[doc = "This is an opaque token. Drivers use this token to express tiling,"]
            #[doc = "compression, etc. driver-specific modifications to the base format"]
            #[doc = "defined by the DRM fourcc code."]
            #[doc = ""]
            #[doc = "Starting from version 4, the invalid_format protocol error is sent if"]
            #[doc = "the format + modifier pair was not advertised as supported."]
            #[doc = ""]
            #[doc = "Starting from version 5, the invalid_format protocol error is sent if"]
            #[doc = "all planes don't use the same modifier."]
            #[doc = ""]
            #[doc = "This request raises the PLANE_IDX error if plane_idx is too large."]
            #[doc = "The error PLANE_SET is raised if attempting to set a plane that"]
            #[doc = "was already set."]
            #[doc = ""]
            async fn add(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                fd: rustix::fd::OwnedFd,
                plane_idx: u32,
                offset: u32,
                stride: u32,
                modifier_hi: u32,
                modifier_lo: u32,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_linux_buffer_params_v1#{}.add()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_fd(fd)
                    .put_uint(plane_idx)
                    .put_uint(offset)
                    .put_uint(stride)
                    .put_uint(modifier_hi)
                    .put_uint(modifier_lo)
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 1u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "This asks for creation of a wl_buffer from the added dmabuf"]
            #[doc = "buffers. The wl_buffer is not created immediately but returned via"]
            #[doc = "the 'created' event if the dmabuf sharing succeeds. The sharing"]
            #[doc = "may fail at runtime for reasons a client cannot predict, in"]
            #[doc = "which case the 'failed' event is triggered."]
            #[doc = ""]
            #[doc = "The 'format' argument is a DRM_FORMAT code, as defined by the"]
            #[doc = "libdrm's drm_fourcc.h. The Linux kernel's DRM sub-system is the"]
            #[doc = "authoritative source on how the format codes should work."]
            #[doc = ""]
            #[doc = "The 'flags' is a bitfield of the flags defined in enum \"flags\"."]
            #[doc = "'y_invert' means the that the image needs to be y-flipped."]
            #[doc = ""]
            #[doc = "Flag 'interlaced' means that the frame in the buffer is not"]
            #[doc = "progressive as usual, but interlaced. An interlaced buffer as"]
            #[doc = "supported here must always contain both top and bottom fields."]
            #[doc = "The top field always begins on the first pixel row. The temporal"]
            #[doc = "ordering between the two fields is top field first, unless"]
            #[doc = "'bottom_first' is specified. It is undefined whether 'bottom_first'"]
            #[doc = "is ignored if 'interlaced' is not set."]
            #[doc = ""]
            #[doc = "This protocol does not convey any information about field rate,"]
            #[doc = "duration, or timing, other than the relative ordering between the"]
            #[doc = "two fields in one buffer. A compositor may have to estimate the"]
            #[doc = "intended field rate from the incoming buffer rate. It is undefined"]
            #[doc = "whether the time of receiving wl_surface.commit with a new buffer"]
            #[doc = "attached, applying the wl_surface state, wl_surface.frame callback"]
            #[doc = "trigger, presentation, or any other point in the compositor cycle"]
            #[doc = "is used to measure the frame or field times. There is no support"]
            #[doc = "for detecting missed or late frames/fields/buffers either, and"]
            #[doc = "there is no support whatsoever for cooperating with interlaced"]
            #[doc = "compositor output."]
            #[doc = ""]
            #[doc = "The composited image quality resulting from the use of interlaced"]
            #[doc = "buffers is explicitly undefined. A compositor may use elaborate"]
            #[doc = "hardware features or software to deinterlace and create progressive"]
            #[doc = "output frames from a sequence of interlaced input buffers, or it"]
            #[doc = "may produce substandard image quality. However, compositors that"]
            #[doc = "cannot guarantee reasonable image quality in all cases are recommended"]
            #[doc = "to just reject all interlaced buffers."]
            #[doc = ""]
            #[doc = "Any argument errors, including non-positive width or height,"]
            #[doc = "mismatch between the number of planes and the format, bad"]
            #[doc = "format, bad offset or stride, may be indicated by fatal protocol"]
            #[doc = "errors: INCOMPLETE, INVALID_FORMAT, INVALID_DIMENSIONS,"]
            #[doc = "OUT_OF_BOUNDS."]
            #[doc = ""]
            #[doc = "Dmabuf import errors in the server that are not obvious client"]
            #[doc = "bugs are returned via the 'failed' event as non-fatal. This"]
            #[doc = "allows attempting dmabuf sharing and falling back in the client"]
            #[doc = "if it fails."]
            #[doc = ""]
            #[doc = "This request can be sent only once in the object's lifetime, after"]
            #[doc = "which the only legal request is destroy. This object should be"]
            #[doc = "destroyed after issuing a 'create' request. Attempting to use this"]
            #[doc = "object after issuing 'create' raises ALREADY_USED protocol error."]
            #[doc = ""]
            #[doc = "It is not mandatory to issue 'create'. If a client wants to"]
            #[doc = "cancel the buffer creation, it can just destroy this object."]
            #[doc = ""]
            async fn create(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                width: i32,
                height: i32,
                format: u32,
                flags: Flags,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_linux_buffer_params_v1#{}.create()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_int(width)
                    .put_int(height)
                    .put_uint(format)
                    .put_uint(flags.bits())
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 2u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "This asks for immediate creation of a wl_buffer by importing the"]
            #[doc = "added dmabufs."]
            #[doc = ""]
            #[doc = "In case of import success, no event is sent from the server, and the"]
            #[doc = "wl_buffer is ready to be used by the client."]
            #[doc = ""]
            #[doc = "Upon import failure, either of the following may happen, as seen fit"]
            #[doc = "by the implementation:"]
            #[doc = "- the client is terminated with one of the following fatal protocol"]
            #[doc = "errors:"]
            #[doc = "- INCOMPLETE, INVALID_FORMAT, INVALID_DIMENSIONS, OUT_OF_BOUNDS,"]
            #[doc = "in case of argument errors such as mismatch between the number"]
            #[doc = "of planes and the format, bad format, non-positive width or"]
            #[doc = "height, or bad offset or stride."]
            #[doc = "- INVALID_WL_BUFFER, in case the cause for failure is unknown or"]
            #[doc = "platform specific."]
            #[doc = "- the server creates an invalid wl_buffer, marks it as failed and"]
            #[doc = "sends a 'failed' event to the client. The result of using this"]
            #[doc = "invalid wl_buffer as an argument in any request by the client is"]
            #[doc = "defined by the compositor implementation."]
            #[doc = ""]
            #[doc = "This takes the same arguments as a 'create' request, and obeys the"]
            #[doc = "same restrictions."]
            #[doc = ""]
            async fn create_immed(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                buffer_id: crate::wire::ObjectId,
                width: i32,
                height: i32,
                format: u32,
                flags: Flags,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_linux_buffer_params_v1#{}.create_immed()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_object(Some(buffer_id))
                    .put_int(width)
                    .put_int(height)
                    .put_uint(format)
                    .put_uint(flags.bits())
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 3u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "This event indicates that the attempted buffer creation was"]
            #[doc = "successful. It provides the new wl_buffer referencing the dmabuf(s)."]
            #[doc = ""]
            #[doc = "Upon receiving this event, the client should destroy the"]
            #[doc = "zwp_linux_buffer_params_v1 object."]
            #[doc = ""]
            async fn created(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                buffer: crate::wire::ObjectId,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "This event indicates that the attempted buffer creation has"]
            #[doc = "failed. It usually means that one of the dmabuf constraints"]
            #[doc = "has not been fulfilled."]
            #[doc = ""]
            #[doc = "Upon receiving this event, the client should destroy the"]
            #[doc = "zwp_linux_buffer_params_v1 object."]
            #[doc = ""]
            async fn failed(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()>;
        }
    }
    #[doc = ""]
    #[doc = "This object advertises dmabuf parameters feedback. This includes the"]
    #[doc = "preferred devices and the supported formats/modifiers."]
    #[doc = ""]
    #[doc = "The parameters are sent once when this object is created and whenever they"]
    #[doc = "change. The done event is always sent once after all parameters have been"]
    #[doc = "sent. When a single parameter changes, all parameters are re-sent by the"]
    #[doc = "compositor."]
    #[doc = ""]
    #[doc = "Compositors can re-send the parameters when the current client buffer"]
    #[doc = "allocations are sub-optimal. Compositors should not re-send the"]
    #[doc = "parameters if re-allocating the buffers would not result in a more optimal"]
    #[doc = "configuration. In particular, compositors should avoid sending the exact"]
    #[doc = "same parameters multiple times in a row."]
    #[doc = ""]
    #[doc = "The tranche_target_device and tranche_formats events are grouped by"]
    #[doc = "tranches of preference. For each tranche, a tranche_target_device, one"]
    #[doc = "tranche_flags and one or more tranche_formats events are sent, followed"]
    #[doc = "by a tranche_done event finishing the list. The tranches are sent in"]
    #[doc = "descending order of preference. All formats and modifiers in the same"]
    #[doc = "tranche have the same preference."]
    #[doc = ""]
    #[doc = "To send parameters, the compositor sends one main_device event, tranches"]
    #[doc = "(each consisting of one tranche_target_device event, one tranche_flags"]
    #[doc = "event, tranche_formats events and then a tranche_done event), then one"]
    #[doc = "done event."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zwp_linux_dmabuf_feedback_v1 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        bitflags::bitflags! { # [derive (Debug , PartialEq , Eq , PartialOrd , Ord , Hash , Clone , Copy)] pub struct TrancheFlags : u32 { # [doc = "direct scan-out tranche"] const Scanout = 1u32 ; } }
        impl TryFrom<u32> for TrancheFlags {
            type Error = crate::wire::DecodeError;
            fn try_from(v: u32) -> Result<Self, Self::Error> {
                Self::from_bits(v).ok_or(crate::wire::DecodeError::MalformedPayload)
            }
        }
        impl std::fmt::Display for TrancheFlags {
            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
                self.bits().fmt(f)
            }
        }
        #[doc = "Trait to implement the zwp_linux_dmabuf_feedback_v1 interface. See the module level documentation for more info"]
        pub trait ZwpLinuxDmabufFeedbackV1 {
            const INTERFACE: &'static str = "zwp_linux_dmabuf_feedback_v1";
            const VERSION: u32 = 5u32;
            async fn handle_event(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    0u16 => {
                        tracing::debug!("zwp_linux_dmabuf_feedback_v1#{}.done()", sender_id,);
                        self.done(client, sender_id).await
                    }
                    1u16 => {
                        let fd = message.fd()?;
                        let size = message.uint()?;
                        tracing::debug!(
                            "zwp_linux_dmabuf_feedback_v1#{}.format_table({}, {})",
                            sender_id,
                            fd.as_raw_fd(),
                            size
                        );
                        self.format_table(client, sender_id, fd, size).await
                    }
                    2u16 => {
                        let device = message.array()?;
                        tracing::debug!(
                            "zwp_linux_dmabuf_feedback_v1#{}.main_device(array[{}])",
                            sender_id,
                            device.len()
                        );
                        self.main_device(client, sender_id, device).await
                    }
                    3u16 => {
                        tracing::debug!(
                            "zwp_linux_dmabuf_feedback_v1#{}.tranche_done()",
                            sender_id,
                        );
                        self.tranche_done(client, sender_id).await
                    }
                    4u16 => {
                        let device = message.array()?;
                        tracing::debug!(
                            "zwp_linux_dmabuf_feedback_v1#{}.tranche_target_device(array[{}])",
                            sender_id,
                            device.len()
                        );
                        self.tranche_target_device(client, sender_id, device).await
                    }
                    5u16 => {
                        let indices = message.array()?;
                        tracing::debug!(
                            "zwp_linux_dmabuf_feedback_v1#{}.tranche_formats(array[{}])",
                            sender_id,
                            indices.len()
                        );
                        self.tranche_formats(client, sender_id, indices).await
                    }
                    6u16 => {
                        let flags = message.uint()?;
                        tracing::debug!(
                            "zwp_linux_dmabuf_feedback_v1#{}.tranche_flags({})",
                            sender_id,
                            flags
                        );
                        self.tranche_flags(client, sender_id, flags.try_into()?)
                            .await
                    }
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "Using this request a client can tell the server that it is not going to"]
            #[doc = "use the wp_linux_dmabuf_feedback object anymore."]
            #[doc = ""]
            async fn destroy(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_linux_dmabuf_feedback_v1#{}.destroy()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "This event is sent after all parameters of a wp_linux_dmabuf_feedback"]
            #[doc = "object have been sent."]
            #[doc = ""]
            #[doc = "This allows changes to the wp_linux_dmabuf_feedback parameters to be"]
            #[doc = "seen as atomic, even if they happen via multiple events."]
            #[doc = ""]
            async fn done(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "This event provides a file descriptor which can be memory-mapped to"]
            #[doc = "access the format and modifier table."]
            #[doc = ""]
            #[doc = "The table contains a tightly packed array of consecutive format +"]
            #[doc = "modifier pairs. Each pair is 16 bytes wide. It contains a format as a"]
            #[doc = "32-bit unsigned integer, followed by 4 bytes of unused padding, and a"]
            #[doc = "modifier as a 64-bit unsigned integer. The native endianness is used."]
            #[doc = ""]
            #[doc = "The client must map the file descriptor in read-only private mode."]
            #[doc = ""]
            #[doc = "Compositors are not allowed to mutate the table file contents once this"]
            #[doc = "event has been sent. Instead, compositors must create a new, separate"]
            #[doc = "table file and re-send feedback parameters. Compositors are allowed to"]
            #[doc = "store duplicate format + modifier pairs in the table."]
            #[doc = ""]
            async fn format_table(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                fd: rustix::fd::OwnedFd,
                size: u32,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "This event advertises the main device that the server prefers to use"]
            #[doc = "when direct scan-out to the target device isn't possible. The"]
            #[doc = "advertised main device may be different for each"]
            #[doc = "wp_linux_dmabuf_feedback object, and may change over time."]
            #[doc = ""]
            #[doc = "There is exactly one main device. The compositor must send at least"]
            #[doc = "one preference tranche with tranche_target_device equal to main_device."]
            #[doc = ""]
            #[doc = "Clients need to create buffers that the main device can import and"]
            #[doc = "read from, otherwise creating the dmabuf wl_buffer will fail (see the"]
            #[doc = "wp_linux_buffer_params.create and create_immed requests for details)."]
            #[doc = "The main device will also likely be kept active by the compositor,"]
            #[doc = "so clients can use it instead of waking up another device for power"]
            #[doc = "savings."]
            #[doc = ""]
            #[doc = "In general the device is a DRM node. The DRM node type (primary vs."]
            #[doc = "render) is unspecified. Clients must not rely on the compositor sending"]
            #[doc = "a particular node type. Clients cannot check two devices for equality"]
            #[doc = "by comparing the dev_t value."]
            #[doc = ""]
            #[doc = "If explicit modifiers are not supported and the client performs buffer"]
            #[doc = "allocations on a different device than the main device, then the client"]
            #[doc = "must force the buffer to have a linear layout."]
            #[doc = ""]
            async fn main_device(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                device: Vec<u8>,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "This event splits tranche_target_device and tranche_formats events in"]
            #[doc = "preference tranches. It is sent after a set of tranche_target_device"]
            #[doc = "and tranche_formats events; it represents the end of a tranche. The"]
            #[doc = "next tranche will have a lower preference."]
            #[doc = ""]
            async fn tranche_done(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "This event advertises the target device that the server prefers to use"]
            #[doc = "for a buffer created given this tranche. The advertised target device"]
            #[doc = "may be different for each preference tranche, and may change over time."]
            #[doc = ""]
            #[doc = "There is exactly one target device per tranche."]
            #[doc = ""]
            #[doc = "The target device may be a scan-out device, for example if the"]
            #[doc = "compositor prefers to directly scan-out a buffer created given this"]
            #[doc = "tranche. The target device may be a rendering device, for example if"]
            #[doc = "the compositor prefers to texture from said buffer."]
            #[doc = ""]
            #[doc = "The client can use this hint to allocate the buffer in a way that makes"]
            #[doc = "it accessible from the target device, ideally directly. The buffer must"]
            #[doc = "still be accessible from the main device, either through direct import"]
            #[doc = "or through a potentially more expensive fallback path. If the buffer"]
            #[doc = "can't be directly imported from the main device then clients must be"]
            #[doc = "prepared for the compositor changing the tranche priority or making"]
            #[doc = "wl_buffer creation fail (see the wp_linux_buffer_params.create and"]
            #[doc = "create_immed requests for details)."]
            #[doc = ""]
            #[doc = "If the device is a DRM node, the DRM node type (primary vs. render) is"]
            #[doc = "unspecified. Clients must not rely on the compositor sending a"]
            #[doc = "particular node type. Clients cannot check two devices for equality by"]
            #[doc = "comparing the dev_t value."]
            #[doc = ""]
            #[doc = "This event is tied to a preference tranche, see the tranche_done event."]
            #[doc = ""]
            async fn tranche_target_device(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                device: Vec<u8>,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "This event advertises the format + modifier combinations that the"]
            #[doc = "compositor supports."]
            #[doc = ""]
            #[doc = "It carries an array of indices, each referring to a format + modifier"]
            #[doc = "pair in the last received format table (see the format_table event)."]
            #[doc = "Each index is a 16-bit unsigned integer in native endianness."]
            #[doc = ""]
            #[doc = "For legacy support, DRM_FORMAT_MOD_INVALID is an allowed modifier."]
            #[doc = "It indicates that the server can support the format with an implicit"]
            #[doc = "modifier. When a buffer has DRM_FORMAT_MOD_INVALID as its modifier, it"]
            #[doc = "is as if no explicit modifier is specified. The effective modifier"]
            #[doc = "will be derived from the dmabuf."]
            #[doc = ""]
            #[doc = "A compositor that sends valid modifiers and DRM_FORMAT_MOD_INVALID for"]
            #[doc = "a given format supports both explicit modifiers and implicit modifiers."]
            #[doc = ""]
            #[doc = "Compositors must not send duplicate format + modifier pairs within the"]
            #[doc = "same tranche or across two different tranches with the same target"]
            #[doc = "device and flags."]
            #[doc = ""]
            #[doc = "This event is tied to a preference tranche, see the tranche_done event."]
            #[doc = ""]
            #[doc = "For the definition of the format and modifier codes, see the"]
            #[doc = "wp_linux_buffer_params.create request."]
            #[doc = ""]
            async fn tranche_formats(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                indices: Vec<u8>,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "This event sets tranche-specific flags."]
            #[doc = ""]
            #[doc = "The scanout flag is a hint that direct scan-out may be attempted by the"]
            #[doc = "compositor on the target device if the client appropriately allocates a"]
            #[doc = "buffer. How to allocate a buffer that can be scanned out on the target"]
            #[doc = "device is implementation-defined."]
            #[doc = ""]
            #[doc = "This event is tied to a preference tranche, see the tranche_done event."]
            #[doc = ""]
            async fn tranche_flags(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                flags: TrancheFlags,
            ) -> crate::client::Result<()>;
        }
    }
}
#[allow(clippy::module_inception)]
pub mod zwp_linux_explicit_synchronization_unstable_v1 {
    #[doc = ""]
    #[doc = "This global is a factory interface, allowing clients to request"]
    #[doc = "explicit synchronization for buffers on a per-surface basis."]
    #[doc = ""]
    #[doc = "See zwp_linux_surface_synchronization_v1 for more information."]
    #[doc = ""]
    #[doc = "This interface is derived from Chromium's"]
    #[doc = "zcr_linux_explicit_synchronization_v1."]
    #[doc = ""]
    #[doc = "Note: this protocol is superseded by linux-drm-syncobj."]
    #[doc = ""]
    #[doc = "Warning! The protocol described in this file is experimental and"]
    #[doc = "backward incompatible changes may be made. Backward compatible changes"]
    #[doc = "may be added together with the corresponding interface version bump."]
    #[doc = "Backward incompatible changes are done by bumping the version number in"]
    #[doc = "the protocol and interface names and resetting the interface version."]
    #[doc = "Once the protocol is to be declared stable, the 'z' prefix and the"]
    #[doc = "version number in the protocol and interface names are removed and the"]
    #[doc = "interface version number is reset."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zwp_linux_explicit_synchronization_v1 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[repr(u32)]
        #[non_exhaustive]
        #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)]
        pub enum Error {
            #[doc = "the surface already has a synchronization object associated"]
            SynchronizationExists = 0u32,
        }
        impl TryFrom<u32> for Error {
            type Error = crate::wire::DecodeError;
            fn try_from(v: u32) -> Result<Self, Self::Error> {
                match v {
                    0u32 => Ok(Self::SynchronizationExists),
                    _ => Err(crate::wire::DecodeError::MalformedPayload),
                }
            }
        }
        impl std::fmt::Display for Error {
            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
                (*self as u32).fmt(f)
            }
        }
        #[doc = "Trait to implement the zwp_linux_explicit_synchronization_v1 interface. See the module level documentation for more info"]
        pub trait ZwpLinuxExplicitSynchronizationV1 {
            const INTERFACE: &'static str = "zwp_linux_explicit_synchronization_v1";
            const VERSION: u32 = 2u32;
            async fn handle_event(
                &self,
                _client: &mut crate::server::Client,
                _sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "Destroy this explicit synchronization factory object. Other objects,"]
            #[doc = "including zwp_linux_surface_synchronization_v1 objects created by this"]
            #[doc = "factory, shall not be affected by this request."]
            #[doc = ""]
            async fn destroy(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!(
                    "-> zwp_linux_explicit_synchronization_v1#{}.destroy()",
                    sender_id
                );
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Instantiate an interface extension for the given wl_surface to provide"]
            #[doc = "explicit synchronization."]
            #[doc = ""]
            #[doc = "If the given wl_surface already has an explicit synchronization object"]
            #[doc = "associated, the synchronization_exists protocol error is raised."]
            #[doc = ""]
            #[doc = "Graphics APIs, like EGL or Vulkan, that manage the buffer queue and"]
            #[doc = "commits of a wl_surface themselves, are likely to be using this"]
            #[doc = "extension internally. If a client is using such an API for a"]
            #[doc = "wl_surface, it should not directly use this extension on that surface,"]
            #[doc = "to avoid raising a synchronization_exists protocol error."]
            #[doc = ""]
            async fn get_synchronization(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                id: crate::wire::ObjectId,
                surface: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!(
                    "-> zwp_linux_explicit_synchronization_v1#{}.get_synchronization()",
                    sender_id
                );
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_object(Some(id))
                    .put_object(Some(surface))
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 1u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
        }
    }
    #[doc = ""]
    #[doc = "This object implements per-surface explicit synchronization."]
    #[doc = ""]
    #[doc = "Synchronization refers to co-ordination of pipelined operations performed"]
    #[doc = "on buffers. Most GPU clients will schedule an asynchronous operation to"]
    #[doc = "render to the buffer, then immediately send the buffer to the compositor"]
    #[doc = "to be attached to a surface."]
    #[doc = ""]
    #[doc = "In implicit synchronization, ensuring that the rendering operation is"]
    #[doc = "complete before the compositor displays the buffer is an implementation"]
    #[doc = "detail handled by either the kernel or userspace graphics driver."]
    #[doc = ""]
    #[doc = "By contrast, in explicit synchronization, dma_fence objects mark when the"]
    #[doc = "asynchronous operations are complete. When submitting a buffer, the"]
    #[doc = "client provides an acquire fence which will be waited on before the"]
    #[doc = "compositor accesses the buffer. The Wayland server, through a"]
    #[doc = "zwp_linux_buffer_release_v1 object, will inform the client with an event"]
    #[doc = "which may be accompanied by a release fence, when the compositor will no"]
    #[doc = "longer access the buffer contents due to the specific commit that"]
    #[doc = "requested the release event."]
    #[doc = ""]
    #[doc = "Each surface can be associated with only one object of this interface at"]
    #[doc = "any time."]
    #[doc = ""]
    #[doc = "In version 1 of this interface, explicit synchronization is only"]
    #[doc = "guaranteed to be supported for buffers created with any version of the"]
    #[doc = "wp_linux_dmabuf buffer factory. Version 2 additionally guarantees"]
    #[doc = "explicit synchronization support for opaque EGL buffers, which is a type"]
    #[doc = "of platform specific buffers described in the EGL_WL_bind_wayland_display"]
    #[doc = "extension. Compositors are free to support explicit synchronization for"]
    #[doc = "additional buffer types."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zwp_linux_surface_synchronization_v1 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[repr(u32)]
        #[non_exhaustive]
        #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)]
        pub enum Error {
            #[doc = "the fence specified by the client could not be imported"]
            InvalidFence = 0u32,
            #[doc = "multiple fences added for a single surface commit"]
            DuplicateFence = 1u32,
            #[doc = "multiple releases added for a single surface commit"]
            DuplicateRelease = 2u32,
            #[doc = "the associated wl_surface was destroyed"]
            NoSurface = 3u32,
            #[doc = "the buffer does not support explicit synchronization"]
            UnsupportedBuffer = 4u32,
            #[doc = "no buffer was attached"]
            NoBuffer = 5u32,
        }
        impl TryFrom<u32> for Error {
            type Error = crate::wire::DecodeError;
            fn try_from(v: u32) -> Result<Self, Self::Error> {
                match v {
                    0u32 => Ok(Self::InvalidFence),
                    1u32 => Ok(Self::DuplicateFence),
                    2u32 => Ok(Self::DuplicateRelease),
                    3u32 => Ok(Self::NoSurface),
                    4u32 => Ok(Self::UnsupportedBuffer),
                    5u32 => Ok(Self::NoBuffer),
                    _ => Err(crate::wire::DecodeError::MalformedPayload),
                }
            }
        }
        impl std::fmt::Display for Error {
            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
                (*self as u32).fmt(f)
            }
        }
        #[doc = "Trait to implement the zwp_linux_surface_synchronization_v1 interface. See the module level documentation for more info"]
        pub trait ZwpLinuxSurfaceSynchronizationV1 {
            const INTERFACE: &'static str = "zwp_linux_surface_synchronization_v1";
            const VERSION: u32 = 2u32;
            async fn handle_event(
                &self,
                _client: &mut crate::server::Client,
                _sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "Destroy this explicit synchronization object."]
            #[doc = ""]
            #[doc = "Any fence set by this object with set_acquire_fence since the last"]
            #[doc = "commit will be discarded by the server. Any fences set by this object"]
            #[doc = "before the last commit are not affected."]
            #[doc = ""]
            #[doc = "zwp_linux_buffer_release_v1 objects created by this object are not"]
            #[doc = "affected by this request."]
            #[doc = ""]
            async fn destroy(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!(
                    "-> zwp_linux_surface_synchronization_v1#{}.destroy()",
                    sender_id
                );
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Set the acquire fence that must be signaled before the compositor"]
            #[doc = "may sample from the buffer attached with wl_surface.attach. The fence"]
            #[doc = "is a dma_fence kernel object."]
            #[doc = ""]
            #[doc = "The acquire fence is double-buffered state, and will be applied on the"]
            #[doc = "next wl_surface.commit request for the associated surface. Thus, it"]
            #[doc = "applies only to the buffer that is attached to the surface at commit"]
            #[doc = "time."]
            #[doc = ""]
            #[doc = "If the provided fd is not a valid dma_fence fd, then an INVALID_FENCE"]
            #[doc = "error is raised."]
            #[doc = ""]
            #[doc = "If a fence has already been attached during the same commit cycle, a"]
            #[doc = "DUPLICATE_FENCE error is raised."]
            #[doc = ""]
            #[doc = "If the associated wl_surface was destroyed, a NO_SURFACE error is"]
            #[doc = "raised."]
            #[doc = ""]
            #[doc = "If at surface commit time the attached buffer does not support explicit"]
            #[doc = "synchronization, an UNSUPPORTED_BUFFER error is raised."]
            #[doc = ""]
            #[doc = "If at surface commit time there is no buffer attached, a NO_BUFFER"]
            #[doc = "error is raised."]
            #[doc = ""]
            async fn set_acquire_fence(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                fd: rustix::fd::OwnedFd,
            ) -> crate::client::Result<()> {
                tracing::debug!(
                    "-> zwp_linux_surface_synchronization_v1#{}.set_acquire_fence()",
                    sender_id
                );
                let (payload, fds) = crate::wire::PayloadBuilder::new().put_fd(fd).build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 1u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Create a listener for the release of the buffer attached by the"]
            #[doc = "client with wl_surface.attach. See zwp_linux_buffer_release_v1"]
            #[doc = "documentation for more information."]
            #[doc = ""]
            #[doc = "The release object is double-buffered state, and will be associated"]
            #[doc = "with the buffer that is attached to the surface at wl_surface.commit"]
            #[doc = "time."]
            #[doc = ""]
            #[doc = "If a zwp_linux_buffer_release_v1 object has already been requested for"]
            #[doc = "the surface in the same commit cycle, a DUPLICATE_RELEASE error is"]
            #[doc = "raised."]
            #[doc = ""]
            #[doc = "If the associated wl_surface was destroyed, a NO_SURFACE error"]
            #[doc = "is raised."]
            #[doc = ""]
            #[doc = "If at surface commit time there is no buffer attached, a NO_BUFFER"]
            #[doc = "error is raised."]
            #[doc = ""]
            async fn get_release(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                release: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!(
                    "-> zwp_linux_surface_synchronization_v1#{}.get_release()",
                    sender_id
                );
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_object(Some(release))
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 2u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
        }
    }
    #[doc = ""]
    #[doc = "This object is instantiated in response to a"]
    #[doc = "zwp_linux_surface_synchronization_v1.get_release request."]
    #[doc = ""]
    #[doc = "It provides an alternative to wl_buffer.release events, providing a"]
    #[doc = "unique release from a single wl_surface.commit request. The release event"]
    #[doc = "also supports explicit synchronization, providing a fence FD for the"]
    #[doc = "client to synchronize against."]
    #[doc = ""]
    #[doc = "Exactly one event, either a fenced_release or an immediate_release, will"]
    #[doc = "be emitted for the wl_surface.commit request. The compositor can choose"]
    #[doc = "release by release which event it uses."]
    #[doc = ""]
    #[doc = "This event does not replace wl_buffer.release events; servers are still"]
    #[doc = "required to send those events."]
    #[doc = ""]
    #[doc = "Once a buffer release object has delivered a 'fenced_release' or an"]
    #[doc = "'immediate_release' event it is automatically destroyed."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zwp_linux_buffer_release_v1 {
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[doc = "Trait to implement the zwp_linux_buffer_release_v1 interface. See the module level documentation for more info"]
        pub trait ZwpLinuxBufferReleaseV1 {
            const INTERFACE: &'static str = "zwp_linux_buffer_release_v1";
            const VERSION: u32 = 1u32;
            async fn handle_event(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    0u16 => {
                        let fence = message.fd()?;
                        tracing::debug!(
                            "zwp_linux_buffer_release_v1#{}.fenced_release({})",
                            sender_id,
                            fence.as_raw_fd()
                        );
                        let result = self.fenced_release(client, sender_id, fence).await;
                        client.remove(sender_id);
                        result
                    }
                    1u16 => {
                        tracing::debug!(
                            "zwp_linux_buffer_release_v1#{}.immediate_release()",
                            sender_id,
                        );
                        let result = self.immediate_release(client, sender_id).await;
                        client.remove(sender_id);
                        result
                    }
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "Sent when the compositor has finalised its usage of the associated"]
            #[doc = "buffer for the relevant commit, providing a dma_fence which will be"]
            #[doc = "signaled when all operations by the compositor on that buffer for that"]
            #[doc = "commit have finished."]
            #[doc = ""]
            #[doc = "Once the fence has signaled, and assuming the associated buffer is not"]
            #[doc = "pending release from other wl_surface.commit requests, no additional"]
            #[doc = "explicit or implicit synchronization is required to safely reuse or"]
            #[doc = "destroy the buffer."]
            #[doc = ""]
            #[doc = "This event destroys the zwp_linux_buffer_release_v1 object."]
            #[doc = ""]
            async fn fenced_release(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                fence: rustix::fd::OwnedFd,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Sent when the compositor has finalised its usage of the associated"]
            #[doc = "buffer for the relevant commit, and either performed no operations"]
            #[doc = "using it, or has a guarantee that all its operations on that buffer for"]
            #[doc = "that commit have finished."]
            #[doc = ""]
            #[doc = "Once this event is received, and assuming the associated buffer is not"]
            #[doc = "pending release from other wl_surface.commit requests, no additional"]
            #[doc = "explicit or implicit synchronization is required to safely reuse or"]
            #[doc = "destroy the buffer."]
            #[doc = ""]
            #[doc = "This event destroys the zwp_linux_buffer_release_v1 object."]
            #[doc = ""]
            async fn immediate_release(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()>;
        }
    }
}
#[doc = ""]
#[doc = "This protocol specifies a set of interfaces used for adding constraints to"]
#[doc = "the motion of a pointer. Possible constraints include confining pointer"]
#[doc = "motions to a given region, or locking it to its current position."]
#[doc = ""]
#[doc = "In order to constrain the pointer, a client must first bind the global"]
#[doc = "interface \"wp_pointer_constraints\" which, if a compositor supports pointer"]
#[doc = "constraints, is exposed by the registry. Using the bound global object, the"]
#[doc = "client uses the request that corresponds to the type of constraint it wants"]
#[doc = "to make. See wp_pointer_constraints for more details."]
#[doc = ""]
#[doc = "Warning! The protocol described in this file is experimental and backward"]
#[doc = "incompatible changes may be made. Backward compatible changes may be added"]
#[doc = "together with the corresponding interface version bump. Backward"]
#[doc = "incompatible changes are done by bumping the version number in the protocol"]
#[doc = "and interface names and resetting the interface version. Once the protocol"]
#[doc = "is to be declared stable, the 'z' prefix and the version number in the"]
#[doc = "protocol and interface names are removed and the interface version number is"]
#[doc = "reset."]
#[doc = ""]
#[allow(clippy::module_inception)]
pub mod pointer_constraints_unstable_v1 {
    #[doc = ""]
    #[doc = "The global interface exposing pointer constraining functionality. It"]
    #[doc = "exposes two requests: lock_pointer for locking the pointer to its"]
    #[doc = "position, and confine_pointer for locking the pointer to a region."]
    #[doc = ""]
    #[doc = "The lock_pointer and confine_pointer requests create the objects"]
    #[doc = "wp_locked_pointer and wp_confined_pointer respectively, and the client can"]
    #[doc = "use these objects to interact with the lock."]
    #[doc = ""]
    #[doc = "For any surface, only one lock or confinement may be active across all"]
    #[doc = "wl_pointer objects of the same seat. If a lock or confinement is requested"]
    #[doc = "when another lock or confinement is active or requested on the same surface"]
    #[doc = "and with any of the wl_pointer objects of the same seat, an"]
    #[doc = "'already_constrained' error will be raised."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zwp_pointer_constraints_v1 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[doc = ""]
        #[doc = "These errors can be emitted in response to wp_pointer_constraints"]
        #[doc = "requests."]
        #[doc = ""]
        #[repr(u32)]
        #[non_exhaustive]
        #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)]
        pub enum Error {
            #[doc = "pointer constraint already requested on that surface"]
            AlreadyConstrained = 1u32,
        }
        impl TryFrom<u32> for Error {
            type Error = crate::wire::DecodeError;
            fn try_from(v: u32) -> Result<Self, Self::Error> {
                match v {
                    1u32 => Ok(Self::AlreadyConstrained),
                    _ => Err(crate::wire::DecodeError::MalformedPayload),
                }
            }
        }
        impl std::fmt::Display for Error {
            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
                (*self as u32).fmt(f)
            }
        }
        #[doc = ""]
        #[doc = "These values represent different lifetime semantics. They are passed"]
        #[doc = "as arguments to the factory requests to specify how the constraint"]
        #[doc = "lifetimes should be managed."]
        #[doc = ""]
        #[repr(u32)]
        #[non_exhaustive]
        #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)]
        pub enum Lifetime {
            Oneshot = 1u32,
            Persistent = 2u32,
        }
        impl TryFrom<u32> for Lifetime {
            type Error = crate::wire::DecodeError;
            fn try_from(v: u32) -> Result<Self, Self::Error> {
                match v {
                    1u32 => Ok(Self::Oneshot),
                    2u32 => Ok(Self::Persistent),
                    _ => Err(crate::wire::DecodeError::MalformedPayload),
                }
            }
        }
        impl std::fmt::Display for Lifetime {
            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
                (*self as u32).fmt(f)
            }
        }
        #[doc = "Trait to implement the zwp_pointer_constraints_v1 interface. See the module level documentation for more info"]
        pub trait ZwpPointerConstraintsV1 {
            const INTERFACE: &'static str = "zwp_pointer_constraints_v1";
            const VERSION: u32 = 1u32;
            async fn handle_event(
                &self,
                _client: &mut crate::server::Client,
                _sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "Used by the client to notify the server that it will no longer use this"]
            #[doc = "pointer constraints object."]
            #[doc = ""]
            async fn destroy(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_pointer_constraints_v1#{}.destroy()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "The lock_pointer request lets the client request to disable movements of"]
            #[doc = "the virtual pointer (i.e. the cursor), effectively locking the pointer"]
            #[doc = "to a position. This request may not take effect immediately; in the"]
            #[doc = "future, when the compositor deems implementation-specific constraints"]
            #[doc = "are satisfied, the pointer lock will be activated and the compositor"]
            #[doc = "sends a locked event."]
            #[doc = ""]
            #[doc = "The protocol provides no guarantee that the constraints are ever"]
            #[doc = "satisfied, and does not require the compositor to send an error if the"]
            #[doc = "constraints cannot ever be satisfied. It is thus possible to request a"]
            #[doc = "lock that will never activate."]
            #[doc = ""]
            #[doc = "There may not be another pointer constraint of any kind requested or"]
            #[doc = "active on the surface for any of the wl_pointer objects of the seat of"]
            #[doc = "the passed pointer when requesting a lock. If there is, an error will be"]
            #[doc = "raised. See general pointer lock documentation for more details."]
            #[doc = ""]
            #[doc = "The intersection of the region passed with this request and the input"]
            #[doc = "region of the surface is used to determine where the pointer must be"]
            #[doc = "in order for the lock to activate. It is up to the compositor whether to"]
            #[doc = "warp the pointer or require some kind of user interaction for the lock"]
            #[doc = "to activate. If the region is null the surface input region is used."]
            #[doc = ""]
            #[doc = "A surface may receive pointer focus without the lock being activated."]
            #[doc = ""]
            #[doc = "The request creates a new object wp_locked_pointer which is used to"]
            #[doc = "interact with the lock as well as receive updates about its state. See"]
            #[doc = "the the description of wp_locked_pointer for further information."]
            #[doc = ""]
            #[doc = "Note that while a pointer is locked, the wl_pointer objects of the"]
            #[doc = "corresponding seat will not emit any wl_pointer.motion events, but"]
            #[doc = "relative motion events will still be emitted via wp_relative_pointer"]
            #[doc = "objects of the same seat. wl_pointer.axis and wl_pointer.button events"]
            #[doc = "are unaffected."]
            #[doc = ""]
            async fn lock_pointer(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                id: crate::wire::ObjectId,
                surface: crate::wire::ObjectId,
                pointer: crate::wire::ObjectId,
                region: Option<crate::wire::ObjectId>,
                lifetime: Lifetime,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_pointer_constraints_v1#{}.lock_pointer()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_object(Some(id))
                    .put_object(Some(surface))
                    .put_object(Some(pointer))
                    .put_object(region)
                    .put_uint(lifetime as u32)
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 1u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "The confine_pointer request lets the client request to confine the"]
            #[doc = "pointer cursor to a given region. This request may not take effect"]
            #[doc = "immediately; in the future, when the compositor deems implementation-"]
            #[doc = "specific constraints are satisfied, the pointer confinement will be"]
            #[doc = "activated and the compositor sends a confined event."]
            #[doc = ""]
            #[doc = "The intersection of the region passed with this request and the input"]
            #[doc = "region of the surface is used to determine where the pointer must be"]
            #[doc = "in order for the confinement to activate. It is up to the compositor"]
            #[doc = "whether to warp the pointer or require some kind of user interaction for"]
            #[doc = "the confinement to activate. If the region is null the surface input"]
            #[doc = "region is used."]
            #[doc = ""]
            #[doc = "The request will create a new object wp_confined_pointer which is used"]
            #[doc = "to interact with the confinement as well as receive updates about its"]
            #[doc = "state. See the the description of wp_confined_pointer for further"]
            #[doc = "information."]
            #[doc = ""]
            async fn confine_pointer(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                id: crate::wire::ObjectId,
                surface: crate::wire::ObjectId,
                pointer: crate::wire::ObjectId,
                region: Option<crate::wire::ObjectId>,
                lifetime: Lifetime,
            ) -> crate::client::Result<()> {
                tracing::debug!(
                    "-> zwp_pointer_constraints_v1#{}.confine_pointer()",
                    sender_id
                );
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_object(Some(id))
                    .put_object(Some(surface))
                    .put_object(Some(pointer))
                    .put_object(region)
                    .put_uint(lifetime as u32)
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 2u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
        }
    }
    #[doc = ""]
    #[doc = "The wp_locked_pointer interface represents a locked pointer state."]
    #[doc = ""]
    #[doc = "While the lock of this object is active, the wl_pointer objects of the"]
    #[doc = "associated seat will not emit any wl_pointer.motion events."]
    #[doc = ""]
    #[doc = "This object will send the event 'locked' when the lock is activated."]
    #[doc = "Whenever the lock is activated, it is guaranteed that the locked surface"]
    #[doc = "will already have received pointer focus and that the pointer will be"]
    #[doc = "within the region passed to the request creating this object."]
    #[doc = ""]
    #[doc = "To unlock the pointer, send the destroy request. This will also destroy"]
    #[doc = "the wp_locked_pointer object."]
    #[doc = ""]
    #[doc = "If the compositor decides to unlock the pointer the unlocked event is"]
    #[doc = "sent. See wp_locked_pointer.unlock for details."]
    #[doc = ""]
    #[doc = "When unlocking, the compositor may warp the cursor position to the set"]
    #[doc = "cursor position hint. If it does, it will not result in any relative"]
    #[doc = "motion events emitted via wp_relative_pointer."]
    #[doc = ""]
    #[doc = "If the surface the lock was requested on is destroyed and the lock is not"]
    #[doc = "yet activated, the wp_locked_pointer object is now defunct and must be"]
    #[doc = "destroyed."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zwp_locked_pointer_v1 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[doc = "Trait to implement the zwp_locked_pointer_v1 interface. See the module level documentation for more info"]
        pub trait ZwpLockedPointerV1 {
            const INTERFACE: &'static str = "zwp_locked_pointer_v1";
            const VERSION: u32 = 1u32;
            async fn handle_event(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    0u16 => {
                        tracing::debug!("zwp_locked_pointer_v1#{}.locked()", sender_id,);
                        self.locked(client, sender_id).await
                    }
                    1u16 => {
                        tracing::debug!("zwp_locked_pointer_v1#{}.unlocked()", sender_id,);
                        self.unlocked(client, sender_id).await
                    }
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "Destroy the locked pointer object. If applicable, the compositor will"]
            #[doc = "unlock the pointer."]
            #[doc = ""]
            async fn destroy(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_locked_pointer_v1#{}.destroy()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Set the cursor position hint relative to the top left corner of the"]
            #[doc = "surface."]
            #[doc = ""]
            #[doc = "If the client is drawing its own cursor, it should update the position"]
            #[doc = "hint to the position of its own cursor. A compositor may use this"]
            #[doc = "information to warp the pointer upon unlock in order to avoid pointer"]
            #[doc = "jumps."]
            #[doc = ""]
            #[doc = "The cursor position hint is double-buffered state, see"]
            #[doc = "wl_surface.commit."]
            #[doc = ""]
            async fn set_cursor_position_hint(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                surface_x: crate::wire::Fixed,
                surface_y: crate::wire::Fixed,
            ) -> crate::client::Result<()> {
                tracing::debug!(
                    "-> zwp_locked_pointer_v1#{}.set_cursor_position_hint()",
                    sender_id
                );
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_fixed(surface_x)
                    .put_fixed(surface_y)
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 1u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Set a new region used to lock the pointer."]
            #[doc = ""]
            #[doc = "The new lock region is double-buffered, see wl_surface.commit."]
            #[doc = ""]
            #[doc = "For details about the lock region, see wp_locked_pointer."]
            #[doc = ""]
            async fn set_region(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                region: Option<crate::wire::ObjectId>,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_locked_pointer_v1#{}.set_region()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_object(region)
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 2u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Notification that the pointer lock of the seat's pointer is activated."]
            #[doc = ""]
            async fn locked(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Notification that the pointer lock of the seat's pointer is no longer"]
            #[doc = "active. If this is a oneshot pointer lock (see"]
            #[doc = "wp_pointer_constraints.lifetime) this object is now defunct and should"]
            #[doc = "be destroyed. If this is a persistent pointer lock (see"]
            #[doc = "wp_pointer_constraints.lifetime) this pointer lock may again"]
            #[doc = "reactivate in the future."]
            #[doc = ""]
            async fn unlocked(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()>;
        }
    }
    #[doc = ""]
    #[doc = "The wp_confined_pointer interface represents a confined pointer state."]
    #[doc = ""]
    #[doc = "This object will send the event 'confined' when the confinement is"]
    #[doc = "activated. Whenever the confinement is activated, it is guaranteed that"]
    #[doc = "the surface the pointer is confined to will already have received pointer"]
    #[doc = "focus and that the pointer will be within the region passed to the request"]
    #[doc = "creating this object. It is up to the compositor to decide whether this"]
    #[doc = "requires some user interaction and if the pointer will warp to within the"]
    #[doc = "passed region if outside."]
    #[doc = ""]
    #[doc = "To unconfine the pointer, send the destroy request. This will also destroy"]
    #[doc = "the wp_confined_pointer object."]
    #[doc = ""]
    #[doc = "If the compositor decides to unconfine the pointer the unconfined event is"]
    #[doc = "sent. The wp_confined_pointer object is at this point defunct and should"]
    #[doc = "be destroyed."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zwp_confined_pointer_v1 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[doc = "Trait to implement the zwp_confined_pointer_v1 interface. See the module level documentation for more info"]
        pub trait ZwpConfinedPointerV1 {
            const INTERFACE: &'static str = "zwp_confined_pointer_v1";
            const VERSION: u32 = 1u32;
            async fn handle_event(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    0u16 => {
                        tracing::debug!("zwp_confined_pointer_v1#{}.confined()", sender_id,);
                        self.confined(client, sender_id).await
                    }
                    1u16 => {
                        tracing::debug!("zwp_confined_pointer_v1#{}.unconfined()", sender_id,);
                        self.unconfined(client, sender_id).await
                    }
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "Destroy the confined pointer object. If applicable, the compositor will"]
            #[doc = "unconfine the pointer."]
            #[doc = ""]
            async fn destroy(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_confined_pointer_v1#{}.destroy()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Set a new region used to confine the pointer."]
            #[doc = ""]
            #[doc = "The new confine region is double-buffered, see wl_surface.commit."]
            #[doc = ""]
            #[doc = "If the confinement is active when the new confinement region is applied"]
            #[doc = "and the pointer ends up outside of newly applied region, the pointer may"]
            #[doc = "warped to a position within the new confinement region. If warped, a"]
            #[doc = "wl_pointer.motion event will be emitted, but no"]
            #[doc = "wp_relative_pointer.relative_motion event."]
            #[doc = ""]
            #[doc = "The compositor may also, instead of using the new region, unconfine the"]
            #[doc = "pointer."]
            #[doc = ""]
            #[doc = "For details about the confine region, see wp_confined_pointer."]
            #[doc = ""]
            async fn set_region(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                region: Option<crate::wire::ObjectId>,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_confined_pointer_v1#{}.set_region()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_object(region)
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 1u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Notification that the pointer confinement of the seat's pointer is"]
            #[doc = "activated."]
            #[doc = ""]
            async fn confined(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Notification that the pointer confinement of the seat's pointer is no"]
            #[doc = "longer active. If this is a oneshot pointer confinement (see"]
            #[doc = "wp_pointer_constraints.lifetime) this object is now defunct and should"]
            #[doc = "be destroyed. If this is a persistent pointer confinement (see"]
            #[doc = "wp_pointer_constraints.lifetime) this pointer confinement may again"]
            #[doc = "reactivate in the future."]
            #[doc = ""]
            async fn unconfined(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()>;
        }
    }
}
#[allow(clippy::module_inception)]
pub mod pointer_gestures_unstable_v1 {
    #[doc = ""]
    #[doc = "A global interface to provide semantic touchpad gestures for a given"]
    #[doc = "pointer."]
    #[doc = ""]
    #[doc = "Three gestures are currently supported: swipe, pinch, and hold."]
    #[doc = "Pinch and swipe gestures follow a three-stage cycle: begin, update,"]
    #[doc = "end. Hold gestures follow a two-stage cycle: begin and end. All"]
    #[doc = "gestures are identified by a unique id."]
    #[doc = ""]
    #[doc = "Warning! The protocol described in this file is experimental and"]
    #[doc = "backward incompatible changes may be made. Backward compatible changes"]
    #[doc = "may be added together with the corresponding interface version bump."]
    #[doc = "Backward incompatible changes are done by bumping the version number in"]
    #[doc = "the protocol and interface names and resetting the interface version."]
    #[doc = "Once the protocol is to be declared stable, the 'z' prefix and the"]
    #[doc = "version number in the protocol and interface names are removed and the"]
    #[doc = "interface version number is reset."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zwp_pointer_gestures_v1 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[doc = "Trait to implement the zwp_pointer_gestures_v1 interface. See the module level documentation for more info"]
        pub trait ZwpPointerGesturesV1 {
            const INTERFACE: &'static str = "zwp_pointer_gestures_v1";
            const VERSION: u32 = 3u32;
            async fn handle_event(
                &self,
                _client: &mut crate::server::Client,
                _sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "Create a swipe gesture object. See the"]
            #[doc = "wl_pointer_gesture_swipe interface for details."]
            #[doc = ""]
            async fn get_swipe_gesture(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                id: crate::wire::ObjectId,
                pointer: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!(
                    "-> zwp_pointer_gestures_v1#{}.get_swipe_gesture()",
                    sender_id
                );
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_object(Some(id))
                    .put_object(Some(pointer))
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Create a pinch gesture object. See the"]
            #[doc = "wl_pointer_gesture_pinch interface for details."]
            #[doc = ""]
            async fn get_pinch_gesture(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                id: crate::wire::ObjectId,
                pointer: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!(
                    "-> zwp_pointer_gestures_v1#{}.get_pinch_gesture()",
                    sender_id
                );
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_object(Some(id))
                    .put_object(Some(pointer))
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 1u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Destroy the pointer gesture object. Swipe, pinch and hold objects"]
            #[doc = "created via this gesture object remain valid."]
            #[doc = ""]
            async fn release(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_pointer_gestures_v1#{}.release()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 2u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Create a hold gesture object. See the"]
            #[doc = "wl_pointer_gesture_hold interface for details."]
            #[doc = ""]
            async fn get_hold_gesture(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                id: crate::wire::ObjectId,
                pointer: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!(
                    "-> zwp_pointer_gestures_v1#{}.get_hold_gesture()",
                    sender_id
                );
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_object(Some(id))
                    .put_object(Some(pointer))
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 3u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
        }
    }
    #[doc = ""]
    #[doc = "A swipe gesture object notifies a client about a multi-finger swipe"]
    #[doc = "gesture detected on an indirect input device such as a touchpad."]
    #[doc = "The gesture is usually initiated by multiple fingers moving in the"]
    #[doc = "same direction but once initiated the direction may change."]
    #[doc = "The precise conditions of when such a gesture is detected are"]
    #[doc = "implementation-dependent."]
    #[doc = ""]
    #[doc = "A gesture consists of three stages: begin, update (optional) and end."]
    #[doc = "There cannot be multiple simultaneous hold, pinch or swipe gestures on a"]
    #[doc = "same pointer/seat, how compositors prevent these situations is"]
    #[doc = "implementation-dependent."]
    #[doc = ""]
    #[doc = "A gesture may be cancelled by the compositor or the hardware."]
    #[doc = "Clients should not consider performing permanent or irreversible"]
    #[doc = "actions until the end of a gesture has been received."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zwp_pointer_gesture_swipe_v1 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[doc = "Trait to implement the zwp_pointer_gesture_swipe_v1 interface. See the module level documentation for more info"]
        pub trait ZwpPointerGestureSwipeV1 {
            const INTERFACE: &'static str = "zwp_pointer_gesture_swipe_v1";
            const VERSION: u32 = 2u32;
            async fn handle_event(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    0u16 => {
                        let serial = message.uint()?;
                        let time = message.uint()?;
                        let surface = message
                            .object()?
                            .ok_or(crate::wire::DecodeError::MalformedPayload)?;
                        let fingers = message.uint()?;
                        tracing::debug!(
                            "zwp_pointer_gesture_swipe_v1#{}.begin({}, {}, {}, {})",
                            sender_id,
                            serial,
                            time,
                            surface,
                            fingers
                        );
                        self.begin(client, sender_id, serial, time, surface, fingers)
                            .await
                    }
                    1u16 => {
                        let time = message.uint()?;
                        let dx = message.fixed()?;
                        let dy = message.fixed()?;
                        tracing::debug!(
                            "zwp_pointer_gesture_swipe_v1#{}.update({}, {}, {})",
                            sender_id,
                            time,
                            dx,
                            dy
                        );
                        self.update(client, sender_id, time, dx, dy).await
                    }
                    2u16 => {
                        let serial = message.uint()?;
                        let time = message.uint()?;
                        let cancelled = message.int()?;
                        tracing::debug!(
                            "zwp_pointer_gesture_swipe_v1#{}.end({}, {}, {})",
                            sender_id,
                            serial,
                            time,
                            cancelled
                        );
                        self.end(client, sender_id, serial, time, cancelled).await
                    }
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            async fn destroy(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_pointer_gesture_swipe_v1#{}.destroy()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "This event is sent when a multi-finger swipe gesture is detected"]
            #[doc = "on the device."]
            #[doc = ""]
            async fn begin(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                serial: u32,
                time: u32,
                surface: crate::wire::ObjectId,
                fingers: u32,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "This event is sent when a multi-finger swipe gesture changes the"]
            #[doc = "position of the logical center."]
            #[doc = ""]
            #[doc = "The dx and dy coordinates are relative coordinates of the logical"]
            #[doc = "center of the gesture compared to the previous event."]
            #[doc = ""]
            async fn update(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                time: u32,
                dx: crate::wire::Fixed,
                dy: crate::wire::Fixed,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "This event is sent when a multi-finger swipe gesture ceases to"]
            #[doc = "be valid. This may happen when one or more fingers are lifted or"]
            #[doc = "the gesture is cancelled."]
            #[doc = ""]
            #[doc = "When a gesture is cancelled, the client should undo state changes"]
            #[doc = "caused by this gesture. What causes a gesture to be cancelled is"]
            #[doc = "implementation-dependent."]
            #[doc = ""]
            async fn end(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                serial: u32,
                time: u32,
                cancelled: i32,
            ) -> crate::client::Result<()>;
        }
    }
    #[doc = ""]
    #[doc = "A pinch gesture object notifies a client about a multi-finger pinch"]
    #[doc = "gesture detected on an indirect input device such as a touchpad."]
    #[doc = "The gesture is usually initiated by multiple fingers moving towards"]
    #[doc = "each other or away from each other, or by two or more fingers rotating"]
    #[doc = "around a logical center of gravity. The precise conditions of when"]
    #[doc = "such a gesture is detected are implementation-dependent."]
    #[doc = ""]
    #[doc = "A gesture consists of three stages: begin, update (optional) and end."]
    #[doc = "There cannot be multiple simultaneous hold, pinch or swipe gestures on a"]
    #[doc = "same pointer/seat, how compositors prevent these situations is"]
    #[doc = "implementation-dependent."]
    #[doc = ""]
    #[doc = "A gesture may be cancelled by the compositor or the hardware."]
    #[doc = "Clients should not consider performing permanent or irreversible"]
    #[doc = "actions until the end of a gesture has been received."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zwp_pointer_gesture_pinch_v1 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[doc = "Trait to implement the zwp_pointer_gesture_pinch_v1 interface. See the module level documentation for more info"]
        pub trait ZwpPointerGesturePinchV1 {
            const INTERFACE: &'static str = "zwp_pointer_gesture_pinch_v1";
            const VERSION: u32 = 2u32;
            async fn handle_event(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    0u16 => {
                        let serial = message.uint()?;
                        let time = message.uint()?;
                        let surface = message
                            .object()?
                            .ok_or(crate::wire::DecodeError::MalformedPayload)?;
                        let fingers = message.uint()?;
                        tracing::debug!(
                            "zwp_pointer_gesture_pinch_v1#{}.begin({}, {}, {}, {})",
                            sender_id,
                            serial,
                            time,
                            surface,
                            fingers
                        );
                        self.begin(client, sender_id, serial, time, surface, fingers)
                            .await
                    }
                    1u16 => {
                        let time = message.uint()?;
                        let dx = message.fixed()?;
                        let dy = message.fixed()?;
                        let scale = message.fixed()?;
                        let rotation = message.fixed()?;
                        tracing::debug!(
                            "zwp_pointer_gesture_pinch_v1#{}.update({}, {}, {}, {}, {})",
                            sender_id,
                            time,
                            dx,
                            dy,
                            scale,
                            rotation
                        );
                        self.update(client, sender_id, time, dx, dy, scale, rotation)
                            .await
                    }
                    2u16 => {
                        let serial = message.uint()?;
                        let time = message.uint()?;
                        let cancelled = message.int()?;
                        tracing::debug!(
                            "zwp_pointer_gesture_pinch_v1#{}.end({}, {}, {})",
                            sender_id,
                            serial,
                            time,
                            cancelled
                        );
                        self.end(client, sender_id, serial, time, cancelled).await
                    }
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            async fn destroy(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_pointer_gesture_pinch_v1#{}.destroy()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "This event is sent when a multi-finger pinch gesture is detected"]
            #[doc = "on the device."]
            #[doc = ""]
            async fn begin(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                serial: u32,
                time: u32,
                surface: crate::wire::ObjectId,
                fingers: u32,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "This event is sent when a multi-finger pinch gesture changes the"]
            #[doc = "position of the logical center, the rotation or the relative scale."]
            #[doc = ""]
            #[doc = "The dx and dy coordinates are relative coordinates in the"]
            #[doc = "surface coordinate space of the logical center of the gesture."]
            #[doc = ""]
            #[doc = "The scale factor is an absolute scale compared to the"]
            #[doc = "pointer_gesture_pinch.begin event, e.g. a scale of 2 means the fingers"]
            #[doc = "are now twice as far apart as on pointer_gesture_pinch.begin."]
            #[doc = ""]
            #[doc = "The rotation is the relative angle in degrees clockwise compared to the previous"]
            #[doc = "pointer_gesture_pinch.begin or pointer_gesture_pinch.update event."]
            #[doc = ""]
            async fn update(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                time: u32,
                dx: crate::wire::Fixed,
                dy: crate::wire::Fixed,
                scale: crate::wire::Fixed,
                rotation: crate::wire::Fixed,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "This event is sent when a multi-finger pinch gesture ceases to"]
            #[doc = "be valid. This may happen when one or more fingers are lifted or"]
            #[doc = "the gesture is cancelled."]
            #[doc = ""]
            #[doc = "When a gesture is cancelled, the client should undo state changes"]
            #[doc = "caused by this gesture. What causes a gesture to be cancelled is"]
            #[doc = "implementation-dependent."]
            #[doc = ""]
            async fn end(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                serial: u32,
                time: u32,
                cancelled: i32,
            ) -> crate::client::Result<()>;
        }
    }
    #[doc = ""]
    #[doc = "A hold gesture object notifies a client about a single- or"]
    #[doc = "multi-finger hold gesture detected on an indirect input device such as"]
    #[doc = "a touchpad. The gesture is usually initiated by one or more fingers"]
    #[doc = "being held down without significant movement. The precise conditions"]
    #[doc = "of when such a gesture is detected are implementation-dependent."]
    #[doc = ""]
    #[doc = "In particular, this gesture may be used to cancel kinetic scrolling."]
    #[doc = ""]
    #[doc = "A hold gesture consists of two stages: begin and end. Unlike pinch and"]
    #[doc = "swipe there is no update stage."]
    #[doc = "There cannot be multiple simultaneous hold, pinch or swipe gestures on a"]
    #[doc = "same pointer/seat, how compositors prevent these situations is"]
    #[doc = "implementation-dependent."]
    #[doc = ""]
    #[doc = "A gesture may be cancelled by the compositor or the hardware."]
    #[doc = "Clients should not consider performing permanent or irreversible"]
    #[doc = "actions until the end of a gesture has been received."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zwp_pointer_gesture_hold_v1 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[doc = "Trait to implement the zwp_pointer_gesture_hold_v1 interface. See the module level documentation for more info"]
        pub trait ZwpPointerGestureHoldV1 {
            const INTERFACE: &'static str = "zwp_pointer_gesture_hold_v1";
            const VERSION: u32 = 3u32;
            async fn handle_event(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    0u16 => {
                        let serial = message.uint()?;
                        let time = message.uint()?;
                        let surface = message
                            .object()?
                            .ok_or(crate::wire::DecodeError::MalformedPayload)?;
                        let fingers = message.uint()?;
                        tracing::debug!(
                            "zwp_pointer_gesture_hold_v1#{}.begin({}, {}, {}, {})",
                            sender_id,
                            serial,
                            time,
                            surface,
                            fingers
                        );
                        self.begin(client, sender_id, serial, time, surface, fingers)
                            .await
                    }
                    1u16 => {
                        let serial = message.uint()?;
                        let time = message.uint()?;
                        let cancelled = message.int()?;
                        tracing::debug!(
                            "zwp_pointer_gesture_hold_v1#{}.end({}, {}, {})",
                            sender_id,
                            serial,
                            time,
                            cancelled
                        );
                        self.end(client, sender_id, serial, time, cancelled).await
                    }
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            async fn destroy(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_pointer_gesture_hold_v1#{}.destroy()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "This event is sent when a hold gesture is detected on the device."]
            #[doc = ""]
            async fn begin(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                serial: u32,
                time: u32,
                surface: crate::wire::ObjectId,
                fingers: u32,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "This event is sent when a hold gesture ceases to"]
            #[doc = "be valid. This may happen when the holding fingers are lifted or"]
            #[doc = "the gesture is cancelled, for example if the fingers move past an"]
            #[doc = "implementation-defined threshold, the finger count changes or the hold"]
            #[doc = "gesture changes into a different type of gesture."]
            #[doc = ""]
            #[doc = "When a gesture is cancelled, the client may need to undo state changes"]
            #[doc = "caused by this gesture. What causes a gesture to be cancelled is"]
            #[doc = "implementation-dependent."]
            #[doc = ""]
            async fn end(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                serial: u32,
                time: u32,
                cancelled: i32,
            ) -> crate::client::Result<()>;
        }
    }
}
#[doc = ""]
#[doc = "This protocol provides the ability to have a primary selection device to"]
#[doc = "match that of the X server. This primary selection is a shortcut to the"]
#[doc = "common clipboard selection, where text just needs to be selected in order"]
#[doc = "to allow copying it elsewhere. The de facto way to perform this action"]
#[doc = "is the middle mouse button, although it is not limited to this one."]
#[doc = ""]
#[doc = "Clients wishing to honor primary selection should create a primary"]
#[doc = "selection source and set it as the selection through"]
#[doc = "wp_primary_selection_device.set_selection whenever the text selection"]
#[doc = "changes. In order to minimize calls in pointer-driven text selection,"]
#[doc = "it should happen only once after the operation finished. Similarly,"]
#[doc = "a NULL source should be set when text is unselected."]
#[doc = ""]
#[doc = "wp_primary_selection_offer objects are first announced through the"]
#[doc = "wp_primary_selection_device.data_offer event. Immediately after this event,"]
#[doc = "the primary data offer will emit wp_primary_selection_offer.offer events"]
#[doc = "to let know of the mime types being offered."]
#[doc = ""]
#[doc = "When the primary selection changes, the client with the keyboard focus"]
#[doc = "will receive wp_primary_selection_device.selection events. Only the client"]
#[doc = "with the keyboard focus will receive such events with a non-NULL"]
#[doc = "wp_primary_selection_offer. Across keyboard focus changes, previously"]
#[doc = "focused clients will receive wp_primary_selection_device.events with a"]
#[doc = "NULL wp_primary_selection_offer."]
#[doc = ""]
#[doc = "In order to request the primary selection data, the client must pass"]
#[doc = "a recent serial pertaining to the press event that is triggering the"]
#[doc = "operation, if the compositor deems the serial valid and recent, the"]
#[doc = "wp_primary_selection_source.send event will happen in the other end"]
#[doc = "to let the transfer begin. The client owning the primary selection"]
#[doc = "should write the requested data, and close the file descriptor"]
#[doc = "immediately."]
#[doc = ""]
#[doc = "If the primary selection owner client disappeared during the transfer,"]
#[doc = "the client reading the data will receive a"]
#[doc = "wp_primary_selection_device.selection event with a NULL"]
#[doc = "wp_primary_selection_offer, the client should take this as a hint"]
#[doc = "to finish the reads related to the no longer existing offer."]
#[doc = ""]
#[doc = "The primary selection owner should be checking for errors during"]
#[doc = "writes, merely cancelling the ongoing transfer if any happened."]
#[doc = ""]
#[allow(clippy::module_inception)]
pub mod wp_primary_selection_unstable_v1 {
    #[doc = ""]
    #[doc = "The primary selection device manager is a singleton global object that"]
    #[doc = "provides access to the primary selection. It allows to create"]
    #[doc = "wp_primary_selection_source objects, as well as retrieving the per-seat"]
    #[doc = "wp_primary_selection_device objects."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zwp_primary_selection_device_manager_v1 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[doc = "Trait to implement the zwp_primary_selection_device_manager_v1 interface. See the module level documentation for more info"]
        pub trait ZwpPrimarySelectionDeviceManagerV1 {
            const INTERFACE: &'static str = "zwp_primary_selection_device_manager_v1";
            const VERSION: u32 = 1u32;
            async fn handle_event(
                &self,
                _client: &mut crate::server::Client,
                _sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "Create a new primary selection source."]
            #[doc = ""]
            async fn create_source(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!(
                    "-> zwp_primary_selection_device_manager_v1#{}.create_source()",
                    sender_id
                );
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_object(Some(id))
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Create a new data device for a given seat."]
            #[doc = ""]
            async fn get_device(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                id: crate::wire::ObjectId,
                seat: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!(
                    "-> zwp_primary_selection_device_manager_v1#{}.get_device()",
                    sender_id
                );
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_object(Some(id))
                    .put_object(Some(seat))
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 1u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Destroy the primary selection device manager."]
            #[doc = ""]
            async fn destroy(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!(
                    "-> zwp_primary_selection_device_manager_v1#{}.destroy()",
                    sender_id
                );
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 2u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
        }
    }
    #[allow(clippy::too_many_arguments)]
    pub mod zwp_primary_selection_device_v1 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[doc = "Trait to implement the zwp_primary_selection_device_v1 interface. See the module level documentation for more info"]
        pub trait ZwpPrimarySelectionDeviceV1 {
            const INTERFACE: &'static str = "zwp_primary_selection_device_v1";
            const VERSION: u32 = 1u32;
            async fn handle_event(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    0u16 => {
                        let offer = message
                            .object()?
                            .ok_or(crate::wire::DecodeError::MalformedPayload)?;
                        tracing::debug!(
                            "zwp_primary_selection_device_v1#{}.data_offer({})",
                            sender_id,
                            offer
                        );
                        self.data_offer(client, sender_id, offer).await
                    }
                    1u16 => {
                        let id = message.object()?;
                        tracing::debug!(
                            "zwp_primary_selection_device_v1#{}.selection({})",
                            sender_id,
                            id.as_ref().map_or("null".to_string(), |v| v.to_string())
                        );
                        self.selection(client, sender_id, id).await
                    }
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "Replaces the current selection. The previous owner of the primary"]
            #[doc = "selection will receive a wp_primary_selection_source.cancelled event."]
            #[doc = ""]
            #[doc = "To unset the selection, set the source to NULL."]
            #[doc = ""]
            async fn set_selection(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                source: Option<crate::wire::ObjectId>,
                serial: u32,
            ) -> crate::client::Result<()> {
                tracing::debug!(
                    "-> zwp_primary_selection_device_v1#{}.set_selection()",
                    sender_id
                );
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_object(source)
                    .put_uint(serial)
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Destroy the primary selection device."]
            #[doc = ""]
            async fn destroy(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_primary_selection_device_v1#{}.destroy()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 1u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Introduces a new wp_primary_selection_offer object that may be used"]
            #[doc = "to receive the current primary selection. Immediately following this"]
            #[doc = "event, the new wp_primary_selection_offer object will send"]
            #[doc = "wp_primary_selection_offer.offer events to describe the offered mime"]
            #[doc = "types."]
            #[doc = ""]
            async fn data_offer(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                offer: crate::wire::ObjectId,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "The wp_primary_selection_device.selection event is sent to notify the"]
            #[doc = "client of a new primary selection. This event is sent after the"]
            #[doc = "wp_primary_selection.data_offer event introducing this object, and after"]
            #[doc = "the offer has announced its mimetypes through"]
            #[doc = "wp_primary_selection_offer.offer."]
            #[doc = ""]
            #[doc = "The data_offer is valid until a new offer or NULL is received"]
            #[doc = "or until the client loses keyboard focus. The client must destroy the"]
            #[doc = "previous selection data_offer, if any, upon receiving this event."]
            #[doc = ""]
            async fn selection(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                id: Option<crate::wire::ObjectId>,
            ) -> crate::client::Result<()>;
        }
    }
    #[doc = ""]
    #[doc = "A wp_primary_selection_offer represents an offer to transfer the contents"]
    #[doc = "of the primary selection clipboard to the client. Similar to"]
    #[doc = "wl_data_offer, the offer also describes the mime types that the data can"]
    #[doc = "be converted to and provides the mechanisms for transferring the data"]
    #[doc = "directly to the client."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zwp_primary_selection_offer_v1 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[doc = "Trait to implement the zwp_primary_selection_offer_v1 interface. See the module level documentation for more info"]
        pub trait ZwpPrimarySelectionOfferV1 {
            const INTERFACE: &'static str = "zwp_primary_selection_offer_v1";
            const VERSION: u32 = 1u32;
            async fn handle_event(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    0u16 => {
                        let mime_type = message
                            .string()?
                            .ok_or(crate::wire::DecodeError::MalformedPayload)?;
                        tracing::debug!(
                            "zwp_primary_selection_offer_v1#{}.offer(\"{}\")",
                            sender_id,
                            mime_type
                        );
                        self.offer(client, sender_id, mime_type).await
                    }
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "To transfer the contents of the primary selection clipboard, the client"]
            #[doc = "issues this request and indicates the mime type that it wants to"]
            #[doc = "receive. The transfer happens through the passed file descriptor"]
            #[doc = "(typically created with the pipe system call). The source client writes"]
            #[doc = "the data in the mime type representation requested and then closes the"]
            #[doc = "file descriptor."]
            #[doc = ""]
            #[doc = "The receiving client reads from the read end of the pipe until EOF and"]
            #[doc = "closes its end, at which point the transfer is complete."]
            #[doc = ""]
            async fn receive(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                mime_type: String,
                fd: rustix::fd::OwnedFd,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_primary_selection_offer_v1#{}.receive()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_string(Some(mime_type))
                    .put_fd(fd)
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Destroy the primary selection offer."]
            #[doc = ""]
            async fn destroy(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_primary_selection_offer_v1#{}.destroy()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 1u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Sent immediately after creating announcing the"]
            #[doc = "wp_primary_selection_offer through"]
            #[doc = "wp_primary_selection_device.data_offer. One event is sent per offered"]
            #[doc = "mime type."]
            #[doc = ""]
            async fn offer(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                mime_type: String,
            ) -> crate::client::Result<()>;
        }
    }
    #[doc = ""]
    #[doc = "The source side of a wp_primary_selection_offer, it provides a way to"]
    #[doc = "describe the offered data and respond to requests to transfer the"]
    #[doc = "requested contents of the primary selection clipboard."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zwp_primary_selection_source_v1 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[doc = "Trait to implement the zwp_primary_selection_source_v1 interface. See the module level documentation for more info"]
        pub trait ZwpPrimarySelectionSourceV1 {
            const INTERFACE: &'static str = "zwp_primary_selection_source_v1";
            const VERSION: u32 = 1u32;
            async fn handle_event(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    0u16 => {
                        let mime_type = message
                            .string()?
                            .ok_or(crate::wire::DecodeError::MalformedPayload)?;
                        let fd = message.fd()?;
                        tracing::debug!(
                            "zwp_primary_selection_source_v1#{}.send(\"{}\", {})",
                            sender_id,
                            mime_type,
                            fd.as_raw_fd()
                        );
                        self.send(client, sender_id, mime_type, fd).await
                    }
                    1u16 => {
                        tracing::debug!(
                            "zwp_primary_selection_source_v1#{}.cancelled()",
                            sender_id,
                        );
                        self.cancelled(client, sender_id).await
                    }
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "This request adds a mime type to the set of mime types advertised to"]
            #[doc = "targets. Can be called several times to offer multiple types."]
            #[doc = ""]
            async fn offer(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                mime_type: String,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_primary_selection_source_v1#{}.offer()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_string(Some(mime_type))
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Destroy the primary selection source."]
            #[doc = ""]
            async fn destroy(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_primary_selection_source_v1#{}.destroy()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 1u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Request for the current primary selection contents from the client."]
            #[doc = "Send the specified mime type over the passed file descriptor, then"]
            #[doc = "close it."]
            #[doc = ""]
            async fn send(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                mime_type: String,
                fd: rustix::fd::OwnedFd,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "This primary selection source is no longer valid. The client should"]
            #[doc = "clean up and destroy this primary selection source."]
            #[doc = ""]
            async fn cancelled(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()>;
        }
    }
}
#[doc = ""]
#[doc = "This protocol specifies a set of interfaces used for making clients able to"]
#[doc = "receive relative pointer events not obstructed by barriers (such as the"]
#[doc = "monitor edge or other pointer barriers)."]
#[doc = ""]
#[doc = "To start receiving relative pointer events, a client must first bind the"]
#[doc = "global interface \"wp_relative_pointer_manager\" which, if a compositor"]
#[doc = "supports relative pointer motion events, is exposed by the registry. After"]
#[doc = "having created the relative pointer manager proxy object, the client uses"]
#[doc = "it to create the actual relative pointer object using the"]
#[doc = "\"get_relative_pointer\" request given a wl_pointer. The relative pointer"]
#[doc = "motion events will then, when applicable, be transmitted via the proxy of"]
#[doc = "the newly created relative pointer object. See the documentation of the"]
#[doc = "relative pointer interface for more details."]
#[doc = ""]
#[doc = "Warning! The protocol described in this file is experimental and backward"]
#[doc = "incompatible changes may be made. Backward compatible changes may be added"]
#[doc = "together with the corresponding interface version bump. Backward"]
#[doc = "incompatible changes are done by bumping the version number in the protocol"]
#[doc = "and interface names and resetting the interface version. Once the protocol"]
#[doc = "is to be declared stable, the 'z' prefix and the version number in the"]
#[doc = "protocol and interface names are removed and the interface version number is"]
#[doc = "reset."]
#[doc = ""]
#[allow(clippy::module_inception)]
pub mod relative_pointer_unstable_v1 {
    #[doc = ""]
    #[doc = "A global interface used for getting the relative pointer object for a"]
    #[doc = "given pointer."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zwp_relative_pointer_manager_v1 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[doc = "Trait to implement the zwp_relative_pointer_manager_v1 interface. See the module level documentation for more info"]
        pub trait ZwpRelativePointerManagerV1 {
            const INTERFACE: &'static str = "zwp_relative_pointer_manager_v1";
            const VERSION: u32 = 1u32;
            async fn handle_event(
                &self,
                _client: &mut crate::server::Client,
                _sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "Used by the client to notify the server that it will no longer use this"]
            #[doc = "relative pointer manager object."]
            #[doc = ""]
            async fn destroy(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_relative_pointer_manager_v1#{}.destroy()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Create a relative pointer interface given a wl_pointer object. See the"]
            #[doc = "wp_relative_pointer interface for more details."]
            #[doc = ""]
            async fn get_relative_pointer(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                id: crate::wire::ObjectId,
                pointer: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!(
                    "-> zwp_relative_pointer_manager_v1#{}.get_relative_pointer()",
                    sender_id
                );
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_object(Some(id))
                    .put_object(Some(pointer))
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 1u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
        }
    }
    #[doc = ""]
    #[doc = "A wp_relative_pointer object is an extension to the wl_pointer interface"]
    #[doc = "used for emitting relative pointer events. It shares the same focus as"]
    #[doc = "wl_pointer objects of the same seat and will only emit events when it has"]
    #[doc = "focus."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zwp_relative_pointer_v1 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[doc = "Trait to implement the zwp_relative_pointer_v1 interface. See the module level documentation for more info"]
        pub trait ZwpRelativePointerV1 {
            const INTERFACE: &'static str = "zwp_relative_pointer_v1";
            const VERSION: u32 = 1u32;
            async fn handle_event(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    0u16 => {
                        let utime_hi = message.uint()?;
                        let utime_lo = message.uint()?;
                        let dx = message.fixed()?;
                        let dy = message.fixed()?;
                        let dx_unaccel = message.fixed()?;
                        let dy_unaccel = message.fixed()?;
                        tracing::debug!(
                            "zwp_relative_pointer_v1#{}.relative_motion({}, {}, {}, {}, {}, {})",
                            sender_id,
                            utime_hi,
                            utime_lo,
                            dx,
                            dy,
                            dx_unaccel,
                            dy_unaccel
                        );
                        self.relative_motion(
                            client, sender_id, utime_hi, utime_lo, dx, dy, dx_unaccel, dy_unaccel,
                        )
                        .await
                    }
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            async fn destroy(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_relative_pointer_v1#{}.destroy()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Relative x/y pointer motion from the pointer of the seat associated with"]
            #[doc = "this object."]
            #[doc = ""]
            #[doc = "A relative motion is in the same dimension as regular wl_pointer motion"]
            #[doc = "events, except they do not represent an absolute position. For example,"]
            #[doc = "moving a pointer from (x, y) to (x', y') would have the equivalent"]
            #[doc = "relative motion (x' - x, y' - y). If a pointer motion caused the"]
            #[doc = "absolute pointer position to be clipped by for example the edge of the"]
            #[doc = "monitor, the relative motion is unaffected by the clipping and will"]
            #[doc = "represent the unclipped motion."]
            #[doc = ""]
            #[doc = "This event also contains non-accelerated motion deltas. The"]
            #[doc = "non-accelerated delta is, when applicable, the regular pointer motion"]
            #[doc = "delta as it was before having applied motion acceleration and other"]
            #[doc = "transformations such as normalization."]
            #[doc = ""]
            #[doc = "Note that the non-accelerated delta does not represent 'raw' events as"]
            #[doc = "they were read from some device. Pointer motion acceleration is device-"]
            #[doc = "and configuration-specific and non-accelerated deltas and accelerated"]
            #[doc = "deltas may have the same value on some devices."]
            #[doc = ""]
            #[doc = "Relative motions are not coupled to wl_pointer.motion events, and can be"]
            #[doc = "sent in combination with such events, but also independently. There may"]
            #[doc = "also be scenarios where wl_pointer.motion is sent, but there is no"]
            #[doc = "relative motion. The order of an absolute and relative motion event"]
            #[doc = "originating from the same physical motion is not guaranteed."]
            #[doc = ""]
            #[doc = "If the client needs button events or focus state, it can receive them"]
            #[doc = "from a wl_pointer object of the same seat that the wp_relative_pointer"]
            #[doc = "object is associated with."]
            #[doc = ""]
            async fn relative_motion(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                utime_hi: u32,
                utime_lo: u32,
                dx: crate::wire::Fixed,
                dy: crate::wire::Fixed,
                dx_unaccel: crate::wire::Fixed,
                dy_unaccel: crate::wire::Fixed,
            ) -> crate::client::Result<()>;
        }
    }
}
#[doc = ""]
#[doc = "This description provides a high-level overview of the interplay between"]
#[doc = "the interfaces defined this protocol. For details, see the protocol"]
#[doc = "specification."]
#[doc = ""]
#[doc = "More than one tablet may exist, and device-specifics matter. Tablets are"]
#[doc = "not represented by a single virtual device like wl_pointer. A client"]
#[doc = "binds to the tablet manager object which is just a proxy object. From"]
#[doc = "that, the client requests wp_tablet_manager.get_tablet_seat(wl_seat)"]
#[doc = "and that returns the actual interface that has all the tablets. With"]
#[doc = "this indirection, we can avoid merging wp_tablet into the actual Wayland"]
#[doc = "protocol, a long-term benefit."]
#[doc = ""]
#[doc = "The wp_tablet_seat sends a \"tablet added\" event for each tablet"]
#[doc = "connected. That event is followed by descriptive events about the"]
#[doc = "hardware; currently that includes events for name, vid/pid and"]
#[doc = "a wp_tablet.path event that describes a local path. This path can be"]
#[doc = "used to uniquely identify a tablet or get more information through"]
#[doc = "libwacom. Emulated or nested tablets can skip any of those, e.g. a"]
#[doc = "virtual tablet may not have a vid/pid. The sequence of descriptive"]
#[doc = "events is terminated by a wp_tablet.done event to signal that a client"]
#[doc = "may now finalize any initialization for that tablet."]
#[doc = ""]
#[doc = "Events from tablets require a tool in proximity. Tools are also managed"]
#[doc = "by the tablet seat; a \"tool added\" event is sent whenever a tool is new"]
#[doc = "to the compositor. That event is followed by a number of descriptive"]
#[doc = "events about the hardware; currently that includes capabilities,"]
#[doc = "hardware id and serial number, and tool type. Similar to the tablet"]
#[doc = "interface, a wp_tablet_tool.done event is sent to terminate that initial"]
#[doc = "sequence."]
#[doc = ""]
#[doc = "Any event from a tool happens on the wp_tablet_tool interface. When the"]
#[doc = "tool gets into proximity of the tablet, a proximity_in event is sent on"]
#[doc = "the wp_tablet_tool interface, listing the tablet and the surface. That"]
#[doc = "event is followed by a motion event with the coordinates. After that,"]
#[doc = "it's the usual motion, axis, button, etc. events. The protocol's"]
#[doc = "serialisation means events are grouped by wp_tablet_tool.frame events."]
#[doc = ""]
#[doc = "Two special events (that don't exist in X) are down and up. They signal"]
#[doc = "\"tip touching the surface\". For tablets without real proximity"]
#[doc = "detection, the sequence is: proximity_in, motion, down, frame."]
#[doc = ""]
#[doc = "When the tool leaves proximity, a proximity_out event is sent. If any"]
#[doc = "button is still down, a button release event is sent before this"]
#[doc = "proximity event. These button events are sent in the same frame as the"]
#[doc = "proximity event to signal to the client that the buttons were held when"]
#[doc = "the tool left proximity."]
#[doc = ""]
#[doc = "If the tool moves out of the surface but stays in proximity (i.e."]
#[doc = "between windows), compositor-specific grab policies apply. This usually"]
#[doc = "means that the proximity-out is delayed until all buttons are released."]
#[doc = ""]
#[doc = "Moving a tool physically from one tablet to the other has no real effect"]
#[doc = "on the protocol, since we already have the tool object from the \"tool"]
#[doc = "added\" event. All the information is already there and the proximity"]
#[doc = "events on both tablets are all a client needs to reconstruct what"]
#[doc = "happened."]
#[doc = ""]
#[doc = "Some extra axes are normalized, i.e. the client knows the range as"]
#[doc = "specified in the protocol (e.g. [0, 65535]), the granularity however is"]
#[doc = "unknown. The current normalized axes are pressure, distance, and slider."]
#[doc = ""]
#[doc = "Other extra axes are in physical units as specified in the protocol."]
#[doc = "The current extra axes with physical units are tilt, rotation and"]
#[doc = "wheel rotation."]
#[doc = ""]
#[doc = "Since tablets work independently of the pointer controlled by the mouse,"]
#[doc = "the focus handling is independent too and controlled by proximity."]
#[doc = "The wp_tablet_tool.set_cursor request sets a tool-specific cursor."]
#[doc = "This cursor surface may be the same as the mouse cursor, and it may be"]
#[doc = "the same across tools but it is possible to be more fine-grained. For"]
#[doc = "example, a client may set different cursors for the pen and eraser."]
#[doc = ""]
#[doc = "Tools are generally independent of tablets and it is"]
#[doc = "compositor-specific policy when a tool can be removed. Common approaches"]
#[doc = "will likely include some form of removing a tool when all tablets the"]
#[doc = "tool was used on are removed."]
#[doc = ""]
#[doc = "Warning! The protocol described in this file is experimental and"]
#[doc = "backward incompatible changes may be made. Backward compatible changes"]
#[doc = "may be added together with the corresponding interface version bump."]
#[doc = "Backward incompatible changes are done by bumping the version number in"]
#[doc = "the protocol and interface names and resetting the interface version."]
#[doc = "Once the protocol is to be declared stable, the 'z' prefix and the"]
#[doc = "version number in the protocol and interface names are removed and the"]
#[doc = "interface version number is reset."]
#[doc = ""]
#[allow(clippy::module_inception)]
pub mod tablet_unstable_v1 {
    #[doc = ""]
    #[doc = "An object that provides access to the graphics tablets available on this"]
    #[doc = "system. All tablets are associated with a seat, to get access to the"]
    #[doc = "actual tablets, use wp_tablet_manager.get_tablet_seat."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zwp_tablet_manager_v1 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[doc = "Trait to implement the zwp_tablet_manager_v1 interface. See the module level documentation for more info"]
        pub trait ZwpTabletManagerV1 {
            const INTERFACE: &'static str = "zwp_tablet_manager_v1";
            const VERSION: u32 = 1u32;
            async fn handle_event(
                &self,
                _client: &mut crate::server::Client,
                _sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "Get the wp_tablet_seat object for the given seat. This object"]
            #[doc = "provides access to all graphics tablets in this seat."]
            #[doc = ""]
            async fn get_tablet_seat(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                tablet_seat: crate::wire::ObjectId,
                seat: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_tablet_manager_v1#{}.get_tablet_seat()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_object(Some(tablet_seat))
                    .put_object(Some(seat))
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Destroy the wp_tablet_manager object. Objects created from this"]
            #[doc = "object are unaffected and should be destroyed separately."]
            #[doc = ""]
            async fn destroy(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_tablet_manager_v1#{}.destroy()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 1u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
        }
    }
    #[doc = ""]
    #[doc = "An object that provides access to the graphics tablets available on this"]
    #[doc = "seat. After binding to this interface, the compositor sends a set of"]
    #[doc = "wp_tablet_seat.tablet_added and wp_tablet_seat.tool_added events."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zwp_tablet_seat_v1 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[doc = "Trait to implement the zwp_tablet_seat_v1 interface. See the module level documentation for more info"]
        pub trait ZwpTabletSeatV1 {
            const INTERFACE: &'static str = "zwp_tablet_seat_v1";
            const VERSION: u32 = 1u32;
            async fn handle_event(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    0u16 => {
                        let id = message
                            .object()?
                            .ok_or(crate::wire::DecodeError::MalformedPayload)?;
                        tracing::debug!("zwp_tablet_seat_v1#{}.tablet_added({})", sender_id, id);
                        self.tablet_added(client, sender_id, id).await
                    }
                    1u16 => {
                        let id = message
                            .object()?
                            .ok_or(crate::wire::DecodeError::MalformedPayload)?;
                        tracing::debug!("zwp_tablet_seat_v1#{}.tool_added({})", sender_id, id);
                        self.tool_added(client, sender_id, id).await
                    }
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "Destroy the wp_tablet_seat object. Objects created from this"]
            #[doc = "object are unaffected and should be destroyed separately."]
            #[doc = ""]
            async fn destroy(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_tablet_seat_v1#{}.destroy()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "This event is sent whenever a new tablet becomes available on this"]
            #[doc = "seat. This event only provides the object id of the tablet, any"]
            #[doc = "static information about the tablet (device name, vid/pid, etc.) is"]
            #[doc = "sent through the wp_tablet interface."]
            #[doc = ""]
            async fn tablet_added(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                id: crate::wire::ObjectId,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "This event is sent whenever a tool that has not previously been used"]
            #[doc = "with a tablet comes into use. This event only provides the object id"]
            #[doc = "of the tool; any static information about the tool (capabilities,"]
            #[doc = "type, etc.) is sent through the wp_tablet_tool interface."]
            #[doc = ""]
            async fn tool_added(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                id: crate::wire::ObjectId,
            ) -> crate::client::Result<()>;
        }
    }
    #[doc = ""]
    #[doc = "An object that represents a physical tool that has been, or is"]
    #[doc = "currently in use with a tablet in this seat. Each wp_tablet_tool"]
    #[doc = "object stays valid until the client destroys it; the compositor"]
    #[doc = "reuses the wp_tablet_tool object to indicate that the object's"]
    #[doc = "respective physical tool has come into proximity of a tablet again."]
    #[doc = ""]
    #[doc = "A wp_tablet_tool object's relation to a physical tool depends on the"]
    #[doc = "tablet's ability to report serial numbers. If the tablet supports"]
    #[doc = "this capability, then the object represents a specific physical tool"]
    #[doc = "and can be identified even when used on multiple tablets."]
    #[doc = ""]
    #[doc = "A tablet tool has a number of static characteristics, e.g. tool type,"]
    #[doc = "hardware_serial and capabilities. These capabilities are sent in an"]
    #[doc = "event sequence after the wp_tablet_seat.tool_added event before any"]
    #[doc = "actual events from this tool. This initial event sequence is"]
    #[doc = "terminated by a wp_tablet_tool.done event."]
    #[doc = ""]
    #[doc = "Tablet tool events are grouped by wp_tablet_tool.frame events."]
    #[doc = "Any events received before a wp_tablet_tool.frame event should be"]
    #[doc = "considered part of the same hardware state change."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zwp_tablet_tool_v1 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[doc = ""]
        #[doc = "Describes the physical type of a tool. The physical type of a tool"]
        #[doc = "generally defines its base usage."]
        #[doc = ""]
        #[doc = "The mouse tool represents a mouse-shaped tool that is not a relative"]
        #[doc = "device but bound to the tablet's surface, providing absolute"]
        #[doc = "coordinates."]
        #[doc = ""]
        #[doc = "The lens tool is a mouse-shaped tool with an attached lens to"]
        #[doc = "provide precision focus."]
        #[doc = ""]
        #[repr(u32)]
        #[non_exhaustive]
        #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)]
        pub enum Type {
            #[doc = "Pen"]
            Pen = 320u32,
            #[doc = "Eraser"]
            Eraser = 321u32,
            #[doc = "Brush"]
            Brush = 322u32,
            #[doc = "Pencil"]
            Pencil = 323u32,
            #[doc = "Airbrush"]
            Airbrush = 324u32,
            #[doc = "Finger"]
            Finger = 325u32,
            #[doc = "Mouse"]
            Mouse = 326u32,
            #[doc = "Lens"]
            Lens = 327u32,
        }
        impl TryFrom<u32> for Type {
            type Error = crate::wire::DecodeError;
            fn try_from(v: u32) -> Result<Self, Self::Error> {
                match v {
                    320u32 => Ok(Self::Pen),
                    321u32 => Ok(Self::Eraser),
                    322u32 => Ok(Self::Brush),
                    323u32 => Ok(Self::Pencil),
                    324u32 => Ok(Self::Airbrush),
                    325u32 => Ok(Self::Finger),
                    326u32 => Ok(Self::Mouse),
                    327u32 => Ok(Self::Lens),
                    _ => Err(crate::wire::DecodeError::MalformedPayload),
                }
            }
        }
        impl std::fmt::Display for Type {
            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
                (*self as u32).fmt(f)
            }
        }
        #[doc = ""]
        #[doc = "Describes extra capabilities on a tablet."]
        #[doc = ""]
        #[doc = "Any tool must provide x and y values, extra axes are"]
        #[doc = "device-specific."]
        #[doc = ""]
        #[repr(u32)]
        #[non_exhaustive]
        #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)]
        pub enum Capability {
            #[doc = "Tilt axes"]
            Tilt = 1u32,
            #[doc = "Pressure axis"]
            Pressure = 2u32,
            #[doc = "Distance axis"]
            Distance = 3u32,
            #[doc = "Z-rotation axis"]
            Rotation = 4u32,
            #[doc = "Slider axis"]
            Slider = 5u32,
            #[doc = "Wheel axis"]
            Wheel = 6u32,
        }
        impl TryFrom<u32> for Capability {
            type Error = crate::wire::DecodeError;
            fn try_from(v: u32) -> Result<Self, Self::Error> {
                match v {
                    1u32 => Ok(Self::Tilt),
                    2u32 => Ok(Self::Pressure),
                    3u32 => Ok(Self::Distance),
                    4u32 => Ok(Self::Rotation),
                    5u32 => Ok(Self::Slider),
                    6u32 => Ok(Self::Wheel),
                    _ => Err(crate::wire::DecodeError::MalformedPayload),
                }
            }
        }
        impl std::fmt::Display for Capability {
            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
                (*self as u32).fmt(f)
            }
        }
        #[doc = ""]
        #[doc = "Describes the physical state of a button that produced the button event."]
        #[doc = ""]
        #[repr(u32)]
        #[non_exhaustive]
        #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)]
        pub enum ButtonState {
            #[doc = "button is not pressed"]
            Released = 0u32,
            #[doc = "button is pressed"]
            Pressed = 1u32,
        }
        impl TryFrom<u32> for ButtonState {
            type Error = crate::wire::DecodeError;
            fn try_from(v: u32) -> Result<Self, Self::Error> {
                match v {
                    0u32 => Ok(Self::Released),
                    1u32 => Ok(Self::Pressed),
                    _ => Err(crate::wire::DecodeError::MalformedPayload),
                }
            }
        }
        impl std::fmt::Display for ButtonState {
            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
                (*self as u32).fmt(f)
            }
        }
        #[repr(u32)]
        #[non_exhaustive]
        #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)]
        pub enum Error {
            #[doc = "given wl_surface has another role"]
            Role = 0u32,
        }
        impl TryFrom<u32> for Error {
            type Error = crate::wire::DecodeError;
            fn try_from(v: u32) -> Result<Self, Self::Error> {
                match v {
                    0u32 => Ok(Self::Role),
                    _ => Err(crate::wire::DecodeError::MalformedPayload),
                }
            }
        }
        impl std::fmt::Display for Error {
            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
                (*self as u32).fmt(f)
            }
        }
        #[doc = "Trait to implement the zwp_tablet_tool_v1 interface. See the module level documentation for more info"]
        pub trait ZwpTabletToolV1 {
            const INTERFACE: &'static str = "zwp_tablet_tool_v1";
            const VERSION: u32 = 1u32;
            async fn handle_event(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    0u16 => {
                        let tool_type = message.uint()?;
                        tracing::debug!("zwp_tablet_tool_v1#{}.type({})", sender_id, tool_type);
                        self.r#type(client, sender_id, tool_type.try_into()?).await
                    }
                    1u16 => {
                        let hardware_serial_hi = message.uint()?;
                        let hardware_serial_lo = message.uint()?;
                        tracing::debug!(
                            "zwp_tablet_tool_v1#{}.hardware_serial({}, {})",
                            sender_id,
                            hardware_serial_hi,
                            hardware_serial_lo
                        );
                        self.hardware_serial(
                            client,
                            sender_id,
                            hardware_serial_hi,
                            hardware_serial_lo,
                        )
                        .await
                    }
                    2u16 => {
                        let hardware_id_hi = message.uint()?;
                        let hardware_id_lo = message.uint()?;
                        tracing::debug!(
                            "zwp_tablet_tool_v1#{}.hardware_id_wacom({}, {})",
                            sender_id,
                            hardware_id_hi,
                            hardware_id_lo
                        );
                        self.hardware_id_wacom(client, sender_id, hardware_id_hi, hardware_id_lo)
                            .await
                    }
                    3u16 => {
                        let capability = message.uint()?;
                        tracing::debug!(
                            "zwp_tablet_tool_v1#{}.capability({})",
                            sender_id,
                            capability
                        );
                        self.capability(client, sender_id, capability.try_into()?)
                            .await
                    }
                    4u16 => {
                        tracing::debug!("zwp_tablet_tool_v1#{}.done()", sender_id,);
                        self.done(client, sender_id).await
                    }
                    5u16 => {
                        tracing::debug!("zwp_tablet_tool_v1#{}.removed()", sender_id,);
                        self.removed(client, sender_id).await
                    }
                    6u16 => {
                        let serial = message.uint()?;
                        let tablet = message
                            .object()?
                            .ok_or(crate::wire::DecodeError::MalformedPayload)?;
                        let surface = message
                            .object()?
                            .ok_or(crate::wire::DecodeError::MalformedPayload)?;
                        tracing::debug!(
                            "zwp_tablet_tool_v1#{}.proximity_in({}, {}, {})",
                            sender_id,
                            serial,
                            tablet,
                            surface
                        );
                        self.proximity_in(client, sender_id, serial, tablet, surface)
                            .await
                    }
                    7u16 => {
                        tracing::debug!("zwp_tablet_tool_v1#{}.proximity_out()", sender_id,);
                        self.proximity_out(client, sender_id).await
                    }
                    8u16 => {
                        let serial = message.uint()?;
                        tracing::debug!("zwp_tablet_tool_v1#{}.down({})", sender_id, serial);
                        self.down(client, sender_id, serial).await
                    }
                    9u16 => {
                        tracing::debug!("zwp_tablet_tool_v1#{}.up()", sender_id,);
                        self.up(client, sender_id).await
                    }
                    10u16 => {
                        let x = message.fixed()?;
                        let y = message.fixed()?;
                        tracing::debug!("zwp_tablet_tool_v1#{}.motion({}, {})", sender_id, x, y);
                        self.motion(client, sender_id, x, y).await
                    }
                    11u16 => {
                        let pressure = message.uint()?;
                        tracing::debug!("zwp_tablet_tool_v1#{}.pressure({})", sender_id, pressure);
                        self.pressure(client, sender_id, pressure).await
                    }
                    12u16 => {
                        let distance = message.uint()?;
                        tracing::debug!("zwp_tablet_tool_v1#{}.distance({})", sender_id, distance);
                        self.distance(client, sender_id, distance).await
                    }
                    13u16 => {
                        let tilt_x = message.int()?;
                        let tilt_y = message.int()?;
                        tracing::debug!(
                            "zwp_tablet_tool_v1#{}.tilt({}, {})",
                            sender_id,
                            tilt_x,
                            tilt_y
                        );
                        self.tilt(client, sender_id, tilt_x, tilt_y).await
                    }
                    14u16 => {
                        let degrees = message.int()?;
                        tracing::debug!("zwp_tablet_tool_v1#{}.rotation({})", sender_id, degrees);
                        self.rotation(client, sender_id, degrees).await
                    }
                    15u16 => {
                        let position = message.int()?;
                        tracing::debug!("zwp_tablet_tool_v1#{}.slider({})", sender_id, position);
                        self.slider(client, sender_id, position).await
                    }
                    16u16 => {
                        let degrees = message.int()?;
                        let clicks = message.int()?;
                        tracing::debug!(
                            "zwp_tablet_tool_v1#{}.wheel({}, {})",
                            sender_id,
                            degrees,
                            clicks
                        );
                        self.wheel(client, sender_id, degrees, clicks).await
                    }
                    17u16 => {
                        let serial = message.uint()?;
                        let button = message.uint()?;
                        let state = message.uint()?;
                        tracing::debug!(
                            "zwp_tablet_tool_v1#{}.button({}, {}, {})",
                            sender_id,
                            serial,
                            button,
                            state
                        );
                        self.button(client, sender_id, serial, button, state.try_into()?)
                            .await
                    }
                    18u16 => {
                        let time = message.uint()?;
                        tracing::debug!("zwp_tablet_tool_v1#{}.frame({})", sender_id, time);
                        self.frame(client, sender_id, time).await
                    }
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "Sets the surface of the cursor used for this tool on the given"]
            #[doc = "tablet. This request only takes effect if the tool is in proximity"]
            #[doc = "of one of the requesting client's surfaces or the surface parameter"]
            #[doc = "is the current pointer surface. If there was a previous surface set"]
            #[doc = "with this request it is replaced. If surface is NULL, the cursor"]
            #[doc = "image is hidden."]
            #[doc = ""]
            #[doc = "The parameters hotspot_x and hotspot_y define the position of the"]
            #[doc = "pointer surface relative to the pointer location. Its top-left corner"]
            #[doc = "is always at (x, y) - (hotspot_x, hotspot_y), where (x, y) are the"]
            #[doc = "coordinates of the pointer location, in surface-local coordinates."]
            #[doc = ""]
            #[doc = "On surface.attach requests to the pointer surface, hotspot_x and"]
            #[doc = "hotspot_y are decremented by the x and y parameters passed to the"]
            #[doc = "request. Attach must be confirmed by wl_surface.commit as usual."]
            #[doc = ""]
            #[doc = "The hotspot can also be updated by passing the currently set pointer"]
            #[doc = "surface to this request with new values for hotspot_x and hotspot_y."]
            #[doc = ""]
            #[doc = "The current and pending input regions of the wl_surface are cleared,"]
            #[doc = "and wl_surface.set_input_region is ignored until the wl_surface is no"]
            #[doc = "longer used as the cursor. When the use as a cursor ends, the current"]
            #[doc = "and pending input regions become undefined, and the wl_surface is"]
            #[doc = "unmapped."]
            #[doc = ""]
            #[doc = "This request gives the surface the role of a cursor. The role"]
            #[doc = "assigned by this request is the same as assigned by"]
            #[doc = "wl_pointer.set_cursor meaning the same surface can be"]
            #[doc = "used both as a wl_pointer cursor and a wp_tablet cursor. If the"]
            #[doc = "surface already has another role, it raises a protocol error."]
            #[doc = "The surface may be used on multiple tablets and across multiple"]
            #[doc = "seats."]
            #[doc = ""]
            async fn set_cursor(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                serial: u32,
                surface: Option<crate::wire::ObjectId>,
                hotspot_x: i32,
                hotspot_y: i32,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_tablet_tool_v1#{}.set_cursor()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_uint(serial)
                    .put_object(surface)
                    .put_int(hotspot_x)
                    .put_int(hotspot_y)
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "This destroys the client's resource for this tool object."]
            #[doc = ""]
            async fn destroy(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_tablet_tool_v1#{}.destroy()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 1u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "The tool type is the high-level type of the tool and usually decides"]
            #[doc = "the interaction expected from this tool."]
            #[doc = ""]
            #[doc = "This event is sent in the initial burst of events before the"]
            #[doc = "wp_tablet_tool.done event."]
            #[doc = ""]
            async fn r#type(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                tool_type: Type,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "If the physical tool can be identified by a unique 64-bit serial"]
            #[doc = "number, this event notifies the client of this serial number."]
            #[doc = ""]
            #[doc = "If multiple tablets are available in the same seat and the tool is"]
            #[doc = "uniquely identifiable by the serial number, that tool may move"]
            #[doc = "between tablets."]
            #[doc = ""]
            #[doc = "Otherwise, if the tool has no serial number and this event is"]
            #[doc = "missing, the tool is tied to the tablet it first comes into"]
            #[doc = "proximity with. Even if the physical tool is used on multiple"]
            #[doc = "tablets, separate wp_tablet_tool objects will be created, one per"]
            #[doc = "tablet."]
            #[doc = ""]
            #[doc = "This event is sent in the initial burst of events before the"]
            #[doc = "wp_tablet_tool.done event."]
            #[doc = ""]
            async fn hardware_serial(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                hardware_serial_hi: u32,
                hardware_serial_lo: u32,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "This event notifies the client of a hardware id available on this tool."]
            #[doc = ""]
            #[doc = "The hardware id is a device-specific 64-bit id that provides extra"]
            #[doc = "information about the tool in use, beyond the wl_tool.type"]
            #[doc = "enumeration. The format of the id is specific to tablets made by"]
            #[doc = "Wacom Inc. For example, the hardware id of a Wacom Grip"]
            #[doc = "Pen (a stylus) is 0x802."]
            #[doc = ""]
            #[doc = "This event is sent in the initial burst of events before the"]
            #[doc = "wp_tablet_tool.done event."]
            #[doc = ""]
            async fn hardware_id_wacom(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                hardware_id_hi: u32,
                hardware_id_lo: u32,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "This event notifies the client of any capabilities of this tool,"]
            #[doc = "beyond the main set of x/y axes and tip up/down detection."]
            #[doc = ""]
            #[doc = "One event is sent for each extra capability available on this tool."]
            #[doc = ""]
            #[doc = "This event is sent in the initial burst of events before the"]
            #[doc = "wp_tablet_tool.done event."]
            #[doc = ""]
            async fn capability(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                capability: Capability,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "This event signals the end of the initial burst of descriptive"]
            #[doc = "events. A client may consider the static description of the tool to"]
            #[doc = "be complete and finalize initialization of the tool."]
            #[doc = ""]
            async fn done(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "This event is sent when the tool is removed from the system and will"]
            #[doc = "send no further events. Should the physical tool come back into"]
            #[doc = "proximity later, a new wp_tablet_tool object will be created."]
            #[doc = ""]
            #[doc = "It is compositor-dependent when a tool is removed. A compositor may"]
            #[doc = "remove a tool on proximity out, tablet removal or any other reason."]
            #[doc = "A compositor may also keep a tool alive until shutdown."]
            #[doc = ""]
            #[doc = "If the tool is currently in proximity, a proximity_out event will be"]
            #[doc = "sent before the removed event. See wp_tablet_tool.proximity_out for"]
            #[doc = "the handling of any buttons logically down."]
            #[doc = ""]
            #[doc = "When this event is received, the client must wp_tablet_tool.destroy"]
            #[doc = "the object."]
            #[doc = ""]
            async fn removed(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Notification that this tool is focused on a certain surface."]
            #[doc = ""]
            #[doc = "This event can be received when the tool has moved from one surface to"]
            #[doc = "another, or when the tool has come back into proximity above the"]
            #[doc = "surface."]
            #[doc = ""]
            #[doc = "If any button is logically down when the tool comes into proximity,"]
            #[doc = "the respective button event is sent after the proximity_in event but"]
            #[doc = "within the same frame as the proximity_in event."]
            #[doc = ""]
            async fn proximity_in(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                serial: u32,
                tablet: crate::wire::ObjectId,
                surface: crate::wire::ObjectId,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Notification that this tool has either left proximity, or is no"]
            #[doc = "longer focused on a certain surface."]
            #[doc = ""]
            #[doc = "When the tablet tool leaves proximity of the tablet, button release"]
            #[doc = "events are sent for each button that was held down at the time of"]
            #[doc = "leaving proximity. These events are sent before the proximity_out"]
            #[doc = "event but within the same wp_tablet.frame."]
            #[doc = ""]
            #[doc = "If the tool stays within proximity of the tablet, but the focus"]
            #[doc = "changes from one surface to another, a button release event may not"]
            #[doc = "be sent until the button is actually released or the tool leaves the"]
            #[doc = "proximity of the tablet."]
            #[doc = ""]
            async fn proximity_out(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Sent whenever the tablet tool comes in contact with the surface of the"]
            #[doc = "tablet."]
            #[doc = ""]
            #[doc = "If the tool is already in contact with the tablet when entering the"]
            #[doc = "input region, the client owning said region will receive a"]
            #[doc = "wp_tablet.proximity_in event, followed by a wp_tablet.down"]
            #[doc = "event and a wp_tablet.frame event."]
            #[doc = ""]
            #[doc = "Note that this event describes logical contact, not physical"]
            #[doc = "contact. On some devices, a compositor may not consider a tool in"]
            #[doc = "logical contact until a minimum physical pressure threshold is"]
            #[doc = "exceeded."]
            #[doc = ""]
            async fn down(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                serial: u32,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Sent whenever the tablet tool stops making contact with the surface of"]
            #[doc = "the tablet, or when the tablet tool moves out of the input region"]
            #[doc = "and the compositor grab (if any) is dismissed."]
            #[doc = ""]
            #[doc = "If the tablet tool moves out of the input region while in contact"]
            #[doc = "with the surface of the tablet and the compositor does not have an"]
            #[doc = "ongoing grab on the surface, the client owning said region will"]
            #[doc = "receive a wp_tablet.up event, followed by a wp_tablet.proximity_out"]
            #[doc = "event and a wp_tablet.frame event. If the compositor has an ongoing"]
            #[doc = "grab on this device, this event sequence is sent whenever the grab"]
            #[doc = "is dismissed in the future."]
            #[doc = ""]
            #[doc = "Note that this event describes logical contact, not physical"]
            #[doc = "contact. On some devices, a compositor may not consider a tool out"]
            #[doc = "of logical contact until physical pressure falls below a specific"]
            #[doc = "threshold."]
            #[doc = ""]
            async fn up(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Sent whenever a tablet tool moves."]
            #[doc = ""]
            async fn motion(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                x: crate::wire::Fixed,
                y: crate::wire::Fixed,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Sent whenever the pressure axis on a tool changes. The value of this"]
            #[doc = "event is normalized to a value between 0 and 65535."]
            #[doc = ""]
            #[doc = "Note that pressure may be nonzero even when a tool is not in logical"]
            #[doc = "contact. See the down and up events for more details."]
            #[doc = ""]
            async fn pressure(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                pressure: u32,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Sent whenever the distance axis on a tool changes. The value of this"]
            #[doc = "event is normalized to a value between 0 and 65535."]
            #[doc = ""]
            #[doc = "Note that distance may be nonzero even when a tool is not in logical"]
            #[doc = "contact. See the down and up events for more details."]
            #[doc = ""]
            async fn distance(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                distance: u32,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Sent whenever one or both of the tilt axes on a tool change. Each tilt"]
            #[doc = "value is in 0.01 of a degree, relative to the z-axis of the tablet."]
            #[doc = "The angle is positive when the top of a tool tilts along the"]
            #[doc = "positive x or y axis."]
            #[doc = ""]
            async fn tilt(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                tilt_x: i32,
                tilt_y: i32,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Sent whenever the z-rotation axis on the tool changes. The"]
            #[doc = "rotation value is in 0.01 of a degree clockwise from the tool's"]
            #[doc = "logical neutral position."]
            #[doc = ""]
            async fn rotation(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                degrees: i32,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Sent whenever the slider position on the tool changes. The"]
            #[doc = "value is normalized between -65535 and 65535, with 0 as the logical"]
            #[doc = "neutral position of the slider."]
            #[doc = ""]
            #[doc = "The slider is available on e.g. the Wacom Airbrush tool."]
            #[doc = ""]
            async fn slider(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                position: i32,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Sent whenever the wheel on the tool emits an event. This event"]
            #[doc = "contains two values for the same axis change. The degrees value is"]
            #[doc = "in 0.01 of a degree in the same orientation as the"]
            #[doc = "wl_pointer.vertical_scroll axis. The clicks value is in discrete"]
            #[doc = "logical clicks of the mouse wheel. This value may be zero if the"]
            #[doc = "movement of the wheel was less than one logical click."]
            #[doc = ""]
            #[doc = "Clients should choose either value and avoid mixing degrees and"]
            #[doc = "clicks. The compositor may accumulate values smaller than a logical"]
            #[doc = "click and emulate click events when a certain threshold is met."]
            #[doc = "Thus, wl_tablet_tool.wheel events with non-zero clicks values may"]
            #[doc = "have different degrees values."]
            #[doc = ""]
            async fn wheel(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                degrees: i32,
                clicks: i32,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Sent whenever a button on the tool is pressed or released."]
            #[doc = ""]
            #[doc = "If a button is held down when the tool moves in or out of proximity,"]
            #[doc = "button events are generated by the compositor. See"]
            #[doc = "wp_tablet_tool.proximity_in and wp_tablet_tool.proximity_out for"]
            #[doc = "details."]
            #[doc = ""]
            async fn button(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                serial: u32,
                button: u32,
                state: ButtonState,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Marks the end of a series of axis and/or button updates from the"]
            #[doc = "tablet. The Wayland protocol requires axis updates to be sent"]
            #[doc = "sequentially, however all events within a frame should be considered"]
            #[doc = "one hardware event."]
            #[doc = ""]
            async fn frame(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                time: u32,
            ) -> crate::client::Result<()>;
        }
    }
    #[doc = ""]
    #[doc = "The wp_tablet interface represents one graphics tablet device. The"]
    #[doc = "tablet interface itself does not generate events; all events are"]
    #[doc = "generated by wp_tablet_tool objects when in proximity above a tablet."]
    #[doc = ""]
    #[doc = "A tablet has a number of static characteristics, e.g. device name and"]
    #[doc = "pid/vid. These capabilities are sent in an event sequence after the"]
    #[doc = "wp_tablet_seat.tablet_added event. This initial event sequence is"]
    #[doc = "terminated by a wp_tablet.done event."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zwp_tablet_v1 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[doc = "Trait to implement the zwp_tablet_v1 interface. See the module level documentation for more info"]
        pub trait ZwpTabletV1 {
            const INTERFACE: &'static str = "zwp_tablet_v1";
            const VERSION: u32 = 1u32;
            async fn handle_event(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    0u16 => {
                        let name = message
                            .string()?
                            .ok_or(crate::wire::DecodeError::MalformedPayload)?;
                        tracing::debug!("zwp_tablet_v1#{}.name(\"{}\")", sender_id, name);
                        self.name(client, sender_id, name).await
                    }
                    1u16 => {
                        let vid = message.uint()?;
                        let pid = message.uint()?;
                        tracing::debug!("zwp_tablet_v1#{}.id({}, {})", sender_id, vid, pid);
                        self.id(client, sender_id, vid, pid).await
                    }
                    2u16 => {
                        let path = message
                            .string()?
                            .ok_or(crate::wire::DecodeError::MalformedPayload)?;
                        tracing::debug!("zwp_tablet_v1#{}.path(\"{}\")", sender_id, path);
                        self.path(client, sender_id, path).await
                    }
                    3u16 => {
                        tracing::debug!("zwp_tablet_v1#{}.done()", sender_id,);
                        self.done(client, sender_id).await
                    }
                    4u16 => {
                        tracing::debug!("zwp_tablet_v1#{}.removed()", sender_id,);
                        self.removed(client, sender_id).await
                    }
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "This destroys the client's resource for this tablet object."]
            #[doc = ""]
            async fn destroy(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_tablet_v1#{}.destroy()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "This event is sent in the initial burst of events before the"]
            #[doc = "wp_tablet.done event."]
            #[doc = ""]
            async fn name(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                name: String,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "This event is sent in the initial burst of events before the"]
            #[doc = "wp_tablet.done event."]
            #[doc = ""]
            async fn id(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                vid: u32,
                pid: u32,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "A system-specific device path that indicates which device is behind"]
            #[doc = "this wp_tablet. This information may be used to gather additional"]
            #[doc = "information about the device, e.g. through libwacom."]
            #[doc = ""]
            #[doc = "A device may have more than one device path. If so, multiple"]
            #[doc = "wp_tablet.path events are sent. A device may be emulated and not"]
            #[doc = "have a device path, and in that case this event will not be sent."]
            #[doc = ""]
            #[doc = "The format of the path is unspecified, it may be a device node, a"]
            #[doc = "sysfs path, or some other identifier. It is up to the client to"]
            #[doc = "identify the string provided."]
            #[doc = ""]
            #[doc = "This event is sent in the initial burst of events before the"]
            #[doc = "wp_tablet.done event."]
            #[doc = ""]
            async fn path(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                path: String,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "This event is sent immediately to signal the end of the initial"]
            #[doc = "burst of descriptive events. A client may consider the static"]
            #[doc = "description of the tablet to be complete and finalize initialization"]
            #[doc = "of the tablet."]
            #[doc = ""]
            async fn done(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Sent when the tablet has been removed from the system. When a tablet"]
            #[doc = "is removed, some tools may be removed."]
            #[doc = ""]
            #[doc = "When this event is received, the client must wp_tablet.destroy"]
            #[doc = "the object."]
            #[doc = ""]
            async fn removed(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()>;
        }
    }
}
#[doc = ""]
#[doc = "This description provides a high-level overview of the interplay between"]
#[doc = "the interfaces defined this protocol. For details, see the protocol"]
#[doc = "specification."]
#[doc = ""]
#[doc = "More than one tablet may exist, and device-specifics matter. Tablets are"]
#[doc = "not represented by a single virtual device like wl_pointer. A client"]
#[doc = "binds to the tablet manager object which is just a proxy object. From"]
#[doc = "that, the client requests wp_tablet_manager.get_tablet_seat(wl_seat)"]
#[doc = "and that returns the actual interface that has all the tablets. With"]
#[doc = "this indirection, we can avoid merging wp_tablet into the actual Wayland"]
#[doc = "protocol, a long-term benefit."]
#[doc = ""]
#[doc = "The wp_tablet_seat sends a \"tablet added\" event for each tablet"]
#[doc = "connected. That event is followed by descriptive events about the"]
#[doc = "hardware; currently that includes events for name, vid/pid and"]
#[doc = "a wp_tablet.path event that describes a local path. This path can be"]
#[doc = "used to uniquely identify a tablet or get more information through"]
#[doc = "libwacom. Emulated or nested tablets can skip any of those, e.g. a"]
#[doc = "virtual tablet may not have a vid/pid. The sequence of descriptive"]
#[doc = "events is terminated by a wp_tablet.done event to signal that a client"]
#[doc = "may now finalize any initialization for that tablet."]
#[doc = ""]
#[doc = "Events from tablets require a tool in proximity. Tools are also managed"]
#[doc = "by the tablet seat; a \"tool added\" event is sent whenever a tool is new"]
#[doc = "to the compositor. That event is followed by a number of descriptive"]
#[doc = "events about the hardware; currently that includes capabilities,"]
#[doc = "hardware id and serial number, and tool type. Similar to the tablet"]
#[doc = "interface, a wp_tablet_tool.done event is sent to terminate that initial"]
#[doc = "sequence."]
#[doc = ""]
#[doc = "Any event from a tool happens on the wp_tablet_tool interface. When the"]
#[doc = "tool gets into proximity of the tablet, a proximity_in event is sent on"]
#[doc = "the wp_tablet_tool interface, listing the tablet and the surface. That"]
#[doc = "event is followed by a motion event with the coordinates. After that,"]
#[doc = "it's the usual motion, axis, button, etc. events. The protocol's"]
#[doc = "serialisation means events are grouped by wp_tablet_tool.frame events."]
#[doc = ""]
#[doc = "Two special events (that don't exist in X) are down and up. They signal"]
#[doc = "\"tip touching the surface\". For tablets without real proximity"]
#[doc = "detection, the sequence is: proximity_in, motion, down, frame."]
#[doc = ""]
#[doc = "When the tool leaves proximity, a proximity_out event is sent. If any"]
#[doc = "button is still down, a button release event is sent before this"]
#[doc = "proximity event. These button events are sent in the same frame as the"]
#[doc = "proximity event to signal to the client that the buttons were held when"]
#[doc = "the tool left proximity."]
#[doc = ""]
#[doc = "If the tool moves out of the surface but stays in proximity (i.e."]
#[doc = "between windows), compositor-specific grab policies apply. This usually"]
#[doc = "means that the proximity-out is delayed until all buttons are released."]
#[doc = ""]
#[doc = "Moving a tool physically from one tablet to the other has no real effect"]
#[doc = "on the protocol, since we already have the tool object from the \"tool"]
#[doc = "added\" event. All the information is already there and the proximity"]
#[doc = "events on both tablets are all a client needs to reconstruct what"]
#[doc = "happened."]
#[doc = ""]
#[doc = "Some extra axes are normalized, i.e. the client knows the range as"]
#[doc = "specified in the protocol (e.g. [0, 65535]), the granularity however is"]
#[doc = "unknown. The current normalized axes are pressure, distance, and slider."]
#[doc = ""]
#[doc = "Other extra axes are in physical units as specified in the protocol."]
#[doc = "The current extra axes with physical units are tilt, rotation and"]
#[doc = "wheel rotation."]
#[doc = ""]
#[doc = "Since tablets work independently of the pointer controlled by the mouse,"]
#[doc = "the focus handling is independent too and controlled by proximity."]
#[doc = "The wp_tablet_tool.set_cursor request sets a tool-specific cursor."]
#[doc = "This cursor surface may be the same as the mouse cursor, and it may be"]
#[doc = "the same across tools but it is possible to be more fine-grained. For"]
#[doc = "example, a client may set different cursors for the pen and eraser."]
#[doc = ""]
#[doc = "Tools are generally independent of tablets and it is"]
#[doc = "compositor-specific policy when a tool can be removed. Common approaches"]
#[doc = "will likely include some form of removing a tool when all tablets the"]
#[doc = "tool was used on are removed."]
#[doc = ""]
#[doc = "Disclaimer: This protocol extension has been marked stable. This copy is"]
#[doc = "no longer used and only retained for backwards compatibility. The"]
#[doc = "canonical version can be found in the stable/ directory."]
#[doc = ""]
#[allow(clippy::module_inception)]
pub mod tablet_unstable_v2 {
    #[doc = ""]
    #[doc = "An object that provides access to the graphics tablets available on this"]
    #[doc = "system. All tablets are associated with a seat, to get access to the"]
    #[doc = "actual tablets, use wp_tablet_manager.get_tablet_seat."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zwp_tablet_manager_v2 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[doc = "Trait to implement the zwp_tablet_manager_v2 interface. See the module level documentation for more info"]
        pub trait ZwpTabletManagerV2 {
            const INTERFACE: &'static str = "zwp_tablet_manager_v2";
            const VERSION: u32 = 1u32;
            async fn handle_event(
                &self,
                _client: &mut crate::server::Client,
                _sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "Get the wp_tablet_seat object for the given seat. This object"]
            #[doc = "provides access to all graphics tablets in this seat."]
            #[doc = ""]
            async fn get_tablet_seat(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                tablet_seat: crate::wire::ObjectId,
                seat: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_tablet_manager_v2#{}.get_tablet_seat()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_object(Some(tablet_seat))
                    .put_object(Some(seat))
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Destroy the wp_tablet_manager object. Objects created from this"]
            #[doc = "object are unaffected and should be destroyed separately."]
            #[doc = ""]
            async fn destroy(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_tablet_manager_v2#{}.destroy()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 1u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
        }
    }
    #[doc = ""]
    #[doc = "An object that provides access to the graphics tablets available on this"]
    #[doc = "seat. After binding to this interface, the compositor sends a set of"]
    #[doc = "wp_tablet_seat.tablet_added and wp_tablet_seat.tool_added events."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zwp_tablet_seat_v2 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[doc = "Trait to implement the zwp_tablet_seat_v2 interface. See the module level documentation for more info"]
        pub trait ZwpTabletSeatV2 {
            const INTERFACE: &'static str = "zwp_tablet_seat_v2";
            const VERSION: u32 = 1u32;
            async fn handle_event(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    0u16 => {
                        let id = message
                            .object()?
                            .ok_or(crate::wire::DecodeError::MalformedPayload)?;
                        tracing::debug!("zwp_tablet_seat_v2#{}.tablet_added({})", sender_id, id);
                        self.tablet_added(client, sender_id, id).await
                    }
                    1u16 => {
                        let id = message
                            .object()?
                            .ok_or(crate::wire::DecodeError::MalformedPayload)?;
                        tracing::debug!("zwp_tablet_seat_v2#{}.tool_added({})", sender_id, id);
                        self.tool_added(client, sender_id, id).await
                    }
                    2u16 => {
                        let id = message
                            .object()?
                            .ok_or(crate::wire::DecodeError::MalformedPayload)?;
                        tracing::debug!("zwp_tablet_seat_v2#{}.pad_added({})", sender_id, id);
                        self.pad_added(client, sender_id, id).await
                    }
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "Destroy the wp_tablet_seat object. Objects created from this"]
            #[doc = "object are unaffected and should be destroyed separately."]
            #[doc = ""]
            async fn destroy(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_tablet_seat_v2#{}.destroy()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "This event is sent whenever a new tablet becomes available on this"]
            #[doc = "seat. This event only provides the object id of the tablet, any"]
            #[doc = "static information about the tablet (device name, vid/pid, etc.) is"]
            #[doc = "sent through the wp_tablet interface."]
            #[doc = ""]
            async fn tablet_added(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                id: crate::wire::ObjectId,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "This event is sent whenever a tool that has not previously been used"]
            #[doc = "with a tablet comes into use. This event only provides the object id"]
            #[doc = "of the tool; any static information about the tool (capabilities,"]
            #[doc = "type, etc.) is sent through the wp_tablet_tool interface."]
            #[doc = ""]
            async fn tool_added(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                id: crate::wire::ObjectId,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "This event is sent whenever a new pad is known to the system. Typically,"]
            #[doc = "pads are physically attached to tablets and a pad_added event is"]
            #[doc = "sent immediately after the wp_tablet_seat.tablet_added."]
            #[doc = "However, some standalone pad devices logically attach to tablets at"]
            #[doc = "runtime, and the client must wait for wp_tablet_pad.enter to know"]
            #[doc = "the tablet a pad is attached to."]
            #[doc = ""]
            #[doc = "This event only provides the object id of the pad. All further"]
            #[doc = "features (buttons, strips, rings) are sent through the wp_tablet_pad"]
            #[doc = "interface."]
            #[doc = ""]
            async fn pad_added(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                id: crate::wire::ObjectId,
            ) -> crate::client::Result<()>;
        }
    }
    #[doc = ""]
    #[doc = "An object that represents a physical tool that has been, or is"]
    #[doc = "currently in use with a tablet in this seat. Each wp_tablet_tool"]
    #[doc = "object stays valid until the client destroys it; the compositor"]
    #[doc = "reuses the wp_tablet_tool object to indicate that the object's"]
    #[doc = "respective physical tool has come into proximity of a tablet again."]
    #[doc = ""]
    #[doc = "A wp_tablet_tool object's relation to a physical tool depends on the"]
    #[doc = "tablet's ability to report serial numbers. If the tablet supports"]
    #[doc = "this capability, then the object represents a specific physical tool"]
    #[doc = "and can be identified even when used on multiple tablets."]
    #[doc = ""]
    #[doc = "A tablet tool has a number of static characteristics, e.g. tool type,"]
    #[doc = "hardware_serial and capabilities. These capabilities are sent in an"]
    #[doc = "event sequence after the wp_tablet_seat.tool_added event before any"]
    #[doc = "actual events from this tool. This initial event sequence is"]
    #[doc = "terminated by a wp_tablet_tool.done event."]
    #[doc = ""]
    #[doc = "Tablet tool events are grouped by wp_tablet_tool.frame events."]
    #[doc = "Any events received before a wp_tablet_tool.frame event should be"]
    #[doc = "considered part of the same hardware state change."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zwp_tablet_tool_v2 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[doc = ""]
        #[doc = "Describes the physical type of a tool. The physical type of a tool"]
        #[doc = "generally defines its base usage."]
        #[doc = ""]
        #[doc = "The mouse tool represents a mouse-shaped tool that is not a relative"]
        #[doc = "device but bound to the tablet's surface, providing absolute"]
        #[doc = "coordinates."]
        #[doc = ""]
        #[doc = "The lens tool is a mouse-shaped tool with an attached lens to"]
        #[doc = "provide precision focus."]
        #[doc = ""]
        #[repr(u32)]
        #[non_exhaustive]
        #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)]
        pub enum Type {
            #[doc = "Pen"]
            Pen = 320u32,
            #[doc = "Eraser"]
            Eraser = 321u32,
            #[doc = "Brush"]
            Brush = 322u32,
            #[doc = "Pencil"]
            Pencil = 323u32,
            #[doc = "Airbrush"]
            Airbrush = 324u32,
            #[doc = "Finger"]
            Finger = 325u32,
            #[doc = "Mouse"]
            Mouse = 326u32,
            #[doc = "Lens"]
            Lens = 327u32,
        }
        impl TryFrom<u32> for Type {
            type Error = crate::wire::DecodeError;
            fn try_from(v: u32) -> Result<Self, Self::Error> {
                match v {
                    320u32 => Ok(Self::Pen),
                    321u32 => Ok(Self::Eraser),
                    322u32 => Ok(Self::Brush),
                    323u32 => Ok(Self::Pencil),
                    324u32 => Ok(Self::Airbrush),
                    325u32 => Ok(Self::Finger),
                    326u32 => Ok(Self::Mouse),
                    327u32 => Ok(Self::Lens),
                    _ => Err(crate::wire::DecodeError::MalformedPayload),
                }
            }
        }
        impl std::fmt::Display for Type {
            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
                (*self as u32).fmt(f)
            }
        }
        #[doc = ""]
        #[doc = "Describes extra capabilities on a tablet."]
        #[doc = ""]
        #[doc = "Any tool must provide x and y values, extra axes are"]
        #[doc = "device-specific."]
        #[doc = ""]
        #[repr(u32)]
        #[non_exhaustive]
        #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)]
        pub enum Capability {
            #[doc = "Tilt axes"]
            Tilt = 1u32,
            #[doc = "Pressure axis"]
            Pressure = 2u32,
            #[doc = "Distance axis"]
            Distance = 3u32,
            #[doc = "Z-rotation axis"]
            Rotation = 4u32,
            #[doc = "Slider axis"]
            Slider = 5u32,
            #[doc = "Wheel axis"]
            Wheel = 6u32,
        }
        impl TryFrom<u32> for Capability {
            type Error = crate::wire::DecodeError;
            fn try_from(v: u32) -> Result<Self, Self::Error> {
                match v {
                    1u32 => Ok(Self::Tilt),
                    2u32 => Ok(Self::Pressure),
                    3u32 => Ok(Self::Distance),
                    4u32 => Ok(Self::Rotation),
                    5u32 => Ok(Self::Slider),
                    6u32 => Ok(Self::Wheel),
                    _ => Err(crate::wire::DecodeError::MalformedPayload),
                }
            }
        }
        impl std::fmt::Display for Capability {
            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
                (*self as u32).fmt(f)
            }
        }
        #[doc = ""]
        #[doc = "Describes the physical state of a button that produced the button event."]
        #[doc = ""]
        #[repr(u32)]
        #[non_exhaustive]
        #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)]
        pub enum ButtonState {
            #[doc = "button is not pressed"]
            Released = 0u32,
            #[doc = "button is pressed"]
            Pressed = 1u32,
        }
        impl TryFrom<u32> for ButtonState {
            type Error = crate::wire::DecodeError;
            fn try_from(v: u32) -> Result<Self, Self::Error> {
                match v {
                    0u32 => Ok(Self::Released),
                    1u32 => Ok(Self::Pressed),
                    _ => Err(crate::wire::DecodeError::MalformedPayload),
                }
            }
        }
        impl std::fmt::Display for ButtonState {
            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
                (*self as u32).fmt(f)
            }
        }
        #[repr(u32)]
        #[non_exhaustive]
        #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)]
        pub enum Error {
            #[doc = "given wl_surface has another role"]
            Role = 0u32,
        }
        impl TryFrom<u32> for Error {
            type Error = crate::wire::DecodeError;
            fn try_from(v: u32) -> Result<Self, Self::Error> {
                match v {
                    0u32 => Ok(Self::Role),
                    _ => Err(crate::wire::DecodeError::MalformedPayload),
                }
            }
        }
        impl std::fmt::Display for Error {
            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
                (*self as u32).fmt(f)
            }
        }
        #[doc = "Trait to implement the zwp_tablet_tool_v2 interface. See the module level documentation for more info"]
        pub trait ZwpTabletToolV2 {
            const INTERFACE: &'static str = "zwp_tablet_tool_v2";
            const VERSION: u32 = 1u32;
            async fn handle_event(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    0u16 => {
                        let tool_type = message.uint()?;
                        tracing::debug!("zwp_tablet_tool_v2#{}.type({})", sender_id, tool_type);
                        self.r#type(client, sender_id, tool_type.try_into()?).await
                    }
                    1u16 => {
                        let hardware_serial_hi = message.uint()?;
                        let hardware_serial_lo = message.uint()?;
                        tracing::debug!(
                            "zwp_tablet_tool_v2#{}.hardware_serial({}, {})",
                            sender_id,
                            hardware_serial_hi,
                            hardware_serial_lo
                        );
                        self.hardware_serial(
                            client,
                            sender_id,
                            hardware_serial_hi,
                            hardware_serial_lo,
                        )
                        .await
                    }
                    2u16 => {
                        let hardware_id_hi = message.uint()?;
                        let hardware_id_lo = message.uint()?;
                        tracing::debug!(
                            "zwp_tablet_tool_v2#{}.hardware_id_wacom({}, {})",
                            sender_id,
                            hardware_id_hi,
                            hardware_id_lo
                        );
                        self.hardware_id_wacom(client, sender_id, hardware_id_hi, hardware_id_lo)
                            .await
                    }
                    3u16 => {
                        let capability = message.uint()?;
                        tracing::debug!(
                            "zwp_tablet_tool_v2#{}.capability({})",
                            sender_id,
                            capability
                        );
                        self.capability(client, sender_id, capability.try_into()?)
                            .await
                    }
                    4u16 => {
                        tracing::debug!("zwp_tablet_tool_v2#{}.done()", sender_id,);
                        self.done(client, sender_id).await
                    }
                    5u16 => {
                        tracing::debug!("zwp_tablet_tool_v2#{}.removed()", sender_id,);
                        self.removed(client, sender_id).await
                    }
                    6u16 => {
                        let serial = message.uint()?;
                        let tablet = message
                            .object()?
                            .ok_or(crate::wire::DecodeError::MalformedPayload)?;
                        let surface = message
                            .object()?
                            .ok_or(crate::wire::DecodeError::MalformedPayload)?;
                        tracing::debug!(
                            "zwp_tablet_tool_v2#{}.proximity_in({}, {}, {})",
                            sender_id,
                            serial,
                            tablet,
                            surface
                        );
                        self.proximity_in(client, sender_id, serial, tablet, surface)
                            .await
                    }
                    7u16 => {
                        tracing::debug!("zwp_tablet_tool_v2#{}.proximity_out()", sender_id,);
                        self.proximity_out(client, sender_id).await
                    }
                    8u16 => {
                        let serial = message.uint()?;
                        tracing::debug!("zwp_tablet_tool_v2#{}.down({})", sender_id, serial);
                        self.down(client, sender_id, serial).await
                    }
                    9u16 => {
                        tracing::debug!("zwp_tablet_tool_v2#{}.up()", sender_id,);
                        self.up(client, sender_id).await
                    }
                    10u16 => {
                        let x = message.fixed()?;
                        let y = message.fixed()?;
                        tracing::debug!("zwp_tablet_tool_v2#{}.motion({}, {})", sender_id, x, y);
                        self.motion(client, sender_id, x, y).await
                    }
                    11u16 => {
                        let pressure = message.uint()?;
                        tracing::debug!("zwp_tablet_tool_v2#{}.pressure({})", sender_id, pressure);
                        self.pressure(client, sender_id, pressure).await
                    }
                    12u16 => {
                        let distance = message.uint()?;
                        tracing::debug!("zwp_tablet_tool_v2#{}.distance({})", sender_id, distance);
                        self.distance(client, sender_id, distance).await
                    }
                    13u16 => {
                        let tilt_x = message.fixed()?;
                        let tilt_y = message.fixed()?;
                        tracing::debug!(
                            "zwp_tablet_tool_v2#{}.tilt({}, {})",
                            sender_id,
                            tilt_x,
                            tilt_y
                        );
                        self.tilt(client, sender_id, tilt_x, tilt_y).await
                    }
                    14u16 => {
                        let degrees = message.fixed()?;
                        tracing::debug!("zwp_tablet_tool_v2#{}.rotation({})", sender_id, degrees);
                        self.rotation(client, sender_id, degrees).await
                    }
                    15u16 => {
                        let position = message.int()?;
                        tracing::debug!("zwp_tablet_tool_v2#{}.slider({})", sender_id, position);
                        self.slider(client, sender_id, position).await
                    }
                    16u16 => {
                        let degrees = message.fixed()?;
                        let clicks = message.int()?;
                        tracing::debug!(
                            "zwp_tablet_tool_v2#{}.wheel({}, {})",
                            sender_id,
                            degrees,
                            clicks
                        );
                        self.wheel(client, sender_id, degrees, clicks).await
                    }
                    17u16 => {
                        let serial = message.uint()?;
                        let button = message.uint()?;
                        let state = message.uint()?;
                        tracing::debug!(
                            "zwp_tablet_tool_v2#{}.button({}, {}, {})",
                            sender_id,
                            serial,
                            button,
                            state
                        );
                        self.button(client, sender_id, serial, button, state.try_into()?)
                            .await
                    }
                    18u16 => {
                        let time = message.uint()?;
                        tracing::debug!("zwp_tablet_tool_v2#{}.frame({})", sender_id, time);
                        self.frame(client, sender_id, time).await
                    }
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "Sets the surface of the cursor used for this tool on the given"]
            #[doc = "tablet. This request only takes effect if the tool is in proximity"]
            #[doc = "of one of the requesting client's surfaces or the surface parameter"]
            #[doc = "is the current pointer surface. If there was a previous surface set"]
            #[doc = "with this request it is replaced. If surface is NULL, the cursor"]
            #[doc = "image is hidden."]
            #[doc = ""]
            #[doc = "The parameters hotspot_x and hotspot_y define the position of the"]
            #[doc = "pointer surface relative to the pointer location. Its top-left corner"]
            #[doc = "is always at (x, y) - (hotspot_x, hotspot_y), where (x, y) are the"]
            #[doc = "coordinates of the pointer location, in surface-local coordinates."]
            #[doc = ""]
            #[doc = "On surface.attach requests to the pointer surface, hotspot_x and"]
            #[doc = "hotspot_y are decremented by the x and y parameters passed to the"]
            #[doc = "request. Attach must be confirmed by wl_surface.commit as usual."]
            #[doc = ""]
            #[doc = "The hotspot can also be updated by passing the currently set pointer"]
            #[doc = "surface to this request with new values for hotspot_x and hotspot_y."]
            #[doc = ""]
            #[doc = "The current and pending input regions of the wl_surface are cleared,"]
            #[doc = "and wl_surface.set_input_region is ignored until the wl_surface is no"]
            #[doc = "longer used as the cursor. When the use as a cursor ends, the current"]
            #[doc = "and pending input regions become undefined, and the wl_surface is"]
            #[doc = "unmapped."]
            #[doc = ""]
            #[doc = "This request gives the surface the role of a wp_tablet_tool cursor. A"]
            #[doc = "surface may only ever be used as the cursor surface for one"]
            #[doc = "wp_tablet_tool. If the surface already has another role or has"]
            #[doc = "previously been used as cursor surface for a different tool, a"]
            #[doc = "protocol error is raised."]
            #[doc = ""]
            async fn set_cursor(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                serial: u32,
                surface: Option<crate::wire::ObjectId>,
                hotspot_x: i32,
                hotspot_y: i32,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_tablet_tool_v2#{}.set_cursor()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_uint(serial)
                    .put_object(surface)
                    .put_int(hotspot_x)
                    .put_int(hotspot_y)
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "This destroys the client's resource for this tool object."]
            #[doc = ""]
            async fn destroy(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_tablet_tool_v2#{}.destroy()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 1u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "The tool type is the high-level type of the tool and usually decides"]
            #[doc = "the interaction expected from this tool."]
            #[doc = ""]
            #[doc = "This event is sent in the initial burst of events before the"]
            #[doc = "wp_tablet_tool.done event."]
            #[doc = ""]
            async fn r#type(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                tool_type: Type,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "If the physical tool can be identified by a unique 64-bit serial"]
            #[doc = "number, this event notifies the client of this serial number."]
            #[doc = ""]
            #[doc = "If multiple tablets are available in the same seat and the tool is"]
            #[doc = "uniquely identifiable by the serial number, that tool may move"]
            #[doc = "between tablets."]
            #[doc = ""]
            #[doc = "Otherwise, if the tool has no serial number and this event is"]
            #[doc = "missing, the tool is tied to the tablet it first comes into"]
            #[doc = "proximity with. Even if the physical tool is used on multiple"]
            #[doc = "tablets, separate wp_tablet_tool objects will be created, one per"]
            #[doc = "tablet."]
            #[doc = ""]
            #[doc = "This event is sent in the initial burst of events before the"]
            #[doc = "wp_tablet_tool.done event."]
            #[doc = ""]
            async fn hardware_serial(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                hardware_serial_hi: u32,
                hardware_serial_lo: u32,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "This event notifies the client of a hardware id available on this tool."]
            #[doc = ""]
            #[doc = "The hardware id is a device-specific 64-bit id that provides extra"]
            #[doc = "information about the tool in use, beyond the wl_tool.type"]
            #[doc = "enumeration. The format of the id is specific to tablets made by"]
            #[doc = "Wacom Inc. For example, the hardware id of a Wacom Grip"]
            #[doc = "Pen (a stylus) is 0x802."]
            #[doc = ""]
            #[doc = "This event is sent in the initial burst of events before the"]
            #[doc = "wp_tablet_tool.done event."]
            #[doc = ""]
            async fn hardware_id_wacom(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                hardware_id_hi: u32,
                hardware_id_lo: u32,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "This event notifies the client of any capabilities of this tool,"]
            #[doc = "beyond the main set of x/y axes and tip up/down detection."]
            #[doc = ""]
            #[doc = "One event is sent for each extra capability available on this tool."]
            #[doc = ""]
            #[doc = "This event is sent in the initial burst of events before the"]
            #[doc = "wp_tablet_tool.done event."]
            #[doc = ""]
            async fn capability(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                capability: Capability,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "This event signals the end of the initial burst of descriptive"]
            #[doc = "events. A client may consider the static description of the tool to"]
            #[doc = "be complete and finalize initialization of the tool."]
            #[doc = ""]
            async fn done(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "This event is sent when the tool is removed from the system and will"]
            #[doc = "send no further events. Should the physical tool come back into"]
            #[doc = "proximity later, a new wp_tablet_tool object will be created."]
            #[doc = ""]
            #[doc = "It is compositor-dependent when a tool is removed. A compositor may"]
            #[doc = "remove a tool on proximity out, tablet removal or any other reason."]
            #[doc = "A compositor may also keep a tool alive until shutdown."]
            #[doc = ""]
            #[doc = "If the tool is currently in proximity, a proximity_out event will be"]
            #[doc = "sent before the removed event. See wp_tablet_tool.proximity_out for"]
            #[doc = "the handling of any buttons logically down."]
            #[doc = ""]
            #[doc = "When this event is received, the client must wp_tablet_tool.destroy"]
            #[doc = "the object."]
            #[doc = ""]
            async fn removed(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Notification that this tool is focused on a certain surface."]
            #[doc = ""]
            #[doc = "This event can be received when the tool has moved from one surface to"]
            #[doc = "another, or when the tool has come back into proximity above the"]
            #[doc = "surface."]
            #[doc = ""]
            #[doc = "If any button is logically down when the tool comes into proximity,"]
            #[doc = "the respective button event is sent after the proximity_in event but"]
            #[doc = "within the same frame as the proximity_in event."]
            #[doc = ""]
            async fn proximity_in(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                serial: u32,
                tablet: crate::wire::ObjectId,
                surface: crate::wire::ObjectId,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Notification that this tool has either left proximity, or is no"]
            #[doc = "longer focused on a certain surface."]
            #[doc = ""]
            #[doc = "When the tablet tool leaves proximity of the tablet, button release"]
            #[doc = "events are sent for each button that was held down at the time of"]
            #[doc = "leaving proximity. These events are sent before the proximity_out"]
            #[doc = "event but within the same wp_tablet.frame."]
            #[doc = ""]
            #[doc = "If the tool stays within proximity of the tablet, but the focus"]
            #[doc = "changes from one surface to another, a button release event may not"]
            #[doc = "be sent until the button is actually released or the tool leaves the"]
            #[doc = "proximity of the tablet."]
            #[doc = ""]
            async fn proximity_out(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Sent whenever the tablet tool comes in contact with the surface of the"]
            #[doc = "tablet."]
            #[doc = ""]
            #[doc = "If the tool is already in contact with the tablet when entering the"]
            #[doc = "input region, the client owning said region will receive a"]
            #[doc = "wp_tablet.proximity_in event, followed by a wp_tablet.down"]
            #[doc = "event and a wp_tablet.frame event."]
            #[doc = ""]
            #[doc = "Note that this event describes logical contact, not physical"]
            #[doc = "contact. On some devices, a compositor may not consider a tool in"]
            #[doc = "logical contact until a minimum physical pressure threshold is"]
            #[doc = "exceeded."]
            #[doc = ""]
            async fn down(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                serial: u32,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Sent whenever the tablet tool stops making contact with the surface of"]
            #[doc = "the tablet, or when the tablet tool moves out of the input region"]
            #[doc = "and the compositor grab (if any) is dismissed."]
            #[doc = ""]
            #[doc = "If the tablet tool moves out of the input region while in contact"]
            #[doc = "with the surface of the tablet and the compositor does not have an"]
            #[doc = "ongoing grab on the surface, the client owning said region will"]
            #[doc = "receive a wp_tablet.up event, followed by a wp_tablet.proximity_out"]
            #[doc = "event and a wp_tablet.frame event. If the compositor has an ongoing"]
            #[doc = "grab on this device, this event sequence is sent whenever the grab"]
            #[doc = "is dismissed in the future."]
            #[doc = ""]
            #[doc = "Note that this event describes logical contact, not physical"]
            #[doc = "contact. On some devices, a compositor may not consider a tool out"]
            #[doc = "of logical contact until physical pressure falls below a specific"]
            #[doc = "threshold."]
            #[doc = ""]
            async fn up(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Sent whenever a tablet tool moves."]
            #[doc = ""]
            async fn motion(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                x: crate::wire::Fixed,
                y: crate::wire::Fixed,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Sent whenever the pressure axis on a tool changes. The value of this"]
            #[doc = "event is normalized to a value between 0 and 65535."]
            #[doc = ""]
            #[doc = "Note that pressure may be nonzero even when a tool is not in logical"]
            #[doc = "contact. See the down and up events for more details."]
            #[doc = ""]
            async fn pressure(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                pressure: u32,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Sent whenever the distance axis on a tool changes. The value of this"]
            #[doc = "event is normalized to a value between 0 and 65535."]
            #[doc = ""]
            #[doc = "Note that distance may be nonzero even when a tool is not in logical"]
            #[doc = "contact. See the down and up events for more details."]
            #[doc = ""]
            async fn distance(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                distance: u32,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Sent whenever one or both of the tilt axes on a tool change. Each tilt"]
            #[doc = "value is in degrees, relative to the z-axis of the tablet."]
            #[doc = "The angle is positive when the top of a tool tilts along the"]
            #[doc = "positive x or y axis."]
            #[doc = ""]
            async fn tilt(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                tilt_x: crate::wire::Fixed,
                tilt_y: crate::wire::Fixed,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Sent whenever the z-rotation axis on the tool changes. The"]
            #[doc = "rotation value is in degrees clockwise from the tool's"]
            #[doc = "logical neutral position."]
            #[doc = ""]
            async fn rotation(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                degrees: crate::wire::Fixed,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Sent whenever the slider position on the tool changes. The"]
            #[doc = "value is normalized between -65535 and 65535, with 0 as the logical"]
            #[doc = "neutral position of the slider."]
            #[doc = ""]
            #[doc = "The slider is available on e.g. the Wacom Airbrush tool."]
            #[doc = ""]
            async fn slider(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                position: i32,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Sent whenever the wheel on the tool emits an event. This event"]
            #[doc = "contains two values for the same axis change. The degrees value is"]
            #[doc = "in the same orientation as the wl_pointer.vertical_scroll axis. The"]
            #[doc = "clicks value is in discrete logical clicks of the mouse wheel. This"]
            #[doc = "value may be zero if the movement of the wheel was less"]
            #[doc = "than one logical click."]
            #[doc = ""]
            #[doc = "Clients should choose either value and avoid mixing degrees and"]
            #[doc = "clicks. The compositor may accumulate values smaller than a logical"]
            #[doc = "click and emulate click events when a certain threshold is met."]
            #[doc = "Thus, wl_tablet_tool.wheel events with non-zero clicks values may"]
            #[doc = "have different degrees values."]
            #[doc = ""]
            async fn wheel(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                degrees: crate::wire::Fixed,
                clicks: i32,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Sent whenever a button on the tool is pressed or released."]
            #[doc = ""]
            #[doc = "If a button is held down when the tool moves in or out of proximity,"]
            #[doc = "button events are generated by the compositor. See"]
            #[doc = "wp_tablet_tool.proximity_in and wp_tablet_tool.proximity_out for"]
            #[doc = "details."]
            #[doc = ""]
            async fn button(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                serial: u32,
                button: u32,
                state: ButtonState,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Marks the end of a series of axis and/or button updates from the"]
            #[doc = "tablet. The Wayland protocol requires axis updates to be sent"]
            #[doc = "sequentially, however all events within a frame should be considered"]
            #[doc = "one hardware event."]
            #[doc = ""]
            async fn frame(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                time: u32,
            ) -> crate::client::Result<()>;
        }
    }
    #[doc = ""]
    #[doc = "The wp_tablet interface represents one graphics tablet device. The"]
    #[doc = "tablet interface itself does not generate events; all events are"]
    #[doc = "generated by wp_tablet_tool objects when in proximity above a tablet."]
    #[doc = ""]
    #[doc = "A tablet has a number of static characteristics, e.g. device name and"]
    #[doc = "pid/vid. These capabilities are sent in an event sequence after the"]
    #[doc = "wp_tablet_seat.tablet_added event. This initial event sequence is"]
    #[doc = "terminated by a wp_tablet.done event."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zwp_tablet_v2 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[doc = "Trait to implement the zwp_tablet_v2 interface. See the module level documentation for more info"]
        pub trait ZwpTabletV2 {
            const INTERFACE: &'static str = "zwp_tablet_v2";
            const VERSION: u32 = 1u32;
            async fn handle_event(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    0u16 => {
                        let name = message
                            .string()?
                            .ok_or(crate::wire::DecodeError::MalformedPayload)?;
                        tracing::debug!("zwp_tablet_v2#{}.name(\"{}\")", sender_id, name);
                        self.name(client, sender_id, name).await
                    }
                    1u16 => {
                        let vid = message.uint()?;
                        let pid = message.uint()?;
                        tracing::debug!("zwp_tablet_v2#{}.id({}, {})", sender_id, vid, pid);
                        self.id(client, sender_id, vid, pid).await
                    }
                    2u16 => {
                        let path = message
                            .string()?
                            .ok_or(crate::wire::DecodeError::MalformedPayload)?;
                        tracing::debug!("zwp_tablet_v2#{}.path(\"{}\")", sender_id, path);
                        self.path(client, sender_id, path).await
                    }
                    3u16 => {
                        tracing::debug!("zwp_tablet_v2#{}.done()", sender_id,);
                        self.done(client, sender_id).await
                    }
                    4u16 => {
                        tracing::debug!("zwp_tablet_v2#{}.removed()", sender_id,);
                        self.removed(client, sender_id).await
                    }
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "This destroys the client's resource for this tablet object."]
            #[doc = ""]
            async fn destroy(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_tablet_v2#{}.destroy()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "A descriptive name for the tablet device."]
            #[doc = ""]
            #[doc = "If the device has no descriptive name, this event is not sent."]
            #[doc = ""]
            #[doc = "This event is sent in the initial burst of events before the"]
            #[doc = "wp_tablet.done event."]
            #[doc = ""]
            async fn name(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                name: String,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "The USB vendor and product IDs for the tablet device."]
            #[doc = ""]
            #[doc = "If the device has no USB vendor/product ID, this event is not sent."]
            #[doc = "This can happen for virtual devices or non-USB devices, for instance."]
            #[doc = ""]
            #[doc = "This event is sent in the initial burst of events before the"]
            #[doc = "wp_tablet.done event."]
            #[doc = ""]
            async fn id(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                vid: u32,
                pid: u32,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "A system-specific device path that indicates which device is behind"]
            #[doc = "this wp_tablet. This information may be used to gather additional"]
            #[doc = "information about the device, e.g. through libwacom."]
            #[doc = ""]
            #[doc = "A device may have more than one device path. If so, multiple"]
            #[doc = "wp_tablet.path events are sent. A device may be emulated and not"]
            #[doc = "have a device path, and in that case this event will not be sent."]
            #[doc = ""]
            #[doc = "The format of the path is unspecified, it may be a device node, a"]
            #[doc = "sysfs path, or some other identifier. It is up to the client to"]
            #[doc = "identify the string provided."]
            #[doc = ""]
            #[doc = "This event is sent in the initial burst of events before the"]
            #[doc = "wp_tablet.done event."]
            #[doc = ""]
            async fn path(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                path: String,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "This event is sent immediately to signal the end of the initial"]
            #[doc = "burst of descriptive events. A client may consider the static"]
            #[doc = "description of the tablet to be complete and finalize initialization"]
            #[doc = "of the tablet."]
            #[doc = ""]
            async fn done(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Sent when the tablet has been removed from the system. When a tablet"]
            #[doc = "is removed, some tools may be removed."]
            #[doc = ""]
            #[doc = "When this event is received, the client must wp_tablet.destroy"]
            #[doc = "the object."]
            #[doc = ""]
            async fn removed(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()>;
        }
    }
    #[doc = ""]
    #[doc = "A circular interaction area, such as the touch ring on the Wacom Intuos"]
    #[doc = "Pro series tablets."]
    #[doc = ""]
    #[doc = "Events on a ring are logically grouped by the wl_tablet_pad_ring.frame"]
    #[doc = "event."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zwp_tablet_pad_ring_v2 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[doc = ""]
        #[doc = "Describes the source types for ring events. This indicates to the"]
        #[doc = "client how a ring event was physically generated; a client may"]
        #[doc = "adjust the user interface accordingly. For example, events"]
        #[doc = "from a \"finger\" source may trigger kinetic scrolling."]
        #[doc = ""]
        #[repr(u32)]
        #[non_exhaustive]
        #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)]
        pub enum Source {
            #[doc = "finger"]
            Finger = 1u32,
        }
        impl TryFrom<u32> for Source {
            type Error = crate::wire::DecodeError;
            fn try_from(v: u32) -> Result<Self, Self::Error> {
                match v {
                    1u32 => Ok(Self::Finger),
                    _ => Err(crate::wire::DecodeError::MalformedPayload),
                }
            }
        }
        impl std::fmt::Display for Source {
            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
                (*self as u32).fmt(f)
            }
        }
        #[doc = "Trait to implement the zwp_tablet_pad_ring_v2 interface. See the module level documentation for more info"]
        pub trait ZwpTabletPadRingV2 {
            const INTERFACE: &'static str = "zwp_tablet_pad_ring_v2";
            const VERSION: u32 = 1u32;
            async fn handle_event(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    0u16 => {
                        let source = message.uint()?;
                        tracing::debug!("zwp_tablet_pad_ring_v2#{}.source({})", sender_id, source);
                        self.source(client, sender_id, source.try_into()?).await
                    }
                    1u16 => {
                        let degrees = message.fixed()?;
                        tracing::debug!("zwp_tablet_pad_ring_v2#{}.angle({})", sender_id, degrees);
                        self.angle(client, sender_id, degrees).await
                    }
                    2u16 => {
                        tracing::debug!("zwp_tablet_pad_ring_v2#{}.stop()", sender_id,);
                        self.stop(client, sender_id).await
                    }
                    3u16 => {
                        let time = message.uint()?;
                        tracing::debug!("zwp_tablet_pad_ring_v2#{}.frame({})", sender_id, time);
                        self.frame(client, sender_id, time).await
                    }
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "Request that the compositor use the provided feedback string"]
            #[doc = "associated with this ring. This request should be issued immediately"]
            #[doc = "after a wp_tablet_pad_group.mode_switch event from the corresponding"]
            #[doc = "group is received, or whenever the ring is mapped to a different"]
            #[doc = "action. See wp_tablet_pad_group.mode_switch for more details."]
            #[doc = ""]
            #[doc = "Clients are encouraged to provide context-aware descriptions for"]
            #[doc = "the actions associated with the ring; compositors may use this"]
            #[doc = "information to offer visual feedback about the button layout"]
            #[doc = "(eg. on-screen displays)."]
            #[doc = ""]
            #[doc = "The provided string 'description' is a UTF-8 encoded string to be"]
            #[doc = "associated with this ring, and is considered user-visible; general"]
            #[doc = "internationalization rules apply."]
            #[doc = ""]
            #[doc = "The serial argument will be that of the last"]
            #[doc = "wp_tablet_pad_group.mode_switch event received for the group of this"]
            #[doc = "ring. Requests providing other serials than the most recent one will be"]
            #[doc = "ignored."]
            #[doc = ""]
            async fn set_feedback(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                description: String,
                serial: u32,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_tablet_pad_ring_v2#{}.set_feedback()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_string(Some(description))
                    .put_uint(serial)
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "This destroys the client's resource for this ring object."]
            #[doc = ""]
            async fn destroy(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_tablet_pad_ring_v2#{}.destroy()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 1u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Source information for ring events."]
            #[doc = ""]
            #[doc = "This event does not occur on its own. It is sent before a"]
            #[doc = "wp_tablet_pad_ring.frame event and carries the source information"]
            #[doc = "for all events within that frame."]
            #[doc = ""]
            #[doc = "The source specifies how this event was generated. If the source is"]
            #[doc = "wp_tablet_pad_ring.source.finger, a wp_tablet_pad_ring.stop event"]
            #[doc = "will be sent when the user lifts the finger off the device."]
            #[doc = ""]
            #[doc = "This event is optional. If the source is unknown for an interaction,"]
            #[doc = "no event is sent."]
            #[doc = ""]
            async fn source(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                source: Source,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Sent whenever the angle on a ring changes."]
            #[doc = ""]
            #[doc = "The angle is provided in degrees clockwise from the logical"]
            #[doc = "north of the ring in the pad's current rotation."]
            #[doc = ""]
            async fn angle(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                degrees: crate::wire::Fixed,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Stop notification for ring events."]
            #[doc = ""]
            #[doc = "For some wp_tablet_pad_ring.source types, a wp_tablet_pad_ring.stop"]
            #[doc = "event is sent to notify a client that the interaction with the ring"]
            #[doc = "has terminated. This enables the client to implement kinetic scrolling."]
            #[doc = "See the wp_tablet_pad_ring.source documentation for information on"]
            #[doc = "when this event may be generated."]
            #[doc = ""]
            #[doc = "Any wp_tablet_pad_ring.angle events with the same source after this"]
            #[doc = "event should be considered as the start of a new interaction."]
            #[doc = ""]
            async fn stop(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Indicates the end of a set of ring events that logically belong"]
            #[doc = "together. A client is expected to accumulate the data in all events"]
            #[doc = "within the frame before proceeding."]
            #[doc = ""]
            #[doc = "All wp_tablet_pad_ring events before a wp_tablet_pad_ring.frame event belong"]
            #[doc = "logically together. For example, on termination of a finger interaction"]
            #[doc = "on a ring the compositor will send a wp_tablet_pad_ring.source event,"]
            #[doc = "a wp_tablet_pad_ring.stop event and a wp_tablet_pad_ring.frame event."]
            #[doc = ""]
            #[doc = "A wp_tablet_pad_ring.frame event is sent for every logical event"]
            #[doc = "group, even if the group only contains a single wp_tablet_pad_ring"]
            #[doc = "event. Specifically, a client may get a sequence: angle, frame,"]
            #[doc = "angle, frame, etc."]
            #[doc = ""]
            async fn frame(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                time: u32,
            ) -> crate::client::Result<()>;
        }
    }
    #[doc = ""]
    #[doc = "A linear interaction area, such as the strips found in Wacom Cintiq"]
    #[doc = "models."]
    #[doc = ""]
    #[doc = "Events on a strip are logically grouped by the wl_tablet_pad_strip.frame"]
    #[doc = "event."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zwp_tablet_pad_strip_v2 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[doc = ""]
        #[doc = "Describes the source types for strip events. This indicates to the"]
        #[doc = "client how a strip event was physically generated; a client may"]
        #[doc = "adjust the user interface accordingly. For example, events"]
        #[doc = "from a \"finger\" source may trigger kinetic scrolling."]
        #[doc = ""]
        #[repr(u32)]
        #[non_exhaustive]
        #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)]
        pub enum Source {
            #[doc = "finger"]
            Finger = 1u32,
        }
        impl TryFrom<u32> for Source {
            type Error = crate::wire::DecodeError;
            fn try_from(v: u32) -> Result<Self, Self::Error> {
                match v {
                    1u32 => Ok(Self::Finger),
                    _ => Err(crate::wire::DecodeError::MalformedPayload),
                }
            }
        }
        impl std::fmt::Display for Source {
            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
                (*self as u32).fmt(f)
            }
        }
        #[doc = "Trait to implement the zwp_tablet_pad_strip_v2 interface. See the module level documentation for more info"]
        pub trait ZwpTabletPadStripV2 {
            const INTERFACE: &'static str = "zwp_tablet_pad_strip_v2";
            const VERSION: u32 = 1u32;
            async fn handle_event(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    0u16 => {
                        let source = message.uint()?;
                        tracing::debug!("zwp_tablet_pad_strip_v2#{}.source({})", sender_id, source);
                        self.source(client, sender_id, source.try_into()?).await
                    }
                    1u16 => {
                        let position = message.uint()?;
                        tracing::debug!(
                            "zwp_tablet_pad_strip_v2#{}.position({})",
                            sender_id,
                            position
                        );
                        self.position(client, sender_id, position).await
                    }
                    2u16 => {
                        tracing::debug!("zwp_tablet_pad_strip_v2#{}.stop()", sender_id,);
                        self.stop(client, sender_id).await
                    }
                    3u16 => {
                        let time = message.uint()?;
                        tracing::debug!("zwp_tablet_pad_strip_v2#{}.frame({})", sender_id, time);
                        self.frame(client, sender_id, time).await
                    }
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "Requests the compositor to use the provided feedback string"]
            #[doc = "associated with this strip. This request should be issued immediately"]
            #[doc = "after a wp_tablet_pad_group.mode_switch event from the corresponding"]
            #[doc = "group is received, or whenever the strip is mapped to a different"]
            #[doc = "action. See wp_tablet_pad_group.mode_switch for more details."]
            #[doc = ""]
            #[doc = "Clients are encouraged to provide context-aware descriptions for"]
            #[doc = "the actions associated with the strip, and compositors may use this"]
            #[doc = "information to offer visual feedback about the button layout"]
            #[doc = "(eg. on-screen displays)."]
            #[doc = ""]
            #[doc = "The provided string 'description' is a UTF-8 encoded string to be"]
            #[doc = "associated with this ring, and is considered user-visible; general"]
            #[doc = "internationalization rules apply."]
            #[doc = ""]
            #[doc = "The serial argument will be that of the last"]
            #[doc = "wp_tablet_pad_group.mode_switch event received for the group of this"]
            #[doc = "strip. Requests providing other serials than the most recent one will be"]
            #[doc = "ignored."]
            #[doc = ""]
            async fn set_feedback(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                description: String,
                serial: u32,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_tablet_pad_strip_v2#{}.set_feedback()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_string(Some(description))
                    .put_uint(serial)
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "This destroys the client's resource for this strip object."]
            #[doc = ""]
            async fn destroy(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_tablet_pad_strip_v2#{}.destroy()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 1u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Source information for strip events."]
            #[doc = ""]
            #[doc = "This event does not occur on its own. It is sent before a"]
            #[doc = "wp_tablet_pad_strip.frame event and carries the source information"]
            #[doc = "for all events within that frame."]
            #[doc = ""]
            #[doc = "The source specifies how this event was generated. If the source is"]
            #[doc = "wp_tablet_pad_strip.source.finger, a wp_tablet_pad_strip.stop event"]
            #[doc = "will be sent when the user lifts their finger off the device."]
            #[doc = ""]
            #[doc = "This event is optional. If the source is unknown for an interaction,"]
            #[doc = "no event is sent."]
            #[doc = ""]
            async fn source(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                source: Source,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Sent whenever the position on a strip changes."]
            #[doc = ""]
            #[doc = "The position is normalized to a range of [0, 65535], the 0-value"]
            #[doc = "represents the top-most and/or left-most position of the strip in"]
            #[doc = "the pad's current rotation."]
            #[doc = ""]
            async fn position(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                position: u32,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Stop notification for strip events."]
            #[doc = ""]
            #[doc = "For some wp_tablet_pad_strip.source types, a wp_tablet_pad_strip.stop"]
            #[doc = "event is sent to notify a client that the interaction with the strip"]
            #[doc = "has terminated. This enables the client to implement kinetic"]
            #[doc = "scrolling. See the wp_tablet_pad_strip.source documentation for"]
            #[doc = "information on when this event may be generated."]
            #[doc = ""]
            #[doc = "Any wp_tablet_pad_strip.position events with the same source after this"]
            #[doc = "event should be considered as the start of a new interaction."]
            #[doc = ""]
            async fn stop(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Indicates the end of a set of events that represent one logical"]
            #[doc = "hardware strip event. A client is expected to accumulate the data"]
            #[doc = "in all events within the frame before proceeding."]
            #[doc = ""]
            #[doc = "All wp_tablet_pad_strip events before a wp_tablet_pad_strip.frame event belong"]
            #[doc = "logically together. For example, on termination of a finger interaction"]
            #[doc = "on a strip the compositor will send a wp_tablet_pad_strip.source event,"]
            #[doc = "a wp_tablet_pad_strip.stop event and a wp_tablet_pad_strip.frame"]
            #[doc = "event."]
            #[doc = ""]
            #[doc = "A wp_tablet_pad_strip.frame event is sent for every logical event"]
            #[doc = "group, even if the group only contains a single wp_tablet_pad_strip"]
            #[doc = "event. Specifically, a client may get a sequence: position, frame,"]
            #[doc = "position, frame, etc."]
            #[doc = ""]
            async fn frame(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                time: u32,
            ) -> crate::client::Result<()>;
        }
    }
    #[doc = ""]
    #[doc = "A pad group describes a distinct (sub)set of buttons, rings and strips"]
    #[doc = "present in the tablet. The criteria of this grouping is usually positional,"]
    #[doc = "eg. if a tablet has buttons on the left and right side, 2 groups will be"]
    #[doc = "presented. The physical arrangement of groups is undisclosed and may"]
    #[doc = "change on the fly."]
    #[doc = ""]
    #[doc = "Pad groups will announce their features during pad initialization. Between"]
    #[doc = "the corresponding wp_tablet_pad.group event and wp_tablet_pad_group.done, the"]
    #[doc = "pad group will announce the buttons, rings and strips contained in it,"]
    #[doc = "plus the number of supported modes."]
    #[doc = ""]
    #[doc = "Modes are a mechanism to allow multiple groups of actions for every element"]
    #[doc = "in the pad group. The number of groups and available modes in each is"]
    #[doc = "persistent across device plugs. The current mode is user-switchable, it"]
    #[doc = "will be announced through the wp_tablet_pad_group.mode_switch event both"]
    #[doc = "whenever it is switched, and after wp_tablet_pad.enter."]
    #[doc = ""]
    #[doc = "The current mode logically applies to all elements in the pad group,"]
    #[doc = "although it is at clients' discretion whether to actually perform different"]
    #[doc = "actions, and/or issue the respective .set_feedback requests to notify the"]
    #[doc = "compositor. See the wp_tablet_pad_group.mode_switch event for more details."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zwp_tablet_pad_group_v2 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[doc = "Trait to implement the zwp_tablet_pad_group_v2 interface. See the module level documentation for more info"]
        pub trait ZwpTabletPadGroupV2 {
            const INTERFACE: &'static str = "zwp_tablet_pad_group_v2";
            const VERSION: u32 = 1u32;
            async fn handle_event(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    0u16 => {
                        let buttons = message.array()?;
                        tracing::debug!(
                            "zwp_tablet_pad_group_v2#{}.buttons(array[{}])",
                            sender_id,
                            buttons.len()
                        );
                        self.buttons(client, sender_id, buttons).await
                    }
                    1u16 => {
                        let ring = message
                            .object()?
                            .ok_or(crate::wire::DecodeError::MalformedPayload)?;
                        tracing::debug!("zwp_tablet_pad_group_v2#{}.ring({})", sender_id, ring);
                        self.ring(client, sender_id, ring).await
                    }
                    2u16 => {
                        let strip = message
                            .object()?
                            .ok_or(crate::wire::DecodeError::MalformedPayload)?;
                        tracing::debug!("zwp_tablet_pad_group_v2#{}.strip({})", sender_id, strip);
                        self.strip(client, sender_id, strip).await
                    }
                    3u16 => {
                        let modes = message.uint()?;
                        tracing::debug!("zwp_tablet_pad_group_v2#{}.modes({})", sender_id, modes);
                        self.modes(client, sender_id, modes).await
                    }
                    4u16 => {
                        tracing::debug!("zwp_tablet_pad_group_v2#{}.done()", sender_id,);
                        self.done(client, sender_id).await
                    }
                    5u16 => {
                        let time = message.uint()?;
                        let serial = message.uint()?;
                        let mode = message.uint()?;
                        tracing::debug!(
                            "zwp_tablet_pad_group_v2#{}.mode_switch({}, {}, {})",
                            sender_id,
                            time,
                            serial,
                            mode
                        );
                        self.mode_switch(client, sender_id, time, serial, mode)
                            .await
                    }
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "Destroy the wp_tablet_pad_group object. Objects created from this object"]
            #[doc = "are unaffected and should be destroyed separately."]
            #[doc = ""]
            async fn destroy(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_tablet_pad_group_v2#{}.destroy()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Sent on wp_tablet_pad_group initialization to announce the available"]
            #[doc = "buttons in the group. Button indices start at 0, a button may only be"]
            #[doc = "in one group at a time."]
            #[doc = ""]
            #[doc = "This event is first sent in the initial burst of events before the"]
            #[doc = "wp_tablet_pad_group.done event."]
            #[doc = ""]
            #[doc = "Some buttons are reserved by the compositor. These buttons may not be"]
            #[doc = "assigned to any wp_tablet_pad_group. Compositors may broadcast this"]
            #[doc = "event in the case of changes to the mapping of these reserved buttons."]
            #[doc = "If the compositor happens to reserve all buttons in a group, this event"]
            #[doc = "will be sent with an empty array."]
            #[doc = ""]
            async fn buttons(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                buttons: Vec<u8>,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Sent on wp_tablet_pad_group initialization to announce available rings."]
            #[doc = "One event is sent for each ring available on this pad group."]
            #[doc = ""]
            #[doc = "This event is sent in the initial burst of events before the"]
            #[doc = "wp_tablet_pad_group.done event."]
            #[doc = ""]
            async fn ring(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                ring: crate::wire::ObjectId,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Sent on wp_tablet_pad initialization to announce available strips."]
            #[doc = "One event is sent for each strip available on this pad group."]
            #[doc = ""]
            #[doc = "This event is sent in the initial burst of events before the"]
            #[doc = "wp_tablet_pad_group.done event."]
            #[doc = ""]
            async fn strip(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                strip: crate::wire::ObjectId,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Sent on wp_tablet_pad_group initialization to announce that the pad"]
            #[doc = "group may switch between modes. A client may use a mode to store a"]
            #[doc = "specific configuration for buttons, rings and strips and use the"]
            #[doc = "wl_tablet_pad_group.mode_switch event to toggle between these"]
            #[doc = "configurations. Mode indices start at 0."]
            #[doc = ""]
            #[doc = "Switching modes is compositor-dependent. See the"]
            #[doc = "wp_tablet_pad_group.mode_switch event for more details."]
            #[doc = ""]
            #[doc = "This event is sent in the initial burst of events before the"]
            #[doc = "wp_tablet_pad_group.done event. This event is only sent when more than"]
            #[doc = "more than one mode is available."]
            #[doc = ""]
            async fn modes(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                modes: u32,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "This event is sent immediately to signal the end of the initial"]
            #[doc = "burst of descriptive events. A client may consider the static"]
            #[doc = "description of the tablet to be complete and finalize initialization"]
            #[doc = "of the tablet group."]
            #[doc = ""]
            async fn done(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Notification that the mode was switched."]
            #[doc = ""]
            #[doc = "A mode applies to all buttons, rings and strips in a group"]
            #[doc = "simultaneously, but a client is not required to assign different actions"]
            #[doc = "for each mode. For example, a client may have mode-specific button"]
            #[doc = "mappings but map the ring to vertical scrolling in all modes. Mode"]
            #[doc = "indices start at 0."]
            #[doc = ""]
            #[doc = "Switching modes is compositor-dependent. The compositor may provide"]
            #[doc = "visual cues to the client about the mode, e.g. by toggling LEDs on"]
            #[doc = "the tablet device. Mode-switching may be software-controlled or"]
            #[doc = "controlled by one or more physical buttons. For example, on a Wacom"]
            #[doc = "Intuos Pro, the button inside the ring may be assigned to switch"]
            #[doc = "between modes."]
            #[doc = ""]
            #[doc = "The compositor will also send this event after wp_tablet_pad.enter on"]
            #[doc = "each group in order to notify of the current mode. Groups that only"]
            #[doc = "feature one mode will use mode=0 when emitting this event."]
            #[doc = ""]
            #[doc = "If a button action in the new mode differs from the action in the"]
            #[doc = "previous mode, the client should immediately issue a"]
            #[doc = "wp_tablet_pad.set_feedback request for each changed button."]
            #[doc = ""]
            #[doc = "If a ring or strip action in the new mode differs from the action"]
            #[doc = "in the previous mode, the client should immediately issue a"]
            #[doc = "wp_tablet_ring.set_feedback or wp_tablet_strip.set_feedback request"]
            #[doc = "for each changed ring or strip."]
            #[doc = ""]
            async fn mode_switch(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                time: u32,
                serial: u32,
                mode: u32,
            ) -> crate::client::Result<()>;
        }
    }
    #[doc = ""]
    #[doc = "A pad device is a set of buttons, rings and strips"]
    #[doc = "usually physically present on the tablet device itself. Some"]
    #[doc = "exceptions exist where the pad device is physically detached, e.g. the"]
    #[doc = "Wacom ExpressKey Remote."]
    #[doc = ""]
    #[doc = "Pad devices have no axes that control the cursor and are generally"]
    #[doc = "auxiliary devices to the tool devices used on the tablet surface."]
    #[doc = ""]
    #[doc = "A pad device has a number of static characteristics, e.g. the number"]
    #[doc = "of rings. These capabilities are sent in an event sequence after the"]
    #[doc = "wp_tablet_seat.pad_added event before any actual events from this pad."]
    #[doc = "This initial event sequence is terminated by a wp_tablet_pad.done"]
    #[doc = "event."]
    #[doc = ""]
    #[doc = "All pad features (buttons, rings and strips) are logically divided into"]
    #[doc = "groups and all pads have at least one group. The available groups are"]
    #[doc = "notified through the wp_tablet_pad.group event; the compositor will"]
    #[doc = "emit one event per group before emitting wp_tablet_pad.done."]
    #[doc = ""]
    #[doc = "Groups may have multiple modes. Modes allow clients to map multiple"]
    #[doc = "actions to a single pad feature. Only one mode can be active per group,"]
    #[doc = "although different groups may have different active modes."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zwp_tablet_pad_v2 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[doc = ""]
        #[doc = "Describes the physical state of a button that caused the button"]
        #[doc = "event."]
        #[doc = ""]
        #[repr(u32)]
        #[non_exhaustive]
        #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)]
        pub enum ButtonState {
            #[doc = "the button is not pressed"]
            Released = 0u32,
            #[doc = "the button is pressed"]
            Pressed = 1u32,
        }
        impl TryFrom<u32> for ButtonState {
            type Error = crate::wire::DecodeError;
            fn try_from(v: u32) -> Result<Self, Self::Error> {
                match v {
                    0u32 => Ok(Self::Released),
                    1u32 => Ok(Self::Pressed),
                    _ => Err(crate::wire::DecodeError::MalformedPayload),
                }
            }
        }
        impl std::fmt::Display for ButtonState {
            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
                (*self as u32).fmt(f)
            }
        }
        #[doc = "Trait to implement the zwp_tablet_pad_v2 interface. See the module level documentation for more info"]
        pub trait ZwpTabletPadV2 {
            const INTERFACE: &'static str = "zwp_tablet_pad_v2";
            const VERSION: u32 = 1u32;
            async fn handle_event(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    0u16 => {
                        let pad_group = message
                            .object()?
                            .ok_or(crate::wire::DecodeError::MalformedPayload)?;
                        tracing::debug!("zwp_tablet_pad_v2#{}.group({})", sender_id, pad_group);
                        self.group(client, sender_id, pad_group).await
                    }
                    1u16 => {
                        let path = message
                            .string()?
                            .ok_or(crate::wire::DecodeError::MalformedPayload)?;
                        tracing::debug!("zwp_tablet_pad_v2#{}.path(\"{}\")", sender_id, path);
                        self.path(client, sender_id, path).await
                    }
                    2u16 => {
                        let buttons = message.uint()?;
                        tracing::debug!("zwp_tablet_pad_v2#{}.buttons({})", sender_id, buttons);
                        self.buttons(client, sender_id, buttons).await
                    }
                    3u16 => {
                        tracing::debug!("zwp_tablet_pad_v2#{}.done()", sender_id,);
                        self.done(client, sender_id).await
                    }
                    4u16 => {
                        let time = message.uint()?;
                        let button = message.uint()?;
                        let state = message.uint()?;
                        tracing::debug!(
                            "zwp_tablet_pad_v2#{}.button({}, {}, {})",
                            sender_id,
                            time,
                            button,
                            state
                        );
                        self.button(client, sender_id, time, button, state.try_into()?)
                            .await
                    }
                    5u16 => {
                        let serial = message.uint()?;
                        let tablet = message
                            .object()?
                            .ok_or(crate::wire::DecodeError::MalformedPayload)?;
                        let surface = message
                            .object()?
                            .ok_or(crate::wire::DecodeError::MalformedPayload)?;
                        tracing::debug!(
                            "zwp_tablet_pad_v2#{}.enter({}, {}, {})",
                            sender_id,
                            serial,
                            tablet,
                            surface
                        );
                        self.enter(client, sender_id, serial, tablet, surface).await
                    }
                    6u16 => {
                        let serial = message.uint()?;
                        let surface = message
                            .object()?
                            .ok_or(crate::wire::DecodeError::MalformedPayload)?;
                        tracing::debug!(
                            "zwp_tablet_pad_v2#{}.leave({}, {})",
                            sender_id,
                            serial,
                            surface
                        );
                        self.leave(client, sender_id, serial, surface).await
                    }
                    7u16 => {
                        tracing::debug!("zwp_tablet_pad_v2#{}.removed()", sender_id,);
                        self.removed(client, sender_id).await
                    }
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "Requests the compositor to use the provided feedback string"]
            #[doc = "associated with this button. This request should be issued immediately"]
            #[doc = "after a wp_tablet_pad_group.mode_switch event from the corresponding"]
            #[doc = "group is received, or whenever a button is mapped to a different"]
            #[doc = "action. See wp_tablet_pad_group.mode_switch for more details."]
            #[doc = ""]
            #[doc = "Clients are encouraged to provide context-aware descriptions for"]
            #[doc = "the actions associated with each button, and compositors may use"]
            #[doc = "this information to offer visual feedback on the button layout"]
            #[doc = "(e.g. on-screen displays)."]
            #[doc = ""]
            #[doc = "Button indices start at 0. Setting the feedback string on a button"]
            #[doc = "that is reserved by the compositor (i.e. not belonging to any"]
            #[doc = "wp_tablet_pad_group) does not generate an error but the compositor"]
            #[doc = "is free to ignore the request."]
            #[doc = ""]
            #[doc = "The provided string 'description' is a UTF-8 encoded string to be"]
            #[doc = "associated with this ring, and is considered user-visible; general"]
            #[doc = "internationalization rules apply."]
            #[doc = ""]
            #[doc = "The serial argument will be that of the last"]
            #[doc = "wp_tablet_pad_group.mode_switch event received for the group of this"]
            #[doc = "button. Requests providing other serials than the most recent one will"]
            #[doc = "be ignored."]
            #[doc = ""]
            async fn set_feedback(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                button: u32,
                description: String,
                serial: u32,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_tablet_pad_v2#{}.set_feedback()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_uint(button)
                    .put_string(Some(description))
                    .put_uint(serial)
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Destroy the wp_tablet_pad object. Objects created from this object"]
            #[doc = "are unaffected and should be destroyed separately."]
            #[doc = ""]
            async fn destroy(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_tablet_pad_v2#{}.destroy()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 1u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Sent on wp_tablet_pad initialization to announce available groups."]
            #[doc = "One event is sent for each pad group available."]
            #[doc = ""]
            #[doc = "This event is sent in the initial burst of events before the"]
            #[doc = "wp_tablet_pad.done event. At least one group will be announced."]
            #[doc = ""]
            async fn group(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                pad_group: crate::wire::ObjectId,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "A system-specific device path that indicates which device is behind"]
            #[doc = "this wp_tablet_pad. This information may be used to gather additional"]
            #[doc = "information about the device, e.g. through libwacom."]
            #[doc = ""]
            #[doc = "The format of the path is unspecified, it may be a device node, a"]
            #[doc = "sysfs path, or some other identifier. It is up to the client to"]
            #[doc = "identify the string provided."]
            #[doc = ""]
            #[doc = "This event is sent in the initial burst of events before the"]
            #[doc = "wp_tablet_pad.done event."]
            #[doc = ""]
            async fn path(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                path: String,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Sent on wp_tablet_pad initialization to announce the available"]
            #[doc = "buttons."]
            #[doc = ""]
            #[doc = "This event is sent in the initial burst of events before the"]
            #[doc = "wp_tablet_pad.done event. This event is only sent when at least one"]
            #[doc = "button is available."]
            #[doc = ""]
            async fn buttons(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                buttons: u32,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "This event signals the end of the initial burst of descriptive"]
            #[doc = "events. A client may consider the static description of the pad to"]
            #[doc = "be complete and finalize initialization of the pad."]
            #[doc = ""]
            async fn done(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Sent whenever the physical state of a button changes."]
            #[doc = ""]
            async fn button(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                time: u32,
                button: u32,
                state: ButtonState,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Notification that this pad is focused on the specified surface."]
            #[doc = ""]
            async fn enter(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                serial: u32,
                tablet: crate::wire::ObjectId,
                surface: crate::wire::ObjectId,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Notification that this pad is no longer focused on the specified"]
            #[doc = "surface."]
            #[doc = ""]
            async fn leave(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                serial: u32,
                surface: crate::wire::ObjectId,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Sent when the pad has been removed from the system. When a tablet"]
            #[doc = "is removed its pad(s) will be removed too."]
            #[doc = ""]
            #[doc = "When this event is received, the client must destroy all rings, strips"]
            #[doc = "and groups that were offered by this pad, and issue wp_tablet_pad.destroy"]
            #[doc = "the pad itself."]
            #[doc = ""]
            async fn removed(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()>;
        }
    }
}
#[allow(clippy::module_inception)]
pub mod text_input_unstable_v1 {
    #[doc = ""]
    #[doc = "An object used for text input. Adds support for text input and input"]
    #[doc = "methods to applications. A text_input object is created from a"]
    #[doc = "wl_text_input_manager and corresponds typically to a text entry in an"]
    #[doc = "application."]
    #[doc = ""]
    #[doc = "Requests are used to activate/deactivate the text_input object and set"]
    #[doc = "state information like surrounding and selected text or the content type."]
    #[doc = "The information about entered text is sent to the text_input object via"]
    #[doc = "the pre-edit and commit events. Using this interface removes the need"]
    #[doc = "for applications to directly process hardware key events and compose text"]
    #[doc = "out of them."]
    #[doc = ""]
    #[doc = "Text is generally UTF-8 encoded, indices and lengths are in bytes."]
    #[doc = ""]
    #[doc = "Serials are used to synchronize the state between the text input and"]
    #[doc = "an input method. New serials are sent by the text input in the"]
    #[doc = "commit_state request and are used by the input method to indicate"]
    #[doc = "the known text input state in events like preedit_string, commit_string,"]
    #[doc = "and keysym. The text input can then ignore events from the input method"]
    #[doc = "which are based on an outdated state (for example after a reset)."]
    #[doc = ""]
    #[doc = "Warning! The protocol described in this file is experimental and"]
    #[doc = "backward incompatible changes may be made. Backward compatible changes"]
    #[doc = "may be added together with the corresponding interface version bump."]
    #[doc = "Backward incompatible changes are done by bumping the version number in"]
    #[doc = "the protocol and interface names and resetting the interface version."]
    #[doc = "Once the protocol is to be declared stable, the 'z' prefix and the"]
    #[doc = "version number in the protocol and interface names are removed and the"]
    #[doc = "interface version number is reset."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zwp_text_input_v1 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        bitflags::bitflags! { # [doc = ""] # [doc = "Content hint is a bitmask to allow to modify the behavior of the text"] # [doc = "input."] # [doc = ""] # [derive (Debug , PartialEq , Eq , PartialOrd , Ord , Hash , Clone , Copy)] pub struct ContentHint : u32 { # [doc = "no special behaviour"] const None = 0u32 ; # [doc = "auto completion, correction and capitalization"] const Default = 7u32 ; # [doc = "hidden and sensitive text"] const Password = 192u32 ; # [doc = "suggest word completions"] const AutoCompletion = 1u32 ; # [doc = "suggest word corrections"] const AutoCorrection = 2u32 ; # [doc = "switch to uppercase letters at the start of a sentence"] const AutoCapitalization = 4u32 ; # [doc = "prefer lowercase letters"] const Lowercase = 8u32 ; # [doc = "prefer uppercase letters"] const Uppercase = 16u32 ; # [doc = "prefer casing for titles and headings (can be language dependent)"] const Titlecase = 32u32 ; # [doc = "characters should be hidden"] const HiddenText = 64u32 ; # [doc = "typed text should not be stored"] const SensitiveData = 128u32 ; # [doc = "just latin characters should be entered"] const Latin = 256u32 ; # [doc = "the text input is multiline"] const Multiline = 512u32 ; } }
        impl TryFrom<u32> for ContentHint {
            type Error = crate::wire::DecodeError;
            fn try_from(v: u32) -> Result<Self, Self::Error> {
                Self::from_bits(v).ok_or(crate::wire::DecodeError::MalformedPayload)
            }
        }
        impl std::fmt::Display for ContentHint {
            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
                self.bits().fmt(f)
            }
        }
        #[doc = ""]
        #[doc = "The content purpose allows to specify the primary purpose of a text"]
        #[doc = "input."]
        #[doc = ""]
        #[doc = "This allows an input method to show special purpose input panels with"]
        #[doc = "extra characters or to disallow some characters."]
        #[doc = ""]
        #[repr(u32)]
        #[non_exhaustive]
        #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)]
        pub enum ContentPurpose {
            #[doc = "default input, allowing all characters"]
            Normal = 0u32,
            #[doc = "allow only alphabetic characters"]
            Alpha = 1u32,
            #[doc = "allow only digits"]
            Digits = 2u32,
            #[doc = "input a number (including decimal separator and sign)"]
            Number = 3u32,
            #[doc = "input a phone number"]
            Phone = 4u32,
            #[doc = "input an URL"]
            Url = 5u32,
            #[doc = "input an email address"]
            Email = 6u32,
            #[doc = "input a name of a person"]
            Name = 7u32,
            #[doc = "input a password (combine with password or sensitive_data hint)"]
            Password = 8u32,
            #[doc = "input a date"]
            Date = 9u32,
            #[doc = "input a time"]
            Time = 10u32,
            #[doc = "input a date and time"]
            Datetime = 11u32,
            #[doc = "input for a terminal"]
            Terminal = 12u32,
        }
        impl TryFrom<u32> for ContentPurpose {
            type Error = crate::wire::DecodeError;
            fn try_from(v: u32) -> Result<Self, Self::Error> {
                match v {
                    0u32 => Ok(Self::Normal),
                    1u32 => Ok(Self::Alpha),
                    2u32 => Ok(Self::Digits),
                    3u32 => Ok(Self::Number),
                    4u32 => Ok(Self::Phone),
                    5u32 => Ok(Self::Url),
                    6u32 => Ok(Self::Email),
                    7u32 => Ok(Self::Name),
                    8u32 => Ok(Self::Password),
                    9u32 => Ok(Self::Date),
                    10u32 => Ok(Self::Time),
                    11u32 => Ok(Self::Datetime),
                    12u32 => Ok(Self::Terminal),
                    _ => Err(crate::wire::DecodeError::MalformedPayload),
                }
            }
        }
        impl std::fmt::Display for ContentPurpose {
            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
                (*self as u32).fmt(f)
            }
        }
        #[repr(u32)]
        #[non_exhaustive]
        #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)]
        pub enum PreeditStyle {
            #[doc = "default style for composing text"]
            Default = 0u32,
            #[doc = "style should be the same as in non-composing text"]
            None = 1u32,
            Active = 2u32,
            Inactive = 3u32,
            Highlight = 4u32,
            Underline = 5u32,
            Selection = 6u32,
            Incorrect = 7u32,
        }
        impl TryFrom<u32> for PreeditStyle {
            type Error = crate::wire::DecodeError;
            fn try_from(v: u32) -> Result<Self, Self::Error> {
                match v {
                    0u32 => Ok(Self::Default),
                    1u32 => Ok(Self::None),
                    2u32 => Ok(Self::Active),
                    3u32 => Ok(Self::Inactive),
                    4u32 => Ok(Self::Highlight),
                    5u32 => Ok(Self::Underline),
                    6u32 => Ok(Self::Selection),
                    7u32 => Ok(Self::Incorrect),
                    _ => Err(crate::wire::DecodeError::MalformedPayload),
                }
            }
        }
        impl std::fmt::Display for PreeditStyle {
            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
                (*self as u32).fmt(f)
            }
        }
        #[repr(u32)]
        #[non_exhaustive]
        #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)]
        pub enum TextDirection {
            #[doc = "automatic text direction based on text and language"]
            Auto = 0u32,
            #[doc = "left-to-right"]
            Ltr = 1u32,
            #[doc = "right-to-left"]
            Rtl = 2u32,
        }
        impl TryFrom<u32> for TextDirection {
            type Error = crate::wire::DecodeError;
            fn try_from(v: u32) -> Result<Self, Self::Error> {
                match v {
                    0u32 => Ok(Self::Auto),
                    1u32 => Ok(Self::Ltr),
                    2u32 => Ok(Self::Rtl),
                    _ => Err(crate::wire::DecodeError::MalformedPayload),
                }
            }
        }
        impl std::fmt::Display for TextDirection {
            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
                (*self as u32).fmt(f)
            }
        }
        #[doc = "Trait to implement the zwp_text_input_v1 interface. See the module level documentation for more info"]
        pub trait ZwpTextInputV1 {
            const INTERFACE: &'static str = "zwp_text_input_v1";
            const VERSION: u32 = 1u32;
            async fn handle_event(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    0u16 => {
                        let surface = message
                            .object()?
                            .ok_or(crate::wire::DecodeError::MalformedPayload)?;
                        tracing::debug!("zwp_text_input_v1#{}.enter({})", sender_id, surface);
                        self.enter(client, sender_id, surface).await
                    }
                    1u16 => {
                        tracing::debug!("zwp_text_input_v1#{}.leave()", sender_id,);
                        self.leave(client, sender_id).await
                    }
                    2u16 => {
                        let map = message.array()?;
                        tracing::debug!(
                            "zwp_text_input_v1#{}.modifiers_map(array[{}])",
                            sender_id,
                            map.len()
                        );
                        self.modifiers_map(client, sender_id, map).await
                    }
                    3u16 => {
                        let state = message.uint()?;
                        tracing::debug!(
                            "zwp_text_input_v1#{}.input_panel_state({})",
                            sender_id,
                            state
                        );
                        self.input_panel_state(client, sender_id, state).await
                    }
                    4u16 => {
                        let serial = message.uint()?;
                        let text = message
                            .string()?
                            .ok_or(crate::wire::DecodeError::MalformedPayload)?;
                        let commit = message
                            .string()?
                            .ok_or(crate::wire::DecodeError::MalformedPayload)?;
                        tracing::debug!(
                            "zwp_text_input_v1#{}.preedit_string({}, \"{}\", \"{}\")",
                            sender_id,
                            serial,
                            text,
                            commit
                        );
                        self.preedit_string(client, sender_id, serial, text, commit)
                            .await
                    }
                    5u16 => {
                        let index = message.uint()?;
                        let length = message.uint()?;
                        let style = message.uint()?;
                        tracing::debug!(
                            "zwp_text_input_v1#{}.preedit_styling({}, {}, {})",
                            sender_id,
                            index,
                            length,
                            style
                        );
                        self.preedit_styling(client, sender_id, index, length, style.try_into()?)
                            .await
                    }
                    6u16 => {
                        let index = message.int()?;
                        tracing::debug!(
                            "zwp_text_input_v1#{}.preedit_cursor({})",
                            sender_id,
                            index
                        );
                        self.preedit_cursor(client, sender_id, index).await
                    }
                    7u16 => {
                        let serial = message.uint()?;
                        let text = message
                            .string()?
                            .ok_or(crate::wire::DecodeError::MalformedPayload)?;
                        tracing::debug!(
                            "zwp_text_input_v1#{}.commit_string({}, \"{}\")",
                            sender_id,
                            serial,
                            text
                        );
                        self.commit_string(client, sender_id, serial, text).await
                    }
                    8u16 => {
                        let index = message.int()?;
                        let anchor = message.int()?;
                        tracing::debug!(
                            "zwp_text_input_v1#{}.cursor_position({}, {})",
                            sender_id,
                            index,
                            anchor
                        );
                        self.cursor_position(client, sender_id, index, anchor).await
                    }
                    9u16 => {
                        let index = message.int()?;
                        let length = message.uint()?;
                        tracing::debug!(
                            "zwp_text_input_v1#{}.delete_surrounding_text({}, {})",
                            sender_id,
                            index,
                            length
                        );
                        self.delete_surrounding_text(client, sender_id, index, length)
                            .await
                    }
                    10u16 => {
                        let serial = message.uint()?;
                        let time = message.uint()?;
                        let sym = message.uint()?;
                        let state = message.uint()?;
                        let modifiers = message.uint()?;
                        tracing::debug!(
                            "zwp_text_input_v1#{}.keysym({}, {}, {}, {}, {})",
                            sender_id,
                            serial,
                            time,
                            sym,
                            state,
                            modifiers
                        );
                        self.keysym(client, sender_id, serial, time, sym, state, modifiers)
                            .await
                    }
                    11u16 => {
                        let serial = message.uint()?;
                        let language = message
                            .string()?
                            .ok_or(crate::wire::DecodeError::MalformedPayload)?;
                        tracing::debug!(
                            "zwp_text_input_v1#{}.language({}, \"{}\")",
                            sender_id,
                            serial,
                            language
                        );
                        self.language(client, sender_id, serial, language).await
                    }
                    12u16 => {
                        let serial = message.uint()?;
                        let direction = message.uint()?;
                        tracing::debug!(
                            "zwp_text_input_v1#{}.text_direction({}, {})",
                            sender_id,
                            serial,
                            direction
                        );
                        self.text_direction(client, sender_id, serial, direction.try_into()?)
                            .await
                    }
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "Requests the text_input object to be activated (typically when the"]
            #[doc = "text entry gets focus)."]
            #[doc = ""]
            #[doc = "The seat argument is a wl_seat which maintains the focus for this"]
            #[doc = "activation. The surface argument is a wl_surface assigned to the"]
            #[doc = "text_input object and tracked for focus lost. The enter event"]
            #[doc = "is emitted on successful activation."]
            #[doc = ""]
            async fn activate(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                seat: crate::wire::ObjectId,
                surface: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_text_input_v1#{}.activate()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_object(Some(seat))
                    .put_object(Some(surface))
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Requests the text_input object to be deactivated (typically when the"]
            #[doc = "text entry lost focus). The seat argument is a wl_seat which was used"]
            #[doc = "for activation."]
            #[doc = ""]
            async fn deactivate(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                seat: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_text_input_v1#{}.deactivate()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_object(Some(seat))
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 1u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Requests input panels (virtual keyboard) to show."]
            #[doc = ""]
            async fn show_input_panel(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_text_input_v1#{}.show_input_panel()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 2u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Requests input panels (virtual keyboard) to hide."]
            #[doc = ""]
            async fn hide_input_panel(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_text_input_v1#{}.hide_input_panel()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 3u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Should be called by an editor widget when the input state should be"]
            #[doc = "reset, for example after the text was changed outside of the normal"]
            #[doc = "input method flow."]
            #[doc = ""]
            async fn reset(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_text_input_v1#{}.reset()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 4u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Sets the plain surrounding text around the input position. Text is"]
            #[doc = "UTF-8 encoded. Cursor is the byte offset within the"]
            #[doc = "surrounding text. Anchor is the byte offset of the"]
            #[doc = "selection anchor within the surrounding text. If there is no selected"]
            #[doc = "text anchor, then it is the same as cursor."]
            #[doc = ""]
            async fn set_surrounding_text(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                text: String,
                cursor: u32,
                anchor: u32,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_text_input_v1#{}.set_surrounding_text()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_string(Some(text))
                    .put_uint(cursor)
                    .put_uint(anchor)
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 5u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Sets the content purpose and content hint. While the purpose is the"]
            #[doc = "basic purpose of an input field, the hint flags allow to modify some"]
            #[doc = "of the behavior."]
            #[doc = ""]
            #[doc = "When no content type is explicitly set, a normal content purpose with"]
            #[doc = "default hints (auto completion, auto correction, auto capitalization)"]
            #[doc = "should be assumed."]
            #[doc = ""]
            async fn set_content_type(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                hint: ContentHint,
                purpose: ContentPurpose,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_text_input_v1#{}.set_content_type()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_uint(hint.bits())
                    .put_uint(purpose as u32)
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 6u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            async fn set_cursor_rectangle(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                x: i32,
                y: i32,
                width: i32,
                height: i32,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_text_input_v1#{}.set_cursor_rectangle()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_int(x)
                    .put_int(y)
                    .put_int(width)
                    .put_int(height)
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 7u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Sets a specific language. This allows for example a virtual keyboard to"]
            #[doc = "show a language specific layout. The \"language\" argument is an RFC-3066"]
            #[doc = "format language tag."]
            #[doc = ""]
            #[doc = "It could be used for example in a word processor to indicate the"]
            #[doc = "language of the currently edited document or in an instant message"]
            #[doc = "application which tracks languages of contacts."]
            #[doc = ""]
            async fn set_preferred_language(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                language: String,
            ) -> crate::client::Result<()> {
                tracing::debug!(
                    "-> zwp_text_input_v1#{}.set_preferred_language()",
                    sender_id
                );
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_string(Some(language))
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 8u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            async fn commit_state(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                serial: u32,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_text_input_v1#{}.commit_state()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().put_uint(serial).build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 9u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            async fn invoke_action(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                button: u32,
                index: u32,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_text_input_v1#{}.invoke_action()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_uint(button)
                    .put_uint(index)
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 10u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Notify the text_input object when it received focus. Typically in"]
            #[doc = "response to an activate request."]
            #[doc = ""]
            async fn enter(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                surface: crate::wire::ObjectId,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Notify the text_input object when it lost focus. Either in response"]
            #[doc = "to a deactivate request or when the assigned surface lost focus or was"]
            #[doc = "destroyed."]
            #[doc = ""]
            async fn leave(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Transfer an array of 0-terminated modifier names. The position in"]
            #[doc = "the array is the index of the modifier as used in the modifiers"]
            #[doc = "bitmask in the keysym event."]
            #[doc = ""]
            async fn modifiers_map(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                map: Vec<u8>,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Notify when the visibility state of the input panel changed."]
            #[doc = ""]
            async fn input_panel_state(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                state: u32,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Notify when a new composing text (pre-edit) should be set around the"]
            #[doc = "current cursor position. Any previously set composing text should"]
            #[doc = "be removed."]
            #[doc = ""]
            #[doc = "The commit text can be used to replace the preedit text on reset"]
            #[doc = "(for example on unfocus)."]
            #[doc = ""]
            #[doc = "The text input should also handle all preedit_style and preedit_cursor"]
            #[doc = "events occurring directly before preedit_string."]
            #[doc = ""]
            async fn preedit_string(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                serial: u32,
                text: String,
                commit: String,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Sets styling information on composing text. The style is applied for"]
            #[doc = "length bytes from index relative to the beginning of the composing"]
            #[doc = "text (as byte offset). Multiple styles can"]
            #[doc = "be applied to a composing text by sending multiple preedit_styling"]
            #[doc = "events."]
            #[doc = ""]
            #[doc = "This event is handled as part of a following preedit_string event."]
            #[doc = ""]
            async fn preedit_styling(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                index: u32,
                length: u32,
                style: PreeditStyle,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Sets the cursor position inside the composing text (as byte"]
            #[doc = "offset) relative to the start of the composing text. When index is a"]
            #[doc = "negative number no cursor is shown."]
            #[doc = ""]
            #[doc = "This event is handled as part of a following preedit_string event."]
            #[doc = ""]
            async fn preedit_cursor(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                index: i32,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Notify when text should be inserted into the editor widget. The text to"]
            #[doc = "commit could be either just a single character after a key press or the"]
            #[doc = "result of some composing (pre-edit). It could also be an empty text"]
            #[doc = "when some text should be removed (see delete_surrounding_text) or when"]
            #[doc = "the input cursor should be moved (see cursor_position)."]
            #[doc = ""]
            #[doc = "Any previously set composing text should be removed."]
            #[doc = ""]
            async fn commit_string(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                serial: u32,
                text: String,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Notify when the cursor or anchor position should be modified."]
            #[doc = ""]
            #[doc = "This event should be handled as part of a following commit_string"]
            #[doc = "event."]
            #[doc = ""]
            async fn cursor_position(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                index: i32,
                anchor: i32,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Notify when the text around the current cursor position should be"]
            #[doc = "deleted."]
            #[doc = ""]
            #[doc = "Index is relative to the current cursor (in bytes)."]
            #[doc = "Length is the length of deleted text (in bytes)."]
            #[doc = ""]
            #[doc = "This event should be handled as part of a following commit_string"]
            #[doc = "event."]
            #[doc = ""]
            async fn delete_surrounding_text(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                index: i32,
                length: u32,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Notify when a key event was sent. Key events should not be used"]
            #[doc = "for normal text input operations, which should be done with"]
            #[doc = "commit_string, delete_surrounding_text, etc. The key event follows"]
            #[doc = "the wl_keyboard key event convention. Sym is an XKB keysym, state a"]
            #[doc = "wl_keyboard key_state. Modifiers are a mask for effective modifiers"]
            #[doc = "(where the modifier indices are set by the modifiers_map event)"]
            #[doc = ""]
            async fn keysym(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                serial: u32,
                time: u32,
                sym: u32,
                state: u32,
                modifiers: u32,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Sets the language of the input text. The \"language\" argument is an"]
            #[doc = "RFC-3066 format language tag."]
            #[doc = ""]
            async fn language(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                serial: u32,
                language: String,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Sets the text direction of input text."]
            #[doc = ""]
            #[doc = "It is mainly needed for showing an input cursor on the correct side of"]
            #[doc = "the editor when there is no input done yet and making sure neutral"]
            #[doc = "direction text is laid out properly."]
            #[doc = ""]
            async fn text_direction(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                serial: u32,
                direction: TextDirection,
            ) -> crate::client::Result<()>;
        }
    }
    #[doc = ""]
    #[doc = "A factory for text_input objects. This object is a global singleton."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zwp_text_input_manager_v1 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[doc = "Trait to implement the zwp_text_input_manager_v1 interface. See the module level documentation for more info"]
        pub trait ZwpTextInputManagerV1 {
            const INTERFACE: &'static str = "zwp_text_input_manager_v1";
            const VERSION: u32 = 1u32;
            async fn handle_event(
                &self,
                _client: &mut crate::server::Client,
                _sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "Creates a new text_input object."]
            #[doc = ""]
            async fn create_text_input(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!(
                    "-> zwp_text_input_manager_v1#{}.create_text_input()",
                    sender_id
                );
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_object(Some(id))
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
        }
    }
}
#[doc = ""]
#[doc = "This protocol allows compositors to act as input methods and to send text"]
#[doc = "to applications. A text input object is used to manage state of what are"]
#[doc = "typically text entry fields in the application."]
#[doc = ""]
#[doc = "This document adheres to the RFC 2119 when using words like \"must\","]
#[doc = "\"should\", \"may\", etc."]
#[doc = ""]
#[doc = "Warning! The protocol described in this file is experimental and"]
#[doc = "backward incompatible changes may be made. Backward compatible changes"]
#[doc = "may be added together with the corresponding interface version bump."]
#[doc = "Backward incompatible changes are done by bumping the version number in"]
#[doc = "the protocol and interface names and resetting the interface version."]
#[doc = "Once the protocol is to be declared stable, the 'z' prefix and the"]
#[doc = "version number in the protocol and interface names are removed and the"]
#[doc = "interface version number is reset."]
#[doc = ""]
#[allow(clippy::module_inception)]
pub mod text_input_unstable_v3 {
    #[doc = ""]
    #[doc = "The zwp_text_input_v3 interface represents text input and input methods"]
    #[doc = "associated with a seat. It provides enter/leave events to follow the"]
    #[doc = "text input focus for a seat."]
    #[doc = ""]
    #[doc = "Requests are used to enable/disable the text-input object and set"]
    #[doc = "state information like surrounding and selected text or the content type."]
    #[doc = "The information about the entered text is sent to the text-input object"]
    #[doc = "via the preedit_string and commit_string events."]
    #[doc = ""]
    #[doc = "Text is valid UTF-8 encoded, indices and lengths are in bytes. Indices"]
    #[doc = "must not point to middle bytes inside a code point: they must either"]
    #[doc = "point to the first byte of a code point or to the end of the buffer."]
    #[doc = "Lengths must be measured between two valid indices."]
    #[doc = ""]
    #[doc = "Focus moving throughout surfaces will result in the emission of"]
    #[doc = "zwp_text_input_v3.enter and zwp_text_input_v3.leave events. The focused"]
    #[doc = "surface must commit zwp_text_input_v3.enable and"]
    #[doc = "zwp_text_input_v3.disable requests as the keyboard focus moves across"]
    #[doc = "editable and non-editable elements of the UI. Those two requests are not"]
    #[doc = "expected to be paired with each other, the compositor must be able to"]
    #[doc = "handle consecutive series of the same request."]
    #[doc = ""]
    #[doc = "State is sent by the state requests (set_surrounding_text,"]
    #[doc = "set_content_type and set_cursor_rectangle) and a commit request. After an"]
    #[doc = "enter event or disable request all state information is invalidated and"]
    #[doc = "needs to be resent by the client."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zwp_text_input_v3 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[doc = ""]
        #[doc = "Reason for the change of surrounding text or cursor posision."]
        #[doc = ""]
        #[repr(u32)]
        #[non_exhaustive]
        #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)]
        pub enum ChangeCause {
            #[doc = "input method caused the change"]
            InputMethod = 0u32,
            #[doc = "something else than the input method caused the change"]
            Other = 1u32,
        }
        impl TryFrom<u32> for ChangeCause {
            type Error = crate::wire::DecodeError;
            fn try_from(v: u32) -> Result<Self, Self::Error> {
                match v {
                    0u32 => Ok(Self::InputMethod),
                    1u32 => Ok(Self::Other),
                    _ => Err(crate::wire::DecodeError::MalformedPayload),
                }
            }
        }
        impl std::fmt::Display for ChangeCause {
            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
                (*self as u32).fmt(f)
            }
        }
        bitflags::bitflags! { # [doc = ""] # [doc = "Content hint is a bitmask to allow to modify the behavior of the text"] # [doc = "input."] # [doc = ""] # [derive (Debug , PartialEq , Eq , PartialOrd , Ord , Hash , Clone , Copy)] pub struct ContentHint : u32 { # [doc = "no special behavior"] const None = 0u32 ; # [doc = "suggest word completions"] const Completion = 1u32 ; # [doc = "suggest word corrections"] const Spellcheck = 2u32 ; # [doc = "switch to uppercase letters at the start of a sentence"] const AutoCapitalization = 4u32 ; # [doc = "prefer lowercase letters"] const Lowercase = 8u32 ; # [doc = "prefer uppercase letters"] const Uppercase = 16u32 ; # [doc = "prefer casing for titles and headings (can be language dependent)"] const Titlecase = 32u32 ; # [doc = "characters should be hidden"] const HiddenText = 64u32 ; # [doc = "typed text should not be stored"] const SensitiveData = 128u32 ; # [doc = "just Latin characters should be entered"] const Latin = 256u32 ; # [doc = "the text input is multiline"] const Multiline = 512u32 ; } }
        impl TryFrom<u32> for ContentHint {
            type Error = crate::wire::DecodeError;
            fn try_from(v: u32) -> Result<Self, Self::Error> {
                Self::from_bits(v).ok_or(crate::wire::DecodeError::MalformedPayload)
            }
        }
        impl std::fmt::Display for ContentHint {
            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
                self.bits().fmt(f)
            }
        }
        #[doc = ""]
        #[doc = "The content purpose allows to specify the primary purpose of a text"]
        #[doc = "input."]
        #[doc = ""]
        #[doc = "This allows an input method to show special purpose input panels with"]
        #[doc = "extra characters or to disallow some characters."]
        #[doc = ""]
        #[repr(u32)]
        #[non_exhaustive]
        #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)]
        pub enum ContentPurpose {
            #[doc = "default input, allowing all characters"]
            Normal = 0u32,
            #[doc = "allow only alphabetic characters"]
            Alpha = 1u32,
            #[doc = "allow only digits"]
            Digits = 2u32,
            #[doc = "input a number (including decimal separator and sign)"]
            Number = 3u32,
            #[doc = "input a phone number"]
            Phone = 4u32,
            #[doc = "input an URL"]
            Url = 5u32,
            #[doc = "input an email address"]
            Email = 6u32,
            #[doc = "input a name of a person"]
            Name = 7u32,
            #[doc = "input a password (combine with sensitive_data hint)"]
            Password = 8u32,
            #[doc = "input is a numeric password (combine with sensitive_data hint)"]
            Pin = 9u32,
            #[doc = "input a date"]
            Date = 10u32,
            #[doc = "input a time"]
            Time = 11u32,
            #[doc = "input a date and time"]
            Datetime = 12u32,
            #[doc = "input for a terminal"]
            Terminal = 13u32,
        }
        impl TryFrom<u32> for ContentPurpose {
            type Error = crate::wire::DecodeError;
            fn try_from(v: u32) -> Result<Self, Self::Error> {
                match v {
                    0u32 => Ok(Self::Normal),
                    1u32 => Ok(Self::Alpha),
                    2u32 => Ok(Self::Digits),
                    3u32 => Ok(Self::Number),
                    4u32 => Ok(Self::Phone),
                    5u32 => Ok(Self::Url),
                    6u32 => Ok(Self::Email),
                    7u32 => Ok(Self::Name),
                    8u32 => Ok(Self::Password),
                    9u32 => Ok(Self::Pin),
                    10u32 => Ok(Self::Date),
                    11u32 => Ok(Self::Time),
                    12u32 => Ok(Self::Datetime),
                    13u32 => Ok(Self::Terminal),
                    _ => Err(crate::wire::DecodeError::MalformedPayload),
                }
            }
        }
        impl std::fmt::Display for ContentPurpose {
            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
                (*self as u32).fmt(f)
            }
        }
        #[doc = "Trait to implement the zwp_text_input_v3 interface. See the module level documentation for more info"]
        pub trait ZwpTextInputV3 {
            const INTERFACE: &'static str = "zwp_text_input_v3";
            const VERSION: u32 = 1u32;
            async fn handle_event(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    0u16 => {
                        let surface = message
                            .object()?
                            .ok_or(crate::wire::DecodeError::MalformedPayload)?;
                        tracing::debug!("zwp_text_input_v3#{}.enter({})", sender_id, surface);
                        self.enter(client, sender_id, surface).await
                    }
                    1u16 => {
                        let surface = message
                            .object()?
                            .ok_or(crate::wire::DecodeError::MalformedPayload)?;
                        tracing::debug!("zwp_text_input_v3#{}.leave({})", sender_id, surface);
                        self.leave(client, sender_id, surface).await
                    }
                    2u16 => {
                        let text = message.string()?;
                        let cursor_begin = message.int()?;
                        let cursor_end = message.int()?;
                        tracing::debug!(
                            "zwp_text_input_v3#{}.preedit_string(\"{}\", {}, {})",
                            sender_id,
                            text.as_ref().map_or("null".to_string(), |v| v.to_string()),
                            cursor_begin,
                            cursor_end
                        );
                        self.preedit_string(client, sender_id, text, cursor_begin, cursor_end)
                            .await
                    }
                    3u16 => {
                        let text = message.string()?;
                        tracing::debug!(
                            "zwp_text_input_v3#{}.commit_string(\"{}\")",
                            sender_id,
                            text.as_ref().map_or("null".to_string(), |v| v.to_string())
                        );
                        self.commit_string(client, sender_id, text).await
                    }
                    4u16 => {
                        let before_length = message.uint()?;
                        let after_length = message.uint()?;
                        tracing::debug!(
                            "zwp_text_input_v3#{}.delete_surrounding_text({}, {})",
                            sender_id,
                            before_length,
                            after_length
                        );
                        self.delete_surrounding_text(client, sender_id, before_length, after_length)
                            .await
                    }
                    5u16 => {
                        let serial = message.uint()?;
                        tracing::debug!("zwp_text_input_v3#{}.done({})", sender_id, serial);
                        self.done(client, sender_id, serial).await
                    }
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "Destroy the wp_text_input object. Also disables all surfaces enabled"]
            #[doc = "through this wp_text_input object."]
            #[doc = ""]
            async fn destroy(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_text_input_v3#{}.destroy()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Requests text input on the surface previously obtained from the enter"]
            #[doc = "event."]
            #[doc = ""]
            #[doc = "This request must be issued every time the focused text input changes"]
            #[doc = "to a new one, including within the current surface. Use"]
            #[doc = "zwp_text_input_v3.disable when there is no longer any input focus on"]
            #[doc = "the current surface."]
            #[doc = ""]
            #[doc = "Clients must not enable more than one text input on the single seat"]
            #[doc = "and should disable the current text input before enabling the new one."]
            #[doc = "Requests to enable a text input when another text input is enabled"]
            #[doc = "on the same seat must be ignored by compositor."]
            #[doc = ""]
            #[doc = "This request resets all state associated with previous enable, disable,"]
            #[doc = "set_surrounding_text, set_text_change_cause, set_content_type, and"]
            #[doc = "set_cursor_rectangle requests, as well as the state associated with"]
            #[doc = "preedit_string, commit_string, and delete_surrounding_text events."]
            #[doc = ""]
            #[doc = "The set_surrounding_text, set_content_type and set_cursor_rectangle"]
            #[doc = "requests must follow if the text input supports the necessary"]
            #[doc = "functionality."]
            #[doc = ""]
            #[doc = "State set with this request is double-buffered. It will get applied on"]
            #[doc = "the next zwp_text_input_v3.commit request, and stay valid until the"]
            #[doc = "next committed enable or disable request."]
            #[doc = ""]
            #[doc = "The changes must be applied by the compositor after issuing a"]
            #[doc = "zwp_text_input_v3.commit request."]
            #[doc = ""]
            async fn enable(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_text_input_v3#{}.enable()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 1u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Explicitly disable text input on the current surface (typically when"]
            #[doc = "there is no focus on any text entry inside the surface)."]
            #[doc = ""]
            #[doc = "State set with this request is double-buffered. It will get applied on"]
            #[doc = "the next zwp_text_input_v3.commit request."]
            #[doc = ""]
            async fn disable(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_text_input_v3#{}.disable()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 2u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Sets the surrounding plain text around the input, excluding the preedit"]
            #[doc = "text."]
            #[doc = ""]
            #[doc = "The client should notify the compositor of any changes in any of the"]
            #[doc = "values carried with this request, including changes caused by handling"]
            #[doc = "incoming text-input events as well as changes caused by other"]
            #[doc = "mechanisms like keyboard typing."]
            #[doc = ""]
            #[doc = "If the client is unaware of the text around the cursor, it should not"]
            #[doc = "issue this request, to signify lack of support to the compositor."]
            #[doc = ""]
            #[doc = "Text is UTF-8 encoded, and should include the cursor position, the"]
            #[doc = "complete selection and additional characters before and after them."]
            #[doc = "There is a maximum length of wayland messages, so text can not be"]
            #[doc = "longer than 4000 bytes."]
            #[doc = ""]
            #[doc = "Cursor is the byte offset of the cursor within text buffer."]
            #[doc = ""]
            #[doc = "Anchor is the byte offset of the selection anchor within text buffer."]
            #[doc = "If there is no selected text, anchor is the same as cursor."]
            #[doc = ""]
            #[doc = "If any preedit text is present, it is replaced with a cursor for the"]
            #[doc = "purpose of this event."]
            #[doc = ""]
            #[doc = "Values set with this request are double-buffered. They will get applied"]
            #[doc = "on the next zwp_text_input_v3.commit request, and stay valid until the"]
            #[doc = "next committed enable or disable request."]
            #[doc = ""]
            #[doc = "The initial state for affected fields is empty, meaning that the text"]
            #[doc = "input does not support sending surrounding text. If the empty values"]
            #[doc = "get applied, subsequent attempts to change them may have no effect."]
            #[doc = ""]
            async fn set_surrounding_text(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                text: String,
                cursor: i32,
                anchor: i32,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_text_input_v3#{}.set_surrounding_text()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_string(Some(text))
                    .put_int(cursor)
                    .put_int(anchor)
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 3u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Tells the compositor why the text surrounding the cursor changed."]
            #[doc = ""]
            #[doc = "Whenever the client detects an external change in text, cursor, or"]
            #[doc = "anchor posision, it must issue this request to the compositor. This"]
            #[doc = "request is intended to give the input method a chance to update the"]
            #[doc = "preedit text in an appropriate way, e.g. by removing it when the user"]
            #[doc = "starts typing with a keyboard."]
            #[doc = ""]
            #[doc = "cause describes the source of the change."]
            #[doc = ""]
            #[doc = "The value set with this request is double-buffered. It must be applied"]
            #[doc = "and reset to initial at the next zwp_text_input_v3.commit request."]
            #[doc = ""]
            #[doc = "The initial value of cause is input_method."]
            #[doc = ""]
            async fn set_text_change_cause(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                cause: ChangeCause,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_text_input_v3#{}.set_text_change_cause()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_uint(cause as u32)
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 4u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Sets the content purpose and content hint. While the purpose is the"]
            #[doc = "basic purpose of an input field, the hint flags allow to modify some of"]
            #[doc = "the behavior."]
            #[doc = ""]
            #[doc = "Values set with this request are double-buffered. They will get applied"]
            #[doc = "on the next zwp_text_input_v3.commit request."]
            #[doc = "Subsequent attempts to update them may have no effect. The values"]
            #[doc = "remain valid until the next committed enable or disable request."]
            #[doc = ""]
            #[doc = "The initial value for hint is none, and the initial value for purpose"]
            #[doc = "is normal."]
            #[doc = ""]
            async fn set_content_type(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                hint: ContentHint,
                purpose: ContentPurpose,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_text_input_v3#{}.set_content_type()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_uint(hint.bits())
                    .put_uint(purpose as u32)
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 5u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Marks an area around the cursor as a x, y, width, height rectangle in"]
            #[doc = "surface local coordinates."]
            #[doc = ""]
            #[doc = "Allows the compositor to put a window with word suggestions near the"]
            #[doc = "cursor, without obstructing the text being input."]
            #[doc = ""]
            #[doc = "If the client is unaware of the position of edited text, it should not"]
            #[doc = "issue this request, to signify lack of support to the compositor."]
            #[doc = ""]
            #[doc = "Values set with this request are double-buffered. They will get applied"]
            #[doc = "on the next zwp_text_input_v3.commit request, and stay valid until the"]
            #[doc = "next committed enable or disable request."]
            #[doc = ""]
            #[doc = "The initial values describing a cursor rectangle are empty. That means"]
            #[doc = "the text input does not support describing the cursor area. If the"]
            #[doc = "empty values get applied, subsequent attempts to change them may have"]
            #[doc = "no effect."]
            #[doc = ""]
            async fn set_cursor_rectangle(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                x: i32,
                y: i32,
                width: i32,
                height: i32,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_text_input_v3#{}.set_cursor_rectangle()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_int(x)
                    .put_int(y)
                    .put_int(width)
                    .put_int(height)
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 6u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Atomically applies state changes recently sent to the compositor."]
            #[doc = ""]
            #[doc = "The commit request establishes and updates the state of the client, and"]
            #[doc = "must be issued after any changes to apply them."]
            #[doc = ""]
            #[doc = "Text input state (enabled status, content purpose, content hint,"]
            #[doc = "surrounding text and change cause, cursor rectangle) is conceptually"]
            #[doc = "double-buffered within the context of a text input, i.e. between a"]
            #[doc = "committed enable request and the following committed enable or disable"]
            #[doc = "request."]
            #[doc = ""]
            #[doc = "Protocol requests modify the pending state, as opposed to the current"]
            #[doc = "state in use by the input method. A commit request atomically applies"]
            #[doc = "all pending state, replacing the current state. After commit, the new"]
            #[doc = "pending state is as documented for each related request."]
            #[doc = ""]
            #[doc = "Requests are applied in the order of arrival."]
            #[doc = ""]
            #[doc = "Neither current nor pending state are modified unless noted otherwise."]
            #[doc = ""]
            #[doc = "The compositor must count the number of commit requests coming from"]
            #[doc = "each zwp_text_input_v3 object and use the count as the serial in done"]
            #[doc = "events."]
            #[doc = ""]
            async fn commit(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_text_input_v3#{}.commit()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 7u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Notification that this seat's text-input focus is on a certain surface."]
            #[doc = ""]
            #[doc = "If client has created multiple text input objects, compositor must send"]
            #[doc = "this event to all of them."]
            #[doc = ""]
            #[doc = "When the seat has the keyboard capability the text-input focus follows"]
            #[doc = "the keyboard focus. This event sets the current surface for the"]
            #[doc = "text-input object."]
            #[doc = ""]
            async fn enter(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                surface: crate::wire::ObjectId,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Notification that this seat's text-input focus is no longer on a"]
            #[doc = "certain surface. The client should reset any preedit string previously"]
            #[doc = "set."]
            #[doc = ""]
            #[doc = "The leave notification clears the current surface. It is sent before"]
            #[doc = "the enter notification for the new focus. After leave event, compositor"]
            #[doc = "must ignore requests from any text input instances until next enter"]
            #[doc = "event."]
            #[doc = ""]
            #[doc = "When the seat has the keyboard capability the text-input focus follows"]
            #[doc = "the keyboard focus."]
            #[doc = ""]
            async fn leave(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                surface: crate::wire::ObjectId,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Notify when a new composing text (pre-edit) should be set at the"]
            #[doc = "current cursor position. Any previously set composing text must be"]
            #[doc = "removed. Any previously existing selected text must be removed."]
            #[doc = ""]
            #[doc = "The argument text contains the pre-edit string buffer."]
            #[doc = ""]
            #[doc = "The parameters cursor_begin and cursor_end are counted in bytes"]
            #[doc = "relative to the beginning of the submitted text buffer. Cursor should"]
            #[doc = "be hidden when both are equal to -1."]
            #[doc = ""]
            #[doc = "They could be represented by the client as a line if both values are"]
            #[doc = "the same, or as a text highlight otherwise."]
            #[doc = ""]
            #[doc = "Values set with this event are double-buffered. They must be applied"]
            #[doc = "and reset to initial on the next zwp_text_input_v3.done event."]
            #[doc = ""]
            #[doc = "The initial value of text is an empty string, and cursor_begin,"]
            #[doc = "cursor_end and cursor_hidden are all 0."]
            #[doc = ""]
            async fn preedit_string(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                text: Option<String>,
                cursor_begin: i32,
                cursor_end: i32,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Notify when text should be inserted into the editor widget. The text to"]
            #[doc = "commit could be either just a single character after a key press or the"]
            #[doc = "result of some composing (pre-edit)."]
            #[doc = ""]
            #[doc = "Values set with this event are double-buffered. They must be applied"]
            #[doc = "and reset to initial on the next zwp_text_input_v3.done event."]
            #[doc = ""]
            #[doc = "The initial value of text is an empty string."]
            #[doc = ""]
            async fn commit_string(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                text: Option<String>,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Notify when the text around the current cursor position should be"]
            #[doc = "deleted."]
            #[doc = ""]
            #[doc = "Before_length and after_length are the number of bytes before and after"]
            #[doc = "the current cursor index (excluding the selection) to delete."]
            #[doc = ""]
            #[doc = "If a preedit text is present, in effect before_length is counted from"]
            #[doc = "the beginning of it, and after_length from its end (see done event"]
            #[doc = "sequence)."]
            #[doc = ""]
            #[doc = "Values set with this event are double-buffered. They must be applied"]
            #[doc = "and reset to initial on the next zwp_text_input_v3.done event."]
            #[doc = ""]
            #[doc = "The initial values of both before_length and after_length are 0."]
            #[doc = ""]
            async fn delete_surrounding_text(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                before_length: u32,
                after_length: u32,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Instruct the application to apply changes to state requested by the"]
            #[doc = "preedit_string, commit_string and delete_surrounding_text events. The"]
            #[doc = "state relating to these events is double-buffered, and each one"]
            #[doc = "modifies the pending state. This event replaces the current state with"]
            #[doc = "the pending state."]
            #[doc = ""]
            #[doc = "The application must proceed by evaluating the changes in the following"]
            #[doc = "order:"]
            #[doc = ""]
            #[doc = "1. Replace existing preedit string with the cursor."]
            #[doc = "2. Delete requested surrounding text."]
            #[doc = "3. Insert commit string with the cursor at its end."]
            #[doc = "4. Calculate surrounding text to send."]
            #[doc = "5. Insert new preedit text in cursor position."]
            #[doc = "6. Place cursor inside preedit text."]
            #[doc = ""]
            #[doc = "The serial number reflects the last state of the zwp_text_input_v3"]
            #[doc = "object known to the compositor. The value of the serial argument must"]
            #[doc = "be equal to the number of commit requests already issued on that object."]
            #[doc = ""]
            #[doc = "When the client receives a done event with a serial different than the"]
            #[doc = "number of past commit requests, it must proceed with evaluating and"]
            #[doc = "applying the changes as normal, except it should not change the current"]
            #[doc = "state of the zwp_text_input_v3 object. All pending state requests"]
            #[doc = "(set_surrounding_text, set_content_type and set_cursor_rectangle) on"]
            #[doc = "the zwp_text_input_v3 object should be sent and committed after"]
            #[doc = "receiving a zwp_text_input_v3.done event with a matching serial."]
            #[doc = ""]
            async fn done(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                serial: u32,
            ) -> crate::client::Result<()>;
        }
    }
    #[doc = ""]
    #[doc = "A factory for text-input objects. This object is a global singleton."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zwp_text_input_manager_v3 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[doc = "Trait to implement the zwp_text_input_manager_v3 interface. See the module level documentation for more info"]
        pub trait ZwpTextInputManagerV3 {
            const INTERFACE: &'static str = "zwp_text_input_manager_v3";
            const VERSION: u32 = 1u32;
            async fn handle_event(
                &self,
                _client: &mut crate::server::Client,
                _sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "Destroy the wp_text_input_manager object."]
            #[doc = ""]
            async fn destroy(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_text_input_manager_v3#{}.destroy()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Creates a new text-input object for a given seat."]
            #[doc = ""]
            async fn get_text_input(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                id: crate::wire::ObjectId,
                seat: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!(
                    "-> zwp_text_input_manager_v3#{}.get_text_input()",
                    sender_id
                );
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_object(Some(id))
                    .put_object(Some(seat))
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 1u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
        }
    }
}
#[allow(clippy::module_inception)]
pub mod xdg_decoration_unstable_v1 {
    #[doc = ""]
    #[doc = "This interface allows a compositor to announce support for server-side"]
    #[doc = "decorations."]
    #[doc = ""]
    #[doc = "A window decoration is a set of window controls as deemed appropriate by"]
    #[doc = "the party managing them, such as user interface components used to move,"]
    #[doc = "resize and change a window's state."]
    #[doc = ""]
    #[doc = "A client can use this protocol to request being decorated by a supporting"]
    #[doc = "compositor."]
    #[doc = ""]
    #[doc = "If compositor and client do not negotiate the use of a server-side"]
    #[doc = "decoration using this protocol, clients continue to self-decorate as they"]
    #[doc = "see fit."]
    #[doc = ""]
    #[doc = "Warning! The protocol described in this file is experimental and"]
    #[doc = "backward incompatible changes may be made. Backward compatible changes"]
    #[doc = "may be added together with the corresponding interface version bump."]
    #[doc = "Backward incompatible changes are done by bumping the version number in"]
    #[doc = "the protocol and interface names and resetting the interface version."]
    #[doc = "Once the protocol is to be declared stable, the 'z' prefix and the"]
    #[doc = "version number in the protocol and interface names are removed and the"]
    #[doc = "interface version number is reset."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zxdg_decoration_manager_v1 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[doc = "Trait to implement the zxdg_decoration_manager_v1 interface. See the module level documentation for more info"]
        pub trait ZxdgDecorationManagerV1 {
            const INTERFACE: &'static str = "zxdg_decoration_manager_v1";
            const VERSION: u32 = 1u32;
            async fn handle_event(
                &self,
                _client: &mut crate::server::Client,
                _sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "Destroy the decoration manager. This doesn't destroy objects created"]
            #[doc = "with the manager."]
            #[doc = ""]
            async fn destroy(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zxdg_decoration_manager_v1#{}.destroy()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Create a new decoration object associated with the given toplevel."]
            #[doc = ""]
            #[doc = "Creating an xdg_toplevel_decoration from an xdg_toplevel which has a"]
            #[doc = "buffer attached or committed is a client error, and any attempts by a"]
            #[doc = "client to attach or manipulate a buffer prior to the first"]
            #[doc = "xdg_toplevel_decoration.configure event must also be treated as"]
            #[doc = "errors."]
            #[doc = ""]
            async fn get_toplevel_decoration(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                id: crate::wire::ObjectId,
                toplevel: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!(
                    "-> zxdg_decoration_manager_v1#{}.get_toplevel_decoration()",
                    sender_id
                );
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_object(Some(id))
                    .put_object(Some(toplevel))
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 1u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
        }
    }
    #[doc = ""]
    #[doc = "The decoration object allows the compositor to toggle server-side window"]
    #[doc = "decorations for a toplevel surface. The client can request to switch to"]
    #[doc = "another mode."]
    #[doc = ""]
    #[doc = "The xdg_toplevel_decoration object must be destroyed before its"]
    #[doc = "xdg_toplevel."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zxdg_toplevel_decoration_v1 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[repr(u32)]
        #[non_exhaustive]
        #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)]
        pub enum Error {
            #[doc = "xdg_toplevel has a buffer attached before configure"]
            UnconfiguredBuffer = 0u32,
            #[doc = "xdg_toplevel already has a decoration object"]
            AlreadyConstructed = 1u32,
            #[doc = "xdg_toplevel destroyed before the decoration object"]
            Orphaned = 2u32,
            #[doc = "invalid mode"]
            InvalidMode = 3u32,
        }
        impl TryFrom<u32> for Error {
            type Error = crate::wire::DecodeError;
            fn try_from(v: u32) -> Result<Self, Self::Error> {
                match v {
                    0u32 => Ok(Self::UnconfiguredBuffer),
                    1u32 => Ok(Self::AlreadyConstructed),
                    2u32 => Ok(Self::Orphaned),
                    3u32 => Ok(Self::InvalidMode),
                    _ => Err(crate::wire::DecodeError::MalformedPayload),
                }
            }
        }
        impl std::fmt::Display for Error {
            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
                (*self as u32).fmt(f)
            }
        }
        #[doc = ""]
        #[doc = "These values describe window decoration modes."]
        #[doc = ""]
        #[repr(u32)]
        #[non_exhaustive]
        #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)]
        pub enum Mode {
            #[doc = "no server-side window decoration"]
            ClientSide = 1u32,
            #[doc = "server-side window decoration"]
            ServerSide = 2u32,
        }
        impl TryFrom<u32> for Mode {
            type Error = crate::wire::DecodeError;
            fn try_from(v: u32) -> Result<Self, Self::Error> {
                match v {
                    1u32 => Ok(Self::ClientSide),
                    2u32 => Ok(Self::ServerSide),
                    _ => Err(crate::wire::DecodeError::MalformedPayload),
                }
            }
        }
        impl std::fmt::Display for Mode {
            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
                (*self as u32).fmt(f)
            }
        }
        #[doc = "Trait to implement the zxdg_toplevel_decoration_v1 interface. See the module level documentation for more info"]
        pub trait ZxdgToplevelDecorationV1 {
            const INTERFACE: &'static str = "zxdg_toplevel_decoration_v1";
            const VERSION: u32 = 1u32;
            async fn handle_event(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    0u16 => {
                        let mode = message.uint()?;
                        tracing::debug!(
                            "zxdg_toplevel_decoration_v1#{}.configure({})",
                            sender_id,
                            mode
                        );
                        self.configure(client, sender_id, mode.try_into()?).await
                    }
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "Switch back to a mode without any server-side decorations at the next"]
            #[doc = "commit."]
            #[doc = ""]
            async fn destroy(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zxdg_toplevel_decoration_v1#{}.destroy()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Set the toplevel surface decoration mode. This informs the compositor"]
            #[doc = "that the client prefers the provided decoration mode."]
            #[doc = ""]
            #[doc = "After requesting a decoration mode, the compositor will respond by"]
            #[doc = "emitting an xdg_surface.configure event. The client should then update"]
            #[doc = "its content, drawing it without decorations if the received mode is"]
            #[doc = "server-side decorations. The client must also acknowledge the configure"]
            #[doc = "when committing the new content (see xdg_surface.ack_configure)."]
            #[doc = ""]
            #[doc = "The compositor can decide not to use the client's mode and enforce a"]
            #[doc = "different mode instead."]
            #[doc = ""]
            #[doc = "Clients whose decoration mode depend on the xdg_toplevel state may send"]
            #[doc = "a set_mode request in response to an xdg_surface.configure event and wait"]
            #[doc = "for the next xdg_surface.configure event to prevent unwanted state."]
            #[doc = "Such clients are responsible for preventing configure loops and must"]
            #[doc = "make sure not to send multiple successive set_mode requests with the"]
            #[doc = "same decoration mode."]
            #[doc = ""]
            #[doc = "If an invalid mode is supplied by the client, the invalid_mode protocol"]
            #[doc = "error is raised by the compositor."]
            #[doc = ""]
            async fn set_mode(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                mode: Mode,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zxdg_toplevel_decoration_v1#{}.set_mode()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_uint(mode as u32)
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 1u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Unset the toplevel surface decoration mode. This informs the compositor"]
            #[doc = "that the client doesn't prefer a particular decoration mode."]
            #[doc = ""]
            #[doc = "This request has the same semantics as set_mode."]
            #[doc = ""]
            async fn unset_mode(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zxdg_toplevel_decoration_v1#{}.unset_mode()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 2u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "The configure event configures the effective decoration mode. The"]
            #[doc = "configured state should not be applied immediately. Clients must send an"]
            #[doc = "ack_configure in response to this event. See xdg_surface.configure and"]
            #[doc = "xdg_surface.ack_configure for details."]
            #[doc = ""]
            #[doc = "A configure event can be sent at any time. The specified mode must be"]
            #[doc = "obeyed by the client."]
            #[doc = ""]
            async fn configure(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                mode: Mode,
            ) -> crate::client::Result<()>;
        }
    }
}
#[doc = ""]
#[doc = "This protocol specifies a way for making it possible to reference a surface"]
#[doc = "of a different client. With such a reference, a client can, by using the"]
#[doc = "interfaces provided by this protocol, manipulate the relationship between"]
#[doc = "its own surfaces and the surface of some other client. For example, stack"]
#[doc = "some of its own surface above the other clients surface."]
#[doc = ""]
#[doc = "In order for a client A to get a reference of a surface of client B, client"]
#[doc = "B must first export its surface using xdg_exporter.export. Upon doing this,"]
#[doc = "client B will receive a handle (a unique string) that it may share with"]
#[doc = "client A in some way (for example D-Bus). After client A has received the"]
#[doc = "handle from client B, it may use xdg_importer.import to create a reference"]
#[doc = "to the surface client B just exported. See the corresponding requests for"]
#[doc = "details."]
#[doc = ""]
#[doc = "A possible use case for this is out-of-process dialogs. For example when a"]
#[doc = "sandboxed client without file system access needs the user to select a file"]
#[doc = "on the file system, given sandbox environment support, it can export its"]
#[doc = "surface, passing the exported surface handle to an unsandboxed process that"]
#[doc = "can show a file browser dialog and stack it above the sandboxed client's"]
#[doc = "surface."]
#[doc = ""]
#[doc = "Warning! The protocol described in this file is experimental and backward"]
#[doc = "incompatible changes may be made. Backward compatible changes may be added"]
#[doc = "together with the corresponding interface version bump. Backward"]
#[doc = "incompatible changes are done by bumping the version number in the protocol"]
#[doc = "and interface names and resetting the interface version. Once the protocol"]
#[doc = "is to be declared stable, the 'z' prefix and the version number in the"]
#[doc = "protocol and interface names are removed and the interface version number is"]
#[doc = "reset."]
#[doc = ""]
#[allow(clippy::module_inception)]
pub mod xdg_foreign_unstable_v1 {
    #[doc = ""]
    #[doc = "A global interface used for exporting surfaces that can later be imported"]
    #[doc = "using xdg_importer."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zxdg_exporter_v1 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[doc = "Trait to implement the zxdg_exporter_v1 interface. See the module level documentation for more info"]
        pub trait ZxdgExporterV1 {
            const INTERFACE: &'static str = "zxdg_exporter_v1";
            const VERSION: u32 = 1u32;
            async fn handle_event(
                &self,
                _client: &mut crate::server::Client,
                _sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "Notify the compositor that the xdg_exporter object will no longer be"]
            #[doc = "used."]
            #[doc = ""]
            async fn destroy(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zxdg_exporter_v1#{}.destroy()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "The export request exports the passed surface so that it can later be"]
            #[doc = "imported via xdg_importer. When called, a new xdg_exported object will"]
            #[doc = "be created and xdg_exported.handle will be sent immediately. See the"]
            #[doc = "corresponding interface and event for details."]
            #[doc = ""]
            #[doc = "A surface may be exported multiple times, and each exported handle may"]
            #[doc = "be used to create an xdg_imported multiple times. Only xdg_surface"]
            #[doc = "surfaces may be exported."]
            #[doc = ""]
            async fn export(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                id: crate::wire::ObjectId,
                surface: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zxdg_exporter_v1#{}.export()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_object(Some(id))
                    .put_object(Some(surface))
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 1u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
        }
    }
    #[doc = ""]
    #[doc = "A global interface used for importing surfaces exported by xdg_exporter."]
    #[doc = "With this interface, a client can create a reference to a surface of"]
    #[doc = "another client."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zxdg_importer_v1 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[doc = "Trait to implement the zxdg_importer_v1 interface. See the module level documentation for more info"]
        pub trait ZxdgImporterV1 {
            const INTERFACE: &'static str = "zxdg_importer_v1";
            const VERSION: u32 = 1u32;
            async fn handle_event(
                &self,
                _client: &mut crate::server::Client,
                _sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "Notify the compositor that the xdg_importer object will no longer be"]
            #[doc = "used."]
            #[doc = ""]
            async fn destroy(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zxdg_importer_v1#{}.destroy()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "The import request imports a surface from any client given a handle"]
            #[doc = "retrieved by exporting said surface using xdg_exporter.export. When"]
            #[doc = "called, a new xdg_imported object will be created. This new object"]
            #[doc = "represents the imported surface, and the importing client can"]
            #[doc = "manipulate its relationship using it. See xdg_imported for details."]
            #[doc = ""]
            async fn import(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                id: crate::wire::ObjectId,
                handle: String,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zxdg_importer_v1#{}.import()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_object(Some(id))
                    .put_string(Some(handle))
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 1u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
        }
    }
    #[doc = ""]
    #[doc = "An xdg_exported object represents an exported reference to a surface. The"]
    #[doc = "exported surface may be referenced as long as the xdg_exported object not"]
    #[doc = "destroyed. Destroying the xdg_exported invalidates any relationship the"]
    #[doc = "importer may have established using xdg_imported."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zxdg_exported_v1 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[doc = "Trait to implement the zxdg_exported_v1 interface. See the module level documentation for more info"]
        pub trait ZxdgExportedV1 {
            const INTERFACE: &'static str = "zxdg_exported_v1";
            const VERSION: u32 = 1u32;
            async fn handle_event(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    0u16 => {
                        let handle = message
                            .string()?
                            .ok_or(crate::wire::DecodeError::MalformedPayload)?;
                        tracing::debug!("zxdg_exported_v1#{}.handle(\"{}\")", sender_id, handle);
                        self.handle(client, sender_id, handle).await
                    }
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "Revoke the previously exported surface. This invalidates any"]
            #[doc = "relationship the importer may have set up using the xdg_imported created"]
            #[doc = "given the handle sent via xdg_exported.handle."]
            #[doc = ""]
            async fn destroy(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zxdg_exported_v1#{}.destroy()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "The handle event contains the unique handle of this exported surface"]
            #[doc = "reference. It may be shared with any client, which then can use it to"]
            #[doc = "import the surface by calling xdg_importer.import. A handle may be"]
            #[doc = "used to import the surface multiple times."]
            #[doc = ""]
            async fn handle(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                handle: String,
            ) -> crate::client::Result<()>;
        }
    }
    #[doc = ""]
    #[doc = "An xdg_imported object represents an imported reference to surface exported"]
    #[doc = "by some client. A client can use this interface to manipulate"]
    #[doc = "relationships between its own surfaces and the imported surface."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zxdg_imported_v1 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[doc = "Trait to implement the zxdg_imported_v1 interface. See the module level documentation for more info"]
        pub trait ZxdgImportedV1 {
            const INTERFACE: &'static str = "zxdg_imported_v1";
            const VERSION: u32 = 1u32;
            async fn handle_event(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    0u16 => {
                        tracing::debug!("zxdg_imported_v1#{}.destroyed()", sender_id,);
                        self.destroyed(client, sender_id).await
                    }
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "Notify the compositor that it will no longer use the xdg_imported"]
            #[doc = "object. Any relationship that may have been set up will at this point"]
            #[doc = "be invalidated."]
            #[doc = ""]
            async fn destroy(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zxdg_imported_v1#{}.destroy()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Set the imported surface as the parent of some surface of the client."]
            #[doc = "The passed surface must be a toplevel xdg_surface. Calling this function"]
            #[doc = "sets up a surface to surface relation with the same stacking and positioning"]
            #[doc = "semantics as xdg_surface.set_parent."]
            #[doc = ""]
            async fn set_parent_of(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                surface: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zxdg_imported_v1#{}.set_parent_of()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_object(Some(surface))
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 1u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "The imported surface handle has been destroyed and any relationship set"]
            #[doc = "up has been invalidated. This may happen for various reasons, for"]
            #[doc = "example if the exported surface or the exported surface handle has been"]
            #[doc = "destroyed, if the handle used for importing was invalid."]
            #[doc = ""]
            async fn destroyed(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()>;
        }
    }
}
#[doc = ""]
#[doc = "This protocol specifies a way for making it possible to reference a surface"]
#[doc = "of a different client. With such a reference, a client can, by using the"]
#[doc = "interfaces provided by this protocol, manipulate the relationship between"]
#[doc = "its own surfaces and the surface of some other client. For example, stack"]
#[doc = "some of its own surface above the other clients surface."]
#[doc = ""]
#[doc = "In order for a client A to get a reference of a surface of client B, client"]
#[doc = "B must first export its surface using xdg_exporter.export_toplevel. Upon"]
#[doc = "doing this, client B will receive a handle (a unique string) that it may"]
#[doc = "share with client A in some way (for example D-Bus). After client A has"]
#[doc = "received the handle from client B, it may use xdg_importer.import_toplevel"]
#[doc = "to create a reference to the surface client B just exported. See the"]
#[doc = "corresponding requests for details."]
#[doc = ""]
#[doc = "A possible use case for this is out-of-process dialogs. For example when a"]
#[doc = "sandboxed client without file system access needs the user to select a file"]
#[doc = "on the file system, given sandbox environment support, it can export its"]
#[doc = "surface, passing the exported surface handle to an unsandboxed process that"]
#[doc = "can show a file browser dialog and stack it above the sandboxed client's"]
#[doc = "surface."]
#[doc = ""]
#[doc = "Warning! The protocol described in this file is experimental and backward"]
#[doc = "incompatible changes may be made. Backward compatible changes may be added"]
#[doc = "together with the corresponding interface version bump. Backward"]
#[doc = "incompatible changes are done by bumping the version number in the protocol"]
#[doc = "and interface names and resetting the interface version. Once the protocol"]
#[doc = "is to be declared stable, the 'z' prefix and the version number in the"]
#[doc = "protocol and interface names are removed and the interface version number is"]
#[doc = "reset."]
#[doc = ""]
#[allow(clippy::module_inception)]
pub mod xdg_foreign_unstable_v2 {
    #[doc = ""]
    #[doc = "A global interface used for exporting surfaces that can later be imported"]
    #[doc = "using xdg_importer."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zxdg_exporter_v2 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[doc = ""]
        #[doc = "These errors can be emitted in response to invalid xdg_exporter"]
        #[doc = "requests."]
        #[doc = ""]
        #[repr(u32)]
        #[non_exhaustive]
        #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)]
        pub enum Error {
            #[doc = "surface is not an xdg_toplevel"]
            InvalidSurface = 0u32,
        }
        impl TryFrom<u32> for Error {
            type Error = crate::wire::DecodeError;
            fn try_from(v: u32) -> Result<Self, Self::Error> {
                match v {
                    0u32 => Ok(Self::InvalidSurface),
                    _ => Err(crate::wire::DecodeError::MalformedPayload),
                }
            }
        }
        impl std::fmt::Display for Error {
            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
                (*self as u32).fmt(f)
            }
        }
        #[doc = "Trait to implement the zxdg_exporter_v2 interface. See the module level documentation for more info"]
        pub trait ZxdgExporterV2 {
            const INTERFACE: &'static str = "zxdg_exporter_v2";
            const VERSION: u32 = 1u32;
            async fn handle_event(
                &self,
                _client: &mut crate::server::Client,
                _sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "Notify the compositor that the xdg_exporter object will no longer be"]
            #[doc = "used."]
            #[doc = ""]
            async fn destroy(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zxdg_exporter_v2#{}.destroy()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "The export_toplevel request exports the passed surface so that it can later be"]
            #[doc = "imported via xdg_importer. When called, a new xdg_exported object will"]
            #[doc = "be created and xdg_exported.handle will be sent immediately. See the"]
            #[doc = "corresponding interface and event for details."]
            #[doc = ""]
            #[doc = "A surface may be exported multiple times, and each exported handle may"]
            #[doc = "be used to create an xdg_imported multiple times. Only xdg_toplevel"]
            #[doc = "equivalent surfaces may be exported, otherwise an invalid_surface"]
            #[doc = "protocol error is sent."]
            #[doc = ""]
            async fn export_toplevel(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                id: crate::wire::ObjectId,
                surface: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zxdg_exporter_v2#{}.export_toplevel()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_object(Some(id))
                    .put_object(Some(surface))
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 1u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
        }
    }
    #[doc = ""]
    #[doc = "A global interface used for importing surfaces exported by xdg_exporter."]
    #[doc = "With this interface, a client can create a reference to a surface of"]
    #[doc = "another client."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zxdg_importer_v2 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[doc = "Trait to implement the zxdg_importer_v2 interface. See the module level documentation for more info"]
        pub trait ZxdgImporterV2 {
            const INTERFACE: &'static str = "zxdg_importer_v2";
            const VERSION: u32 = 1u32;
            async fn handle_event(
                &self,
                _client: &mut crate::server::Client,
                _sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "Notify the compositor that the xdg_importer object will no longer be"]
            #[doc = "used."]
            #[doc = ""]
            async fn destroy(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zxdg_importer_v2#{}.destroy()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "The import_toplevel request imports a surface from any client given a handle"]
            #[doc = "retrieved by exporting said surface using xdg_exporter.export_toplevel."]
            #[doc = "When called, a new xdg_imported object will be created. This new object"]
            #[doc = "represents the imported surface, and the importing client can"]
            #[doc = "manipulate its relationship using it. See xdg_imported for details."]
            #[doc = ""]
            async fn import_toplevel(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                id: crate::wire::ObjectId,
                handle: String,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zxdg_importer_v2#{}.import_toplevel()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_object(Some(id))
                    .put_string(Some(handle))
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 1u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
        }
    }
    #[doc = ""]
    #[doc = "An xdg_exported object represents an exported reference to a surface. The"]
    #[doc = "exported surface may be referenced as long as the xdg_exported object not"]
    #[doc = "destroyed. Destroying the xdg_exported invalidates any relationship the"]
    #[doc = "importer may have established using xdg_imported."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zxdg_exported_v2 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[doc = "Trait to implement the zxdg_exported_v2 interface. See the module level documentation for more info"]
        pub trait ZxdgExportedV2 {
            const INTERFACE: &'static str = "zxdg_exported_v2";
            const VERSION: u32 = 1u32;
            async fn handle_event(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    0u16 => {
                        let handle = message
                            .string()?
                            .ok_or(crate::wire::DecodeError::MalformedPayload)?;
                        tracing::debug!("zxdg_exported_v2#{}.handle(\"{}\")", sender_id, handle);
                        self.handle(client, sender_id, handle).await
                    }
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "Revoke the previously exported surface. This invalidates any"]
            #[doc = "relationship the importer may have set up using the xdg_imported created"]
            #[doc = "given the handle sent via xdg_exported.handle."]
            #[doc = ""]
            async fn destroy(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zxdg_exported_v2#{}.destroy()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "The handle event contains the unique handle of this exported surface"]
            #[doc = "reference. It may be shared with any client, which then can use it to"]
            #[doc = "import the surface by calling xdg_importer.import_toplevel. A handle"]
            #[doc = "may be used to import the surface multiple times."]
            #[doc = ""]
            async fn handle(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                handle: String,
            ) -> crate::client::Result<()>;
        }
    }
    #[doc = ""]
    #[doc = "An xdg_imported object represents an imported reference to surface exported"]
    #[doc = "by some client. A client can use this interface to manipulate"]
    #[doc = "relationships between its own surfaces and the imported surface."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zxdg_imported_v2 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[doc = ""]
        #[doc = "These errors can be emitted in response to invalid xdg_imported"]
        #[doc = "requests."]
        #[doc = ""]
        #[repr(u32)]
        #[non_exhaustive]
        #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)]
        pub enum Error {
            #[doc = "surface is not an xdg_toplevel"]
            InvalidSurface = 0u32,
        }
        impl TryFrom<u32> for Error {
            type Error = crate::wire::DecodeError;
            fn try_from(v: u32) -> Result<Self, Self::Error> {
                match v {
                    0u32 => Ok(Self::InvalidSurface),
                    _ => Err(crate::wire::DecodeError::MalformedPayload),
                }
            }
        }
        impl std::fmt::Display for Error {
            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
                (*self as u32).fmt(f)
            }
        }
        #[doc = "Trait to implement the zxdg_imported_v2 interface. See the module level documentation for more info"]
        pub trait ZxdgImportedV2 {
            const INTERFACE: &'static str = "zxdg_imported_v2";
            const VERSION: u32 = 1u32;
            async fn handle_event(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    0u16 => {
                        tracing::debug!("zxdg_imported_v2#{}.destroyed()", sender_id,);
                        self.destroyed(client, sender_id).await
                    }
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "Notify the compositor that it will no longer use the xdg_imported"]
            #[doc = "object. Any relationship that may have been set up will at this point"]
            #[doc = "be invalidated."]
            #[doc = ""]
            async fn destroy(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zxdg_imported_v2#{}.destroy()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Set the imported surface as the parent of some surface of the client."]
            #[doc = "The passed surface must be an xdg_toplevel equivalent, otherwise an"]
            #[doc = "invalid_surface protocol error is sent. Calling this function sets up"]
            #[doc = "a surface to surface relation with the same stacking and positioning"]
            #[doc = "semantics as xdg_toplevel.set_parent."]
            #[doc = ""]
            async fn set_parent_of(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                surface: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zxdg_imported_v2#{}.set_parent_of()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_object(Some(surface))
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 1u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "The imported surface handle has been destroyed and any relationship set"]
            #[doc = "up has been invalidated. This may happen for various reasons, for"]
            #[doc = "example if the exported surface or the exported surface handle has been"]
            #[doc = "destroyed, if the handle used for importing was invalid."]
            #[doc = ""]
            async fn destroyed(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()>;
        }
    }
}
#[doc = ""]
#[doc = "This protocol aims at describing outputs in a way which is more in line"]
#[doc = "with the concept of an output on desktop oriented systems."]
#[doc = ""]
#[doc = "Some information are more specific to the concept of an output for"]
#[doc = "a desktop oriented system and may not make sense in other applications,"]
#[doc = "such as IVI systems for example."]
#[doc = ""]
#[doc = "Typically, the global compositor space on a desktop system is made of"]
#[doc = "a contiguous or overlapping set of rectangular regions."]
#[doc = ""]
#[doc = "The logical_position and logical_size events defined in this protocol"]
#[doc = "might provide information identical to their counterparts already"]
#[doc = "available from wl_output, in which case the information provided by this"]
#[doc = "protocol should be preferred to their equivalent in wl_output. The goal is"]
#[doc = "to move the desktop specific concepts (such as output location within the"]
#[doc = "global compositor space, etc.) out of the core wl_output protocol."]
#[doc = ""]
#[doc = "Warning! The protocol described in this file is experimental and"]
#[doc = "backward incompatible changes may be made. Backward compatible"]
#[doc = "changes may be added together with the corresponding interface"]
#[doc = "version bump."]
#[doc = "Backward incompatible changes are done by bumping the version"]
#[doc = "number in the protocol and interface names and resetting the"]
#[doc = "interface version. Once the protocol is to be declared stable,"]
#[doc = "the 'z' prefix and the version number in the protocol and"]
#[doc = "interface names are removed and the interface version number is"]
#[doc = "reset."]
#[doc = ""]
#[allow(clippy::module_inception)]
pub mod xdg_output_unstable_v1 {
    #[doc = ""]
    #[doc = "A global factory interface for xdg_output objects."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zxdg_output_manager_v1 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[doc = "Trait to implement the zxdg_output_manager_v1 interface. See the module level documentation for more info"]
        pub trait ZxdgOutputManagerV1 {
            const INTERFACE: &'static str = "zxdg_output_manager_v1";
            const VERSION: u32 = 3u32;
            async fn handle_event(
                &self,
                _client: &mut crate::server::Client,
                _sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "Using this request a client can tell the server that it is not"]
            #[doc = "going to use the xdg_output_manager object anymore."]
            #[doc = ""]
            #[doc = "Any objects already created through this instance are not affected."]
            #[doc = ""]
            async fn destroy(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zxdg_output_manager_v1#{}.destroy()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "This creates a new xdg_output object for the given wl_output."]
            #[doc = ""]
            async fn get_xdg_output(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                id: crate::wire::ObjectId,
                output: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zxdg_output_manager_v1#{}.get_xdg_output()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_object(Some(id))
                    .put_object(Some(output))
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 1u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
        }
    }
    #[doc = ""]
    #[doc = "An xdg_output describes part of the compositor geometry."]
    #[doc = ""]
    #[doc = "This typically corresponds to a monitor that displays part of the"]
    #[doc = "compositor space."]
    #[doc = ""]
    #[doc = "For objects version 3 onwards, after all xdg_output properties have been"]
    #[doc = "sent (when the object is created and when properties are updated), a"]
    #[doc = "wl_output.done event is sent. This allows changes to the output"]
    #[doc = "properties to be seen as atomic, even if they happen via multiple events."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zxdg_output_v1 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[doc = "Trait to implement the zxdg_output_v1 interface. See the module level documentation for more info"]
        pub trait ZxdgOutputV1 {
            const INTERFACE: &'static str = "zxdg_output_v1";
            const VERSION: u32 = 3u32;
            async fn handle_event(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    0u16 => {
                        let x = message.int()?;
                        let y = message.int()?;
                        tracing::debug!(
                            "zxdg_output_v1#{}.logical_position({}, {})",
                            sender_id,
                            x,
                            y
                        );
                        self.logical_position(client, sender_id, x, y).await
                    }
                    1u16 => {
                        let width = message.int()?;
                        let height = message.int()?;
                        tracing::debug!(
                            "zxdg_output_v1#{}.logical_size({}, {})",
                            sender_id,
                            width,
                            height
                        );
                        self.logical_size(client, sender_id, width, height).await
                    }
                    2u16 => {
                        tracing::debug!("zxdg_output_v1#{}.done()", sender_id,);
                        self.done(client, sender_id).await
                    }
                    3u16 => {
                        let name = message
                            .string()?
                            .ok_or(crate::wire::DecodeError::MalformedPayload)?;
                        tracing::debug!("zxdg_output_v1#{}.name(\"{}\")", sender_id, name);
                        self.name(client, sender_id, name).await
                    }
                    4u16 => {
                        let description = message
                            .string()?
                            .ok_or(crate::wire::DecodeError::MalformedPayload)?;
                        tracing::debug!(
                            "zxdg_output_v1#{}.description(\"{}\")",
                            sender_id,
                            description
                        );
                        self.description(client, sender_id, description).await
                    }
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "Using this request a client can tell the server that it is not"]
            #[doc = "going to use the xdg_output object anymore."]
            #[doc = ""]
            async fn destroy(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zxdg_output_v1#{}.destroy()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "The position event describes the location of the wl_output within"]
            #[doc = "the global compositor space."]
            #[doc = ""]
            #[doc = "The logical_position event is sent after creating an xdg_output"]
            #[doc = "(see xdg_output_manager.get_xdg_output) and whenever the location"]
            #[doc = "of the output changes within the global compositor space."]
            #[doc = ""]
            async fn logical_position(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                x: i32,
                y: i32,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "The logical_size event describes the size of the output in the"]
            #[doc = "global compositor space."]
            #[doc = ""]
            #[doc = "Most regular Wayland clients should not pay attention to the"]
            #[doc = "logical size and would rather rely on xdg_shell interfaces."]
            #[doc = ""]
            #[doc = "Some clients such as Xwayland, however, need this to configure"]
            #[doc = "their surfaces in the global compositor space as the compositor"]
            #[doc = "may apply a different scale from what is advertised by the output"]
            #[doc = "scaling property (to achieve fractional scaling, for example)."]
            #[doc = ""]
            #[doc = "For example, for a wl_output mode 3840×2160 and a scale factor 2:"]
            #[doc = ""]
            #[doc = "- A compositor not scaling the monitor viewport in its compositing space"]
            #[doc = "will advertise a logical size of 3840×2160,"]
            #[doc = ""]
            #[doc = "- A compositor scaling the monitor viewport with scale factor 2 will"]
            #[doc = "advertise a logical size of 1920×1080,"]
            #[doc = ""]
            #[doc = "- A compositor scaling the monitor viewport using a fractional scale of"]
            #[doc = "1.5 will advertise a logical size of 2560×1440."]
            #[doc = ""]
            #[doc = "For example, for a wl_output mode 1920×1080 and a 90 degree rotation,"]
            #[doc = "the compositor will advertise a logical size of 1080x1920."]
            #[doc = ""]
            #[doc = "The logical_size event is sent after creating an xdg_output"]
            #[doc = "(see xdg_output_manager.get_xdg_output) and whenever the logical"]
            #[doc = "size of the output changes, either as a result of a change in the"]
            #[doc = "applied scale or because of a change in the corresponding output"]
            #[doc = "mode(see wl_output.mode) or transform (see wl_output.transform)."]
            #[doc = ""]
            async fn logical_size(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                width: i32,
                height: i32,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "This event is sent after all other properties of an xdg_output"]
            #[doc = "have been sent."]
            #[doc = ""]
            #[doc = "This allows changes to the xdg_output properties to be seen as"]
            #[doc = "atomic, even if they happen via multiple events."]
            #[doc = ""]
            #[doc = "For objects version 3 onwards, this event is deprecated. Compositors"]
            #[doc = "are not required to send it anymore and must send wl_output.done"]
            #[doc = "instead."]
            #[doc = ""]
            async fn done(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Many compositors will assign names to their outputs, show them to the"]
            #[doc = "user, allow them to be configured by name, etc. The client may wish to"]
            #[doc = "know this name as well to offer the user similar behaviors."]
            #[doc = ""]
            #[doc = "The naming convention is compositor defined, but limited to"]
            #[doc = "alphanumeric characters and dashes (-). Each name is unique among all"]
            #[doc = "wl_output globals, but if a wl_output global is destroyed the same name"]
            #[doc = "may be reused later. The names will also remain consistent across"]
            #[doc = "sessions with the same hardware and software configuration."]
            #[doc = ""]
            #[doc = "Examples of names include 'HDMI-A-1', 'WL-1', 'X11-1', etc. However, do"]
            #[doc = "not assume that the name is a reflection of an underlying DRM"]
            #[doc = "connector, X11 connection, etc."]
            #[doc = ""]
            #[doc = "The name event is sent after creating an xdg_output (see"]
            #[doc = "xdg_output_manager.get_xdg_output). This event is only sent once per"]
            #[doc = "xdg_output, and the name does not change over the lifetime of the"]
            #[doc = "wl_output global."]
            #[doc = ""]
            #[doc = "This event is deprecated, instead clients should use wl_output.name."]
            #[doc = "Compositors must still support this event."]
            #[doc = ""]
            async fn name(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                name: String,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "Many compositors can produce human-readable descriptions of their"]
            #[doc = "outputs.  The client may wish to know this description as well, to"]
            #[doc = "communicate the user for various purposes."]
            #[doc = ""]
            #[doc = "The description is a UTF-8 string with no convention defined for its"]
            #[doc = "contents. Examples might include 'Foocorp 11\" Display' or 'Virtual X11"]
            #[doc = "output via :1'."]
            #[doc = ""]
            #[doc = "The description event is sent after creating an xdg_output (see"]
            #[doc = "xdg_output_manager.get_xdg_output) and whenever the description"]
            #[doc = "changes. The description is optional, and may not be sent at all."]
            #[doc = ""]
            #[doc = "For objects of version 2 and lower, this event is only sent once per"]
            #[doc = "xdg_output, and the description does not change over the lifetime of"]
            #[doc = "the wl_output global."]
            #[doc = ""]
            #[doc = "This event is deprecated, instead clients should use"]
            #[doc = "wl_output.description. Compositors must still support this event."]
            #[doc = ""]
            async fn description(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                description: String,
            ) -> crate::client::Result<()>;
        }
    }
}
#[allow(clippy::module_inception)]
pub mod xdg_shell_unstable_v5 {
    #[doc = ""]
    #[doc = "xdg_shell allows clients to turn a wl_surface into a \"real window\""]
    #[doc = "which can be dragged, resized, stacked, and moved around by the"]
    #[doc = "user. Everything about this interface is suited towards traditional"]
    #[doc = "desktop environments."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod xdg_shell {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[doc = ""]
        #[doc = "The 'current' member of this enum gives the version of the"]
        #[doc = "protocol.  Implementations can compare this to the version"]
        #[doc = "they implement using static_assert to ensure the protocol and"]
        #[doc = "implementation versions match."]
        #[doc = ""]
        #[repr(u32)]
        #[non_exhaustive]
        #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)]
        pub enum Version {
            #[doc = "Always the latest version"]
            Current = 5u32,
        }
        impl TryFrom<u32> for Version {
            type Error = crate::wire::DecodeError;
            fn try_from(v: u32) -> Result<Self, Self::Error> {
                match v {
                    5u32 => Ok(Self::Current),
                    _ => Err(crate::wire::DecodeError::MalformedPayload),
                }
            }
        }
        impl std::fmt::Display for Version {
            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
                (*self as u32).fmt(f)
            }
        }
        #[repr(u32)]
        #[non_exhaustive]
        #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)]
        pub enum Error {
            #[doc = "given wl_surface has another role"]
            Role = 0u32,
            #[doc = "xdg_shell was destroyed before children"]
            DefunctSurfaces = 1u32,
            #[doc = "the client tried to map or destroy a non-topmost popup"]
            NotTheTopmostPopup = 2u32,
            #[doc = "the client specified an invalid popup parent surface"]
            InvalidPopupParent = 3u32,
        }
        impl TryFrom<u32> for Error {
            type Error = crate::wire::DecodeError;
            fn try_from(v: u32) -> Result<Self, Self::Error> {
                match v {
                    0u32 => Ok(Self::Role),
                    1u32 => Ok(Self::DefunctSurfaces),
                    2u32 => Ok(Self::NotTheTopmostPopup),
                    3u32 => Ok(Self::InvalidPopupParent),
                    _ => Err(crate::wire::DecodeError::MalformedPayload),
                }
            }
        }
        impl std::fmt::Display for Error {
            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
                (*self as u32).fmt(f)
            }
        }
        #[doc = "Trait to implement the xdg_shell interface. See the module level documentation for more info"]
        pub trait XdgShell {
            const INTERFACE: &'static str = "xdg_shell";
            const VERSION: u32 = 1u32;
            async fn handle_event(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    0u16 => {
                        let serial = message.uint()?;
                        tracing::debug!("xdg_shell#{}.ping({})", sender_id, serial);
                        self.ping(client, sender_id, serial).await
                    }
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "Destroy this xdg_shell object."]
            #[doc = ""]
            #[doc = "Destroying a bound xdg_shell object while there are surfaces"]
            #[doc = "still alive created by this xdg_shell object instance is illegal"]
            #[doc = "and will result in a protocol error."]
            #[doc = ""]
            async fn destroy(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> xdg_shell#{}.destroy()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Negotiate the unstable version of the interface.  This"]
            #[doc = "mechanism is in place to ensure client and server agree on the"]
            #[doc = "unstable versions of the protocol that they speak or exit"]
            #[doc = "cleanly if they don't agree.  This request will go away once"]
            #[doc = "the xdg-shell protocol is stable."]
            #[doc = ""]
            async fn use_unstable_version(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                version: i32,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> xdg_shell#{}.use_unstable_version()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().put_int(version).build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 1u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "This creates an xdg_surface for the given surface and gives it the"]
            #[doc = "xdg_surface role. A wl_surface can only be given an xdg_surface role"]
            #[doc = "once. If get_xdg_surface is called with a wl_surface that already has"]
            #[doc = "an active xdg_surface associated with it, or if it had any other role,"]
            #[doc = "an error is raised."]
            #[doc = ""]
            #[doc = "See the documentation of xdg_surface for more details about what an"]
            #[doc = "xdg_surface is and how it is used."]
            #[doc = ""]
            async fn get_xdg_surface(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                id: crate::wire::ObjectId,
                surface: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> xdg_shell#{}.get_xdg_surface()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_object(Some(id))
                    .put_object(Some(surface))
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 2u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "This creates an xdg_popup for the given surface and gives it the"]
            #[doc = "xdg_popup role. A wl_surface can only be given an xdg_popup role"]
            #[doc = "once. If get_xdg_popup is called with a wl_surface that already has"]
            #[doc = "an active xdg_popup associated with it, or if it had any other role,"]
            #[doc = "an error is raised."]
            #[doc = ""]
            #[doc = "This request must be used in response to some sort of user action"]
            #[doc = "like a button press, key press, or touch down event."]
            #[doc = ""]
            #[doc = "See the documentation of xdg_popup for more details about what an"]
            #[doc = "xdg_popup is and how it is used."]
            #[doc = ""]
            async fn get_xdg_popup(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                id: crate::wire::ObjectId,
                surface: crate::wire::ObjectId,
                parent: crate::wire::ObjectId,
                seat: crate::wire::ObjectId,
                serial: u32,
                x: i32,
                y: i32,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> xdg_shell#{}.get_xdg_popup()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_object(Some(id))
                    .put_object(Some(surface))
                    .put_object(Some(parent))
                    .put_object(Some(seat))
                    .put_uint(serial)
                    .put_int(x)
                    .put_int(y)
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 3u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "A client must respond to a ping event with a pong request or"]
            #[doc = "the client may be deemed unresponsive."]
            #[doc = ""]
            async fn pong(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                serial: u32,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> xdg_shell#{}.pong()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().put_uint(serial).build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 4u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "The ping event asks the client if it's still alive. Pass the"]
            #[doc = "serial specified in the event back to the compositor by sending"]
            #[doc = "a \"pong\" request back with the specified serial."]
            #[doc = ""]
            #[doc = "Compositors can use this to determine if the client is still"]
            #[doc = "alive. It's unspecified what will happen if the client doesn't"]
            #[doc = "respond to the ping request, or in what timeframe. Clients should"]
            #[doc = "try to respond in a reasonable amount of time."]
            #[doc = ""]
            #[doc = "A compositor is free to ping in any way it wants, but a client must"]
            #[doc = "always respond to any xdg_shell object it created."]
            #[doc = ""]
            async fn ping(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                serial: u32,
            ) -> crate::client::Result<()>;
        }
    }
    #[doc = ""]
    #[doc = "An interface that may be implemented by a wl_surface, for"]
    #[doc = "implementations that provide a desktop-style user interface."]
    #[doc = ""]
    #[doc = "It provides requests to treat surfaces like windows, allowing to set"]
    #[doc = "properties like maximized, fullscreen, minimized, and to move and resize"]
    #[doc = "them, and associate metadata like title and app id."]
    #[doc = ""]
    #[doc = "The client must call wl_surface.commit on the corresponding wl_surface"]
    #[doc = "for the xdg_surface state to take effect. Prior to committing the new"]
    #[doc = "state, it can set up initial configuration, such as maximizing or setting"]
    #[doc = "a window geometry."]
    #[doc = ""]
    #[doc = "Even without attaching a buffer the compositor must respond to initial"]
    #[doc = "committed configuration, for instance sending a configure event with"]
    #[doc = "expected window geometry if the client maximized its surface during"]
    #[doc = "initialization."]
    #[doc = ""]
    #[doc = "For a surface to be mapped by the compositor the client must have"]
    #[doc = "committed both an xdg_surface state and a buffer."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod xdg_surface {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[doc = ""]
        #[doc = "These values are used to indicate which edge of a surface"]
        #[doc = "is being dragged in a resize operation."]
        #[doc = ""]
        #[repr(u32)]
        #[non_exhaustive]
        #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)]
        pub enum ResizeEdge {
            None = 0u32,
            Top = 1u32,
            Bottom = 2u32,
            Left = 4u32,
            TopLeft = 5u32,
            BottomLeft = 6u32,
            Right = 8u32,
            TopRight = 9u32,
            BottomRight = 10u32,
        }
        impl TryFrom<u32> for ResizeEdge {
            type Error = crate::wire::DecodeError;
            fn try_from(v: u32) -> Result<Self, Self::Error> {
                match v {
                    0u32 => Ok(Self::None),
                    1u32 => Ok(Self::Top),
                    2u32 => Ok(Self::Bottom),
                    4u32 => Ok(Self::Left),
                    5u32 => Ok(Self::TopLeft),
                    6u32 => Ok(Self::BottomLeft),
                    8u32 => Ok(Self::Right),
                    9u32 => Ok(Self::TopRight),
                    10u32 => Ok(Self::BottomRight),
                    _ => Err(crate::wire::DecodeError::MalformedPayload),
                }
            }
        }
        impl std::fmt::Display for ResizeEdge {
            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
                (*self as u32).fmt(f)
            }
        }
        #[doc = ""]
        #[doc = "The different state values used on the surface. This is designed for"]
        #[doc = "state values like maximized, fullscreen. It is paired with the"]
        #[doc = "configure event to ensure that both the client and the compositor"]
        #[doc = "setting the state can be synchronized."]
        #[doc = ""]
        #[doc = "States set in this way are double-buffered, see wl_surface.commit."]
        #[doc = ""]
        #[doc = "Desktop environments may extend this enum by taking up a range of"]
        #[doc = "values and documenting the range they chose in this description."]
        #[doc = "They are not required to document the values for the range that they"]
        #[doc = "chose. Ideally, any good extensions from a desktop environment should"]
        #[doc = "make its way into standardization into this enum."]
        #[doc = ""]
        #[doc = "The current reserved ranges are:"]
        #[doc = ""]
        #[doc = "0x0000 - 0x0FFF: xdg-shell core values, documented below."]
        #[doc = "0x1000 - 0x1FFF: GNOME"]
        #[doc = "0x2000 - 0x2FFF: EFL"]
        #[doc = ""]
        #[repr(u32)]
        #[non_exhaustive]
        #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)]
        pub enum State {
            #[doc = "the surface is maximized"]
            Maximized = 1u32,
            #[doc = "the surface is fullscreen"]
            Fullscreen = 2u32,
            #[doc = "the surface is being resized"]
            Resizing = 3u32,
            #[doc = "the surface is now activated"]
            Activated = 4u32,
        }
        impl TryFrom<u32> for State {
            type Error = crate::wire::DecodeError;
            fn try_from(v: u32) -> Result<Self, Self::Error> {
                match v {
                    1u32 => Ok(Self::Maximized),
                    2u32 => Ok(Self::Fullscreen),
                    3u32 => Ok(Self::Resizing),
                    4u32 => Ok(Self::Activated),
                    _ => Err(crate::wire::DecodeError::MalformedPayload),
                }
            }
        }
        impl std::fmt::Display for State {
            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
                (*self as u32).fmt(f)
            }
        }
        #[doc = "Trait to implement the xdg_surface interface. See the module level documentation for more info"]
        pub trait XdgSurface {
            const INTERFACE: &'static str = "xdg_surface";
            const VERSION: u32 = 1u32;
            async fn handle_event(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    0u16 => {
                        let width = message.int()?;
                        let height = message.int()?;
                        let states = message.array()?;
                        let serial = message.uint()?;
                        tracing::debug!(
                            "xdg_surface#{}.configure({}, {}, array[{}], {})",
                            sender_id,
                            width,
                            height,
                            states.len(),
                            serial
                        );
                        self.configure(client, sender_id, width, height, states, serial)
                            .await
                    }
                    1u16 => {
                        tracing::debug!("xdg_surface#{}.close()", sender_id,);
                        self.close(client, sender_id).await
                    }
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "Unmap and destroy the window. The window will be effectively"]
            #[doc = "hidden from the user's point of view, and all state like"]
            #[doc = "maximization, fullscreen, and so on, will be lost."]
            #[doc = ""]
            async fn destroy(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> xdg_surface#{}.destroy()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Set the \"parent\" of this surface. This window should be stacked"]
            #[doc = "above a parent. The parent surface must be mapped as long as this"]
            #[doc = "surface is mapped."]
            #[doc = ""]
            #[doc = "Parent windows should be set on dialogs, toolboxes, or other"]
            #[doc = "\"auxiliary\" surfaces, so that the parent is raised when the dialog"]
            #[doc = "is raised."]
            #[doc = ""]
            async fn set_parent(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                parent: Option<crate::wire::ObjectId>,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> xdg_surface#{}.set_parent()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_object(parent)
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 1u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Set a short title for the surface."]
            #[doc = ""]
            #[doc = "This string may be used to identify the surface in a task bar,"]
            #[doc = "window list, or other user interface elements provided by the"]
            #[doc = "compositor."]
            #[doc = ""]
            #[doc = "The string must be encoded in UTF-8."]
            #[doc = ""]
            async fn set_title(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                title: String,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> xdg_surface#{}.set_title()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_string(Some(title))
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 2u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Set an application identifier for the surface."]
            #[doc = ""]
            #[doc = "The app ID identifies the general class of applications to which"]
            #[doc = "the surface belongs. The compositor can use this to group multiple"]
            #[doc = "surfaces together, or to determine how to launch a new application."]
            #[doc = ""]
            #[doc = "For D-Bus activatable applications, the app ID is used as the D-Bus"]
            #[doc = "service name."]
            #[doc = ""]
            #[doc = "The compositor shell will try to group application surfaces together"]
            #[doc = "by their app ID.  As a best practice, it is suggested to select app"]
            #[doc = "ID's that match the basename of the application's .desktop file."]
            #[doc = "For example, \"org.freedesktop.FooViewer\" where the .desktop file is"]
            #[doc = "\"org.freedesktop.FooViewer.desktop\"."]
            #[doc = ""]
            #[doc = "See the desktop-entry specification [0] for more details on"]
            #[doc = "application identifiers and how they relate to well-known D-Bus"]
            #[doc = "names and .desktop files."]
            #[doc = ""]
            #[doc = "[0] http://standards.freedesktop.org/desktop-entry-spec/"]
            #[doc = ""]
            async fn set_app_id(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                app_id: String,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> xdg_surface#{}.set_app_id()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_string(Some(app_id))
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 3u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Clients implementing client-side decorations might want to show"]
            #[doc = "a context menu when right-clicking on the decorations, giving the"]
            #[doc = "user a menu that they can use to maximize or minimize the window."]
            #[doc = ""]
            #[doc = "This request asks the compositor to pop up such a window menu at"]
            #[doc = "the given position, relative to the local surface coordinates of"]
            #[doc = "the parent surface. There are no guarantees as to what menu items"]
            #[doc = "the window menu contains."]
            #[doc = ""]
            #[doc = "This request must be used in response to some sort of user action"]
            #[doc = "like a button press, key press, or touch down event."]
            #[doc = ""]
            async fn show_window_menu(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                seat: crate::wire::ObjectId,
                serial: u32,
                x: i32,
                y: i32,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> xdg_surface#{}.show_window_menu()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_object(Some(seat))
                    .put_uint(serial)
                    .put_int(x)
                    .put_int(y)
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 4u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Start an interactive, user-driven move of the surface."]
            #[doc = ""]
            #[doc = "This request must be used in response to some sort of user action"]
            #[doc = "like a button press, key press, or touch down event. The passed"]
            #[doc = "serial is used to determine the type of interactive move (touch,"]
            #[doc = "pointer, etc)."]
            #[doc = ""]
            #[doc = "The server may ignore move requests depending on the state of"]
            #[doc = "the surface (e.g. fullscreen or maximized), or if the passed serial"]
            #[doc = "is no longer valid."]
            #[doc = ""]
            #[doc = "If triggered, the surface will lose the focus of the device"]
            #[doc = "(wl_pointer, wl_touch, etc) used for the move. It is up to the"]
            #[doc = "compositor to visually indicate that the move is taking place, such as"]
            #[doc = "updating a pointer cursor, during the move. There is no guarantee"]
            #[doc = "that the device focus will return when the move is completed."]
            #[doc = ""]
            async fn r#move(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                seat: crate::wire::ObjectId,
                serial: u32,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> xdg_surface#{}.move()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_object(Some(seat))
                    .put_uint(serial)
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 5u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Start a user-driven, interactive resize of the surface."]
            #[doc = ""]
            #[doc = "This request must be used in response to some sort of user action"]
            #[doc = "like a button press, key press, or touch down event. The passed"]
            #[doc = "serial is used to determine the type of interactive resize (touch,"]
            #[doc = "pointer, etc)."]
            #[doc = ""]
            #[doc = "The server may ignore resize requests depending on the state of"]
            #[doc = "the surface (e.g. fullscreen or maximized)."]
            #[doc = ""]
            #[doc = "If triggered, the client will receive configure events with the"]
            #[doc = "\"resize\" state enum value and the expected sizes. See the \"resize\""]
            #[doc = "enum value for more details about what is required. The client"]
            #[doc = "must also acknowledge configure events using \"ack_configure\". After"]
            #[doc = "the resize is completed, the client will receive another \"configure\""]
            #[doc = "event without the resize state."]
            #[doc = ""]
            #[doc = "If triggered, the surface also will lose the focus of the device"]
            #[doc = "(wl_pointer, wl_touch, etc) used for the resize. It is up to the"]
            #[doc = "compositor to visually indicate that the resize is taking place,"]
            #[doc = "such as updating a pointer cursor, during the resize. There is no"]
            #[doc = "guarantee that the device focus will return when the resize is"]
            #[doc = "completed."]
            #[doc = ""]
            #[doc = "The edges parameter specifies how the surface should be resized,"]
            #[doc = "and is one of the values of the resize_edge enum. The compositor"]
            #[doc = "may use this information to update the surface position for"]
            #[doc = "example when dragging the top left corner. The compositor may also"]
            #[doc = "use this information to adapt its behavior, e.g. choose an"]
            #[doc = "appropriate cursor image."]
            #[doc = ""]
            async fn resize(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                seat: crate::wire::ObjectId,
                serial: u32,
                edges: u32,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> xdg_surface#{}.resize()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_object(Some(seat))
                    .put_uint(serial)
                    .put_uint(edges)
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 6u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "When a configure event is received, if a client commits the"]
            #[doc = "surface in response to the configure event, then the client"]
            #[doc = "must make an ack_configure request sometime before the commit"]
            #[doc = "request, passing along the serial of the configure event."]
            #[doc = ""]
            #[doc = "For instance, the compositor might use this information to move"]
            #[doc = "a surface to the top left only when the client has drawn itself"]
            #[doc = "for the maximized or fullscreen state."]
            #[doc = ""]
            #[doc = "If the client receives multiple configure events before it"]
            #[doc = "can respond to one, it only has to ack the last configure event."]
            #[doc = ""]
            #[doc = "A client is not required to commit immediately after sending"]
            #[doc = "an ack_configure request - it may even ack_configure several times"]
            #[doc = "before its next surface commit."]
            #[doc = ""]
            #[doc = "The compositor expects that the most recently received"]
            #[doc = "ack_configure request at the time of a commit indicates which"]
            #[doc = "configure event the client is responding to."]
            #[doc = ""]
            async fn ack_configure(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                serial: u32,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> xdg_surface#{}.ack_configure()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().put_uint(serial).build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 7u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "The window geometry of a window is its \"visible bounds\" from the"]
            #[doc = "user's perspective. Client-side decorations often have invisible"]
            #[doc = "portions like drop-shadows which should be ignored for the"]
            #[doc = "purposes of aligning, placing and constraining windows."]
            #[doc = ""]
            #[doc = "The window geometry is double-buffered state, see wl_surface.commit."]
            #[doc = ""]
            #[doc = "Once the window geometry of the surface is set once, it is not"]
            #[doc = "possible to unset it, and it will remain the same until"]
            #[doc = "set_window_geometry is called again, even if a new subsurface or"]
            #[doc = "buffer is attached."]
            #[doc = ""]
            #[doc = "If never set, the value is the full bounds of the surface,"]
            #[doc = "including any subsurfaces. This updates dynamically on every"]
            #[doc = "commit. This unset mode is meant for extremely simple clients."]
            #[doc = ""]
            #[doc = "If responding to a configure event, the window geometry in here"]
            #[doc = "must respect the sizing negotiations specified by the states in"]
            #[doc = "the configure event."]
            #[doc = ""]
            #[doc = "The arguments are given in the surface local coordinate space of"]
            #[doc = "the wl_surface associated with this xdg_surface."]
            #[doc = ""]
            #[doc = "The width and height must be greater than zero."]
            #[doc = ""]
            async fn set_window_geometry(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                x: i32,
                y: i32,
                width: i32,
                height: i32,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> xdg_surface#{}.set_window_geometry()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_int(x)
                    .put_int(y)
                    .put_int(width)
                    .put_int(height)
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 8u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Maximize the surface."]
            #[doc = ""]
            #[doc = "After requesting that the surface should be maximized, the compositor"]
            #[doc = "will respond by emitting a configure event with the \"maximized\" state"]
            #[doc = "and the required window geometry. The client should then update its"]
            #[doc = "content, drawing it in a maximized state, i.e. without shadow or other"]
            #[doc = "decoration outside of the window geometry. The client must also"]
            #[doc = "acknowledge the configure when committing the new content (see"]
            #[doc = "ack_configure)."]
            #[doc = ""]
            #[doc = "It is up to the compositor to decide how and where to maximize the"]
            #[doc = "surface, for example which output and what region of the screen should"]
            #[doc = "be used."]
            #[doc = ""]
            #[doc = "If the surface was already maximized, the compositor will still emit"]
            #[doc = "a configure event with the \"maximized\" state."]
            #[doc = ""]
            #[doc = "Note that unrelated compositor side state changes may cause"]
            #[doc = "configure events to be emitted at any time, meaning trying to"]
            #[doc = "match this request to a specific future configure event is"]
            #[doc = "futile."]
            #[doc = ""]
            async fn set_maximized(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> xdg_surface#{}.set_maximized()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 9u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Unmaximize the surface."]
            #[doc = ""]
            #[doc = "After requesting that the surface should be unmaximized, the compositor"]
            #[doc = "will respond by emitting a configure event without the \"maximized\""]
            #[doc = "state. If available, the compositor will include the window geometry"]
            #[doc = "dimensions the window had prior to being maximized in the configure"]
            #[doc = "request. The client must then update its content, drawing it in a"]
            #[doc = "regular state, i.e. potentially with shadow, etc. The client must also"]
            #[doc = "acknowledge the configure when committing the new content (see"]
            #[doc = "ack_configure)."]
            #[doc = ""]
            #[doc = "It is up to the compositor to position the surface after it was"]
            #[doc = "unmaximized; usually the position the surface had before maximizing, if"]
            #[doc = "applicable."]
            #[doc = ""]
            #[doc = "If the surface was already not maximized, the compositor will still"]
            #[doc = "emit a configure event without the \"maximized\" state."]
            #[doc = ""]
            #[doc = "Note that unrelated compositor side state changes may cause"]
            #[doc = "configure events to be emitted at any time, meaning trying to"]
            #[doc = "match this request to a specific future configure event is"]
            #[doc = "futile."]
            #[doc = ""]
            async fn unset_maximized(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> xdg_surface#{}.unset_maximized()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 10u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Make the surface fullscreen."]
            #[doc = ""]
            #[doc = "You can specify an output that you would prefer to be fullscreen."]
            #[doc = "If this value is NULL, it's up to the compositor to choose which"]
            #[doc = "display will be used to map this surface."]
            #[doc = ""]
            #[doc = "If the surface doesn't cover the whole output, the compositor will"]
            #[doc = "position the surface in the center of the output and compensate with"]
            #[doc = "black borders filling the rest of the output."]
            #[doc = ""]
            async fn set_fullscreen(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                output: Option<crate::wire::ObjectId>,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> xdg_surface#{}.set_fullscreen()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_object(output)
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 11u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            async fn unset_fullscreen(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> xdg_surface#{}.unset_fullscreen()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 12u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Request that the compositor minimize your surface. There is no"]
            #[doc = "way to know if the surface is currently minimized, nor is there"]
            #[doc = "any way to unset minimization on this surface."]
            #[doc = ""]
            #[doc = "If you are looking to throttle redrawing when minimized, please"]
            #[doc = "instead use the wl_surface.frame event for this, as this will"]
            #[doc = "also work with live previews on windows in Alt-Tab, Expose or"]
            #[doc = "similar compositor features."]
            #[doc = ""]
            async fn set_minimized(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> xdg_surface#{}.set_minimized()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 13u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "The configure event asks the client to resize its surface or to"]
            #[doc = "change its state."]
            #[doc = ""]
            #[doc = "The width and height arguments specify a hint to the window"]
            #[doc = "about how its surface should be resized in window geometry"]
            #[doc = "coordinates. See set_window_geometry."]
            #[doc = ""]
            #[doc = "If the width or height arguments are zero, it means the client"]
            #[doc = "should decide its own window dimension. This may happen when the"]
            #[doc = "compositor need to configure the state of the surface but doesn't"]
            #[doc = "have any information about any previous or expected dimension."]
            #[doc = ""]
            #[doc = "The states listed in the event specify how the width/height"]
            #[doc = "arguments should be interpreted, and possibly how it should be"]
            #[doc = "drawn."]
            #[doc = ""]
            #[doc = "Clients should arrange their surface for the new size and"]
            #[doc = "states, and then send a ack_configure request with the serial"]
            #[doc = "sent in this configure event at some point before committing"]
            #[doc = "the new surface."]
            #[doc = ""]
            #[doc = "If the client receives multiple configure events before it"]
            #[doc = "can respond to one, it is free to discard all but the last"]
            #[doc = "event it received."]
            #[doc = ""]
            async fn configure(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                width: i32,
                height: i32,
                states: Vec<u8>,
                serial: u32,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "The close event is sent by the compositor when the user"]
            #[doc = "wants the surface to be closed. This should be equivalent to"]
            #[doc = "the user clicking the close button in client-side decorations,"]
            #[doc = "if your application has any..."]
            #[doc = ""]
            #[doc = "This is only a request that the user intends to close your"]
            #[doc = "window. The client may choose to ignore this request, or show"]
            #[doc = "a dialog to ask the user to save their data..."]
            #[doc = ""]
            async fn close(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()>;
        }
    }
    #[doc = ""]
    #[doc = "A popup surface is a short-lived, temporary surface that can be"]
    #[doc = "used to implement menus. It takes an explicit grab on the surface"]
    #[doc = "that will be dismissed when the user dismisses the popup. This can"]
    #[doc = "be done by the user clicking outside the surface, using the keyboard,"]
    #[doc = "or even locking the screen through closing the lid or a timeout."]
    #[doc = ""]
    #[doc = "When the popup is dismissed, a popup_done event will be sent out,"]
    #[doc = "and at the same time the surface will be unmapped. The xdg_popup"]
    #[doc = "object is now inert and cannot be reactivated, so clients should"]
    #[doc = "destroy it. Explicitly destroying the xdg_popup object will also"]
    #[doc = "dismiss the popup and unmap the surface."]
    #[doc = ""]
    #[doc = "Clients will receive events for all their surfaces during this"]
    #[doc = "grab (which is an \"owner-events\" grab in X11 parlance). This is"]
    #[doc = "done so that users can navigate through submenus and other"]
    #[doc = "\"nested\" popup windows without having to dismiss the topmost"]
    #[doc = "popup."]
    #[doc = ""]
    #[doc = "Clients that want to dismiss the popup when another surface of"]
    #[doc = "their own is clicked should dismiss the popup using the destroy"]
    #[doc = "request."]
    #[doc = ""]
    #[doc = "The parent surface must have either an xdg_surface or xdg_popup"]
    #[doc = "role."]
    #[doc = ""]
    #[doc = "Specifying an xdg_popup for the parent means that the popups are"]
    #[doc = "nested, with this popup now being the topmost popup. Nested"]
    #[doc = "popups must be destroyed in the reverse order they were created"]
    #[doc = "in, e.g. the only popup you are allowed to destroy at all times"]
    #[doc = "is the topmost one."]
    #[doc = ""]
    #[doc = "If there is an existing popup when creating a new popup, the"]
    #[doc = "parent must be the current topmost popup."]
    #[doc = ""]
    #[doc = "A parent surface must be mapped before the new popup is mapped."]
    #[doc = ""]
    #[doc = "When compositors choose to dismiss a popup, they will likely"]
    #[doc = "dismiss every nested popup as well. When a compositor dismisses"]
    #[doc = "popups, it will follow the same dismissing order as required"]
    #[doc = "from the client."]
    #[doc = ""]
    #[doc = "The x and y arguments passed when creating the popup object specify"]
    #[doc = "where the top left of the popup should be placed, relative to the"]
    #[doc = "local surface coordinates of the parent surface. See"]
    #[doc = "xdg_shell.get_xdg_popup."]
    #[doc = ""]
    #[doc = "The client must call wl_surface.commit on the corresponding wl_surface"]
    #[doc = "for the xdg_popup state to take effect."]
    #[doc = ""]
    #[doc = "For a surface to be mapped by the compositor the client must have"]
    #[doc = "committed both the xdg_popup state and a buffer."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod xdg_popup {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[doc = "Trait to implement the xdg_popup interface. See the module level documentation for more info"]
        pub trait XdgPopup {
            const INTERFACE: &'static str = "xdg_popup";
            const VERSION: u32 = 1u32;
            async fn handle_event(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    0u16 => {
                        tracing::debug!("xdg_popup#{}.popup_done()", sender_id,);
                        self.popup_done(client, sender_id).await
                    }
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "This destroys the popup. Explicitly destroying the xdg_popup"]
            #[doc = "object will also dismiss the popup, and unmap the surface."]
            #[doc = ""]
            #[doc = "If this xdg_popup is not the \"topmost\" popup, a protocol error"]
            #[doc = "will be sent."]
            #[doc = ""]
            async fn destroy(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> xdg_popup#{}.destroy()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "The popup_done event is sent out when a popup is dismissed by the"]
            #[doc = "compositor. The client should destroy the xdg_popup object at this"]
            #[doc = "point."]
            #[doc = ""]
            async fn popup_done(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()>;
        }
    }
}
#[allow(clippy::module_inception)]
pub mod xdg_shell_unstable_v6 {
    #[doc = ""]
    #[doc = "xdg_shell allows clients to turn a wl_surface into a \"real window\""]
    #[doc = "which can be dragged, resized, stacked, and moved around by the"]
    #[doc = "user. Everything about this interface is suited towards traditional"]
    #[doc = "desktop environments."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zxdg_shell_v6 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[repr(u32)]
        #[non_exhaustive]
        #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)]
        pub enum Error {
            #[doc = "given wl_surface has another role"]
            Role = 0u32,
            #[doc = "xdg_shell was destroyed before children"]
            DefunctSurfaces = 1u32,
            #[doc = "the client tried to map or destroy a non-topmost popup"]
            NotTheTopmostPopup = 2u32,
            #[doc = "the client specified an invalid popup parent surface"]
            InvalidPopupParent = 3u32,
            #[doc = "the client provided an invalid surface state"]
            InvalidSurfaceState = 4u32,
            #[doc = "the client provided an invalid positioner"]
            InvalidPositioner = 5u32,
        }
        impl TryFrom<u32> for Error {
            type Error = crate::wire::DecodeError;
            fn try_from(v: u32) -> Result<Self, Self::Error> {
                match v {
                    0u32 => Ok(Self::Role),
                    1u32 => Ok(Self::DefunctSurfaces),
                    2u32 => Ok(Self::NotTheTopmostPopup),
                    3u32 => Ok(Self::InvalidPopupParent),
                    4u32 => Ok(Self::InvalidSurfaceState),
                    5u32 => Ok(Self::InvalidPositioner),
                    _ => Err(crate::wire::DecodeError::MalformedPayload),
                }
            }
        }
        impl std::fmt::Display for Error {
            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
                (*self as u32).fmt(f)
            }
        }
        #[doc = "Trait to implement the zxdg_shell_v6 interface. See the module level documentation for more info"]
        pub trait ZxdgShellV6 {
            const INTERFACE: &'static str = "zxdg_shell_v6";
            const VERSION: u32 = 1u32;
            async fn handle_event(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    0u16 => {
                        let serial = message.uint()?;
                        tracing::debug!("zxdg_shell_v6#{}.ping({})", sender_id, serial);
                        self.ping(client, sender_id, serial).await
                    }
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "Destroy this xdg_shell object."]
            #[doc = ""]
            #[doc = "Destroying a bound xdg_shell object while there are surfaces"]
            #[doc = "still alive created by this xdg_shell object instance is illegal"]
            #[doc = "and will result in a protocol error."]
            #[doc = ""]
            async fn destroy(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zxdg_shell_v6#{}.destroy()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Create a positioner object. A positioner object is used to position"]
            #[doc = "surfaces relative to some parent surface. See the interface description"]
            #[doc = "and xdg_surface.get_popup for details."]
            #[doc = ""]
            async fn create_positioner(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zxdg_shell_v6#{}.create_positioner()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_object(Some(id))
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 1u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "This creates an xdg_surface for the given surface. While xdg_surface"]
            #[doc = "itself is not a role, the corresponding surface may only be assigned"]
            #[doc = "a role extending xdg_surface, such as xdg_toplevel or xdg_popup."]
            #[doc = ""]
            #[doc = "This creates an xdg_surface for the given surface. An xdg_surface is"]
            #[doc = "used as basis to define a role to a given surface, such as xdg_toplevel"]
            #[doc = "or xdg_popup. It also manages functionality shared between xdg_surface"]
            #[doc = "based surface roles."]
            #[doc = ""]
            #[doc = "See the documentation of xdg_surface for more details about what an"]
            #[doc = "xdg_surface is and how it is used."]
            #[doc = ""]
            async fn get_xdg_surface(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                id: crate::wire::ObjectId,
                surface: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zxdg_shell_v6#{}.get_xdg_surface()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_object(Some(id))
                    .put_object(Some(surface))
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 2u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "A client must respond to a ping event with a pong request or"]
            #[doc = "the client may be deemed unresponsive. See xdg_shell.ping."]
            #[doc = ""]
            async fn pong(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                serial: u32,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zxdg_shell_v6#{}.pong()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().put_uint(serial).build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 3u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "The ping event asks the client if it's still alive. Pass the"]
            #[doc = "serial specified in the event back to the compositor by sending"]
            #[doc = "a \"pong\" request back with the specified serial. See xdg_shell.ping."]
            #[doc = ""]
            #[doc = "Compositors can use this to determine if the client is still"]
            #[doc = "alive. It's unspecified what will happen if the client doesn't"]
            #[doc = "respond to the ping request, or in what timeframe. Clients should"]
            #[doc = "try to respond in a reasonable amount of time."]
            #[doc = ""]
            #[doc = "A compositor is free to ping in any way it wants, but a client must"]
            #[doc = "always respond to any xdg_shell object it created."]
            #[doc = ""]
            async fn ping(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                serial: u32,
            ) -> crate::client::Result<()>;
        }
    }
    #[doc = ""]
    #[doc = "The xdg_positioner provides a collection of rules for the placement of a"]
    #[doc = "child surface relative to a parent surface. Rules can be defined to ensure"]
    #[doc = "the child surface remains within the visible area's borders, and to"]
    #[doc = "specify how the child surface changes its position, such as sliding along"]
    #[doc = "an axis, or flipping around a rectangle. These positioner-created rules are"]
    #[doc = "constrained by the requirement that a child surface must intersect with or"]
    #[doc = "be at least partially adjacent to its parent surface."]
    #[doc = ""]
    #[doc = "See the various requests for details about possible rules."]
    #[doc = ""]
    #[doc = "At the time of the request, the compositor makes a copy of the rules"]
    #[doc = "specified by the xdg_positioner. Thus, after the request is complete the"]
    #[doc = "xdg_positioner object can be destroyed or reused; further changes to the"]
    #[doc = "object will have no effect on previous usages."]
    #[doc = ""]
    #[doc = "For an xdg_positioner object to be considered complete, it must have a"]
    #[doc = "non-zero size set by set_size, and a non-zero anchor rectangle set by"]
    #[doc = "set_anchor_rect. Passing an incomplete xdg_positioner object when"]
    #[doc = "positioning a surface raises an error."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zxdg_positioner_v6 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[repr(u32)]
        #[non_exhaustive]
        #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)]
        pub enum Error {
            #[doc = "invalid input provided"]
            InvalidInput = 0u32,
        }
        impl TryFrom<u32> for Error {
            type Error = crate::wire::DecodeError;
            fn try_from(v: u32) -> Result<Self, Self::Error> {
                match v {
                    0u32 => Ok(Self::InvalidInput),
                    _ => Err(crate::wire::DecodeError::MalformedPayload),
                }
            }
        }
        impl std::fmt::Display for Error {
            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
                (*self as u32).fmt(f)
            }
        }
        bitflags::bitflags! { # [derive (Debug , PartialEq , Eq , PartialOrd , Ord , Hash , Clone , Copy)] pub struct Anchor : u32 { # [doc = "the center of the anchor rectangle"] const None = 0u32 ; # [doc = "the top edge of the anchor rectangle"] const Top = 1u32 ; # [doc = "the bottom edge of the anchor rectangle"] const Bottom = 2u32 ; # [doc = "the left edge of the anchor rectangle"] const Left = 4u32 ; # [doc = "the right edge of the anchor rectangle"] const Right = 8u32 ; } }
        impl TryFrom<u32> for Anchor {
            type Error = crate::wire::DecodeError;
            fn try_from(v: u32) -> Result<Self, Self::Error> {
                Self::from_bits(v).ok_or(crate::wire::DecodeError::MalformedPayload)
            }
        }
        impl std::fmt::Display for Anchor {
            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
                self.bits().fmt(f)
            }
        }
        bitflags::bitflags! { # [derive (Debug , PartialEq , Eq , PartialOrd , Ord , Hash , Clone , Copy)] pub struct Gravity : u32 { # [doc = "center over the anchor edge"] const None = 0u32 ; # [doc = "position above the anchor edge"] const Top = 1u32 ; # [doc = "position below the anchor edge"] const Bottom = 2u32 ; # [doc = "position to the left of the anchor edge"] const Left = 4u32 ; # [doc = "position to the right of the anchor edge"] const Right = 8u32 ; } }
        impl TryFrom<u32> for Gravity {
            type Error = crate::wire::DecodeError;
            fn try_from(v: u32) -> Result<Self, Self::Error> {
                Self::from_bits(v).ok_or(crate::wire::DecodeError::MalformedPayload)
            }
        }
        impl std::fmt::Display for Gravity {
            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
                self.bits().fmt(f)
            }
        }
        bitflags::bitflags! { # [doc = ""] # [doc = "The constraint adjustment value define ways the compositor will adjust"] # [doc = "the position of the surface, if the unadjusted position would result"] # [doc = "in the surface being partly constrained."] # [doc = ""] # [doc = "Whether a surface is considered 'constrained' is left to the compositor"] # [doc = "to determine. For example, the surface may be partly outside the"] # [doc = "compositor's defined 'work area', thus necessitating the child surface's"] # [doc = "position be adjusted until it is entirely inside the work area."] # [doc = ""] # [doc = "The adjustments can be combined, according to a defined precedence: 1)"] # [doc = "Flip, 2) Slide, 3) Resize."] # [doc = ""] # [derive (Debug , PartialEq , Eq , PartialOrd , Ord , Hash , Clone , Copy)] pub struct ConstraintAdjustment : u32 { const None = 0u32 ; const SlideX = 1u32 ; const SlideY = 2u32 ; const FlipX = 4u32 ; const FlipY = 8u32 ; const ResizeX = 16u32 ; const ResizeY = 32u32 ; } }
        impl TryFrom<u32> for ConstraintAdjustment {
            type Error = crate::wire::DecodeError;
            fn try_from(v: u32) -> Result<Self, Self::Error> {
                Self::from_bits(v).ok_or(crate::wire::DecodeError::MalformedPayload)
            }
        }
        impl std::fmt::Display for ConstraintAdjustment {
            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
                self.bits().fmt(f)
            }
        }
        #[doc = "Trait to implement the zxdg_positioner_v6 interface. See the module level documentation for more info"]
        pub trait ZxdgPositionerV6 {
            const INTERFACE: &'static str = "zxdg_positioner_v6";
            const VERSION: u32 = 1u32;
            async fn handle_event(
                &self,
                _client: &mut crate::server::Client,
                _sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "Notify the compositor that the xdg_positioner will no longer be used."]
            #[doc = ""]
            async fn destroy(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zxdg_positioner_v6#{}.destroy()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Set the size of the surface that is to be positioned with the positioner"]
            #[doc = "object. The size is in surface-local coordinates and corresponds to the"]
            #[doc = "window geometry. See xdg_surface.set_window_geometry."]
            #[doc = ""]
            #[doc = "If a zero or negative size is set the invalid_input error is raised."]
            #[doc = ""]
            async fn set_size(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                width: i32,
                height: i32,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zxdg_positioner_v6#{}.set_size()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_int(width)
                    .put_int(height)
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 1u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Specify the anchor rectangle within the parent surface that the child"]
            #[doc = "surface will be placed relative to. The rectangle is relative to the"]
            #[doc = "window geometry as defined by xdg_surface.set_window_geometry of the"]
            #[doc = "parent surface. The rectangle must be at least 1x1 large."]
            #[doc = ""]
            #[doc = "When the xdg_positioner object is used to position a child surface, the"]
            #[doc = "anchor rectangle may not extend outside the window geometry of the"]
            #[doc = "positioned child's parent surface."]
            #[doc = ""]
            #[doc = "If a zero or negative size is set the invalid_input error is raised."]
            #[doc = ""]
            async fn set_anchor_rect(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                x: i32,
                y: i32,
                width: i32,
                height: i32,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zxdg_positioner_v6#{}.set_anchor_rect()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_int(x)
                    .put_int(y)
                    .put_int(width)
                    .put_int(height)
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 2u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Defines a set of edges for the anchor rectangle. These are used to"]
            #[doc = "derive an anchor point that the child surface will be positioned"]
            #[doc = "relative to. If two orthogonal edges are specified (e.g. 'top' and"]
            #[doc = "'left'), then the anchor point will be the intersection of the edges"]
            #[doc = "(e.g. the top left position of the rectangle); otherwise, the derived"]
            #[doc = "anchor point will be centered on the specified edge, or in the center of"]
            #[doc = "the anchor rectangle if no edge is specified."]
            #[doc = ""]
            #[doc = "If two parallel anchor edges are specified (e.g. 'left' and 'right'),"]
            #[doc = "the invalid_input error is raised."]
            #[doc = ""]
            async fn set_anchor(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                anchor: Anchor,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zxdg_positioner_v6#{}.set_anchor()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_uint(anchor.bits())
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 3u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Defines in what direction a surface should be positioned, relative to"]
            #[doc = "the anchor point of the parent surface. If two orthogonal gravities are"]
            #[doc = "specified (e.g. 'bottom' and 'right'), then the child surface will be"]
            #[doc = "placed in the specified direction; otherwise, the child surface will be"]
            #[doc = "centered over the anchor point on any axis that had no gravity"]
            #[doc = "specified."]
            #[doc = ""]
            #[doc = "If two parallel gravities are specified (e.g. 'left' and 'right'), the"]
            #[doc = "invalid_input error is raised."]
            #[doc = ""]
            async fn set_gravity(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                gravity: Gravity,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zxdg_positioner_v6#{}.set_gravity()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_uint(gravity.bits())
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 4u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Specify how the window should be positioned if the originally intended"]
            #[doc = "position caused the surface to be constrained, meaning at least"]
            #[doc = "partially outside positioning boundaries set by the compositor. The"]
            #[doc = "adjustment is set by constructing a bitmask describing the adjustment to"]
            #[doc = "be made when the surface is constrained on that axis."]
            #[doc = ""]
            #[doc = "If no bit for one axis is set, the compositor will assume that the child"]
            #[doc = "surface should not change its position on that axis when constrained."]
            #[doc = ""]
            #[doc = "If more than one bit for one axis is set, the order of how adjustments"]
            #[doc = "are applied is specified in the corresponding adjustment descriptions."]
            #[doc = ""]
            #[doc = "The default adjustment is none."]
            #[doc = ""]
            async fn set_constraint_adjustment(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                constraint_adjustment: u32,
            ) -> crate::client::Result<()> {
                tracing::debug!(
                    "-> zxdg_positioner_v6#{}.set_constraint_adjustment()",
                    sender_id
                );
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_uint(constraint_adjustment)
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 5u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Specify the surface position offset relative to the position of the"]
            #[doc = "anchor on the anchor rectangle and the anchor on the surface. For"]
            #[doc = "example if the anchor of the anchor rectangle is at (x, y), the surface"]
            #[doc = "has the gravity bottom|right, and the offset is (ox, oy), the calculated"]
            #[doc = "surface position will be (x + ox, y + oy). The offset position of the"]
            #[doc = "surface is the one used for constraint testing. See"]
            #[doc = "set_constraint_adjustment."]
            #[doc = ""]
            #[doc = "An example use case is placing a popup menu on top of a user interface"]
            #[doc = "element, while aligning the user interface element of the parent surface"]
            #[doc = "with some user interface element placed somewhere in the popup surface."]
            #[doc = ""]
            async fn set_offset(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                x: i32,
                y: i32,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zxdg_positioner_v6#{}.set_offset()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_int(x)
                    .put_int(y)
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 6u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
        }
    }
    #[doc = ""]
    #[doc = "An interface that may be implemented by a wl_surface, for"]
    #[doc = "implementations that provide a desktop-style user interface."]
    #[doc = ""]
    #[doc = "It provides a base set of functionality required to construct user"]
    #[doc = "interface elements requiring management by the compositor, such as"]
    #[doc = "toplevel windows, menus, etc. The types of functionality are split into"]
    #[doc = "xdg_surface roles."]
    #[doc = ""]
    #[doc = "Creating an xdg_surface does not set the role for a wl_surface. In order"]
    #[doc = "to map an xdg_surface, the client must create a role-specific object"]
    #[doc = "using, e.g., get_toplevel, get_popup. The wl_surface for any given"]
    #[doc = "xdg_surface can have at most one role, and may not be assigned any role"]
    #[doc = "not based on xdg_surface."]
    #[doc = ""]
    #[doc = "A role must be assigned before any other requests are made to the"]
    #[doc = "xdg_surface object."]
    #[doc = ""]
    #[doc = "The client must call wl_surface.commit on the corresponding wl_surface"]
    #[doc = "for the xdg_surface state to take effect."]
    #[doc = ""]
    #[doc = "Creating an xdg_surface from a wl_surface which has a buffer attached or"]
    #[doc = "committed is a client error, and any attempts by a client to attach or"]
    #[doc = "manipulate a buffer prior to the first xdg_surface.configure call must"]
    #[doc = "also be treated as errors."]
    #[doc = ""]
    #[doc = "For a surface to be mapped by the compositor, the following conditions"]
    #[doc = "must be met: (1) the client has assigned an xdg_surface based role to the"]
    #[doc = "surface, (2) the client has set and committed the xdg_surface state and"]
    #[doc = "the role dependent state to the surface and (3) the client has committed a"]
    #[doc = "buffer to the surface."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zxdg_surface_v6 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[repr(u32)]
        #[non_exhaustive]
        #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)]
        pub enum Error {
            NotConstructed = 1u32,
            AlreadyConstructed = 2u32,
            UnconfiguredBuffer = 3u32,
        }
        impl TryFrom<u32> for Error {
            type Error = crate::wire::DecodeError;
            fn try_from(v: u32) -> Result<Self, Self::Error> {
                match v {
                    1u32 => Ok(Self::NotConstructed),
                    2u32 => Ok(Self::AlreadyConstructed),
                    3u32 => Ok(Self::UnconfiguredBuffer),
                    _ => Err(crate::wire::DecodeError::MalformedPayload),
                }
            }
        }
        impl std::fmt::Display for Error {
            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
                (*self as u32).fmt(f)
            }
        }
        #[doc = "Trait to implement the zxdg_surface_v6 interface. See the module level documentation for more info"]
        pub trait ZxdgSurfaceV6 {
            const INTERFACE: &'static str = "zxdg_surface_v6";
            const VERSION: u32 = 1u32;
            async fn handle_event(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    0u16 => {
                        let serial = message.uint()?;
                        tracing::debug!("zxdg_surface_v6#{}.configure({})", sender_id, serial);
                        self.configure(client, sender_id, serial).await
                    }
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "Destroy the xdg_surface object. An xdg_surface must only be destroyed"]
            #[doc = "after its role object has been destroyed. If the role object still"]
            #[doc = "exists when this request is issued, the zxdg_shell_v6.defunct_surfaces"]
            #[doc = "is raised."]
            #[doc = ""]
            async fn destroy(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zxdg_surface_v6#{}.destroy()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "This creates an xdg_toplevel object for the given xdg_surface and gives"]
            #[doc = "the associated wl_surface the xdg_toplevel role. If the surface already"]
            #[doc = "had a role, the zxdg_shell_v6.role error is raised."]
            #[doc = ""]
            #[doc = "See the documentation of xdg_toplevel for more details about what an"]
            #[doc = "xdg_toplevel is and how it is used."]
            #[doc = ""]
            async fn get_toplevel(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zxdg_surface_v6#{}.get_toplevel()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_object(Some(id))
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 1u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "This creates an xdg_popup object for the given xdg_surface and gives the"]
            #[doc = "associated wl_surface the xdg_popup role. If the surface already"]
            #[doc = "had a role, the zxdg_shell_v6.role error is raised."]
            #[doc = ""]
            #[doc = "See the documentation of xdg_popup for more details about what an"]
            #[doc = "xdg_popup is and how it is used."]
            #[doc = ""]
            async fn get_popup(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                id: crate::wire::ObjectId,
                parent: crate::wire::ObjectId,
                positioner: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zxdg_surface_v6#{}.get_popup()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_object(Some(id))
                    .put_object(Some(parent))
                    .put_object(Some(positioner))
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 2u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "The window geometry of a surface is its \"visible bounds\" from the"]
            #[doc = "user's perspective. Client-side decorations often have invisible"]
            #[doc = "portions like drop-shadows which should be ignored for the"]
            #[doc = "purposes of aligning, placing and constraining windows."]
            #[doc = ""]
            #[doc = "The window geometry is double-buffered state, see wl_surface.commit."]
            #[doc = ""]
            #[doc = "Once the window geometry of the surface is set, it is not possible to"]
            #[doc = "unset it, and it will remain the same until set_window_geometry is"]
            #[doc = "called again, even if a new subsurface or buffer is attached."]
            #[doc = ""]
            #[doc = "If never set, the value is the full bounds of the surface,"]
            #[doc = "including any subsurfaces. This updates dynamically on every"]
            #[doc = "commit. This unset is meant for extremely simple clients."]
            #[doc = ""]
            #[doc = "The arguments are given in the surface-local coordinate space of"]
            #[doc = "the wl_surface associated with this xdg_surface."]
            #[doc = ""]
            #[doc = "The width and height must be greater than zero. Setting an invalid size"]
            #[doc = "will raise an error. When applied, the effective window geometry will be"]
            #[doc = "the set window geometry clamped to the bounding rectangle of the"]
            #[doc = "combined geometry of the surface of the xdg_surface and the associated"]
            #[doc = "subsurfaces."]
            #[doc = ""]
            async fn set_window_geometry(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                x: i32,
                y: i32,
                width: i32,
                height: i32,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zxdg_surface_v6#{}.set_window_geometry()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_int(x)
                    .put_int(y)
                    .put_int(width)
                    .put_int(height)
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 3u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "When a configure event is received, if a client commits the"]
            #[doc = "surface in response to the configure event, then the client"]
            #[doc = "must make an ack_configure request sometime before the commit"]
            #[doc = "request, passing along the serial of the configure event."]
            #[doc = ""]
            #[doc = "For instance, for toplevel surfaces the compositor might use this"]
            #[doc = "information to move a surface to the top left only when the client has"]
            #[doc = "drawn itself for the maximized or fullscreen state."]
            #[doc = ""]
            #[doc = "If the client receives multiple configure events before it"]
            #[doc = "can respond to one, it only has to ack the last configure event."]
            #[doc = ""]
            #[doc = "A client is not required to commit immediately after sending"]
            #[doc = "an ack_configure request - it may even ack_configure several times"]
            #[doc = "before its next surface commit."]
            #[doc = ""]
            #[doc = "A client may send multiple ack_configure requests before committing, but"]
            #[doc = "only the last request sent before a commit indicates which configure"]
            #[doc = "event the client really is responding to."]
            #[doc = ""]
            #[doc = "If an invalid serial is used, the zxdg_shell_v6.invalid_surface_state"]
            #[doc = "error is raised."]
            #[doc = ""]
            async fn ack_configure(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                serial: u32,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zxdg_surface_v6#{}.ack_configure()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().put_uint(serial).build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 4u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "The configure event marks the end of a configure sequence. A configure"]
            #[doc = "sequence is a set of one or more events configuring the state of the"]
            #[doc = "xdg_surface, including the final xdg_surface.configure event."]
            #[doc = ""]
            #[doc = "Where applicable, xdg_surface surface roles will during a configure"]
            #[doc = "sequence extend this event as a latched state sent as events before the"]
            #[doc = "xdg_surface.configure event. Such events should be considered to make up"]
            #[doc = "a set of atomically applied configuration states, where the"]
            #[doc = "xdg_surface.configure commits the accumulated state."]
            #[doc = ""]
            #[doc = "Clients should arrange their surface for the new states, and then send"]
            #[doc = "an ack_configure request with the serial sent in this configure event at"]
            #[doc = "some point before committing the new surface."]
            #[doc = ""]
            #[doc = "If the client receives multiple configure events before it can respond"]
            #[doc = "to one, it is free to discard all but the last event it received."]
            #[doc = ""]
            async fn configure(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                serial: u32,
            ) -> crate::client::Result<()>;
        }
    }
    #[doc = ""]
    #[doc = "This interface defines an xdg_surface role which allows a surface to,"]
    #[doc = "among other things, set window-like properties such as maximize,"]
    #[doc = "fullscreen, and minimize, set application-specific metadata like title and"]
    #[doc = "id, and well as trigger user interactive operations such as interactive"]
    #[doc = "resize and move."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zxdg_toplevel_v6 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[doc = ""]
        #[doc = "These values are used to indicate which edge of a surface"]
        #[doc = "is being dragged in a resize operation."]
        #[doc = ""]
        #[repr(u32)]
        #[non_exhaustive]
        #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)]
        pub enum ResizeEdge {
            None = 0u32,
            Top = 1u32,
            Bottom = 2u32,
            Left = 4u32,
            TopLeft = 5u32,
            BottomLeft = 6u32,
            Right = 8u32,
            TopRight = 9u32,
            BottomRight = 10u32,
        }
        impl TryFrom<u32> for ResizeEdge {
            type Error = crate::wire::DecodeError;
            fn try_from(v: u32) -> Result<Self, Self::Error> {
                match v {
                    0u32 => Ok(Self::None),
                    1u32 => Ok(Self::Top),
                    2u32 => Ok(Self::Bottom),
                    4u32 => Ok(Self::Left),
                    5u32 => Ok(Self::TopLeft),
                    6u32 => Ok(Self::BottomLeft),
                    8u32 => Ok(Self::Right),
                    9u32 => Ok(Self::TopRight),
                    10u32 => Ok(Self::BottomRight),
                    _ => Err(crate::wire::DecodeError::MalformedPayload),
                }
            }
        }
        impl std::fmt::Display for ResizeEdge {
            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
                (*self as u32).fmt(f)
            }
        }
        #[doc = ""]
        #[doc = "The different state values used on the surface. This is designed for"]
        #[doc = "state values like maximized, fullscreen. It is paired with the"]
        #[doc = "configure event to ensure that both the client and the compositor"]
        #[doc = "setting the state can be synchronized."]
        #[doc = ""]
        #[doc = "States set in this way are double-buffered, see wl_surface.commit."]
        #[doc = ""]
        #[repr(u32)]
        #[non_exhaustive]
        #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)]
        pub enum State {
            #[doc = "the surface is maximized"]
            Maximized = 1u32,
            #[doc = "the surface is fullscreen"]
            Fullscreen = 2u32,
            #[doc = "the surface is being resized"]
            Resizing = 3u32,
            #[doc = "the surface is now activated"]
            Activated = 4u32,
        }
        impl TryFrom<u32> for State {
            type Error = crate::wire::DecodeError;
            fn try_from(v: u32) -> Result<Self, Self::Error> {
                match v {
                    1u32 => Ok(Self::Maximized),
                    2u32 => Ok(Self::Fullscreen),
                    3u32 => Ok(Self::Resizing),
                    4u32 => Ok(Self::Activated),
                    _ => Err(crate::wire::DecodeError::MalformedPayload),
                }
            }
        }
        impl std::fmt::Display for State {
            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
                (*self as u32).fmt(f)
            }
        }
        #[doc = "Trait to implement the zxdg_toplevel_v6 interface. See the module level documentation for more info"]
        pub trait ZxdgToplevelV6 {
            const INTERFACE: &'static str = "zxdg_toplevel_v6";
            const VERSION: u32 = 1u32;
            async fn handle_event(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    0u16 => {
                        let width = message.int()?;
                        let height = message.int()?;
                        let states = message.array()?;
                        tracing::debug!(
                            "zxdg_toplevel_v6#{}.configure({}, {}, array[{}])",
                            sender_id,
                            width,
                            height,
                            states.len()
                        );
                        self.configure(client, sender_id, width, height, states)
                            .await
                    }
                    1u16 => {
                        tracing::debug!("zxdg_toplevel_v6#{}.close()", sender_id,);
                        self.close(client, sender_id).await
                    }
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "Unmap and destroy the window. The window will be effectively"]
            #[doc = "hidden from the user's point of view, and all state like"]
            #[doc = "maximization, fullscreen, and so on, will be lost."]
            #[doc = ""]
            async fn destroy(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zxdg_toplevel_v6#{}.destroy()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Set the \"parent\" of this surface. This window should be stacked"]
            #[doc = "above a parent. The parent surface must be mapped as long as this"]
            #[doc = "surface is mapped."]
            #[doc = ""]
            #[doc = "Parent windows should be set on dialogs, toolboxes, or other"]
            #[doc = "\"auxiliary\" surfaces, so that the parent is raised when the dialog"]
            #[doc = "is raised."]
            #[doc = ""]
            async fn set_parent(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                parent: Option<crate::wire::ObjectId>,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zxdg_toplevel_v6#{}.set_parent()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_object(parent)
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 1u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Set a short title for the surface."]
            #[doc = ""]
            #[doc = "This string may be used to identify the surface in a task bar,"]
            #[doc = "window list, or other user interface elements provided by the"]
            #[doc = "compositor."]
            #[doc = ""]
            #[doc = "The string must be encoded in UTF-8."]
            #[doc = ""]
            async fn set_title(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                title: String,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zxdg_toplevel_v6#{}.set_title()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_string(Some(title))
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 2u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Set an application identifier for the surface."]
            #[doc = ""]
            #[doc = "The app ID identifies the general class of applications to which"]
            #[doc = "the surface belongs. The compositor can use this to group multiple"]
            #[doc = "surfaces together, or to determine how to launch a new application."]
            #[doc = ""]
            #[doc = "For D-Bus activatable applications, the app ID is used as the D-Bus"]
            #[doc = "service name."]
            #[doc = ""]
            #[doc = "The compositor shell will try to group application surfaces together"]
            #[doc = "by their app ID. As a best practice, it is suggested to select app"]
            #[doc = "ID's that match the basename of the application's .desktop file."]
            #[doc = "For example, \"org.freedesktop.FooViewer\" where the .desktop file is"]
            #[doc = "\"org.freedesktop.FooViewer.desktop\"."]
            #[doc = ""]
            #[doc = "See the desktop-entry specification [0] for more details on"]
            #[doc = "application identifiers and how they relate to well-known D-Bus"]
            #[doc = "names and .desktop files."]
            #[doc = ""]
            #[doc = "[0] http://standards.freedesktop.org/desktop-entry-spec/"]
            #[doc = ""]
            async fn set_app_id(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                app_id: String,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zxdg_toplevel_v6#{}.set_app_id()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_string(Some(app_id))
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 3u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Clients implementing client-side decorations might want to show"]
            #[doc = "a context menu when right-clicking on the decorations, giving the"]
            #[doc = "user a menu that they can use to maximize or minimize the window."]
            #[doc = ""]
            #[doc = "This request asks the compositor to pop up such a window menu at"]
            #[doc = "the given position, relative to the local surface coordinates of"]
            #[doc = "the parent surface. There are no guarantees as to what menu items"]
            #[doc = "the window menu contains."]
            #[doc = ""]
            #[doc = "This request must be used in response to some sort of user action"]
            #[doc = "like a button press, key press, or touch down event."]
            #[doc = ""]
            async fn show_window_menu(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                seat: crate::wire::ObjectId,
                serial: u32,
                x: i32,
                y: i32,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zxdg_toplevel_v6#{}.show_window_menu()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_object(Some(seat))
                    .put_uint(serial)
                    .put_int(x)
                    .put_int(y)
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 4u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Start an interactive, user-driven move of the surface."]
            #[doc = ""]
            #[doc = "This request must be used in response to some sort of user action"]
            #[doc = "like a button press, key press, or touch down event. The passed"]
            #[doc = "serial is used to determine the type of interactive move (touch,"]
            #[doc = "pointer, etc)."]
            #[doc = ""]
            #[doc = "The server may ignore move requests depending on the state of"]
            #[doc = "the surface (e.g. fullscreen or maximized), or if the passed serial"]
            #[doc = "is no longer valid."]
            #[doc = ""]
            #[doc = "If triggered, the surface will lose the focus of the device"]
            #[doc = "(wl_pointer, wl_touch, etc) used for the move. It is up to the"]
            #[doc = "compositor to visually indicate that the move is taking place, such as"]
            #[doc = "updating a pointer cursor, during the move. There is no guarantee"]
            #[doc = "that the device focus will return when the move is completed."]
            #[doc = ""]
            async fn r#move(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                seat: crate::wire::ObjectId,
                serial: u32,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zxdg_toplevel_v6#{}.move()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_object(Some(seat))
                    .put_uint(serial)
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 5u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Start a user-driven, interactive resize of the surface."]
            #[doc = ""]
            #[doc = "This request must be used in response to some sort of user action"]
            #[doc = "like a button press, key press, or touch down event. The passed"]
            #[doc = "serial is used to determine the type of interactive resize (touch,"]
            #[doc = "pointer, etc)."]
            #[doc = ""]
            #[doc = "The server may ignore resize requests depending on the state of"]
            #[doc = "the surface (e.g. fullscreen or maximized)."]
            #[doc = ""]
            #[doc = "If triggered, the client will receive configure events with the"]
            #[doc = "\"resize\" state enum value and the expected sizes. See the \"resize\""]
            #[doc = "enum value for more details about what is required. The client"]
            #[doc = "must also acknowledge configure events using \"ack_configure\". After"]
            #[doc = "the resize is completed, the client will receive another \"configure\""]
            #[doc = "event without the resize state."]
            #[doc = ""]
            #[doc = "If triggered, the surface also will lose the focus of the device"]
            #[doc = "(wl_pointer, wl_touch, etc) used for the resize. It is up to the"]
            #[doc = "compositor to visually indicate that the resize is taking place,"]
            #[doc = "such as updating a pointer cursor, during the resize. There is no"]
            #[doc = "guarantee that the device focus will return when the resize is"]
            #[doc = "completed."]
            #[doc = ""]
            #[doc = "The edges parameter specifies how the surface should be resized,"]
            #[doc = "and is one of the values of the resize_edge enum. The compositor"]
            #[doc = "may use this information to update the surface position for"]
            #[doc = "example when dragging the top left corner. The compositor may also"]
            #[doc = "use this information to adapt its behavior, e.g. choose an"]
            #[doc = "appropriate cursor image."]
            #[doc = ""]
            async fn resize(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                seat: crate::wire::ObjectId,
                serial: u32,
                edges: u32,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zxdg_toplevel_v6#{}.resize()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_object(Some(seat))
                    .put_uint(serial)
                    .put_uint(edges)
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 6u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Set a maximum size for the window."]
            #[doc = ""]
            #[doc = "The client can specify a maximum size so that the compositor does"]
            #[doc = "not try to configure the window beyond this size."]
            #[doc = ""]
            #[doc = "The width and height arguments are in window geometry coordinates."]
            #[doc = "See xdg_surface.set_window_geometry."]
            #[doc = ""]
            #[doc = "Values set in this way are double-buffered, see wl_surface.commit."]
            #[doc = ""]
            #[doc = "The compositor can use this information to allow or disallow"]
            #[doc = "different states like maximize or fullscreen and draw accurate"]
            #[doc = "animations."]
            #[doc = ""]
            #[doc = "Similarly, a tiling window manager may use this information to"]
            #[doc = "place and resize client windows in a more effective way."]
            #[doc = ""]
            #[doc = "The client should not rely on the compositor to obey the maximum"]
            #[doc = "size. The compositor may decide to ignore the values set by the"]
            #[doc = "client and request a larger size."]
            #[doc = ""]
            #[doc = "If never set, or a value of zero in the request, means that the"]
            #[doc = "client has no expected maximum size in the given dimension."]
            #[doc = "As a result, a client wishing to reset the maximum size"]
            #[doc = "to an unspecified state can use zero for width and height in the"]
            #[doc = "request."]
            #[doc = ""]
            #[doc = "Requesting a maximum size to be smaller than the minimum size of"]
            #[doc = "a surface is illegal and will result in a protocol error."]
            #[doc = ""]
            #[doc = "The width and height must be greater than or equal to zero. Using"]
            #[doc = "strictly negative values for width and height will result in the"]
            #[doc = "zxdg_shell_v6.invalid_surface_state error being raised."]
            #[doc = ""]
            async fn set_max_size(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                width: i32,
                height: i32,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zxdg_toplevel_v6#{}.set_max_size()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_int(width)
                    .put_int(height)
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 7u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Set a minimum size for the window."]
            #[doc = ""]
            #[doc = "The client can specify a minimum size so that the compositor does"]
            #[doc = "not try to configure the window below this size."]
            #[doc = ""]
            #[doc = "The width and height arguments are in window geometry coordinates."]
            #[doc = "See xdg_surface.set_window_geometry."]
            #[doc = ""]
            #[doc = "Values set in this way are double-buffered, see wl_surface.commit."]
            #[doc = ""]
            #[doc = "The compositor can use this information to allow or disallow"]
            #[doc = "different states like maximize or fullscreen and draw accurate"]
            #[doc = "animations."]
            #[doc = ""]
            #[doc = "Similarly, a tiling window manager may use this information to"]
            #[doc = "place and resize client windows in a more effective way."]
            #[doc = ""]
            #[doc = "The client should not rely on the compositor to obey the minimum"]
            #[doc = "size. The compositor may decide to ignore the values set by the"]
            #[doc = "client and request a smaller size."]
            #[doc = ""]
            #[doc = "If never set, or a value of zero in the request, means that the"]
            #[doc = "client has no expected minimum size in the given dimension."]
            #[doc = "As a result, a client wishing to reset the minimum size"]
            #[doc = "to an unspecified state can use zero for width and height in the"]
            #[doc = "request."]
            #[doc = ""]
            #[doc = "Requesting a minimum size to be larger than the maximum size of"]
            #[doc = "a surface is illegal and will result in a protocol error."]
            #[doc = ""]
            #[doc = "The width and height must be greater than or equal to zero. Using"]
            #[doc = "strictly negative values for width and height will result in the"]
            #[doc = "zxdg_shell_v6.invalid_surface_state error being raised."]
            #[doc = ""]
            async fn set_min_size(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                width: i32,
                height: i32,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zxdg_toplevel_v6#{}.set_min_size()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_int(width)
                    .put_int(height)
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 8u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Maximize the surface."]
            #[doc = ""]
            #[doc = "After requesting that the surface should be maximized, the compositor"]
            #[doc = "will respond by emitting a configure event with the \"maximized\" state"]
            #[doc = "and the required window geometry. The client should then update its"]
            #[doc = "content, drawing it in a maximized state, i.e. without shadow or other"]
            #[doc = "decoration outside of the window geometry. The client must also"]
            #[doc = "acknowledge the configure when committing the new content (see"]
            #[doc = "ack_configure)."]
            #[doc = ""]
            #[doc = "It is up to the compositor to decide how and where to maximize the"]
            #[doc = "surface, for example which output and what region of the screen should"]
            #[doc = "be used."]
            #[doc = ""]
            #[doc = "If the surface was already maximized, the compositor will still emit"]
            #[doc = "a configure event with the \"maximized\" state."]
            #[doc = ""]
            #[doc = "Note that unrelated compositor side state changes may cause"]
            #[doc = "configure events to be emitted at any time, meaning trying to"]
            #[doc = "match this request to a specific future configure event is"]
            #[doc = "futile."]
            #[doc = ""]
            async fn set_maximized(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zxdg_toplevel_v6#{}.set_maximized()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 9u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Unmaximize the surface."]
            #[doc = ""]
            #[doc = "After requesting that the surface should be unmaximized, the compositor"]
            #[doc = "will respond by emitting a configure event without the \"maximized\""]
            #[doc = "state. If available, the compositor will include the window geometry"]
            #[doc = "dimensions the window had prior to being maximized in the configure"]
            #[doc = "request. The client must then update its content, drawing it in a"]
            #[doc = "regular state, i.e. potentially with shadow, etc. The client must also"]
            #[doc = "acknowledge the configure when committing the new content (see"]
            #[doc = "ack_configure)."]
            #[doc = ""]
            #[doc = "It is up to the compositor to position the surface after it was"]
            #[doc = "unmaximized; usually the position the surface had before maximizing, if"]
            #[doc = "applicable."]
            #[doc = ""]
            #[doc = "If the surface was already not maximized, the compositor will still"]
            #[doc = "emit a configure event without the \"maximized\" state."]
            #[doc = ""]
            #[doc = "Note that unrelated changes in the state of compositor may cause"]
            #[doc = "configure events to be emitted by the compositor between processing"]
            #[doc = "this request and emitting corresponding configure event, so trying"]
            #[doc = "to match the request with the event is futile."]
            #[doc = ""]
            async fn unset_maximized(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zxdg_toplevel_v6#{}.unset_maximized()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 10u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Make the surface fullscreen."]
            #[doc = ""]
            #[doc = "You can specify an output that you would prefer to be fullscreen."]
            #[doc = "If this value is NULL, it's up to the compositor to choose which"]
            #[doc = "display will be used to map this surface."]
            #[doc = ""]
            #[doc = "If the surface doesn't cover the whole output, the compositor will"]
            #[doc = "position the surface in the center of the output and compensate with"]
            #[doc = "black borders filling the rest of the output."]
            #[doc = ""]
            async fn set_fullscreen(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                output: Option<crate::wire::ObjectId>,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zxdg_toplevel_v6#{}.set_fullscreen()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_object(output)
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 11u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            async fn unset_fullscreen(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zxdg_toplevel_v6#{}.unset_fullscreen()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 12u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "Request that the compositor minimize your surface. There is no"]
            #[doc = "way to know if the surface is currently minimized, nor is there"]
            #[doc = "any way to unset minimization on this surface."]
            #[doc = ""]
            #[doc = "If you are looking to throttle redrawing when minimized, please"]
            #[doc = "instead use the wl_surface.frame event for this, as this will"]
            #[doc = "also work with live previews on windows in Alt-Tab, Expose or"]
            #[doc = "similar compositor features."]
            #[doc = ""]
            async fn set_minimized(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zxdg_toplevel_v6#{}.set_minimized()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 13u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "This configure event asks the client to resize its toplevel surface or"]
            #[doc = "to change its state. The configured state should not be applied"]
            #[doc = "immediately. See xdg_surface.configure for details."]
            #[doc = ""]
            #[doc = "The width and height arguments specify a hint to the window"]
            #[doc = "about how its surface should be resized in window geometry"]
            #[doc = "coordinates. See set_window_geometry."]
            #[doc = ""]
            #[doc = "If the width or height arguments are zero, it means the client"]
            #[doc = "should decide its own window dimension. This may happen when the"]
            #[doc = "compositor needs to configure the state of the surface but doesn't"]
            #[doc = "have any information about any previous or expected dimension."]
            #[doc = ""]
            #[doc = "The states listed in the event specify how the width/height"]
            #[doc = "arguments should be interpreted, and possibly how it should be"]
            #[doc = "drawn."]
            #[doc = ""]
            #[doc = "Clients must send an ack_configure in response to this event. See"]
            #[doc = "xdg_surface.configure and xdg_surface.ack_configure for details."]
            #[doc = ""]
            async fn configure(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                width: i32,
                height: i32,
                states: Vec<u8>,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "The close event is sent by the compositor when the user"]
            #[doc = "wants the surface to be closed. This should be equivalent to"]
            #[doc = "the user clicking the close button in client-side decorations,"]
            #[doc = "if your application has any."]
            #[doc = ""]
            #[doc = "This is only a request that the user intends to close the"]
            #[doc = "window. The client may choose to ignore this request, or show"]
            #[doc = "a dialog to ask the user to save their data, etc."]
            #[doc = ""]
            async fn close(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()>;
        }
    }
    #[doc = ""]
    #[doc = "A popup surface is a short-lived, temporary surface. It can be used to"]
    #[doc = "implement for example menus, popovers, tooltips and other similar user"]
    #[doc = "interface concepts."]
    #[doc = ""]
    #[doc = "A popup can be made to take an explicit grab. See xdg_popup.grab for"]
    #[doc = "details."]
    #[doc = ""]
    #[doc = "When the popup is dismissed, a popup_done event will be sent out, and at"]
    #[doc = "the same time the surface will be unmapped. See the xdg_popup.popup_done"]
    #[doc = "event for details."]
    #[doc = ""]
    #[doc = "Explicitly destroying the xdg_popup object will also dismiss the popup and"]
    #[doc = "unmap the surface. Clients that want to dismiss the popup when another"]
    #[doc = "surface of their own is clicked should dismiss the popup using the destroy"]
    #[doc = "request."]
    #[doc = ""]
    #[doc = "The parent surface must have either the xdg_toplevel or xdg_popup surface"]
    #[doc = "role."]
    #[doc = ""]
    #[doc = "A newly created xdg_popup will be stacked on top of all previously created"]
    #[doc = "xdg_popup surfaces associated with the same xdg_toplevel."]
    #[doc = ""]
    #[doc = "The parent of an xdg_popup must be mapped (see the xdg_surface"]
    #[doc = "description) before the xdg_popup itself."]
    #[doc = ""]
    #[doc = "The x and y arguments passed when creating the popup object specify"]
    #[doc = "where the top left of the popup should be placed, relative to the"]
    #[doc = "local surface coordinates of the parent surface. See"]
    #[doc = "xdg_surface.get_popup. An xdg_popup must intersect with or be at least"]
    #[doc = "partially adjacent to its parent surface."]
    #[doc = ""]
    #[doc = "The client must call wl_surface.commit on the corresponding wl_surface"]
    #[doc = "for the xdg_popup state to take effect."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zxdg_popup_v6 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[repr(u32)]
        #[non_exhaustive]
        #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)]
        pub enum Error {
            #[doc = "tried to grab after being mapped"]
            InvalidGrab = 0u32,
        }
        impl TryFrom<u32> for Error {
            type Error = crate::wire::DecodeError;
            fn try_from(v: u32) -> Result<Self, Self::Error> {
                match v {
                    0u32 => Ok(Self::InvalidGrab),
                    _ => Err(crate::wire::DecodeError::MalformedPayload),
                }
            }
        }
        impl std::fmt::Display for Error {
            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
                (*self as u32).fmt(f)
            }
        }
        #[doc = "Trait to implement the zxdg_popup_v6 interface. See the module level documentation for more info"]
        pub trait ZxdgPopupV6 {
            const INTERFACE: &'static str = "zxdg_popup_v6";
            const VERSION: u32 = 1u32;
            async fn handle_event(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    0u16 => {
                        let x = message.int()?;
                        let y = message.int()?;
                        let width = message.int()?;
                        let height = message.int()?;
                        tracing::debug!(
                            "zxdg_popup_v6#{}.configure({}, {}, {}, {})",
                            sender_id,
                            x,
                            y,
                            width,
                            height
                        );
                        self.configure(client, sender_id, x, y, width, height).await
                    }
                    1u16 => {
                        tracing::debug!("zxdg_popup_v6#{}.popup_done()", sender_id,);
                        self.popup_done(client, sender_id).await
                    }
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "This destroys the popup. Explicitly destroying the xdg_popup"]
            #[doc = "object will also dismiss the popup, and unmap the surface."]
            #[doc = ""]
            #[doc = "If this xdg_popup is not the \"topmost\" popup, a protocol error"]
            #[doc = "will be sent."]
            #[doc = ""]
            async fn destroy(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zxdg_popup_v6#{}.destroy()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "This request makes the created popup take an explicit grab. An explicit"]
            #[doc = "grab will be dismissed when the user dismisses the popup, or when the"]
            #[doc = "client destroys the xdg_popup. This can be done by the user clicking"]
            #[doc = "outside the surface, using the keyboard, or even locking the screen"]
            #[doc = "through closing the lid or a timeout."]
            #[doc = ""]
            #[doc = "If the compositor denies the grab, the popup will be immediately"]
            #[doc = "dismissed."]
            #[doc = ""]
            #[doc = "This request must be used in response to some sort of user action like a"]
            #[doc = "button press, key press, or touch down event. The serial number of the"]
            #[doc = "event should be passed as 'serial'."]
            #[doc = ""]
            #[doc = "The parent of a grabbing popup must either be an xdg_toplevel surface or"]
            #[doc = "another xdg_popup with an explicit grab. If the parent is another"]
            #[doc = "xdg_popup it means that the popups are nested, with this popup now being"]
            #[doc = "the topmost popup."]
            #[doc = ""]
            #[doc = "Nested popups must be destroyed in the reverse order they were created"]
            #[doc = "in, e.g. the only popup you are allowed to destroy at all times is the"]
            #[doc = "topmost one."]
            #[doc = ""]
            #[doc = "When compositors choose to dismiss a popup, they may dismiss every"]
            #[doc = "nested grabbing popup as well. When a compositor dismisses popups, it"]
            #[doc = "will follow the same dismissing order as required from the client."]
            #[doc = ""]
            #[doc = "The parent of a grabbing popup must either be another xdg_popup with an"]
            #[doc = "active explicit grab, or an xdg_popup or xdg_toplevel, if there are no"]
            #[doc = "explicit grabs already taken."]
            #[doc = ""]
            #[doc = "If the topmost grabbing popup is destroyed, the grab will be returned to"]
            #[doc = "the parent of the popup, if that parent previously had an explicit grab."]
            #[doc = ""]
            #[doc = "If the parent is a grabbing popup which has already been dismissed, this"]
            #[doc = "popup will be immediately dismissed. If the parent is a popup that did"]
            #[doc = "not take an explicit grab, an error will be raised."]
            #[doc = ""]
            #[doc = "During a popup grab, the client owning the grab will receive pointer"]
            #[doc = "and touch events for all their surfaces as normal (similar to an"]
            #[doc = "\"owner-events\" grab in X11 parlance), while the top most grabbing popup"]
            #[doc = "will always have keyboard focus."]
            #[doc = ""]
            async fn grab(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                seat: crate::wire::ObjectId,
                serial: u32,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zxdg_popup_v6#{}.grab()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_object(Some(seat))
                    .put_uint(serial)
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 1u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "This event asks the popup surface to configure itself given the"]
            #[doc = "configuration. The configured state should not be applied immediately."]
            #[doc = "See xdg_surface.configure for details."]
            #[doc = ""]
            #[doc = "The x and y arguments represent the position the popup was placed at"]
            #[doc = "given the xdg_positioner rule, relative to the upper left corner of the"]
            #[doc = "window geometry of the parent surface."]
            #[doc = ""]
            async fn configure(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                x: i32,
                y: i32,
                width: i32,
                height: i32,
            ) -> crate::client::Result<()>;
            #[doc = ""]
            #[doc = "The popup_done event is sent out when a popup is dismissed by the"]
            #[doc = "compositor. The client should destroy the xdg_popup object at this"]
            #[doc = "point."]
            #[doc = ""]
            async fn popup_done(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()>;
        }
    }
}
#[doc = ""]
#[doc = "This protocol is application-specific to meet the needs of the X11"]
#[doc = "protocol through Xwayland. It provides a way for Xwayland to request"]
#[doc = "all keyboard events to be forwarded to a surface even when the"]
#[doc = "surface does not have keyboard focus."]
#[doc = ""]
#[doc = "In the X11 protocol, a client may request an \"active grab\" on the"]
#[doc = "keyboard. On success, all key events are reported only to the"]
#[doc = "grabbing X11 client. For details, see XGrabKeyboard(3)."]
#[doc = ""]
#[doc = "The core Wayland protocol does not have a notion of an active"]
#[doc = "keyboard grab. When running in Xwayland, X11 applications may"]
#[doc = "acquire an active grab inside Xwayland but that cannot be translated"]
#[doc = "to the Wayland compositor who may set the input focus to some other"]
#[doc = "surface. In doing so, it breaks the X11 client assumption that all"]
#[doc = "key events are reported to the grabbing client."]
#[doc = ""]
#[doc = "This protocol specifies a way for Xwayland to request all keyboard"]
#[doc = "be directed to the given surface. The protocol does not guarantee"]
#[doc = "that the compositor will honor this request and it does not"]
#[doc = "prescribe user interfaces on how to handle the respond. For example,"]
#[doc = "a compositor may inform the user that all key events are now"]
#[doc = "forwarded to the given client surface, or it may ask the user for"]
#[doc = "permission to do so."]
#[doc = ""]
#[doc = "Compositors are required to restrict access to this application"]
#[doc = "specific protocol to Xwayland alone."]
#[doc = ""]
#[doc = "Warning! The protocol described in this file is experimental and"]
#[doc = "backward incompatible changes may be made. Backward compatible"]
#[doc = "changes may be added together with the corresponding interface"]
#[doc = "version bump."]
#[doc = "Backward incompatible changes are done by bumping the version"]
#[doc = "number in the protocol and interface names and resetting the"]
#[doc = "interface version. Once the protocol is to be declared stable,"]
#[doc = "the 'z' prefix and the version number in the protocol and"]
#[doc = "interface names are removed and the interface version number is"]
#[doc = "reset."]
#[doc = ""]
#[allow(clippy::module_inception)]
pub mod xwayland_keyboard_grab_unstable_v1 {
    #[doc = ""]
    #[doc = "A global interface used for grabbing the keyboard."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zwp_xwayland_keyboard_grab_manager_v1 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[doc = "Trait to implement the zwp_xwayland_keyboard_grab_manager_v1 interface. See the module level documentation for more info"]
        pub trait ZwpXwaylandKeyboardGrabManagerV1 {
            const INTERFACE: &'static str = "zwp_xwayland_keyboard_grab_manager_v1";
            const VERSION: u32 = 1u32;
            async fn handle_event(
                &self,
                _client: &mut crate::server::Client,
                _sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "Destroy the keyboard grab manager."]
            #[doc = ""]
            async fn destroy(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!(
                    "-> zwp_xwayland_keyboard_grab_manager_v1#{}.destroy()",
                    sender_id
                );
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
            #[doc = ""]
            #[doc = "The grab_keyboard request asks for a grab of the keyboard, forcing"]
            #[doc = "the keyboard focus for the given seat upon the given surface."]
            #[doc = ""]
            #[doc = "The protocol provides no guarantee that the grab is ever satisfied,"]
            #[doc = "and does not require the compositor to send an error if the grab"]
            #[doc = "cannot ever be satisfied. It is thus possible to request a keyboard"]
            #[doc = "grab that will never be effective."]
            #[doc = ""]
            #[doc = "The protocol:"]
            #[doc = ""]
            #[doc = "* does not guarantee that the grab itself is applied for a surface,"]
            #[doc = "the grab request may be silently ignored by the compositor,"]
            #[doc = "* does not guarantee that any events are sent to this client even"]
            #[doc = "if the grab is applied to a surface,"]
            #[doc = "* does not guarantee that events sent to this client are exhaustive,"]
            #[doc = "a compositor may filter some events for its own consumption,"]
            #[doc = "* does not guarantee that events sent to this client are continuous,"]
            #[doc = "a compositor may change and reroute keyboard events while the grab"]
            #[doc = "is nominally active."]
            #[doc = ""]
            async fn grab_keyboard(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
                id: crate::wire::ObjectId,
                surface: crate::wire::ObjectId,
                seat: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!(
                    "-> zwp_xwayland_keyboard_grab_manager_v1#{}.grab_keyboard()",
                    sender_id
                );
                let (payload, fds) = crate::wire::PayloadBuilder::new()
                    .put_object(Some(id))
                    .put_object(Some(surface))
                    .put_object(Some(seat))
                    .build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 1u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
        }
    }
    #[doc = ""]
    #[doc = "A global interface used for grabbing the keyboard."]
    #[doc = ""]
    #[allow(clippy::too_many_arguments)]
    pub mod zwp_xwayland_keyboard_grab_v1 {
        use futures_util::SinkExt;
        #[allow(unused)]
        use std::os::fd::AsRawFd;
        #[doc = "Trait to implement the zwp_xwayland_keyboard_grab_v1 interface. See the module level documentation for more info"]
        pub trait ZwpXwaylandKeyboardGrabV1 {
            const INTERFACE: &'static str = "zwp_xwayland_keyboard_grab_v1";
            const VERSION: u32 = 1u32;
            async fn handle_event(
                &self,
                _client: &mut crate::server::Client,
                _sender_id: crate::wire::ObjectId,
                message: &mut crate::wire::Message,
            ) -> crate::client::Result<()> {
                #[allow(clippy::match_single_binding)]
                match message.opcode() {
                    _ => Err(crate::client::Error::UnknownOpcode),
                }
            }
            #[doc = ""]
            #[doc = "Destroy the grabbed keyboard object. If applicable, the compositor"]
            #[doc = "will ungrab the keyboard."]
            #[doc = ""]
            async fn destroy(
                &self,
                client: &mut crate::server::Client,
                sender_id: crate::wire::ObjectId,
            ) -> crate::client::Result<()> {
                tracing::debug!("-> zwp_xwayland_keyboard_grab_v1#{}.destroy()", sender_id);
                let (payload, fds) = crate::wire::PayloadBuilder::new().build();
                client
                    .send_message(crate::wire::Message::new(sender_id, 0u16, payload, fds))
                    .await
                    .map_err(crate::client::Error::IoError)
            }
        }
    }
}