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
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT

use glib::error::ErrorDomain;
use glib::translate::*;
use glib::value::FromValue;
use glib::value::ToValue;
use glib::Quark;
use glib::StaticType;
use glib::Type;
use std::fmt;

/// An enumeration describing the way in which a device
/// axis (valuator) maps onto the predefined valuator
/// types that GTK+ understands.
///
/// Note that the X and Y axes are not really needed; pointer devices
/// report their location via the x/y members of events regardless. Whether
/// X and Y are present as axes depends on the GDK backend.
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkAxisUse")]
pub enum AxisUse {
    /// the axis is ignored.
    #[doc(alias = "GDK_AXIS_IGNORE")]
    Ignore,
    /// the axis is used as the x axis.
    #[doc(alias = "GDK_AXIS_X")]
    X,
    /// the axis is used as the y axis.
    #[doc(alias = "GDK_AXIS_Y")]
    Y,
    /// the axis is used for pressure information.
    #[doc(alias = "GDK_AXIS_PRESSURE")]
    Pressure,
    /// the axis is used for x tilt information.
    #[doc(alias = "GDK_AXIS_XTILT")]
    Xtilt,
    /// the axis is used for y tilt information.
    #[doc(alias = "GDK_AXIS_YTILT")]
    Ytilt,
    /// the axis is used for wheel information.
    #[doc(alias = "GDK_AXIS_WHEEL")]
    Wheel,
    /// the axis is used for pen/tablet distance information. (Since: 3.22)
    #[doc(alias = "GDK_AXIS_DISTANCE")]
    Distance,
    /// the axis is used for pen rotation information. (Since: 3.22)
    #[doc(alias = "GDK_AXIS_ROTATION")]
    Rotation,
    /// the axis is used for pen slider information. (Since: 3.22)
    #[doc(alias = "GDK_AXIS_SLIDER")]
    Slider,
    /// a constant equal to the numerically highest axis value.
    #[doc(alias = "GDK_AXIS_LAST")]
    Last,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for AxisUse {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "AxisUse::{}",
            match *self {
                Self::Ignore => "Ignore",
                Self::X => "X",
                Self::Y => "Y",
                Self::Pressure => "Pressure",
                Self::Xtilt => "Xtilt",
                Self::Ytilt => "Ytilt",
                Self::Wheel => "Wheel",
                Self::Distance => "Distance",
                Self::Rotation => "Rotation",
                Self::Slider => "Slider",
                Self::Last => "Last",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl IntoGlib for AxisUse {
    type GlibType = ffi::GdkAxisUse;

    fn into_glib(self) -> ffi::GdkAxisUse {
        match self {
            Self::Ignore => ffi::GDK_AXIS_IGNORE,
            Self::X => ffi::GDK_AXIS_X,
            Self::Y => ffi::GDK_AXIS_Y,
            Self::Pressure => ffi::GDK_AXIS_PRESSURE,
            Self::Xtilt => ffi::GDK_AXIS_XTILT,
            Self::Ytilt => ffi::GDK_AXIS_YTILT,
            Self::Wheel => ffi::GDK_AXIS_WHEEL,
            Self::Distance => ffi::GDK_AXIS_DISTANCE,
            Self::Rotation => ffi::GDK_AXIS_ROTATION,
            Self::Slider => ffi::GDK_AXIS_SLIDER,
            Self::Last => ffi::GDK_AXIS_LAST,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GdkAxisUse> for AxisUse {
    unsafe fn from_glib(value: ffi::GdkAxisUse) -> Self {
        skip_assert_initialized!();
        match value {
            ffi::GDK_AXIS_IGNORE => Self::Ignore,
            ffi::GDK_AXIS_X => Self::X,
            ffi::GDK_AXIS_Y => Self::Y,
            ffi::GDK_AXIS_PRESSURE => Self::Pressure,
            ffi::GDK_AXIS_XTILT => Self::Xtilt,
            ffi::GDK_AXIS_YTILT => Self::Ytilt,
            ffi::GDK_AXIS_WHEEL => Self::Wheel,
            ffi::GDK_AXIS_DISTANCE => Self::Distance,
            ffi::GDK_AXIS_ROTATION => Self::Rotation,
            ffi::GDK_AXIS_SLIDER => Self::Slider,
            ffi::GDK_AXIS_LAST => Self::Last,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for AxisUse {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gdk_axis_use_get_type()) }
    }
}

impl glib::value::ValueType for AxisUse {
    type Type = Self;
}

unsafe impl<'a> FromValue<'a> for AxisUse {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for AxisUse {
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

/// A set of values describing the possible byte-orders
/// for storing pixel values in memory.
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkByteOrder")]
pub enum ByteOrder {
    /// The values are stored with the least-significant byte
    ///  first. For instance, the 32-bit value 0xffeecc would be stored
    ///  in memory as 0xcc, 0xee, 0xff, 0x00.
    #[doc(alias = "GDK_LSB_FIRST")]
    LsbFirst,
    /// The values are stored with the most-significant byte
    ///  first. For instance, the 32-bit value 0xffeecc would be stored
    ///  in memory as 0x00, 0xff, 0xee, 0xcc.
    #[doc(alias = "GDK_MSB_FIRST")]
    MsbFirst,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for ByteOrder {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "ByteOrder::{}",
            match *self {
                Self::LsbFirst => "LsbFirst",
                Self::MsbFirst => "MsbFirst",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl IntoGlib for ByteOrder {
    type GlibType = ffi::GdkByteOrder;

    fn into_glib(self) -> ffi::GdkByteOrder {
        match self {
            Self::LsbFirst => ffi::GDK_LSB_FIRST,
            Self::MsbFirst => ffi::GDK_MSB_FIRST,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GdkByteOrder> for ByteOrder {
    unsafe fn from_glib(value: ffi::GdkByteOrder) -> Self {
        skip_assert_initialized!();
        match value {
            ffi::GDK_LSB_FIRST => Self::LsbFirst,
            ffi::GDK_MSB_FIRST => Self::MsbFirst,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for ByteOrder {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gdk_byte_order_get_type()) }
    }
}

impl glib::value::ValueType for ByteOrder {
    type Type = Self;
}

unsafe impl<'a> FromValue<'a> for ByteOrder {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for ByteOrder {
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

/// Specifies the crossing mode for [`EventCrossing`][crate::EventCrossing].
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkCrossingMode")]
pub enum CrossingMode {
    /// crossing because of pointer motion.
    #[doc(alias = "GDK_CROSSING_NORMAL")]
    Normal,
    /// crossing because a grab is activated.
    #[doc(alias = "GDK_CROSSING_GRAB")]
    Grab,
    /// crossing because a grab is deactivated.
    #[doc(alias = "GDK_CROSSING_UNGRAB")]
    Ungrab,
    /// crossing because a GTK+ grab is activated.
    #[doc(alias = "GDK_CROSSING_GTK_GRAB")]
    GtkGrab,
    /// crossing because a GTK+ grab is deactivated.
    #[doc(alias = "GDK_CROSSING_GTK_UNGRAB")]
    GtkUngrab,
    /// crossing because a GTK+ widget changed
    ///  state (e.g. sensitivity).
    #[doc(alias = "GDK_CROSSING_STATE_CHANGED")]
    StateChanged,
    /// crossing because a touch sequence has begun,
    ///  this event is synthetic as the pointer might have not left the window.
    #[doc(alias = "GDK_CROSSING_TOUCH_BEGIN")]
    TouchBegin,
    /// crossing because a touch sequence has ended,
    ///  this event is synthetic as the pointer might have not left the window.
    #[doc(alias = "GDK_CROSSING_TOUCH_END")]
    TouchEnd,
    /// crossing because of a device switch (i.e.
    ///  a mouse taking control of the pointer after a touch device), this event
    ///  is synthetic as the pointer didn’t leave the window.
    #[doc(alias = "GDK_CROSSING_DEVICE_SWITCH")]
    DeviceSwitch,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for CrossingMode {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "CrossingMode::{}",
            match *self {
                Self::Normal => "Normal",
                Self::Grab => "Grab",
                Self::Ungrab => "Ungrab",
                Self::GtkGrab => "GtkGrab",
                Self::GtkUngrab => "GtkUngrab",
                Self::StateChanged => "StateChanged",
                Self::TouchBegin => "TouchBegin",
                Self::TouchEnd => "TouchEnd",
                Self::DeviceSwitch => "DeviceSwitch",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl IntoGlib for CrossingMode {
    type GlibType = ffi::GdkCrossingMode;

    fn into_glib(self) -> ffi::GdkCrossingMode {
        match self {
            Self::Normal => ffi::GDK_CROSSING_NORMAL,
            Self::Grab => ffi::GDK_CROSSING_GRAB,
            Self::Ungrab => ffi::GDK_CROSSING_UNGRAB,
            Self::GtkGrab => ffi::GDK_CROSSING_GTK_GRAB,
            Self::GtkUngrab => ffi::GDK_CROSSING_GTK_UNGRAB,
            Self::StateChanged => ffi::GDK_CROSSING_STATE_CHANGED,
            Self::TouchBegin => ffi::GDK_CROSSING_TOUCH_BEGIN,
            Self::TouchEnd => ffi::GDK_CROSSING_TOUCH_END,
            Self::DeviceSwitch => ffi::GDK_CROSSING_DEVICE_SWITCH,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GdkCrossingMode> for CrossingMode {
    unsafe fn from_glib(value: ffi::GdkCrossingMode) -> Self {
        skip_assert_initialized!();
        match value {
            ffi::GDK_CROSSING_NORMAL => Self::Normal,
            ffi::GDK_CROSSING_GRAB => Self::Grab,
            ffi::GDK_CROSSING_UNGRAB => Self::Ungrab,
            ffi::GDK_CROSSING_GTK_GRAB => Self::GtkGrab,
            ffi::GDK_CROSSING_GTK_UNGRAB => Self::GtkUngrab,
            ffi::GDK_CROSSING_STATE_CHANGED => Self::StateChanged,
            ffi::GDK_CROSSING_TOUCH_BEGIN => Self::TouchBegin,
            ffi::GDK_CROSSING_TOUCH_END => Self::TouchEnd,
            ffi::GDK_CROSSING_DEVICE_SWITCH => Self::DeviceSwitch,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for CrossingMode {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gdk_crossing_mode_get_type()) }
    }
}

impl glib::value::ValueType for CrossingMode {
    type Type = Self;
}

unsafe impl<'a> FromValue<'a> for CrossingMode {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for CrossingMode {
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

/// Predefined cursors.
///
/// Note that these IDs are directly taken from the X cursor font, and many
/// of these cursors are either not useful, or are not available on other platforms.
///
/// The recommended way to create cursors is to use [`Cursor::from_name()`][crate::Cursor::from_name()].
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkCursorType")]
pub enum CursorType {
    /// ![](X_cursor.png)
    #[doc(alias = "GDK_X_CURSOR")]
    XCursor,
    /// ![](arrow.png)
    #[doc(alias = "GDK_ARROW")]
    Arrow,
    /// ![](based_arrow_down.png)
    #[doc(alias = "GDK_BASED_ARROW_DOWN")]
    BasedArrowDown,
    /// ![](based_arrow_up.png)
    #[doc(alias = "GDK_BASED_ARROW_UP")]
    BasedArrowUp,
    /// ![](boat.png)
    #[doc(alias = "GDK_BOAT")]
    Boat,
    /// ![](bogosity.png)
    #[doc(alias = "GDK_BOGOSITY")]
    Bogosity,
    /// ![](bottom_left_corner.png)
    #[doc(alias = "GDK_BOTTOM_LEFT_CORNER")]
    BottomLeftCorner,
    /// ![](bottom_right_corner.png)
    #[doc(alias = "GDK_BOTTOM_RIGHT_CORNER")]
    BottomRightCorner,
    /// ![](bottom_side.png)
    #[doc(alias = "GDK_BOTTOM_SIDE")]
    BottomSide,
    /// ![](bottom_tee.png)
    #[doc(alias = "GDK_BOTTOM_TEE")]
    BottomTee,
    /// ![](box_spiral.png)
    #[doc(alias = "GDK_BOX_SPIRAL")]
    BoxSpiral,
    /// ![](center_ptr.png)
    #[doc(alias = "GDK_CENTER_PTR")]
    CenterPtr,
    /// ![](circle.png)
    #[doc(alias = "GDK_CIRCLE")]
    Circle,
    /// ![](clock.png)
    #[doc(alias = "GDK_CLOCK")]
    Clock,
    /// ![](coffee_mug.png)
    #[doc(alias = "GDK_COFFEE_MUG")]
    CoffeeMug,
    /// ![](cross.png)
    #[doc(alias = "GDK_CROSS")]
    Cross,
    /// ![](cross_reverse.png)
    #[doc(alias = "GDK_CROSS_REVERSE")]
    CrossReverse,
    /// ![](crosshair.png)
    #[doc(alias = "GDK_CROSSHAIR")]
    Crosshair,
    /// ![](diamond_cross.png)
    #[doc(alias = "GDK_DIAMOND_CROSS")]
    DiamondCross,
    /// ![](dot.png)
    #[doc(alias = "GDK_DOT")]
    Dot,
    /// ![](dotbox.png)
    #[doc(alias = "GDK_DOTBOX")]
    Dotbox,
    /// ![](double_arrow.png)
    #[doc(alias = "GDK_DOUBLE_ARROW")]
    DoubleArrow,
    /// ![](draft_large.png)
    #[doc(alias = "GDK_DRAFT_LARGE")]
    DraftLarge,
    /// ![](draft_small.png)
    #[doc(alias = "GDK_DRAFT_SMALL")]
    DraftSmall,
    /// ![](draped_box.png)
    #[doc(alias = "GDK_DRAPED_BOX")]
    DrapedBox,
    /// ![](exchange.png)
    #[doc(alias = "GDK_EXCHANGE")]
    Exchange,
    /// ![](fleur.png)
    #[doc(alias = "GDK_FLEUR")]
    Fleur,
    /// ![](gobbler.png)
    #[doc(alias = "GDK_GOBBLER")]
    Gobbler,
    /// ![](gumby.png)
    #[doc(alias = "GDK_GUMBY")]
    Gumby,
    /// ![](hand1.png)
    #[doc(alias = "GDK_HAND1")]
    Hand1,
    /// ![](hand2.png)
    #[doc(alias = "GDK_HAND2")]
    Hand2,
    /// ![](heart.png)
    #[doc(alias = "GDK_HEART")]
    Heart,
    /// ![](icon.png)
    #[doc(alias = "GDK_ICON")]
    Icon,
    /// ![](iron_cross.png)
    #[doc(alias = "GDK_IRON_CROSS")]
    IronCross,
    /// ![](left_ptr.png)
    #[doc(alias = "GDK_LEFT_PTR")]
    LeftPtr,
    /// ![](left_side.png)
    #[doc(alias = "GDK_LEFT_SIDE")]
    LeftSide,
    /// ![](left_tee.png)
    #[doc(alias = "GDK_LEFT_TEE")]
    LeftTee,
    /// ![](leftbutton.png)
    #[doc(alias = "GDK_LEFTBUTTON")]
    Leftbutton,
    /// ![](ll_angle.png)
    #[doc(alias = "GDK_LL_ANGLE")]
    LlAngle,
    /// ![](lr_angle.png)
    #[doc(alias = "GDK_LR_ANGLE")]
    LrAngle,
    /// ![](man.png)
    #[doc(alias = "GDK_MAN")]
    Man,
    /// ![](middlebutton.png)
    #[doc(alias = "GDK_MIDDLEBUTTON")]
    Middlebutton,
    /// ![](mouse.png)
    #[doc(alias = "GDK_MOUSE")]
    Mouse,
    /// ![](pencil.png)
    #[doc(alias = "GDK_PENCIL")]
    Pencil,
    /// ![](pirate.png)
    #[doc(alias = "GDK_PIRATE")]
    Pirate,
    /// ![](plus.png)
    #[doc(alias = "GDK_PLUS")]
    Plus,
    /// ![](question_arrow.png)
    #[doc(alias = "GDK_QUESTION_ARROW")]
    QuestionArrow,
    /// ![](right_ptr.png)
    #[doc(alias = "GDK_RIGHT_PTR")]
    RightPtr,
    /// ![](right_side.png)
    #[doc(alias = "GDK_RIGHT_SIDE")]
    RightSide,
    /// ![](right_tee.png)
    #[doc(alias = "GDK_RIGHT_TEE")]
    RightTee,
    /// ![](rightbutton.png)
    #[doc(alias = "GDK_RIGHTBUTTON")]
    Rightbutton,
    /// ![](rtl_logo.png)
    #[doc(alias = "GDK_RTL_LOGO")]
    RtlLogo,
    /// ![](sailboat.png)
    #[doc(alias = "GDK_SAILBOAT")]
    Sailboat,
    /// ![](sb_down_arrow.png)
    #[doc(alias = "GDK_SB_DOWN_ARROW")]
    SbDownArrow,
    /// ![](sb_h_double_arrow.png)
    #[doc(alias = "GDK_SB_H_DOUBLE_ARROW")]
    SbHDoubleArrow,
    /// ![](sb_left_arrow.png)
    #[doc(alias = "GDK_SB_LEFT_ARROW")]
    SbLeftArrow,
    /// ![](sb_right_arrow.png)
    #[doc(alias = "GDK_SB_RIGHT_ARROW")]
    SbRightArrow,
    /// ![](sb_up_arrow.png)
    #[doc(alias = "GDK_SB_UP_ARROW")]
    SbUpArrow,
    /// ![](sb_v_double_arrow.png)
    #[doc(alias = "GDK_SB_V_DOUBLE_ARROW")]
    SbVDoubleArrow,
    /// ![](shuttle.png)
    #[doc(alias = "GDK_SHUTTLE")]
    Shuttle,
    /// ![](sizing.png)
    #[doc(alias = "GDK_SIZING")]
    Sizing,
    /// ![](spider.png)
    #[doc(alias = "GDK_SPIDER")]
    Spider,
    /// ![](spraycan.png)
    #[doc(alias = "GDK_SPRAYCAN")]
    Spraycan,
    /// ![](star.png)
    #[doc(alias = "GDK_STAR")]
    Star,
    /// ![](target.png)
    #[doc(alias = "GDK_TARGET")]
    Target,
    /// ![](tcross.png)
    #[doc(alias = "GDK_TCROSS")]
    Tcross,
    /// ![](top_left_arrow.png)
    #[doc(alias = "GDK_TOP_LEFT_ARROW")]
    TopLeftArrow,
    /// ![](top_left_corner.png)
    #[doc(alias = "GDK_TOP_LEFT_CORNER")]
    TopLeftCorner,
    /// ![](top_right_corner.png)
    #[doc(alias = "GDK_TOP_RIGHT_CORNER")]
    TopRightCorner,
    /// ![](top_side.png)
    #[doc(alias = "GDK_TOP_SIDE")]
    TopSide,
    /// ![](top_tee.png)
    #[doc(alias = "GDK_TOP_TEE")]
    TopTee,
    /// ![](trek.png)
    #[doc(alias = "GDK_TREK")]
    Trek,
    /// ![](ul_angle.png)
    #[doc(alias = "GDK_UL_ANGLE")]
    UlAngle,
    /// ![](umbrella.png)
    #[doc(alias = "GDK_UMBRELLA")]
    Umbrella,
    /// ![](ur_angle.png)
    #[doc(alias = "GDK_UR_ANGLE")]
    UrAngle,
    /// ![](watch.png)
    #[doc(alias = "GDK_WATCH")]
    Watch,
    /// ![](xterm.png)
    #[doc(alias = "GDK_XTERM")]
    Xterm,
    /// last cursor type
    #[doc(alias = "GDK_LAST_CURSOR")]
    LastCursor,
    /// Blank cursor. Since 2.16
    #[doc(alias = "GDK_BLANK_CURSOR")]
    BlankCursor,
    /// type of cursors constructed with
    ///  [`Cursor::from_pixbuf()`][crate::Cursor::from_pixbuf()]
    #[doc(alias = "GDK_CURSOR_IS_PIXMAP")]
    CursorIsPixmap,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for CursorType {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "CursorType::{}",
            match *self {
                Self::XCursor => "XCursor",
                Self::Arrow => "Arrow",
                Self::BasedArrowDown => "BasedArrowDown",
                Self::BasedArrowUp => "BasedArrowUp",
                Self::Boat => "Boat",
                Self::Bogosity => "Bogosity",
                Self::BottomLeftCorner => "BottomLeftCorner",
                Self::BottomRightCorner => "BottomRightCorner",
                Self::BottomSide => "BottomSide",
                Self::BottomTee => "BottomTee",
                Self::BoxSpiral => "BoxSpiral",
                Self::CenterPtr => "CenterPtr",
                Self::Circle => "Circle",
                Self::Clock => "Clock",
                Self::CoffeeMug => "CoffeeMug",
                Self::Cross => "Cross",
                Self::CrossReverse => "CrossReverse",
                Self::Crosshair => "Crosshair",
                Self::DiamondCross => "DiamondCross",
                Self::Dot => "Dot",
                Self::Dotbox => "Dotbox",
                Self::DoubleArrow => "DoubleArrow",
                Self::DraftLarge => "DraftLarge",
                Self::DraftSmall => "DraftSmall",
                Self::DrapedBox => "DrapedBox",
                Self::Exchange => "Exchange",
                Self::Fleur => "Fleur",
                Self::Gobbler => "Gobbler",
                Self::Gumby => "Gumby",
                Self::Hand1 => "Hand1",
                Self::Hand2 => "Hand2",
                Self::Heart => "Heart",
                Self::Icon => "Icon",
                Self::IronCross => "IronCross",
                Self::LeftPtr => "LeftPtr",
                Self::LeftSide => "LeftSide",
                Self::LeftTee => "LeftTee",
                Self::Leftbutton => "Leftbutton",
                Self::LlAngle => "LlAngle",
                Self::LrAngle => "LrAngle",
                Self::Man => "Man",
                Self::Middlebutton => "Middlebutton",
                Self::Mouse => "Mouse",
                Self::Pencil => "Pencil",
                Self::Pirate => "Pirate",
                Self::Plus => "Plus",
                Self::QuestionArrow => "QuestionArrow",
                Self::RightPtr => "RightPtr",
                Self::RightSide => "RightSide",
                Self::RightTee => "RightTee",
                Self::Rightbutton => "Rightbutton",
                Self::RtlLogo => "RtlLogo",
                Self::Sailboat => "Sailboat",
                Self::SbDownArrow => "SbDownArrow",
                Self::SbHDoubleArrow => "SbHDoubleArrow",
                Self::SbLeftArrow => "SbLeftArrow",
                Self::SbRightArrow => "SbRightArrow",
                Self::SbUpArrow => "SbUpArrow",
                Self::SbVDoubleArrow => "SbVDoubleArrow",
                Self::Shuttle => "Shuttle",
                Self::Sizing => "Sizing",
                Self::Spider => "Spider",
                Self::Spraycan => "Spraycan",
                Self::Star => "Star",
                Self::Target => "Target",
                Self::Tcross => "Tcross",
                Self::TopLeftArrow => "TopLeftArrow",
                Self::TopLeftCorner => "TopLeftCorner",
                Self::TopRightCorner => "TopRightCorner",
                Self::TopSide => "TopSide",
                Self::TopTee => "TopTee",
                Self::Trek => "Trek",
                Self::UlAngle => "UlAngle",
                Self::Umbrella => "Umbrella",
                Self::UrAngle => "UrAngle",
                Self::Watch => "Watch",
                Self::Xterm => "Xterm",
                Self::LastCursor => "LastCursor",
                Self::BlankCursor => "BlankCursor",
                Self::CursorIsPixmap => "CursorIsPixmap",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl IntoGlib for CursorType {
    type GlibType = ffi::GdkCursorType;

    fn into_glib(self) -> ffi::GdkCursorType {
        match self {
            Self::XCursor => ffi::GDK_X_CURSOR,
            Self::Arrow => ffi::GDK_ARROW,
            Self::BasedArrowDown => ffi::GDK_BASED_ARROW_DOWN,
            Self::BasedArrowUp => ffi::GDK_BASED_ARROW_UP,
            Self::Boat => ffi::GDK_BOAT,
            Self::Bogosity => ffi::GDK_BOGOSITY,
            Self::BottomLeftCorner => ffi::GDK_BOTTOM_LEFT_CORNER,
            Self::BottomRightCorner => ffi::GDK_BOTTOM_RIGHT_CORNER,
            Self::BottomSide => ffi::GDK_BOTTOM_SIDE,
            Self::BottomTee => ffi::GDK_BOTTOM_TEE,
            Self::BoxSpiral => ffi::GDK_BOX_SPIRAL,
            Self::CenterPtr => ffi::GDK_CENTER_PTR,
            Self::Circle => ffi::GDK_CIRCLE,
            Self::Clock => ffi::GDK_CLOCK,
            Self::CoffeeMug => ffi::GDK_COFFEE_MUG,
            Self::Cross => ffi::GDK_CROSS,
            Self::CrossReverse => ffi::GDK_CROSS_REVERSE,
            Self::Crosshair => ffi::GDK_CROSSHAIR,
            Self::DiamondCross => ffi::GDK_DIAMOND_CROSS,
            Self::Dot => ffi::GDK_DOT,
            Self::Dotbox => ffi::GDK_DOTBOX,
            Self::DoubleArrow => ffi::GDK_DOUBLE_ARROW,
            Self::DraftLarge => ffi::GDK_DRAFT_LARGE,
            Self::DraftSmall => ffi::GDK_DRAFT_SMALL,
            Self::DrapedBox => ffi::GDK_DRAPED_BOX,
            Self::Exchange => ffi::GDK_EXCHANGE,
            Self::Fleur => ffi::GDK_FLEUR,
            Self::Gobbler => ffi::GDK_GOBBLER,
            Self::Gumby => ffi::GDK_GUMBY,
            Self::Hand1 => ffi::GDK_HAND1,
            Self::Hand2 => ffi::GDK_HAND2,
            Self::Heart => ffi::GDK_HEART,
            Self::Icon => ffi::GDK_ICON,
            Self::IronCross => ffi::GDK_IRON_CROSS,
            Self::LeftPtr => ffi::GDK_LEFT_PTR,
            Self::LeftSide => ffi::GDK_LEFT_SIDE,
            Self::LeftTee => ffi::GDK_LEFT_TEE,
            Self::Leftbutton => ffi::GDK_LEFTBUTTON,
            Self::LlAngle => ffi::GDK_LL_ANGLE,
            Self::LrAngle => ffi::GDK_LR_ANGLE,
            Self::Man => ffi::GDK_MAN,
            Self::Middlebutton => ffi::GDK_MIDDLEBUTTON,
            Self::Mouse => ffi::GDK_MOUSE,
            Self::Pencil => ffi::GDK_PENCIL,
            Self::Pirate => ffi::GDK_PIRATE,
            Self::Plus => ffi::GDK_PLUS,
            Self::QuestionArrow => ffi::GDK_QUESTION_ARROW,
            Self::RightPtr => ffi::GDK_RIGHT_PTR,
            Self::RightSide => ffi::GDK_RIGHT_SIDE,
            Self::RightTee => ffi::GDK_RIGHT_TEE,
            Self::Rightbutton => ffi::GDK_RIGHTBUTTON,
            Self::RtlLogo => ffi::GDK_RTL_LOGO,
            Self::Sailboat => ffi::GDK_SAILBOAT,
            Self::SbDownArrow => ffi::GDK_SB_DOWN_ARROW,
            Self::SbHDoubleArrow => ffi::GDK_SB_H_DOUBLE_ARROW,
            Self::SbLeftArrow => ffi::GDK_SB_LEFT_ARROW,
            Self::SbRightArrow => ffi::GDK_SB_RIGHT_ARROW,
            Self::SbUpArrow => ffi::GDK_SB_UP_ARROW,
            Self::SbVDoubleArrow => ffi::GDK_SB_V_DOUBLE_ARROW,
            Self::Shuttle => ffi::GDK_SHUTTLE,
            Self::Sizing => ffi::GDK_SIZING,
            Self::Spider => ffi::GDK_SPIDER,
            Self::Spraycan => ffi::GDK_SPRAYCAN,
            Self::Star => ffi::GDK_STAR,
            Self::Target => ffi::GDK_TARGET,
            Self::Tcross => ffi::GDK_TCROSS,
            Self::TopLeftArrow => ffi::GDK_TOP_LEFT_ARROW,
            Self::TopLeftCorner => ffi::GDK_TOP_LEFT_CORNER,
            Self::TopRightCorner => ffi::GDK_TOP_RIGHT_CORNER,
            Self::TopSide => ffi::GDK_TOP_SIDE,
            Self::TopTee => ffi::GDK_TOP_TEE,
            Self::Trek => ffi::GDK_TREK,
            Self::UlAngle => ffi::GDK_UL_ANGLE,
            Self::Umbrella => ffi::GDK_UMBRELLA,
            Self::UrAngle => ffi::GDK_UR_ANGLE,
            Self::Watch => ffi::GDK_WATCH,
            Self::Xterm => ffi::GDK_XTERM,
            Self::LastCursor => ffi::GDK_LAST_CURSOR,
            Self::BlankCursor => ffi::GDK_BLANK_CURSOR,
            Self::CursorIsPixmap => ffi::GDK_CURSOR_IS_PIXMAP,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GdkCursorType> for CursorType {
    unsafe fn from_glib(value: ffi::GdkCursorType) -> Self {
        skip_assert_initialized!();
        match value {
            ffi::GDK_X_CURSOR => Self::XCursor,
            ffi::GDK_ARROW => Self::Arrow,
            ffi::GDK_BASED_ARROW_DOWN => Self::BasedArrowDown,
            ffi::GDK_BASED_ARROW_UP => Self::BasedArrowUp,
            ffi::GDK_BOAT => Self::Boat,
            ffi::GDK_BOGOSITY => Self::Bogosity,
            ffi::GDK_BOTTOM_LEFT_CORNER => Self::BottomLeftCorner,
            ffi::GDK_BOTTOM_RIGHT_CORNER => Self::BottomRightCorner,
            ffi::GDK_BOTTOM_SIDE => Self::BottomSide,
            ffi::GDK_BOTTOM_TEE => Self::BottomTee,
            ffi::GDK_BOX_SPIRAL => Self::BoxSpiral,
            ffi::GDK_CENTER_PTR => Self::CenterPtr,
            ffi::GDK_CIRCLE => Self::Circle,
            ffi::GDK_CLOCK => Self::Clock,
            ffi::GDK_COFFEE_MUG => Self::CoffeeMug,
            ffi::GDK_CROSS => Self::Cross,
            ffi::GDK_CROSS_REVERSE => Self::CrossReverse,
            ffi::GDK_CROSSHAIR => Self::Crosshair,
            ffi::GDK_DIAMOND_CROSS => Self::DiamondCross,
            ffi::GDK_DOT => Self::Dot,
            ffi::GDK_DOTBOX => Self::Dotbox,
            ffi::GDK_DOUBLE_ARROW => Self::DoubleArrow,
            ffi::GDK_DRAFT_LARGE => Self::DraftLarge,
            ffi::GDK_DRAFT_SMALL => Self::DraftSmall,
            ffi::GDK_DRAPED_BOX => Self::DrapedBox,
            ffi::GDK_EXCHANGE => Self::Exchange,
            ffi::GDK_FLEUR => Self::Fleur,
            ffi::GDK_GOBBLER => Self::Gobbler,
            ffi::GDK_GUMBY => Self::Gumby,
            ffi::GDK_HAND1 => Self::Hand1,
            ffi::GDK_HAND2 => Self::Hand2,
            ffi::GDK_HEART => Self::Heart,
            ffi::GDK_ICON => Self::Icon,
            ffi::GDK_IRON_CROSS => Self::IronCross,
            ffi::GDK_LEFT_PTR => Self::LeftPtr,
            ffi::GDK_LEFT_SIDE => Self::LeftSide,
            ffi::GDK_LEFT_TEE => Self::LeftTee,
            ffi::GDK_LEFTBUTTON => Self::Leftbutton,
            ffi::GDK_LL_ANGLE => Self::LlAngle,
            ffi::GDK_LR_ANGLE => Self::LrAngle,
            ffi::GDK_MAN => Self::Man,
            ffi::GDK_MIDDLEBUTTON => Self::Middlebutton,
            ffi::GDK_MOUSE => Self::Mouse,
            ffi::GDK_PENCIL => Self::Pencil,
            ffi::GDK_PIRATE => Self::Pirate,
            ffi::GDK_PLUS => Self::Plus,
            ffi::GDK_QUESTION_ARROW => Self::QuestionArrow,
            ffi::GDK_RIGHT_PTR => Self::RightPtr,
            ffi::GDK_RIGHT_SIDE => Self::RightSide,
            ffi::GDK_RIGHT_TEE => Self::RightTee,
            ffi::GDK_RIGHTBUTTON => Self::Rightbutton,
            ffi::GDK_RTL_LOGO => Self::RtlLogo,
            ffi::GDK_SAILBOAT => Self::Sailboat,
            ffi::GDK_SB_DOWN_ARROW => Self::SbDownArrow,
            ffi::GDK_SB_H_DOUBLE_ARROW => Self::SbHDoubleArrow,
            ffi::GDK_SB_LEFT_ARROW => Self::SbLeftArrow,
            ffi::GDK_SB_RIGHT_ARROW => Self::SbRightArrow,
            ffi::GDK_SB_UP_ARROW => Self::SbUpArrow,
            ffi::GDK_SB_V_DOUBLE_ARROW => Self::SbVDoubleArrow,
            ffi::GDK_SHUTTLE => Self::Shuttle,
            ffi::GDK_SIZING => Self::Sizing,
            ffi::GDK_SPIDER => Self::Spider,
            ffi::GDK_SPRAYCAN => Self::Spraycan,
            ffi::GDK_STAR => Self::Star,
            ffi::GDK_TARGET => Self::Target,
            ffi::GDK_TCROSS => Self::Tcross,
            ffi::GDK_TOP_LEFT_ARROW => Self::TopLeftArrow,
            ffi::GDK_TOP_LEFT_CORNER => Self::TopLeftCorner,
            ffi::GDK_TOP_RIGHT_CORNER => Self::TopRightCorner,
            ffi::GDK_TOP_SIDE => Self::TopSide,
            ffi::GDK_TOP_TEE => Self::TopTee,
            ffi::GDK_TREK => Self::Trek,
            ffi::GDK_UL_ANGLE => Self::UlAngle,
            ffi::GDK_UMBRELLA => Self::Umbrella,
            ffi::GDK_UR_ANGLE => Self::UrAngle,
            ffi::GDK_WATCH => Self::Watch,
            ffi::GDK_XTERM => Self::Xterm,
            ffi::GDK_LAST_CURSOR => Self::LastCursor,
            ffi::GDK_BLANK_CURSOR => Self::BlankCursor,
            ffi::GDK_CURSOR_IS_PIXMAP => Self::CursorIsPixmap,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for CursorType {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gdk_cursor_type_get_type()) }
    }
}

impl glib::value::ValueType for CursorType {
    type Type = Self;
}

unsafe impl<'a> FromValue<'a> for CursorType {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for CursorType {
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

/// A pad feature.
#[cfg(any(feature = "v3_22", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkDevicePadFeature")]
pub enum DevicePadFeature {
    /// a button
    #[doc(alias = "GDK_DEVICE_PAD_FEATURE_BUTTON")]
    Button,
    /// a ring-shaped interactive area
    #[doc(alias = "GDK_DEVICE_PAD_FEATURE_RING")]
    Ring,
    /// a straight interactive area
    #[doc(alias = "GDK_DEVICE_PAD_FEATURE_STRIP")]
    Strip,
    #[doc(hidden)]
    __Unknown(i32),
}

#[cfg(any(feature = "v3_22", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
impl fmt::Display for DevicePadFeature {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "DevicePadFeature::{}",
            match *self {
                Self::Button => "Button",
                Self::Ring => "Ring",
                Self::Strip => "Strip",
                _ => "Unknown",
            }
        )
    }
}

#[cfg(any(feature = "v3_22", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
#[doc(hidden)]
impl IntoGlib for DevicePadFeature {
    type GlibType = ffi::GdkDevicePadFeature;

    fn into_glib(self) -> ffi::GdkDevicePadFeature {
        match self {
            Self::Button => ffi::GDK_DEVICE_PAD_FEATURE_BUTTON,
            Self::Ring => ffi::GDK_DEVICE_PAD_FEATURE_RING,
            Self::Strip => ffi::GDK_DEVICE_PAD_FEATURE_STRIP,
            Self::__Unknown(value) => value,
        }
    }
}

#[cfg(any(feature = "v3_22", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
#[doc(hidden)]
impl FromGlib<ffi::GdkDevicePadFeature> for DevicePadFeature {
    unsafe fn from_glib(value: ffi::GdkDevicePadFeature) -> Self {
        skip_assert_initialized!();
        match value {
            ffi::GDK_DEVICE_PAD_FEATURE_BUTTON => Self::Button,
            ffi::GDK_DEVICE_PAD_FEATURE_RING => Self::Ring,
            ffi::GDK_DEVICE_PAD_FEATURE_STRIP => Self::Strip,
            value => Self::__Unknown(value),
        }
    }
}

#[cfg(any(feature = "v3_22", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
impl StaticType for DevicePadFeature {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gdk_device_pad_feature_get_type()) }
    }
}

#[cfg(any(feature = "v3_22", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
impl glib::value::ValueType for DevicePadFeature {
    type Type = Self;
}

#[cfg(any(feature = "v3_22", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
unsafe impl<'a> FromValue<'a> for DevicePadFeature {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

#[cfg(any(feature = "v3_22", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
impl ToValue for DevicePadFeature {
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

/// Indicates the specific type of tool being used being a tablet. Such as an
/// airbrush, pencil, etc.
#[cfg(any(feature = "v3_22", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkDeviceToolType")]
pub enum DeviceToolType {
    /// Tool is of an unknown type.
    #[doc(alias = "GDK_DEVICE_TOOL_TYPE_UNKNOWN")]
    Unknown,
    /// Tool is a standard tablet stylus.
    #[doc(alias = "GDK_DEVICE_TOOL_TYPE_PEN")]
    Pen,
    /// Tool is standard tablet eraser.
    #[doc(alias = "GDK_DEVICE_TOOL_TYPE_ERASER")]
    Eraser,
    /// Tool is a brush stylus.
    #[doc(alias = "GDK_DEVICE_TOOL_TYPE_BRUSH")]
    Brush,
    /// Tool is a pencil stylus.
    #[doc(alias = "GDK_DEVICE_TOOL_TYPE_PENCIL")]
    Pencil,
    /// Tool is an airbrush stylus.
    #[doc(alias = "GDK_DEVICE_TOOL_TYPE_AIRBRUSH")]
    Airbrush,
    /// Tool is a mouse.
    #[doc(alias = "GDK_DEVICE_TOOL_TYPE_MOUSE")]
    Mouse,
    /// Tool is a lens cursor.
    #[doc(alias = "GDK_DEVICE_TOOL_TYPE_LENS")]
    Lens,
    #[doc(hidden)]
    __Unknown(i32),
}

#[cfg(any(feature = "v3_22", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
impl fmt::Display for DeviceToolType {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "DeviceToolType::{}",
            match *self {
                Self::Unknown => "Unknown",
                Self::Pen => "Pen",
                Self::Eraser => "Eraser",
                Self::Brush => "Brush",
                Self::Pencil => "Pencil",
                Self::Airbrush => "Airbrush",
                Self::Mouse => "Mouse",
                Self::Lens => "Lens",
                _ => "Unknown",
            }
        )
    }
}

#[cfg(any(feature = "v3_22", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
#[doc(hidden)]
impl IntoGlib for DeviceToolType {
    type GlibType = ffi::GdkDeviceToolType;

    fn into_glib(self) -> ffi::GdkDeviceToolType {
        match self {
            Self::Unknown => ffi::GDK_DEVICE_TOOL_TYPE_UNKNOWN,
            Self::Pen => ffi::GDK_DEVICE_TOOL_TYPE_PEN,
            Self::Eraser => ffi::GDK_DEVICE_TOOL_TYPE_ERASER,
            Self::Brush => ffi::GDK_DEVICE_TOOL_TYPE_BRUSH,
            Self::Pencil => ffi::GDK_DEVICE_TOOL_TYPE_PENCIL,
            Self::Airbrush => ffi::GDK_DEVICE_TOOL_TYPE_AIRBRUSH,
            Self::Mouse => ffi::GDK_DEVICE_TOOL_TYPE_MOUSE,
            Self::Lens => ffi::GDK_DEVICE_TOOL_TYPE_LENS,
            Self::__Unknown(value) => value,
        }
    }
}

#[cfg(any(feature = "v3_22", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
#[doc(hidden)]
impl FromGlib<ffi::GdkDeviceToolType> for DeviceToolType {
    unsafe fn from_glib(value: ffi::GdkDeviceToolType) -> Self {
        skip_assert_initialized!();
        match value {
            ffi::GDK_DEVICE_TOOL_TYPE_UNKNOWN => Self::Unknown,
            ffi::GDK_DEVICE_TOOL_TYPE_PEN => Self::Pen,
            ffi::GDK_DEVICE_TOOL_TYPE_ERASER => Self::Eraser,
            ffi::GDK_DEVICE_TOOL_TYPE_BRUSH => Self::Brush,
            ffi::GDK_DEVICE_TOOL_TYPE_PENCIL => Self::Pencil,
            ffi::GDK_DEVICE_TOOL_TYPE_AIRBRUSH => Self::Airbrush,
            ffi::GDK_DEVICE_TOOL_TYPE_MOUSE => Self::Mouse,
            ffi::GDK_DEVICE_TOOL_TYPE_LENS => Self::Lens,
            value => Self::__Unknown(value),
        }
    }
}

#[cfg(any(feature = "v3_22", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
impl StaticType for DeviceToolType {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gdk_device_tool_type_get_type()) }
    }
}

#[cfg(any(feature = "v3_22", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
impl glib::value::ValueType for DeviceToolType {
    type Type = Self;
}

#[cfg(any(feature = "v3_22", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
unsafe impl<'a> FromValue<'a> for DeviceToolType {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

#[cfg(any(feature = "v3_22", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
impl ToValue for DeviceToolType {
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

/// Indicates the device type. See [above][GdkDeviceManager.description]
/// for more information about the meaning of these device types.
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkDeviceType")]
pub enum DeviceType {
    /// Device is a master (or virtual) device. There will
    ///  be an associated focus indicator on the screen.
    #[doc(alias = "GDK_DEVICE_TYPE_MASTER")]
    Master,
    /// Device is a slave (or physical) device.
    #[doc(alias = "GDK_DEVICE_TYPE_SLAVE")]
    Slave,
    /// Device is a physical device, currently not attached to
    ///  any virtual device.
    #[doc(alias = "GDK_DEVICE_TYPE_FLOATING")]
    Floating,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for DeviceType {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "DeviceType::{}",
            match *self {
                Self::Master => "Master",
                Self::Slave => "Slave",
                Self::Floating => "Floating",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl IntoGlib for DeviceType {
    type GlibType = ffi::GdkDeviceType;

    fn into_glib(self) -> ffi::GdkDeviceType {
        match self {
            Self::Master => ffi::GDK_DEVICE_TYPE_MASTER,
            Self::Slave => ffi::GDK_DEVICE_TYPE_SLAVE,
            Self::Floating => ffi::GDK_DEVICE_TYPE_FLOATING,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GdkDeviceType> for DeviceType {
    unsafe fn from_glib(value: ffi::GdkDeviceType) -> Self {
        skip_assert_initialized!();
        match value {
            ffi::GDK_DEVICE_TYPE_MASTER => Self::Master,
            ffi::GDK_DEVICE_TYPE_SLAVE => Self::Slave,
            ffi::GDK_DEVICE_TYPE_FLOATING => Self::Floating,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for DeviceType {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gdk_device_type_get_type()) }
    }
}

impl glib::value::ValueType for DeviceType {
    type Type = Self;
}

unsafe impl<'a> FromValue<'a> for DeviceType {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for DeviceType {
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

/// Used in [`DragContext`][crate::DragContext] to the reason of a cancelled DND operation.
#[cfg(any(feature = "v3_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkDragCancelReason")]
pub enum DragCancelReason {
    /// There is no suitable drop target.
    #[doc(alias = "GDK_DRAG_CANCEL_NO_TARGET")]
    NoTarget,
    /// Drag cancelled by the user
    #[doc(alias = "GDK_DRAG_CANCEL_USER_CANCELLED")]
    UserCancelled,
    /// Unspecified error.
    #[doc(alias = "GDK_DRAG_CANCEL_ERROR")]
    Error,
    #[doc(hidden)]
    __Unknown(i32),
}

#[cfg(any(feature = "v3_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
impl fmt::Display for DragCancelReason {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "DragCancelReason::{}",
            match *self {
                Self::NoTarget => "NoTarget",
                Self::UserCancelled => "UserCancelled",
                Self::Error => "Error",
                _ => "Unknown",
            }
        )
    }
}

#[cfg(any(feature = "v3_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
#[doc(hidden)]
impl IntoGlib for DragCancelReason {
    type GlibType = ffi::GdkDragCancelReason;

    fn into_glib(self) -> ffi::GdkDragCancelReason {
        match self {
            Self::NoTarget => ffi::GDK_DRAG_CANCEL_NO_TARGET,
            Self::UserCancelled => ffi::GDK_DRAG_CANCEL_USER_CANCELLED,
            Self::Error => ffi::GDK_DRAG_CANCEL_ERROR,
            Self::__Unknown(value) => value,
        }
    }
}

#[cfg(any(feature = "v3_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
#[doc(hidden)]
impl FromGlib<ffi::GdkDragCancelReason> for DragCancelReason {
    unsafe fn from_glib(value: ffi::GdkDragCancelReason) -> Self {
        skip_assert_initialized!();
        match value {
            ffi::GDK_DRAG_CANCEL_NO_TARGET => Self::NoTarget,
            ffi::GDK_DRAG_CANCEL_USER_CANCELLED => Self::UserCancelled,
            ffi::GDK_DRAG_CANCEL_ERROR => Self::Error,
            value => Self::__Unknown(value),
        }
    }
}

#[cfg(any(feature = "v3_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
impl StaticType for DragCancelReason {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gdk_drag_cancel_reason_get_type()) }
    }
}

#[cfg(any(feature = "v3_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
impl glib::value::ValueType for DragCancelReason {
    type Type = Self;
}

#[cfg(any(feature = "v3_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
unsafe impl<'a> FromValue<'a> for DragCancelReason {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

#[cfg(any(feature = "v3_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
impl ToValue for DragCancelReason {
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

/// Used in [`DragContext`][crate::DragContext] to indicate the protocol according to
/// which DND is done.
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkDragProtocol")]
pub enum DragProtocol {
    /// no protocol.
    #[doc(alias = "GDK_DRAG_PROTO_NONE")]
    None,
    /// The Motif DND protocol. No longer supported
    #[doc(alias = "GDK_DRAG_PROTO_MOTIF")]
    Motif,
    /// The Xdnd protocol.
    #[doc(alias = "GDK_DRAG_PROTO_XDND")]
    Xdnd,
    /// An extension to the Xdnd protocol for
    ///  unclaimed root window drops.
    #[doc(alias = "GDK_DRAG_PROTO_ROOTWIN")]
    Rootwin,
    /// The simple WM_DROPFILES protocol.
    #[doc(alias = "GDK_DRAG_PROTO_WIN32_DROPFILES")]
    Win32Dropfiles,
    /// The complex OLE2 DND protocol (not implemented).
    #[doc(alias = "GDK_DRAG_PROTO_OLE2")]
    Ole2,
    /// Intra-application DND.
    #[doc(alias = "GDK_DRAG_PROTO_LOCAL")]
    Local,
    /// Wayland DND protocol.
    #[doc(alias = "GDK_DRAG_PROTO_WAYLAND")]
    Wayland,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for DragProtocol {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "DragProtocol::{}",
            match *self {
                Self::None => "None",
                Self::Motif => "Motif",
                Self::Xdnd => "Xdnd",
                Self::Rootwin => "Rootwin",
                Self::Win32Dropfiles => "Win32Dropfiles",
                Self::Ole2 => "Ole2",
                Self::Local => "Local",
                Self::Wayland => "Wayland",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl IntoGlib for DragProtocol {
    type GlibType = ffi::GdkDragProtocol;

    fn into_glib(self) -> ffi::GdkDragProtocol {
        match self {
            Self::None => ffi::GDK_DRAG_PROTO_NONE,
            Self::Motif => ffi::GDK_DRAG_PROTO_MOTIF,
            Self::Xdnd => ffi::GDK_DRAG_PROTO_XDND,
            Self::Rootwin => ffi::GDK_DRAG_PROTO_ROOTWIN,
            Self::Win32Dropfiles => ffi::GDK_DRAG_PROTO_WIN32_DROPFILES,
            Self::Ole2 => ffi::GDK_DRAG_PROTO_OLE2,
            Self::Local => ffi::GDK_DRAG_PROTO_LOCAL,
            Self::Wayland => ffi::GDK_DRAG_PROTO_WAYLAND,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GdkDragProtocol> for DragProtocol {
    unsafe fn from_glib(value: ffi::GdkDragProtocol) -> Self {
        skip_assert_initialized!();
        match value {
            ffi::GDK_DRAG_PROTO_NONE => Self::None,
            ffi::GDK_DRAG_PROTO_MOTIF => Self::Motif,
            ffi::GDK_DRAG_PROTO_XDND => Self::Xdnd,
            ffi::GDK_DRAG_PROTO_ROOTWIN => Self::Rootwin,
            ffi::GDK_DRAG_PROTO_WIN32_DROPFILES => Self::Win32Dropfiles,
            ffi::GDK_DRAG_PROTO_OLE2 => Self::Ole2,
            ffi::GDK_DRAG_PROTO_LOCAL => Self::Local,
            ffi::GDK_DRAG_PROTO_WAYLAND => Self::Wayland,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for DragProtocol {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gdk_drag_protocol_get_type()) }
    }
}

impl glib::value::ValueType for DragProtocol {
    type Type = Self;
}

unsafe impl<'a> FromValue<'a> for DragProtocol {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for DragProtocol {
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

/// Specifies the type of the event.
///
/// Do not confuse these events with the signals that GTK+ widgets emit.
/// Although many of these events result in corresponding signals being emitted,
/// the events are often transformed or filtered along the way.
///
/// In some language bindings, the values [`_2buttonPress`][Self::_2buttonPress] and
/// [`_3buttonPress`][Self::_3buttonPress] would translate into something syntactically
/// invalid (eg `Gdk.EventType.2ButtonPress`, where a
/// symbol is not allowed to start with a number). In that case, the
/// aliases [`DoubleButtonPress`][Self::DoubleButtonPress] and [`TripleButtonPress`][Self::TripleButtonPress] can
/// be used instead.
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkEventType")]
pub enum EventType {
    /// a special code to indicate a null event.
    #[doc(alias = "GDK_NOTHING")]
    Nothing,
    /// the window manager has requested that the toplevel window be
    ///  hidden or destroyed, usually when the user clicks on a special icon in the
    ///  title bar.
    #[doc(alias = "GDK_DELETE")]
    Delete,
    /// the window has been destroyed.
    #[doc(alias = "GDK_DESTROY")]
    Destroy,
    /// all or part of the window has become visible and needs to be
    ///  redrawn.
    #[doc(alias = "GDK_EXPOSE")]
    Expose,
    /// the pointer (usually a mouse) has moved.
    #[doc(alias = "GDK_MOTION_NOTIFY")]
    MotionNotify,
    /// a mouse button has been pressed.
    #[doc(alias = "GDK_BUTTON_PRESS")]
    ButtonPress,
    /// alias for [`_2buttonPress`][Self::_2buttonPress], added in 3.6.
    #[doc(alias = "GDK_DOUBLE_BUTTON_PRESS")]
    DoubleButtonPress,
    /// alias for [`_3buttonPress`][Self::_3buttonPress], added in 3.6.
    #[doc(alias = "GDK_TRIPLE_BUTTON_PRESS")]
    TripleButtonPress,
    /// a mouse button has been released.
    #[doc(alias = "GDK_BUTTON_RELEASE")]
    ButtonRelease,
    /// a key has been pressed.
    #[doc(alias = "GDK_KEY_PRESS")]
    KeyPress,
    /// a key has been released.
    #[doc(alias = "GDK_KEY_RELEASE")]
    KeyRelease,
    /// the pointer has entered the window.
    #[doc(alias = "GDK_ENTER_NOTIFY")]
    EnterNotify,
    /// the pointer has left the window.
    #[doc(alias = "GDK_LEAVE_NOTIFY")]
    LeaveNotify,
    /// the keyboard focus has entered or left the window.
    #[doc(alias = "GDK_FOCUS_CHANGE")]
    FocusChange,
    /// the size, position or stacking order of the window has changed.
    ///  Note that GTK+ discards these events for [`WindowType::Child`][crate::WindowType::Child] windows.
    #[doc(alias = "GDK_CONFIGURE")]
    Configure,
    /// the window has been mapped.
    #[doc(alias = "GDK_MAP")]
    Map,
    /// the window has been unmapped.
    #[doc(alias = "GDK_UNMAP")]
    Unmap,
    /// a property on the window has been changed or deleted.
    #[doc(alias = "GDK_PROPERTY_NOTIFY")]
    PropertyNotify,
    /// the application has lost ownership of a selection.
    #[doc(alias = "GDK_SELECTION_CLEAR")]
    SelectionClear,
    /// another application has requested a selection.
    #[doc(alias = "GDK_SELECTION_REQUEST")]
    SelectionRequest,
    /// a selection has been received.
    #[doc(alias = "GDK_SELECTION_NOTIFY")]
    SelectionNotify,
    /// an input device has moved into contact with a sensing
    ///  surface (e.g. a touchscreen or graphics tablet).
    #[doc(alias = "GDK_PROXIMITY_IN")]
    ProximityIn,
    /// an input device has moved out of contact with a sensing
    ///  surface.
    #[doc(alias = "GDK_PROXIMITY_OUT")]
    ProximityOut,
    /// the mouse has entered the window while a drag is in progress.
    #[doc(alias = "GDK_DRAG_ENTER")]
    DragEnter,
    /// the mouse has left the window while a drag is in progress.
    #[doc(alias = "GDK_DRAG_LEAVE")]
    DragLeave,
    /// the mouse has moved in the window while a drag is in
    ///  progress.
    #[doc(alias = "GDK_DRAG_MOTION")]
    DragMotion,
    /// the status of the drag operation initiated by the window
    ///  has changed.
    #[doc(alias = "GDK_DRAG_STATUS")]
    DragStatus,
    /// a drop operation onto the window has started.
    #[doc(alias = "GDK_DROP_START")]
    DropStart,
    /// the drop operation initiated by the window has completed.
    #[doc(alias = "GDK_DROP_FINISHED")]
    DropFinished,
    /// a message has been received from another application.
    #[doc(alias = "GDK_CLIENT_EVENT")]
    ClientEvent,
    /// the window visibility status has changed.
    #[doc(alias = "GDK_VISIBILITY_NOTIFY")]
    VisibilityNotify,
    /// the scroll wheel was turned
    #[doc(alias = "GDK_SCROLL")]
    Scroll,
    /// the state of a window has changed. See [`WindowState`][crate::WindowState]
    ///  for the possible window states
    #[doc(alias = "GDK_WINDOW_STATE")]
    WindowState,
    /// a setting has been modified.
    #[doc(alias = "GDK_SETTING")]
    Setting,
    /// the owner of a selection has changed. This event type
    ///  was added in 2.6
    #[doc(alias = "GDK_OWNER_CHANGE")]
    OwnerChange,
    /// a pointer or keyboard grab was broken. This event type
    ///  was added in 2.8.
    #[doc(alias = "GDK_GRAB_BROKEN")]
    GrabBroken,
    /// the content of the window has been changed. This event type
    ///  was added in 2.14.
    #[doc(alias = "GDK_DAMAGE")]
    Damage,
    /// A new touch event sequence has just started. This event
    ///  type was added in 3.4.
    #[doc(alias = "GDK_TOUCH_BEGIN")]
    TouchBegin,
    /// A touch event sequence has been updated. This event type
    ///  was added in 3.4.
    #[doc(alias = "GDK_TOUCH_UPDATE")]
    TouchUpdate,
    /// A touch event sequence has finished. This event type
    ///  was added in 3.4.
    #[doc(alias = "GDK_TOUCH_END")]
    TouchEnd,
    /// A touch event sequence has been canceled. This event type
    ///  was added in 3.4.
    #[doc(alias = "GDK_TOUCH_CANCEL")]
    TouchCancel,
    /// A touchpad swipe gesture event, the current state
    ///  is determined by its phase field. This event type was added in 3.18.
    #[doc(alias = "GDK_TOUCHPAD_SWIPE")]
    TouchpadSwipe,
    /// A touchpad pinch gesture event, the current state
    ///  is determined by its phase field. This event type was added in 3.18.
    #[doc(alias = "GDK_TOUCHPAD_PINCH")]
    TouchpadPinch,
    /// A tablet pad button press event. This event type
    ///  was added in 3.22.
    #[doc(alias = "GDK_PAD_BUTTON_PRESS")]
    PadButtonPress,
    /// A tablet pad button release event. This event type
    ///  was added in 3.22.
    #[doc(alias = "GDK_PAD_BUTTON_RELEASE")]
    PadButtonRelease,
    /// A tablet pad axis event from a "ring". This event type was
    ///  added in 3.22.
    #[doc(alias = "GDK_PAD_RING")]
    PadRing,
    /// A tablet pad axis event from a "strip". This event type was
    ///  added in 3.22.
    #[doc(alias = "GDK_PAD_STRIP")]
    PadStrip,
    /// A tablet pad group mode change. This event type was
    ///  added in 3.22.
    #[doc(alias = "GDK_PAD_GROUP_MODE")]
    PadGroupMode,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for EventType {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "EventType::{}",
            match *self {
                Self::Nothing => "Nothing",
                Self::Delete => "Delete",
                Self::Destroy => "Destroy",
                Self::Expose => "Expose",
                Self::MotionNotify => "MotionNotify",
                Self::ButtonPress => "ButtonPress",
                Self::DoubleButtonPress => "DoubleButtonPress",
                Self::TripleButtonPress => "TripleButtonPress",
                Self::ButtonRelease => "ButtonRelease",
                Self::KeyPress => "KeyPress",
                Self::KeyRelease => "KeyRelease",
                Self::EnterNotify => "EnterNotify",
                Self::LeaveNotify => "LeaveNotify",
                Self::FocusChange => "FocusChange",
                Self::Configure => "Configure",
                Self::Map => "Map",
                Self::Unmap => "Unmap",
                Self::PropertyNotify => "PropertyNotify",
                Self::SelectionClear => "SelectionClear",
                Self::SelectionRequest => "SelectionRequest",
                Self::SelectionNotify => "SelectionNotify",
                Self::ProximityIn => "ProximityIn",
                Self::ProximityOut => "ProximityOut",
                Self::DragEnter => "DragEnter",
                Self::DragLeave => "DragLeave",
                Self::DragMotion => "DragMotion",
                Self::DragStatus => "DragStatus",
                Self::DropStart => "DropStart",
                Self::DropFinished => "DropFinished",
                Self::ClientEvent => "ClientEvent",
                Self::VisibilityNotify => "VisibilityNotify",
                Self::Scroll => "Scroll",
                Self::WindowState => "WindowState",
                Self::Setting => "Setting",
                Self::OwnerChange => "OwnerChange",
                Self::GrabBroken => "GrabBroken",
                Self::Damage => "Damage",
                Self::TouchBegin => "TouchBegin",
                Self::TouchUpdate => "TouchUpdate",
                Self::TouchEnd => "TouchEnd",
                Self::TouchCancel => "TouchCancel",
                Self::TouchpadSwipe => "TouchpadSwipe",
                Self::TouchpadPinch => "TouchpadPinch",
                Self::PadButtonPress => "PadButtonPress",
                Self::PadButtonRelease => "PadButtonRelease",
                Self::PadRing => "PadRing",
                Self::PadStrip => "PadStrip",
                Self::PadGroupMode => "PadGroupMode",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl IntoGlib for EventType {
    type GlibType = ffi::GdkEventType;

    fn into_glib(self) -> ffi::GdkEventType {
        match self {
            Self::Nothing => ffi::GDK_NOTHING,
            Self::Delete => ffi::GDK_DELETE,
            Self::Destroy => ffi::GDK_DESTROY,
            Self::Expose => ffi::GDK_EXPOSE,
            Self::MotionNotify => ffi::GDK_MOTION_NOTIFY,
            Self::ButtonPress => ffi::GDK_BUTTON_PRESS,
            Self::DoubleButtonPress => ffi::GDK_DOUBLE_BUTTON_PRESS,
            Self::TripleButtonPress => ffi::GDK_TRIPLE_BUTTON_PRESS,
            Self::ButtonRelease => ffi::GDK_BUTTON_RELEASE,
            Self::KeyPress => ffi::GDK_KEY_PRESS,
            Self::KeyRelease => ffi::GDK_KEY_RELEASE,
            Self::EnterNotify => ffi::GDK_ENTER_NOTIFY,
            Self::LeaveNotify => ffi::GDK_LEAVE_NOTIFY,
            Self::FocusChange => ffi::GDK_FOCUS_CHANGE,
            Self::Configure => ffi::GDK_CONFIGURE,
            Self::Map => ffi::GDK_MAP,
            Self::Unmap => ffi::GDK_UNMAP,
            Self::PropertyNotify => ffi::GDK_PROPERTY_NOTIFY,
            Self::SelectionClear => ffi::GDK_SELECTION_CLEAR,
            Self::SelectionRequest => ffi::GDK_SELECTION_REQUEST,
            Self::SelectionNotify => ffi::GDK_SELECTION_NOTIFY,
            Self::ProximityIn => ffi::GDK_PROXIMITY_IN,
            Self::ProximityOut => ffi::GDK_PROXIMITY_OUT,
            Self::DragEnter => ffi::GDK_DRAG_ENTER,
            Self::DragLeave => ffi::GDK_DRAG_LEAVE,
            Self::DragMotion => ffi::GDK_DRAG_MOTION,
            Self::DragStatus => ffi::GDK_DRAG_STATUS,
            Self::DropStart => ffi::GDK_DROP_START,
            Self::DropFinished => ffi::GDK_DROP_FINISHED,
            Self::ClientEvent => ffi::GDK_CLIENT_EVENT,
            Self::VisibilityNotify => ffi::GDK_VISIBILITY_NOTIFY,
            Self::Scroll => ffi::GDK_SCROLL,
            Self::WindowState => ffi::GDK_WINDOW_STATE,
            Self::Setting => ffi::GDK_SETTING,
            Self::OwnerChange => ffi::GDK_OWNER_CHANGE,
            Self::GrabBroken => ffi::GDK_GRAB_BROKEN,
            Self::Damage => ffi::GDK_DAMAGE,
            Self::TouchBegin => ffi::GDK_TOUCH_BEGIN,
            Self::TouchUpdate => ffi::GDK_TOUCH_UPDATE,
            Self::TouchEnd => ffi::GDK_TOUCH_END,
            Self::TouchCancel => ffi::GDK_TOUCH_CANCEL,
            Self::TouchpadSwipe => ffi::GDK_TOUCHPAD_SWIPE,
            Self::TouchpadPinch => ffi::GDK_TOUCHPAD_PINCH,
            Self::PadButtonPress => ffi::GDK_PAD_BUTTON_PRESS,
            Self::PadButtonRelease => ffi::GDK_PAD_BUTTON_RELEASE,
            Self::PadRing => ffi::GDK_PAD_RING,
            Self::PadStrip => ffi::GDK_PAD_STRIP,
            Self::PadGroupMode => ffi::GDK_PAD_GROUP_MODE,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GdkEventType> for EventType {
    unsafe fn from_glib(value: ffi::GdkEventType) -> Self {
        skip_assert_initialized!();
        match value {
            ffi::GDK_NOTHING => Self::Nothing,
            ffi::GDK_DELETE => Self::Delete,
            ffi::GDK_DESTROY => Self::Destroy,
            ffi::GDK_EXPOSE => Self::Expose,
            ffi::GDK_MOTION_NOTIFY => Self::MotionNotify,
            ffi::GDK_BUTTON_PRESS => Self::ButtonPress,
            ffi::GDK_DOUBLE_BUTTON_PRESS => Self::DoubleButtonPress,
            ffi::GDK_TRIPLE_BUTTON_PRESS => Self::TripleButtonPress,
            ffi::GDK_BUTTON_RELEASE => Self::ButtonRelease,
            ffi::GDK_KEY_PRESS => Self::KeyPress,
            ffi::GDK_KEY_RELEASE => Self::KeyRelease,
            ffi::GDK_ENTER_NOTIFY => Self::EnterNotify,
            ffi::GDK_LEAVE_NOTIFY => Self::LeaveNotify,
            ffi::GDK_FOCUS_CHANGE => Self::FocusChange,
            ffi::GDK_CONFIGURE => Self::Configure,
            ffi::GDK_MAP => Self::Map,
            ffi::GDK_UNMAP => Self::Unmap,
            ffi::GDK_PROPERTY_NOTIFY => Self::PropertyNotify,
            ffi::GDK_SELECTION_CLEAR => Self::SelectionClear,
            ffi::GDK_SELECTION_REQUEST => Self::SelectionRequest,
            ffi::GDK_SELECTION_NOTIFY => Self::SelectionNotify,
            ffi::GDK_PROXIMITY_IN => Self::ProximityIn,
            ffi::GDK_PROXIMITY_OUT => Self::ProximityOut,
            ffi::GDK_DRAG_ENTER => Self::DragEnter,
            ffi::GDK_DRAG_LEAVE => Self::DragLeave,
            ffi::GDK_DRAG_MOTION => Self::DragMotion,
            ffi::GDK_DRAG_STATUS => Self::DragStatus,
            ffi::GDK_DROP_START => Self::DropStart,
            ffi::GDK_DROP_FINISHED => Self::DropFinished,
            ffi::GDK_CLIENT_EVENT => Self::ClientEvent,
            ffi::GDK_VISIBILITY_NOTIFY => Self::VisibilityNotify,
            ffi::GDK_SCROLL => Self::Scroll,
            ffi::GDK_WINDOW_STATE => Self::WindowState,
            ffi::GDK_SETTING => Self::Setting,
            ffi::GDK_OWNER_CHANGE => Self::OwnerChange,
            ffi::GDK_GRAB_BROKEN => Self::GrabBroken,
            ffi::GDK_DAMAGE => Self::Damage,
            ffi::GDK_TOUCH_BEGIN => Self::TouchBegin,
            ffi::GDK_TOUCH_UPDATE => Self::TouchUpdate,
            ffi::GDK_TOUCH_END => Self::TouchEnd,
            ffi::GDK_TOUCH_CANCEL => Self::TouchCancel,
            ffi::GDK_TOUCHPAD_SWIPE => Self::TouchpadSwipe,
            ffi::GDK_TOUCHPAD_PINCH => Self::TouchpadPinch,
            ffi::GDK_PAD_BUTTON_PRESS => Self::PadButtonPress,
            ffi::GDK_PAD_BUTTON_RELEASE => Self::PadButtonRelease,
            ffi::GDK_PAD_RING => Self::PadRing,
            ffi::GDK_PAD_STRIP => Self::PadStrip,
            ffi::GDK_PAD_GROUP_MODE => Self::PadGroupMode,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for EventType {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gdk_event_type_get_type()) }
    }
}

impl glib::value::ValueType for EventType {
    type Type = Self;
}

unsafe impl<'a> FromValue<'a> for EventType {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for EventType {
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

/// Indicates which monitor (in a multi-head setup) a window should span over
/// when in fullscreen mode.
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkFullscreenMode")]
pub enum FullscreenMode {
    /// Fullscreen on current monitor only.
    #[doc(alias = "GDK_FULLSCREEN_ON_CURRENT_MONITOR")]
    CurrentMonitor,
    /// Span across all monitors when fullscreen.
    #[doc(alias = "GDK_FULLSCREEN_ON_ALL_MONITORS")]
    AllMonitors,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for FullscreenMode {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "FullscreenMode::{}",
            match *self {
                Self::CurrentMonitor => "CurrentMonitor",
                Self::AllMonitors => "AllMonitors",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl IntoGlib for FullscreenMode {
    type GlibType = ffi::GdkFullscreenMode;

    fn into_glib(self) -> ffi::GdkFullscreenMode {
        match self {
            Self::CurrentMonitor => ffi::GDK_FULLSCREEN_ON_CURRENT_MONITOR,
            Self::AllMonitors => ffi::GDK_FULLSCREEN_ON_ALL_MONITORS,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GdkFullscreenMode> for FullscreenMode {
    unsafe fn from_glib(value: ffi::GdkFullscreenMode) -> Self {
        skip_assert_initialized!();
        match value {
            ffi::GDK_FULLSCREEN_ON_CURRENT_MONITOR => Self::CurrentMonitor,
            ffi::GDK_FULLSCREEN_ON_ALL_MONITORS => Self::AllMonitors,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for FullscreenMode {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gdk_fullscreen_mode_get_type()) }
    }
}

impl glib::value::ValueType for FullscreenMode {
    type Type = Self;
}

unsafe impl<'a> FromValue<'a> for FullscreenMode {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for FullscreenMode {
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

/// Error enumeration for [`GLContext`][crate::GLContext].
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkGLError")]
pub enum GLError {
    /// OpenGL support is not available
    #[doc(alias = "GDK_GL_ERROR_NOT_AVAILABLE")]
    NotAvailable,
    /// The requested visual format is not supported
    #[doc(alias = "GDK_GL_ERROR_UNSUPPORTED_FORMAT")]
    UnsupportedFormat,
    /// The requested profile is not supported
    #[doc(alias = "GDK_GL_ERROR_UNSUPPORTED_PROFILE")]
    UnsupportedProfile,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for GLError {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "GLError::{}",
            match *self {
                Self::NotAvailable => "NotAvailable",
                Self::UnsupportedFormat => "UnsupportedFormat",
                Self::UnsupportedProfile => "UnsupportedProfile",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl IntoGlib for GLError {
    type GlibType = ffi::GdkGLError;

    fn into_glib(self) -> ffi::GdkGLError {
        match self {
            Self::NotAvailable => ffi::GDK_GL_ERROR_NOT_AVAILABLE,
            Self::UnsupportedFormat => ffi::GDK_GL_ERROR_UNSUPPORTED_FORMAT,
            Self::UnsupportedProfile => ffi::GDK_GL_ERROR_UNSUPPORTED_PROFILE,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GdkGLError> for GLError {
    unsafe fn from_glib(value: ffi::GdkGLError) -> Self {
        skip_assert_initialized!();
        match value {
            ffi::GDK_GL_ERROR_NOT_AVAILABLE => Self::NotAvailable,
            ffi::GDK_GL_ERROR_UNSUPPORTED_FORMAT => Self::UnsupportedFormat,
            ffi::GDK_GL_ERROR_UNSUPPORTED_PROFILE => Self::UnsupportedProfile,
            value => Self::__Unknown(value),
        }
    }
}

impl ErrorDomain for GLError {
    fn domain() -> Quark {
        skip_assert_initialized!();

        unsafe { from_glib(ffi::gdk_gl_error_quark()) }
    }

    fn code(self) -> i32 {
        self.into_glib()
    }

    fn from(code: i32) -> Option<Self> {
        skip_assert_initialized!();
        match code {
            ffi::GDK_GL_ERROR_NOT_AVAILABLE => Some(Self::NotAvailable),
            ffi::GDK_GL_ERROR_UNSUPPORTED_FORMAT => Some(Self::UnsupportedFormat),
            ffi::GDK_GL_ERROR_UNSUPPORTED_PROFILE => Some(Self::UnsupportedProfile),
            value => Some(Self::__Unknown(value)),
        }
    }
}

impl StaticType for GLError {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gdk_gl_error_get_type()) }
    }
}

impl glib::value::ValueType for GLError {
    type Type = Self;
}

unsafe impl<'a> FromValue<'a> for GLError {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for GLError {
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

/// Defines how device grabs interact with other devices.
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkGrabOwnership")]
pub enum GrabOwnership {
    /// All other devices’ events are allowed.
    #[doc(alias = "GDK_OWNERSHIP_NONE")]
    None,
    /// Other devices’ events are blocked for the grab window.
    #[doc(alias = "GDK_OWNERSHIP_WINDOW")]
    Window,
    /// Other devices’ events are blocked for the whole application.
    #[doc(alias = "GDK_OWNERSHIP_APPLICATION")]
    Application,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for GrabOwnership {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "GrabOwnership::{}",
            match *self {
                Self::None => "None",
                Self::Window => "Window",
                Self::Application => "Application",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl IntoGlib for GrabOwnership {
    type GlibType = ffi::GdkGrabOwnership;

    fn into_glib(self) -> ffi::GdkGrabOwnership {
        match self {
            Self::None => ffi::GDK_OWNERSHIP_NONE,
            Self::Window => ffi::GDK_OWNERSHIP_WINDOW,
            Self::Application => ffi::GDK_OWNERSHIP_APPLICATION,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GdkGrabOwnership> for GrabOwnership {
    unsafe fn from_glib(value: ffi::GdkGrabOwnership) -> Self {
        skip_assert_initialized!();
        match value {
            ffi::GDK_OWNERSHIP_NONE => Self::None,
            ffi::GDK_OWNERSHIP_WINDOW => Self::Window,
            ffi::GDK_OWNERSHIP_APPLICATION => Self::Application,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for GrabOwnership {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gdk_grab_ownership_get_type()) }
    }
}

impl glib::value::ValueType for GrabOwnership {
    type Type = Self;
}

unsafe impl<'a> FromValue<'a> for GrabOwnership {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for GrabOwnership {
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

/// Returned by [`Device::grab()`][crate::Device::grab()], `gdk_pointer_grab()` and `gdk_keyboard_grab()` to
/// indicate success or the reason for the failure of the grab attempt.
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkGrabStatus")]
pub enum GrabStatus {
    /// the resource was successfully grabbed.
    #[doc(alias = "GDK_GRAB_SUCCESS")]
    Success,
    /// the resource is actively grabbed by another client.
    #[doc(alias = "GDK_GRAB_ALREADY_GRABBED")]
    AlreadyGrabbed,
    /// the resource was grabbed more recently than the
    ///  specified time.
    #[doc(alias = "GDK_GRAB_INVALID_TIME")]
    InvalidTime,
    /// the grab window or the `confine_to` window are not
    ///  viewable.
    #[doc(alias = "GDK_GRAB_NOT_VIEWABLE")]
    NotViewable,
    /// the resource is frozen by an active grab of another client.
    #[doc(alias = "GDK_GRAB_FROZEN")]
    Frozen,
    /// the grab failed for some other reason. Since 3.16
    #[doc(alias = "GDK_GRAB_FAILED")]
    Failed,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for GrabStatus {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "GrabStatus::{}",
            match *self {
                Self::Success => "Success",
                Self::AlreadyGrabbed => "AlreadyGrabbed",
                Self::InvalidTime => "InvalidTime",
                Self::NotViewable => "NotViewable",
                Self::Frozen => "Frozen",
                Self::Failed => "Failed",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl IntoGlib for GrabStatus {
    type GlibType = ffi::GdkGrabStatus;

    fn into_glib(self) -> ffi::GdkGrabStatus {
        match self {
            Self::Success => ffi::GDK_GRAB_SUCCESS,
            Self::AlreadyGrabbed => ffi::GDK_GRAB_ALREADY_GRABBED,
            Self::InvalidTime => ffi::GDK_GRAB_INVALID_TIME,
            Self::NotViewable => ffi::GDK_GRAB_NOT_VIEWABLE,
            Self::Frozen => ffi::GDK_GRAB_FROZEN,
            Self::Failed => ffi::GDK_GRAB_FAILED,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GdkGrabStatus> for GrabStatus {
    unsafe fn from_glib(value: ffi::GdkGrabStatus) -> Self {
        skip_assert_initialized!();
        match value {
            ffi::GDK_GRAB_SUCCESS => Self::Success,
            ffi::GDK_GRAB_ALREADY_GRABBED => Self::AlreadyGrabbed,
            ffi::GDK_GRAB_INVALID_TIME => Self::InvalidTime,
            ffi::GDK_GRAB_NOT_VIEWABLE => Self::NotViewable,
            ffi::GDK_GRAB_FROZEN => Self::Frozen,
            ffi::GDK_GRAB_FAILED => Self::Failed,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for GrabStatus {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gdk_grab_status_get_type()) }
    }
}

impl glib::value::ValueType for GrabStatus {
    type Type = Self;
}

unsafe impl<'a> FromValue<'a> for GrabStatus {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for GrabStatus {
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

/// Defines the reference point of a window and the meaning of coordinates
/// passed to `gtk_window_move()`. See `gtk_window_move()` and the "implementation
/// notes" section of the
/// [Extended Window Manager Hints](http://www.freedesktop.org/Standards/wm-spec)
/// specification for more details.
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkGravity")]
pub enum Gravity {
    /// the reference point is at the top left corner.
    #[doc(alias = "GDK_GRAVITY_NORTH_WEST")]
    NorthWest,
    /// the reference point is in the middle of the top edge.
    #[doc(alias = "GDK_GRAVITY_NORTH")]
    North,
    /// the reference point is at the top right corner.
    #[doc(alias = "GDK_GRAVITY_NORTH_EAST")]
    NorthEast,
    /// the reference point is at the middle of the left edge.
    #[doc(alias = "GDK_GRAVITY_WEST")]
    West,
    /// the reference point is at the center of the window.
    #[doc(alias = "GDK_GRAVITY_CENTER")]
    Center,
    /// the reference point is at the middle of the right edge.
    #[doc(alias = "GDK_GRAVITY_EAST")]
    East,
    /// the reference point is at the lower left corner.
    #[doc(alias = "GDK_GRAVITY_SOUTH_WEST")]
    SouthWest,
    /// the reference point is at the middle of the lower edge.
    #[doc(alias = "GDK_GRAVITY_SOUTH")]
    South,
    /// the reference point is at the lower right corner.
    #[doc(alias = "GDK_GRAVITY_SOUTH_EAST")]
    SouthEast,
    /// the reference point is at the top left corner of the
    ///  window itself, ignoring window manager decorations.
    #[doc(alias = "GDK_GRAVITY_STATIC")]
    Static,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for Gravity {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "Gravity::{}",
            match *self {
                Self::NorthWest => "NorthWest",
                Self::North => "North",
                Self::NorthEast => "NorthEast",
                Self::West => "West",
                Self::Center => "Center",
                Self::East => "East",
                Self::SouthWest => "SouthWest",
                Self::South => "South",
                Self::SouthEast => "SouthEast",
                Self::Static => "Static",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl IntoGlib for Gravity {
    type GlibType = ffi::GdkGravity;

    fn into_glib(self) -> ffi::GdkGravity {
        match self {
            Self::NorthWest => ffi::GDK_GRAVITY_NORTH_WEST,
            Self::North => ffi::GDK_GRAVITY_NORTH,
            Self::NorthEast => ffi::GDK_GRAVITY_NORTH_EAST,
            Self::West => ffi::GDK_GRAVITY_WEST,
            Self::Center => ffi::GDK_GRAVITY_CENTER,
            Self::East => ffi::GDK_GRAVITY_EAST,
            Self::SouthWest => ffi::GDK_GRAVITY_SOUTH_WEST,
            Self::South => ffi::GDK_GRAVITY_SOUTH,
            Self::SouthEast => ffi::GDK_GRAVITY_SOUTH_EAST,
            Self::Static => ffi::GDK_GRAVITY_STATIC,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GdkGravity> for Gravity {
    unsafe fn from_glib(value: ffi::GdkGravity) -> Self {
        skip_assert_initialized!();
        match value {
            ffi::GDK_GRAVITY_NORTH_WEST => Self::NorthWest,
            ffi::GDK_GRAVITY_NORTH => Self::North,
            ffi::GDK_GRAVITY_NORTH_EAST => Self::NorthEast,
            ffi::GDK_GRAVITY_WEST => Self::West,
            ffi::GDK_GRAVITY_CENTER => Self::Center,
            ffi::GDK_GRAVITY_EAST => Self::East,
            ffi::GDK_GRAVITY_SOUTH_WEST => Self::SouthWest,
            ffi::GDK_GRAVITY_SOUTH => Self::South,
            ffi::GDK_GRAVITY_SOUTH_EAST => Self::SouthEast,
            ffi::GDK_GRAVITY_STATIC => Self::Static,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for Gravity {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gdk_gravity_get_type()) }
    }
}

impl glib::value::ValueType for Gravity {
    type Type = Self;
}

unsafe impl<'a> FromValue<'a> for Gravity {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for Gravity {
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

/// An enumeration that describes the mode of an input device.
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkInputMode")]
pub enum InputMode {
    /// the device is disabled and will not report any events.
    #[doc(alias = "GDK_MODE_DISABLED")]
    Disabled,
    /// the device is enabled. The device’s coordinate space
    ///  maps to the entire screen.
    #[doc(alias = "GDK_MODE_SCREEN")]
    Screen,
    /// the device is enabled. The device’s coordinate space
    ///  is mapped to a single window. The manner in which this window
    ///  is chosen is undefined, but it will typically be the same
    ///  way in which the focus window for key events is determined.
    #[doc(alias = "GDK_MODE_WINDOW")]
    Window,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for InputMode {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "InputMode::{}",
            match *self {
                Self::Disabled => "Disabled",
                Self::Screen => "Screen",
                Self::Window => "Window",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl IntoGlib for InputMode {
    type GlibType = ffi::GdkInputMode;

    fn into_glib(self) -> ffi::GdkInputMode {
        match self {
            Self::Disabled => ffi::GDK_MODE_DISABLED,
            Self::Screen => ffi::GDK_MODE_SCREEN,
            Self::Window => ffi::GDK_MODE_WINDOW,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GdkInputMode> for InputMode {
    unsafe fn from_glib(value: ffi::GdkInputMode) -> Self {
        skip_assert_initialized!();
        match value {
            ffi::GDK_MODE_DISABLED => Self::Disabled,
            ffi::GDK_MODE_SCREEN => Self::Screen,
            ffi::GDK_MODE_WINDOW => Self::Window,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for InputMode {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gdk_input_mode_get_type()) }
    }
}

impl glib::value::ValueType for InputMode {
    type Type = Self;
}

unsafe impl<'a> FromValue<'a> for InputMode {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for InputMode {
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

/// An enumeration describing the type of an input device in general terms.
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkInputSource")]
pub enum InputSource {
    /// the device is a mouse. (This will be reported for the core
    ///  pointer, even if it is something else, such as a trackball.)
    #[doc(alias = "GDK_SOURCE_MOUSE")]
    Mouse,
    /// the device is a stylus of a graphics tablet or similar device.
    #[doc(alias = "GDK_SOURCE_PEN")]
    Pen,
    /// the device is an eraser. Typically, this would be the other end
    ///  of a stylus on a graphics tablet.
    #[doc(alias = "GDK_SOURCE_ERASER")]
    Eraser,
    /// the device is a graphics tablet “puck” or similar device.
    #[doc(alias = "GDK_SOURCE_CURSOR")]
    Cursor,
    /// the device is a keyboard.
    #[doc(alias = "GDK_SOURCE_KEYBOARD")]
    Keyboard,
    /// the device is a direct-input touch device, such
    ///  as a touchscreen or tablet. This device type has been added in 3.4.
    #[doc(alias = "GDK_SOURCE_TOUCHSCREEN")]
    Touchscreen,
    /// the device is an indirect touch device, such
    ///  as a touchpad. This device type has been added in 3.4.
    #[doc(alias = "GDK_SOURCE_TOUCHPAD")]
    Touchpad,
    /// the device is a trackpoint. This device type has been
    ///  added in 3.22
    #[doc(alias = "GDK_SOURCE_TRACKPOINT")]
    Trackpoint,
    /// the device is a "pad", a collection of buttons,
    ///  rings and strips found in drawing tablets. This device type has been
    ///  added in 3.22.
    #[doc(alias = "GDK_SOURCE_TABLET_PAD")]
    TabletPad,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for InputSource {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "InputSource::{}",
            match *self {
                Self::Mouse => "Mouse",
                Self::Pen => "Pen",
                Self::Eraser => "Eraser",
                Self::Cursor => "Cursor",
                Self::Keyboard => "Keyboard",
                Self::Touchscreen => "Touchscreen",
                Self::Touchpad => "Touchpad",
                Self::Trackpoint => "Trackpoint",
                Self::TabletPad => "TabletPad",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl IntoGlib for InputSource {
    type GlibType = ffi::GdkInputSource;

    fn into_glib(self) -> ffi::GdkInputSource {
        match self {
            Self::Mouse => ffi::GDK_SOURCE_MOUSE,
            Self::Pen => ffi::GDK_SOURCE_PEN,
            Self::Eraser => ffi::GDK_SOURCE_ERASER,
            Self::Cursor => ffi::GDK_SOURCE_CURSOR,
            Self::Keyboard => ffi::GDK_SOURCE_KEYBOARD,
            Self::Touchscreen => ffi::GDK_SOURCE_TOUCHSCREEN,
            Self::Touchpad => ffi::GDK_SOURCE_TOUCHPAD,
            Self::Trackpoint => ffi::GDK_SOURCE_TRACKPOINT,
            Self::TabletPad => ffi::GDK_SOURCE_TABLET_PAD,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GdkInputSource> for InputSource {
    unsafe fn from_glib(value: ffi::GdkInputSource) -> Self {
        skip_assert_initialized!();
        match value {
            ffi::GDK_SOURCE_MOUSE => Self::Mouse,
            ffi::GDK_SOURCE_PEN => Self::Pen,
            ffi::GDK_SOURCE_ERASER => Self::Eraser,
            ffi::GDK_SOURCE_CURSOR => Self::Cursor,
            ffi::GDK_SOURCE_KEYBOARD => Self::Keyboard,
            ffi::GDK_SOURCE_TOUCHSCREEN => Self::Touchscreen,
            ffi::GDK_SOURCE_TOUCHPAD => Self::Touchpad,
            ffi::GDK_SOURCE_TRACKPOINT => Self::Trackpoint,
            ffi::GDK_SOURCE_TABLET_PAD => Self::TabletPad,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for InputSource {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gdk_input_source_get_type()) }
    }
}

impl glib::value::ValueType for InputSource {
    type Type = Self;
}

unsafe impl<'a> FromValue<'a> for InputSource {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for InputSource {
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

/// This enum is used with [`Keymap::modifier_mask()`][crate::Keymap::modifier_mask()]
/// in order to determine what modifiers the
/// currently used windowing system backend uses for particular
/// purposes. For example, on X11/Windows, the Control key is used for
/// invoking menu shortcuts (accelerators), whereas on Apple computers
/// it’s the Command key (which correspond to [`ModifierType::CONTROL_MASK`][crate::ModifierType::CONTROL_MASK] and
/// [`ModifierType::MOD2_MASK`][crate::ModifierType::MOD2_MASK], respectively).
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkModifierIntent")]
pub enum ModifierIntent {
    /// the primary modifier used to invoke
    ///  menu accelerators.
    #[doc(alias = "GDK_MODIFIER_INTENT_PRIMARY_ACCELERATOR")]
    PrimaryAccelerator,
    /// the modifier used to invoke context menus.
    ///  Note that mouse button 3 always triggers context menus. When this modifier
    ///  is not 0, it additionally triggers context menus when used with mouse button 1.
    #[doc(alias = "GDK_MODIFIER_INTENT_CONTEXT_MENU")]
    ContextMenu,
    /// the modifier used to extend selections
    ///  using `modifier`-click or `modifier`-cursor-key
    #[doc(alias = "GDK_MODIFIER_INTENT_EXTEND_SELECTION")]
    ExtendSelection,
    /// the modifier used to modify selections,
    ///  which in most cases means toggling the clicked item into or out of the selection.
    #[doc(alias = "GDK_MODIFIER_INTENT_MODIFY_SELECTION")]
    ModifySelection,
    /// when any of these modifiers is pressed, the
    ///  key event cannot produce a symbol directly. This is meant to be used for
    ///  input methods, and for use cases like typeahead search.
    #[doc(alias = "GDK_MODIFIER_INTENT_NO_TEXT_INPUT")]
    NoTextInput,
    /// the modifier that switches between keyboard
    ///  groups (AltGr on X11/Windows and Option/Alt on OS X).
    #[doc(alias = "GDK_MODIFIER_INTENT_SHIFT_GROUP")]
    ShiftGroup,
    /// The set of modifier masks accepted
    /// as modifiers in accelerators. Needed because Command is mapped to MOD2 on
    /// OSX, which is widely used, but on X11 MOD2 is NumLock and using that for a
    /// mod key is problematic at best.
    /// Ref: https://bugzilla.gnome.org/show_bug.cgi?id=736125.
    #[doc(alias = "GDK_MODIFIER_INTENT_DEFAULT_MOD_MASK")]
    DefaultModMask,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for ModifierIntent {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "ModifierIntent::{}",
            match *self {
                Self::PrimaryAccelerator => "PrimaryAccelerator",
                Self::ContextMenu => "ContextMenu",
                Self::ExtendSelection => "ExtendSelection",
                Self::ModifySelection => "ModifySelection",
                Self::NoTextInput => "NoTextInput",
                Self::ShiftGroup => "ShiftGroup",
                Self::DefaultModMask => "DefaultModMask",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl IntoGlib for ModifierIntent {
    type GlibType = ffi::GdkModifierIntent;

    fn into_glib(self) -> ffi::GdkModifierIntent {
        match self {
            Self::PrimaryAccelerator => ffi::GDK_MODIFIER_INTENT_PRIMARY_ACCELERATOR,
            Self::ContextMenu => ffi::GDK_MODIFIER_INTENT_CONTEXT_MENU,
            Self::ExtendSelection => ffi::GDK_MODIFIER_INTENT_EXTEND_SELECTION,
            Self::ModifySelection => ffi::GDK_MODIFIER_INTENT_MODIFY_SELECTION,
            Self::NoTextInput => ffi::GDK_MODIFIER_INTENT_NO_TEXT_INPUT,
            Self::ShiftGroup => ffi::GDK_MODIFIER_INTENT_SHIFT_GROUP,
            Self::DefaultModMask => ffi::GDK_MODIFIER_INTENT_DEFAULT_MOD_MASK,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GdkModifierIntent> for ModifierIntent {
    unsafe fn from_glib(value: ffi::GdkModifierIntent) -> Self {
        skip_assert_initialized!();
        match value {
            ffi::GDK_MODIFIER_INTENT_PRIMARY_ACCELERATOR => Self::PrimaryAccelerator,
            ffi::GDK_MODIFIER_INTENT_CONTEXT_MENU => Self::ContextMenu,
            ffi::GDK_MODIFIER_INTENT_EXTEND_SELECTION => Self::ExtendSelection,
            ffi::GDK_MODIFIER_INTENT_MODIFY_SELECTION => Self::ModifySelection,
            ffi::GDK_MODIFIER_INTENT_NO_TEXT_INPUT => Self::NoTextInput,
            ffi::GDK_MODIFIER_INTENT_SHIFT_GROUP => Self::ShiftGroup,
            ffi::GDK_MODIFIER_INTENT_DEFAULT_MOD_MASK => Self::DefaultModMask,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for ModifierIntent {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gdk_modifier_intent_get_type()) }
    }
}

impl glib::value::ValueType for ModifierIntent {
    type Type = Self;
}

unsafe impl<'a> FromValue<'a> for ModifierIntent {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for ModifierIntent {
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

/// Specifies the kind of crossing for [`EventCrossing`][crate::EventCrossing].
///
/// See the X11 protocol specification of LeaveNotify for
/// full details of crossing event generation.
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkNotifyType")]
pub enum NotifyType {
    /// the window is entered from an ancestor or
    ///  left towards an ancestor.
    #[doc(alias = "GDK_NOTIFY_ANCESTOR")]
    Ancestor,
    /// the pointer moves between an ancestor and an
    ///  inferior of the window.
    #[doc(alias = "GDK_NOTIFY_VIRTUAL")]
    Virtual,
    /// the window is entered from an inferior or
    ///  left towards an inferior.
    #[doc(alias = "GDK_NOTIFY_INFERIOR")]
    Inferior,
    /// the window is entered from or left towards
    ///  a window which is neither an ancestor nor an inferior.
    #[doc(alias = "GDK_NOTIFY_NONLINEAR")]
    Nonlinear,
    /// the pointer moves between two windows
    ///  which are not ancestors of each other and the window is part of
    ///  the ancestor chain between one of these windows and their least
    ///  common ancestor.
    #[doc(alias = "GDK_NOTIFY_NONLINEAR_VIRTUAL")]
    NonlinearVirtual,
    /// an unknown type of enter/leave event occurred.
    #[doc(alias = "GDK_NOTIFY_UNKNOWN")]
    Unknown,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for NotifyType {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "NotifyType::{}",
            match *self {
                Self::Ancestor => "Ancestor",
                Self::Virtual => "Virtual",
                Self::Inferior => "Inferior",
                Self::Nonlinear => "Nonlinear",
                Self::NonlinearVirtual => "NonlinearVirtual",
                Self::Unknown => "Unknown",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl IntoGlib for NotifyType {
    type GlibType = ffi::GdkNotifyType;

    fn into_glib(self) -> ffi::GdkNotifyType {
        match self {
            Self::Ancestor => ffi::GDK_NOTIFY_ANCESTOR,
            Self::Virtual => ffi::GDK_NOTIFY_VIRTUAL,
            Self::Inferior => ffi::GDK_NOTIFY_INFERIOR,
            Self::Nonlinear => ffi::GDK_NOTIFY_NONLINEAR,
            Self::NonlinearVirtual => ffi::GDK_NOTIFY_NONLINEAR_VIRTUAL,
            Self::Unknown => ffi::GDK_NOTIFY_UNKNOWN,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GdkNotifyType> for NotifyType {
    unsafe fn from_glib(value: ffi::GdkNotifyType) -> Self {
        skip_assert_initialized!();
        match value {
            ffi::GDK_NOTIFY_ANCESTOR => Self::Ancestor,
            ffi::GDK_NOTIFY_VIRTUAL => Self::Virtual,
            ffi::GDK_NOTIFY_INFERIOR => Self::Inferior,
            ffi::GDK_NOTIFY_NONLINEAR => Self::Nonlinear,
            ffi::GDK_NOTIFY_NONLINEAR_VIRTUAL => Self::NonlinearVirtual,
            ffi::GDK_NOTIFY_UNKNOWN => Self::Unknown,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for NotifyType {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gdk_notify_type_get_type()) }
    }
}

impl glib::value::ValueType for NotifyType {
    type Type = Self;
}

unsafe impl<'a> FromValue<'a> for NotifyType {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for NotifyType {
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

/// Specifies why a selection ownership was changed.
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkOwnerChange")]
pub enum OwnerChange {
    /// some other app claimed the ownership
    #[doc(alias = "GDK_OWNER_CHANGE_NEW_OWNER")]
    NewOwner,
    /// the window was destroyed
    #[doc(alias = "GDK_OWNER_CHANGE_DESTROY")]
    Destroy,
    /// the client was closed
    #[doc(alias = "GDK_OWNER_CHANGE_CLOSE")]
    Close,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for OwnerChange {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "OwnerChange::{}",
            match *self {
                Self::NewOwner => "NewOwner",
                Self::Destroy => "Destroy",
                Self::Close => "Close",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl IntoGlib for OwnerChange {
    type GlibType = ffi::GdkOwnerChange;

    fn into_glib(self) -> ffi::GdkOwnerChange {
        match self {
            Self::NewOwner => ffi::GDK_OWNER_CHANGE_NEW_OWNER,
            Self::Destroy => ffi::GDK_OWNER_CHANGE_DESTROY,
            Self::Close => ffi::GDK_OWNER_CHANGE_CLOSE,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GdkOwnerChange> for OwnerChange {
    unsafe fn from_glib(value: ffi::GdkOwnerChange) -> Self {
        skip_assert_initialized!();
        match value {
            ffi::GDK_OWNER_CHANGE_NEW_OWNER => Self::NewOwner,
            ffi::GDK_OWNER_CHANGE_DESTROY => Self::Destroy,
            ffi::GDK_OWNER_CHANGE_CLOSE => Self::Close,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for OwnerChange {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gdk_owner_change_get_type()) }
    }
}

impl glib::value::ValueType for OwnerChange {
    type Type = Self;
}

unsafe impl<'a> FromValue<'a> for OwnerChange {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for OwnerChange {
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

/// Describes how existing data is combined with new data when
/// using `gdk_property_change()`.
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkPropMode")]
pub enum PropMode {
    /// the new data replaces the existing data.
    #[doc(alias = "GDK_PROP_MODE_REPLACE")]
    Replace,
    /// the new data is prepended to the existing data.
    #[doc(alias = "GDK_PROP_MODE_PREPEND")]
    Prepend,
    /// the new data is appended to the existing data.
    #[doc(alias = "GDK_PROP_MODE_APPEND")]
    Append,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for PropMode {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "PropMode::{}",
            match *self {
                Self::Replace => "Replace",
                Self::Prepend => "Prepend",
                Self::Append => "Append",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl IntoGlib for PropMode {
    type GlibType = ffi::GdkPropMode;

    fn into_glib(self) -> ffi::GdkPropMode {
        match self {
            Self::Replace => ffi::GDK_PROP_MODE_REPLACE,
            Self::Prepend => ffi::GDK_PROP_MODE_PREPEND,
            Self::Append => ffi::GDK_PROP_MODE_APPEND,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GdkPropMode> for PropMode {
    unsafe fn from_glib(value: ffi::GdkPropMode) -> Self {
        skip_assert_initialized!();
        match value {
            ffi::GDK_PROP_MODE_REPLACE => Self::Replace,
            ffi::GDK_PROP_MODE_PREPEND => Self::Prepend,
            ffi::GDK_PROP_MODE_APPEND => Self::Append,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for PropMode {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gdk_prop_mode_get_type()) }
    }
}

impl glib::value::ValueType for PropMode {
    type Type = Self;
}

unsafe impl<'a> FromValue<'a> for PropMode {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for PropMode {
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

/// Specifies the type of a property change for a [`EventProperty`][crate::EventProperty].
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkPropertyState")]
pub enum PropertyState {
    /// the property value was changed.
    #[doc(alias = "GDK_PROPERTY_NEW_VALUE")]
    NewValue,
    /// the property was deleted.
    #[doc(alias = "GDK_PROPERTY_DELETE")]
    Delete,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for PropertyState {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "PropertyState::{}",
            match *self {
                Self::NewValue => "NewValue",
                Self::Delete => "Delete",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl IntoGlib for PropertyState {
    type GlibType = ffi::GdkPropertyState;

    fn into_glib(self) -> ffi::GdkPropertyState {
        match self {
            Self::NewValue => ffi::GDK_PROPERTY_NEW_VALUE,
            Self::Delete => ffi::GDK_PROPERTY_DELETE,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GdkPropertyState> for PropertyState {
    unsafe fn from_glib(value: ffi::GdkPropertyState) -> Self {
        skip_assert_initialized!();
        match value {
            ffi::GDK_PROPERTY_NEW_VALUE => Self::NewValue,
            ffi::GDK_PROPERTY_DELETE => Self::Delete,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for PropertyState {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gdk_property_state_get_type()) }
    }
}

impl glib::value::ValueType for PropertyState {
    type Type = Self;
}

unsafe impl<'a> FromValue<'a> for PropertyState {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for PropertyState {
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

/// Specifies the direction for [`EventScroll`][crate::EventScroll].
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkScrollDirection")]
pub enum ScrollDirection {
    /// the window is scrolled up.
    #[doc(alias = "GDK_SCROLL_UP")]
    Up,
    /// the window is scrolled down.
    #[doc(alias = "GDK_SCROLL_DOWN")]
    Down,
    /// the window is scrolled to the left.
    #[doc(alias = "GDK_SCROLL_LEFT")]
    Left,
    /// the window is scrolled to the right.
    #[doc(alias = "GDK_SCROLL_RIGHT")]
    Right,
    /// the scrolling is determined by the delta values
    ///  in [`EventScroll`][crate::EventScroll]. See `gdk_event_get_scroll_deltas()`. Since: 3.4
    #[doc(alias = "GDK_SCROLL_SMOOTH")]
    Smooth,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for ScrollDirection {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "ScrollDirection::{}",
            match *self {
                Self::Up => "Up",
                Self::Down => "Down",
                Self::Left => "Left",
                Self::Right => "Right",
                Self::Smooth => "Smooth",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl IntoGlib for ScrollDirection {
    type GlibType = ffi::GdkScrollDirection;

    fn into_glib(self) -> ffi::GdkScrollDirection {
        match self {
            Self::Up => ffi::GDK_SCROLL_UP,
            Self::Down => ffi::GDK_SCROLL_DOWN,
            Self::Left => ffi::GDK_SCROLL_LEFT,
            Self::Right => ffi::GDK_SCROLL_RIGHT,
            Self::Smooth => ffi::GDK_SCROLL_SMOOTH,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GdkScrollDirection> for ScrollDirection {
    unsafe fn from_glib(value: ffi::GdkScrollDirection) -> Self {
        skip_assert_initialized!();
        match value {
            ffi::GDK_SCROLL_UP => Self::Up,
            ffi::GDK_SCROLL_DOWN => Self::Down,
            ffi::GDK_SCROLL_LEFT => Self::Left,
            ffi::GDK_SCROLL_RIGHT => Self::Right,
            ffi::GDK_SCROLL_SMOOTH => Self::Smooth,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for ScrollDirection {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gdk_scroll_direction_get_type()) }
    }
}

impl glib::value::ValueType for ScrollDirection {
    type Type = Self;
}

unsafe impl<'a> FromValue<'a> for ScrollDirection {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for ScrollDirection {
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

/// Specifies the kind of modification applied to a setting in a
/// [`EventSetting`][crate::EventSetting].
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkSettingAction")]
pub enum SettingAction {
    /// a setting was added.
    #[doc(alias = "GDK_SETTING_ACTION_NEW")]
    New,
    /// a setting was changed.
    #[doc(alias = "GDK_SETTING_ACTION_CHANGED")]
    Changed,
    /// a setting was deleted.
    #[doc(alias = "GDK_SETTING_ACTION_DELETED")]
    Deleted,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for SettingAction {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "SettingAction::{}",
            match *self {
                Self::New => "New",
                Self::Changed => "Changed",
                Self::Deleted => "Deleted",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl IntoGlib for SettingAction {
    type GlibType = ffi::GdkSettingAction;

    fn into_glib(self) -> ffi::GdkSettingAction {
        match self {
            Self::New => ffi::GDK_SETTING_ACTION_NEW,
            Self::Changed => ffi::GDK_SETTING_ACTION_CHANGED,
            Self::Deleted => ffi::GDK_SETTING_ACTION_DELETED,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GdkSettingAction> for SettingAction {
    unsafe fn from_glib(value: ffi::GdkSettingAction) -> Self {
        skip_assert_initialized!();
        match value {
            ffi::GDK_SETTING_ACTION_NEW => Self::New,
            ffi::GDK_SETTING_ACTION_CHANGED => Self::Changed,
            ffi::GDK_SETTING_ACTION_DELETED => Self::Deleted,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for SettingAction {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gdk_setting_action_get_type()) }
    }
}

impl glib::value::ValueType for SettingAction {
    type Type = Self;
}

unsafe impl<'a> FromValue<'a> for SettingAction {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for SettingAction {
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

/// This enumeration describes how the red, green and blue components
/// of physical pixels on an output device are laid out.
#[cfg(any(feature = "v3_22", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkSubpixelLayout")]
pub enum SubpixelLayout {
    /// The layout is not known
    #[doc(alias = "GDK_SUBPIXEL_LAYOUT_UNKNOWN")]
    Unknown,
    /// Not organized in this way
    #[doc(alias = "GDK_SUBPIXEL_LAYOUT_NONE")]
    None,
    /// The layout is horizontal, the order is RGB
    #[doc(alias = "GDK_SUBPIXEL_LAYOUT_HORIZONTAL_RGB")]
    HorizontalRgb,
    /// The layout is horizontal, the order is BGR
    #[doc(alias = "GDK_SUBPIXEL_LAYOUT_HORIZONTAL_BGR")]
    HorizontalBgr,
    /// The layout is vertical, the order is RGB
    #[doc(alias = "GDK_SUBPIXEL_LAYOUT_VERTICAL_RGB")]
    VerticalRgb,
    /// The layout is vertical, the order is BGR
    #[doc(alias = "GDK_SUBPIXEL_LAYOUT_VERTICAL_BGR")]
    VerticalBgr,
    #[doc(hidden)]
    __Unknown(i32),
}

#[cfg(any(feature = "v3_22", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
impl fmt::Display for SubpixelLayout {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "SubpixelLayout::{}",
            match *self {
                Self::Unknown => "Unknown",
                Self::None => "None",
                Self::HorizontalRgb => "HorizontalRgb",
                Self::HorizontalBgr => "HorizontalBgr",
                Self::VerticalRgb => "VerticalRgb",
                Self::VerticalBgr => "VerticalBgr",
                _ => "Unknown",
            }
        )
    }
}

#[cfg(any(feature = "v3_22", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
#[doc(hidden)]
impl IntoGlib for SubpixelLayout {
    type GlibType = ffi::GdkSubpixelLayout;

    fn into_glib(self) -> ffi::GdkSubpixelLayout {
        match self {
            Self::Unknown => ffi::GDK_SUBPIXEL_LAYOUT_UNKNOWN,
            Self::None => ffi::GDK_SUBPIXEL_LAYOUT_NONE,
            Self::HorizontalRgb => ffi::GDK_SUBPIXEL_LAYOUT_HORIZONTAL_RGB,
            Self::HorizontalBgr => ffi::GDK_SUBPIXEL_LAYOUT_HORIZONTAL_BGR,
            Self::VerticalRgb => ffi::GDK_SUBPIXEL_LAYOUT_VERTICAL_RGB,
            Self::VerticalBgr => ffi::GDK_SUBPIXEL_LAYOUT_VERTICAL_BGR,
            Self::__Unknown(value) => value,
        }
    }
}

#[cfg(any(feature = "v3_22", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
#[doc(hidden)]
impl FromGlib<ffi::GdkSubpixelLayout> for SubpixelLayout {
    unsafe fn from_glib(value: ffi::GdkSubpixelLayout) -> Self {
        skip_assert_initialized!();
        match value {
            ffi::GDK_SUBPIXEL_LAYOUT_UNKNOWN => Self::Unknown,
            ffi::GDK_SUBPIXEL_LAYOUT_NONE => Self::None,
            ffi::GDK_SUBPIXEL_LAYOUT_HORIZONTAL_RGB => Self::HorizontalRgb,
            ffi::GDK_SUBPIXEL_LAYOUT_HORIZONTAL_BGR => Self::HorizontalBgr,
            ffi::GDK_SUBPIXEL_LAYOUT_VERTICAL_RGB => Self::VerticalRgb,
            ffi::GDK_SUBPIXEL_LAYOUT_VERTICAL_BGR => Self::VerticalBgr,
            value => Self::__Unknown(value),
        }
    }
}

#[cfg(any(feature = "v3_22", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
impl StaticType for SubpixelLayout {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gdk_subpixel_layout_get_type()) }
    }
}

#[cfg(any(feature = "v3_22", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
impl glib::value::ValueType for SubpixelLayout {
    type Type = Self;
}

#[cfg(any(feature = "v3_22", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
unsafe impl<'a> FromValue<'a> for SubpixelLayout {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

#[cfg(any(feature = "v3_22", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
impl ToValue for SubpixelLayout {
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

/// Specifies the visiblity status of a window for a [`EventVisibility`][crate::EventVisibility].
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkVisibilityState")]
pub enum VisibilityState {
    /// the window is completely visible.
    #[doc(alias = "GDK_VISIBILITY_UNOBSCURED")]
    Unobscured,
    /// the window is partially visible.
    #[doc(alias = "GDK_VISIBILITY_PARTIAL")]
    Partial,
    /// the window is not visible at all.
    #[doc(alias = "GDK_VISIBILITY_FULLY_OBSCURED")]
    FullyObscured,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for VisibilityState {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "VisibilityState::{}",
            match *self {
                Self::Unobscured => "Unobscured",
                Self::Partial => "Partial",
                Self::FullyObscured => "FullyObscured",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl IntoGlib for VisibilityState {
    type GlibType = ffi::GdkVisibilityState;

    fn into_glib(self) -> ffi::GdkVisibilityState {
        match self {
            Self::Unobscured => ffi::GDK_VISIBILITY_UNOBSCURED,
            Self::Partial => ffi::GDK_VISIBILITY_PARTIAL,
            Self::FullyObscured => ffi::GDK_VISIBILITY_FULLY_OBSCURED,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GdkVisibilityState> for VisibilityState {
    unsafe fn from_glib(value: ffi::GdkVisibilityState) -> Self {
        skip_assert_initialized!();
        match value {
            ffi::GDK_VISIBILITY_UNOBSCURED => Self::Unobscured,
            ffi::GDK_VISIBILITY_PARTIAL => Self::Partial,
            ffi::GDK_VISIBILITY_FULLY_OBSCURED => Self::FullyObscured,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for VisibilityState {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gdk_visibility_state_get_type()) }
    }
}

impl glib::value::ValueType for VisibilityState {
    type Type = Self;
}

unsafe impl<'a> FromValue<'a> for VisibilityState {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for VisibilityState {
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

/// A set of values that describe the manner in which the pixel values
/// for a visual are converted into RGB values for display.
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkVisualType")]
pub enum VisualType {
    /// Each pixel value indexes a grayscale value
    ///  directly.
    #[doc(alias = "GDK_VISUAL_STATIC_GRAY")]
    StaticGray,
    /// Each pixel is an index into a color map that
    ///  maps pixel values into grayscale values. The color map can be
    ///  changed by an application.
    #[doc(alias = "GDK_VISUAL_GRAYSCALE")]
    Grayscale,
    /// Each pixel value is an index into a predefined,
    ///  unmodifiable color map that maps pixel values into RGB values.
    #[doc(alias = "GDK_VISUAL_STATIC_COLOR")]
    StaticColor,
    /// Each pixel is an index into a color map that
    ///  maps pixel values into rgb values. The color map can be changed by
    ///  an application.
    #[doc(alias = "GDK_VISUAL_PSEUDO_COLOR")]
    PseudoColor,
    /// Each pixel value directly contains red, green,
    ///  and blue components. Use [`Visual::red_pixel_details()`][crate::Visual::red_pixel_details()], etc,
    ///  to obtain information about how the components are assembled into
    ///  a pixel value.
    #[doc(alias = "GDK_VISUAL_TRUE_COLOR")]
    TrueColor,
    /// Each pixel value contains red, green, and blue
    ///  components as for [`TrueColor`][Self::TrueColor], but the components are
    ///  mapped via a color table into the final output table instead of
    ///  being converted directly.
    #[doc(alias = "GDK_VISUAL_DIRECT_COLOR")]
    DirectColor,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for VisualType {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "VisualType::{}",
            match *self {
                Self::StaticGray => "StaticGray",
                Self::Grayscale => "Grayscale",
                Self::StaticColor => "StaticColor",
                Self::PseudoColor => "PseudoColor",
                Self::TrueColor => "TrueColor",
                Self::DirectColor => "DirectColor",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl IntoGlib for VisualType {
    type GlibType = ffi::GdkVisualType;

    fn into_glib(self) -> ffi::GdkVisualType {
        match self {
            Self::StaticGray => ffi::GDK_VISUAL_STATIC_GRAY,
            Self::Grayscale => ffi::GDK_VISUAL_GRAYSCALE,
            Self::StaticColor => ffi::GDK_VISUAL_STATIC_COLOR,
            Self::PseudoColor => ffi::GDK_VISUAL_PSEUDO_COLOR,
            Self::TrueColor => ffi::GDK_VISUAL_TRUE_COLOR,
            Self::DirectColor => ffi::GDK_VISUAL_DIRECT_COLOR,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GdkVisualType> for VisualType {
    unsafe fn from_glib(value: ffi::GdkVisualType) -> Self {
        skip_assert_initialized!();
        match value {
            ffi::GDK_VISUAL_STATIC_GRAY => Self::StaticGray,
            ffi::GDK_VISUAL_GRAYSCALE => Self::Grayscale,
            ffi::GDK_VISUAL_STATIC_COLOR => Self::StaticColor,
            ffi::GDK_VISUAL_PSEUDO_COLOR => Self::PseudoColor,
            ffi::GDK_VISUAL_TRUE_COLOR => Self::TrueColor,
            ffi::GDK_VISUAL_DIRECT_COLOR => Self::DirectColor,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for VisualType {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gdk_visual_type_get_type()) }
    }
}

impl glib::value::ValueType for VisualType {
    type Type = Self;
}

unsafe impl<'a> FromValue<'a> for VisualType {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for VisualType {
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

/// Determines a window edge or corner.
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkWindowEdge")]
pub enum WindowEdge {
    /// the top left corner.
    #[doc(alias = "GDK_WINDOW_EDGE_NORTH_WEST")]
    NorthWest,
    /// the top edge.
    #[doc(alias = "GDK_WINDOW_EDGE_NORTH")]
    North,
    /// the top right corner.
    #[doc(alias = "GDK_WINDOW_EDGE_NORTH_EAST")]
    NorthEast,
    /// the left edge.
    #[doc(alias = "GDK_WINDOW_EDGE_WEST")]
    West,
    /// the right edge.
    #[doc(alias = "GDK_WINDOW_EDGE_EAST")]
    East,
    /// the lower left corner.
    #[doc(alias = "GDK_WINDOW_EDGE_SOUTH_WEST")]
    SouthWest,
    /// the lower edge.
    #[doc(alias = "GDK_WINDOW_EDGE_SOUTH")]
    South,
    /// the lower right corner.
    #[doc(alias = "GDK_WINDOW_EDGE_SOUTH_EAST")]
    SouthEast,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for WindowEdge {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "WindowEdge::{}",
            match *self {
                Self::NorthWest => "NorthWest",
                Self::North => "North",
                Self::NorthEast => "NorthEast",
                Self::West => "West",
                Self::East => "East",
                Self::SouthWest => "SouthWest",
                Self::South => "South",
                Self::SouthEast => "SouthEast",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl IntoGlib for WindowEdge {
    type GlibType = ffi::GdkWindowEdge;

    fn into_glib(self) -> ffi::GdkWindowEdge {
        match self {
            Self::NorthWest => ffi::GDK_WINDOW_EDGE_NORTH_WEST,
            Self::North => ffi::GDK_WINDOW_EDGE_NORTH,
            Self::NorthEast => ffi::GDK_WINDOW_EDGE_NORTH_EAST,
            Self::West => ffi::GDK_WINDOW_EDGE_WEST,
            Self::East => ffi::GDK_WINDOW_EDGE_EAST,
            Self::SouthWest => ffi::GDK_WINDOW_EDGE_SOUTH_WEST,
            Self::South => ffi::GDK_WINDOW_EDGE_SOUTH,
            Self::SouthEast => ffi::GDK_WINDOW_EDGE_SOUTH_EAST,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GdkWindowEdge> for WindowEdge {
    unsafe fn from_glib(value: ffi::GdkWindowEdge) -> Self {
        skip_assert_initialized!();
        match value {
            ffi::GDK_WINDOW_EDGE_NORTH_WEST => Self::NorthWest,
            ffi::GDK_WINDOW_EDGE_NORTH => Self::North,
            ffi::GDK_WINDOW_EDGE_NORTH_EAST => Self::NorthEast,
            ffi::GDK_WINDOW_EDGE_WEST => Self::West,
            ffi::GDK_WINDOW_EDGE_EAST => Self::East,
            ffi::GDK_WINDOW_EDGE_SOUTH_WEST => Self::SouthWest,
            ffi::GDK_WINDOW_EDGE_SOUTH => Self::South,
            ffi::GDK_WINDOW_EDGE_SOUTH_EAST => Self::SouthEast,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for WindowEdge {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gdk_window_edge_get_type()) }
    }
}

impl glib::value::ValueType for WindowEdge {
    type Type = Self;
}

unsafe impl<'a> FromValue<'a> for WindowEdge {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for WindowEdge {
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

/// Describes the kind of window.
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkWindowType")]
pub enum WindowType {
    /// root window; this window has no parent, covers the entire
    ///  screen, and is created by the window system
    #[doc(alias = "GDK_WINDOW_ROOT")]
    Root,
    /// toplevel window (used to implement `GtkWindow`)
    #[doc(alias = "GDK_WINDOW_TOPLEVEL")]
    Toplevel,
    /// child window (used to implement e.g. `GtkEntry`)
    #[doc(alias = "GDK_WINDOW_CHILD")]
    Child,
    /// override redirect temporary window (used to implement
    ///  `GtkMenu`)
    #[doc(alias = "GDK_WINDOW_TEMP")]
    Temp,
    /// foreign window (see `gdk_window_foreign_new()`)
    #[doc(alias = "GDK_WINDOW_FOREIGN")]
    Foreign,
    /// offscreen window (see
    ///  [Offscreen Windows][OFFSCREEN-WINDOWS]). Since 2.18
    #[doc(alias = "GDK_WINDOW_OFFSCREEN")]
    Offscreen,
    /// subsurface-based window; This window is visually
    ///  tied to a toplevel, and is moved/stacked with it. Currently this window
    ///  type is only implemented in Wayland. Since 3.14
    #[doc(alias = "GDK_WINDOW_SUBSURFACE")]
    Subsurface,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for WindowType {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "WindowType::{}",
            match *self {
                Self::Root => "Root",
                Self::Toplevel => "Toplevel",
                Self::Child => "Child",
                Self::Temp => "Temp",
                Self::Foreign => "Foreign",
                Self::Offscreen => "Offscreen",
                Self::Subsurface => "Subsurface",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl IntoGlib for WindowType {
    type GlibType = ffi::GdkWindowType;

    fn into_glib(self) -> ffi::GdkWindowType {
        match self {
            Self::Root => ffi::GDK_WINDOW_ROOT,
            Self::Toplevel => ffi::GDK_WINDOW_TOPLEVEL,
            Self::Child => ffi::GDK_WINDOW_CHILD,
            Self::Temp => ffi::GDK_WINDOW_TEMP,
            Self::Foreign => ffi::GDK_WINDOW_FOREIGN,
            Self::Offscreen => ffi::GDK_WINDOW_OFFSCREEN,
            Self::Subsurface => ffi::GDK_WINDOW_SUBSURFACE,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GdkWindowType> for WindowType {
    unsafe fn from_glib(value: ffi::GdkWindowType) -> Self {
        skip_assert_initialized!();
        match value {
            ffi::GDK_WINDOW_ROOT => Self::Root,
            ffi::GDK_WINDOW_TOPLEVEL => Self::Toplevel,
            ffi::GDK_WINDOW_CHILD => Self::Child,
            ffi::GDK_WINDOW_TEMP => Self::Temp,
            ffi::GDK_WINDOW_FOREIGN => Self::Foreign,
            ffi::GDK_WINDOW_OFFSCREEN => Self::Offscreen,
            ffi::GDK_WINDOW_SUBSURFACE => Self::Subsurface,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for WindowType {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gdk_window_type_get_type()) }
    }
}

impl glib::value::ValueType for WindowType {
    type Type = Self;
}

unsafe impl<'a> FromValue<'a> for WindowType {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for WindowType {
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

/// These are hints for the window manager that indicate what type of function
/// the window has. The window manager can use this when determining decoration
/// and behaviour of the window. The hint must be set before mapping the window.
///
/// See the [Extended Window Manager Hints](http://www.freedesktop.org/Standards/wm-spec)
/// specification for more details about window types.
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkWindowTypeHint")]
pub enum WindowTypeHint {
    /// Normal toplevel window.
    #[doc(alias = "GDK_WINDOW_TYPE_HINT_NORMAL")]
    Normal,
    /// Dialog window.
    #[doc(alias = "GDK_WINDOW_TYPE_HINT_DIALOG")]
    Dialog,
    /// Window used to implement a menu; GTK+ uses
    ///  this hint only for torn-off menus, see `GtkTearoffMenuItem`.
    #[doc(alias = "GDK_WINDOW_TYPE_HINT_MENU")]
    Menu,
    /// Window used to implement toolbars.
    #[doc(alias = "GDK_WINDOW_TYPE_HINT_TOOLBAR")]
    Toolbar,
    /// Window used to display a splash
    ///  screen during application startup.
    #[doc(alias = "GDK_WINDOW_TYPE_HINT_SPLASHSCREEN")]
    Splashscreen,
    /// Utility windows which are not detached
    ///  toolbars or dialogs.
    #[doc(alias = "GDK_WINDOW_TYPE_HINT_UTILITY")]
    Utility,
    /// Used for creating dock or panel windows.
    #[doc(alias = "GDK_WINDOW_TYPE_HINT_DOCK")]
    Dock,
    /// Used for creating the desktop background
    ///  window.
    #[doc(alias = "GDK_WINDOW_TYPE_HINT_DESKTOP")]
    Desktop,
    /// A menu that belongs to a menubar.
    #[doc(alias = "GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU")]
    DropdownMenu,
    /// A menu that does not belong to a menubar,
    ///  e.g. a context menu.
    #[doc(alias = "GDK_WINDOW_TYPE_HINT_POPUP_MENU")]
    PopupMenu,
    /// A tooltip.
    #[doc(alias = "GDK_WINDOW_TYPE_HINT_TOOLTIP")]
    Tooltip,
    /// A notification - typically a “bubble”
    ///  that belongs to a status icon.
    #[doc(alias = "GDK_WINDOW_TYPE_HINT_NOTIFICATION")]
    Notification,
    /// A popup from a combo box.
    #[doc(alias = "GDK_WINDOW_TYPE_HINT_COMBO")]
    Combo,
    /// A window that is used to implement a DND cursor.
    #[doc(alias = "GDK_WINDOW_TYPE_HINT_DND")]
    Dnd,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for WindowTypeHint {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "WindowTypeHint::{}",
            match *self {
                Self::Normal => "Normal",
                Self::Dialog => "Dialog",
                Self::Menu => "Menu",
                Self::Toolbar => "Toolbar",
                Self::Splashscreen => "Splashscreen",
                Self::Utility => "Utility",
                Self::Dock => "Dock",
                Self::Desktop => "Desktop",
                Self::DropdownMenu => "DropdownMenu",
                Self::PopupMenu => "PopupMenu",
                Self::Tooltip => "Tooltip",
                Self::Notification => "Notification",
                Self::Combo => "Combo",
                Self::Dnd => "Dnd",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl IntoGlib for WindowTypeHint {
    type GlibType = ffi::GdkWindowTypeHint;

    fn into_glib(self) -> ffi::GdkWindowTypeHint {
        match self {
            Self::Normal => ffi::GDK_WINDOW_TYPE_HINT_NORMAL,
            Self::Dialog => ffi::GDK_WINDOW_TYPE_HINT_DIALOG,
            Self::Menu => ffi::GDK_WINDOW_TYPE_HINT_MENU,
            Self::Toolbar => ffi::GDK_WINDOW_TYPE_HINT_TOOLBAR,
            Self::Splashscreen => ffi::GDK_WINDOW_TYPE_HINT_SPLASHSCREEN,
            Self::Utility => ffi::GDK_WINDOW_TYPE_HINT_UTILITY,
            Self::Dock => ffi::GDK_WINDOW_TYPE_HINT_DOCK,
            Self::Desktop => ffi::GDK_WINDOW_TYPE_HINT_DESKTOP,
            Self::DropdownMenu => ffi::GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU,
            Self::PopupMenu => ffi::GDK_WINDOW_TYPE_HINT_POPUP_MENU,
            Self::Tooltip => ffi::GDK_WINDOW_TYPE_HINT_TOOLTIP,
            Self::Notification => ffi::GDK_WINDOW_TYPE_HINT_NOTIFICATION,
            Self::Combo => ffi::GDK_WINDOW_TYPE_HINT_COMBO,
            Self::Dnd => ffi::GDK_WINDOW_TYPE_HINT_DND,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GdkWindowTypeHint> for WindowTypeHint {
    unsafe fn from_glib(value: ffi::GdkWindowTypeHint) -> Self {
        skip_assert_initialized!();
        match value {
            ffi::GDK_WINDOW_TYPE_HINT_NORMAL => Self::Normal,
            ffi::GDK_WINDOW_TYPE_HINT_DIALOG => Self::Dialog,
            ffi::GDK_WINDOW_TYPE_HINT_MENU => Self::Menu,
            ffi::GDK_WINDOW_TYPE_HINT_TOOLBAR => Self::Toolbar,
            ffi::GDK_WINDOW_TYPE_HINT_SPLASHSCREEN => Self::Splashscreen,
            ffi::GDK_WINDOW_TYPE_HINT_UTILITY => Self::Utility,
            ffi::GDK_WINDOW_TYPE_HINT_DOCK => Self::Dock,
            ffi::GDK_WINDOW_TYPE_HINT_DESKTOP => Self::Desktop,
            ffi::GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU => Self::DropdownMenu,
            ffi::GDK_WINDOW_TYPE_HINT_POPUP_MENU => Self::PopupMenu,
            ffi::GDK_WINDOW_TYPE_HINT_TOOLTIP => Self::Tooltip,
            ffi::GDK_WINDOW_TYPE_HINT_NOTIFICATION => Self::Notification,
            ffi::GDK_WINDOW_TYPE_HINT_COMBO => Self::Combo,
            ffi::GDK_WINDOW_TYPE_HINT_DND => Self::Dnd,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for WindowTypeHint {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gdk_window_type_hint_get_type()) }
    }
}

impl glib::value::ValueType for WindowTypeHint {
    type Type = Self;
}

unsafe impl<'a> FromValue<'a> for WindowTypeHint {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for WindowTypeHint {
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

/// [`InputOutput`][Self::InputOutput] windows are the standard kind of window you might expect.
/// Such windows receive events and are also displayed on screen.
/// [`InputOnly`][Self::InputOnly] windows are invisible; they are usually placed above other
/// windows in order to trap or filter the events. You can’t draw on
/// [`InputOnly`][Self::InputOnly] windows.
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkWindowWindowClass")]
pub enum WindowWindowClass {
    /// window for graphics and events
    #[doc(alias = "GDK_INPUT_OUTPUT")]
    InputOutput,
    /// window for events only
    #[doc(alias = "GDK_INPUT_ONLY")]
    InputOnly,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for WindowWindowClass {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "WindowWindowClass::{}",
            match *self {
                Self::InputOutput => "InputOutput",
                Self::InputOnly => "InputOnly",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl IntoGlib for WindowWindowClass {
    type GlibType = ffi::GdkWindowWindowClass;

    fn into_glib(self) -> ffi::GdkWindowWindowClass {
        match self {
            Self::InputOutput => ffi::GDK_INPUT_OUTPUT,
            Self::InputOnly => ffi::GDK_INPUT_ONLY,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GdkWindowWindowClass> for WindowWindowClass {
    unsafe fn from_glib(value: ffi::GdkWindowWindowClass) -> Self {
        skip_assert_initialized!();
        match value {
            ffi::GDK_INPUT_OUTPUT => Self::InputOutput,
            ffi::GDK_INPUT_ONLY => Self::InputOnly,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for WindowWindowClass {
    fn static_type() -> Type {
        unsafe { from_glib(ffi::gdk_window_window_class_get_type()) }
    }
}

impl glib::value::ValueType for WindowWindowClass {
    type Type = Self;
}

unsafe impl<'a> FromValue<'a> for WindowWindowClass {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for WindowWindowClass {
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}