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
// 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 atk_sys;
use glib::translate::*;
use glib::value::FromValue;
use glib::value::FromValueOptional;
use glib::value::SetValue;
use glib::value::Value;
use glib::StaticType;
use glib::Type;
use gobject_sys;
use std::fmt;

/// Specifies how xy coordinates are to be interpreted. Used by functions such
/// as `Component::get_position` and `Text::get_character_extents`
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum CoordType {
    /// specifies xy coordinates relative to the screen
    Screen,
    /// specifies xy coordinates relative to the widget's
    /// top-level window
    Window,
    /// specifies xy coordinates relative to the widget's
    /// immediate parent. Since: 2.30
    Parent,
    #[doc(hidden)]
    __Unknown(i32),
}

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

#[doc(hidden)]
impl ToGlib for CoordType {
    type GlibType = atk_sys::AtkCoordType;

    fn to_glib(&self) -> atk_sys::AtkCoordType {
        match *self {
            CoordType::Screen => atk_sys::ATK_XY_SCREEN,
            CoordType::Window => atk_sys::ATK_XY_WINDOW,
            CoordType::Parent => atk_sys::ATK_XY_PARENT,
            CoordType::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<atk_sys::AtkCoordType> for CoordType {
    fn from_glib(value: atk_sys::AtkCoordType) -> Self {
        skip_assert_initialized!();
        match value {
            0 => CoordType::Screen,
            1 => CoordType::Window,
            2 => CoordType::Parent,
            value => CoordType::__Unknown(value),
        }
    }
}

impl StaticType for CoordType {
    fn static_type() -> Type {
        unsafe { from_glib(atk_sys::atk_coord_type_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for CoordType {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for CoordType {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for CoordType {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

/// Describes the layer of a component
///
/// These enumerated "layer values" are used when determining which UI
/// rendering layer a component is drawn into, which can help in making
/// determinations of when components occlude one another.
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum Layer {
    /// The object does not have a layer
    Invalid,
    /// This layer is reserved for the desktop background
    Background,
    /// This layer is used for Canvas components
    Canvas,
    /// This layer is normally used for components
    Widget,
    /// This layer is used for layered components
    Mdi,
    /// This layer is used for popup components, such as menus
    Popup,
    /// This layer is reserved for future use.
    Overlay,
    /// This layer is used for toplevel windows.
    Window,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for Layer {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "Layer::{}",
            match *self {
                Layer::Invalid => "Invalid",
                Layer::Background => "Background",
                Layer::Canvas => "Canvas",
                Layer::Widget => "Widget",
                Layer::Mdi => "Mdi",
                Layer::Popup => "Popup",
                Layer::Overlay => "Overlay",
                Layer::Window => "Window",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for Layer {
    type GlibType = atk_sys::AtkLayer;

    fn to_glib(&self) -> atk_sys::AtkLayer {
        match *self {
            Layer::Invalid => atk_sys::ATK_LAYER_INVALID,
            Layer::Background => atk_sys::ATK_LAYER_BACKGROUND,
            Layer::Canvas => atk_sys::ATK_LAYER_CANVAS,
            Layer::Widget => atk_sys::ATK_LAYER_WIDGET,
            Layer::Mdi => atk_sys::ATK_LAYER_MDI,
            Layer::Popup => atk_sys::ATK_LAYER_POPUP,
            Layer::Overlay => atk_sys::ATK_LAYER_OVERLAY,
            Layer::Window => atk_sys::ATK_LAYER_WINDOW,
            Layer::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<atk_sys::AtkLayer> for Layer {
    fn from_glib(value: atk_sys::AtkLayer) -> Self {
        skip_assert_initialized!();
        match value {
            0 => Layer::Invalid,
            1 => Layer::Background,
            2 => Layer::Canvas,
            3 => Layer::Widget,
            4 => Layer::Mdi,
            5 => Layer::Popup,
            6 => Layer::Overlay,
            7 => Layer::Window,
            value => Layer::__Unknown(value),
        }
    }
}

impl StaticType for Layer {
    fn static_type() -> Type {
        unsafe { from_glib(atk_sys::atk_layer_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for Layer {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for Layer {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for Layer {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

/// Describes the type of the relation
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum RelationType {
    /// Not used, represens "no relationship" or an error condition.
    Null,
    /// Indicates an object controlled by one or more target objects.
    ControlledBy,
    /// Indicates an object is an controller for one or more target objects.
    ControllerFor,
    /// Indicates an object is a label for one or more target objects.
    LabelFor,
    /// Indicates an object is labelled by one or more target objects.
    LabelledBy,
    /// Indicates an object is a member of a group of one or more target objects.
    MemberOf,
    /// Indicates an object is a cell in a treetable which is displayed because a cell in the same column is expanded and identifies that cell.
    NodeChildOf,
    /// Indicates that the object has content that flows logically to another
    ///  AtkObject in a sequential way, (for instance text-flow).
    FlowsTo,
    /// Indicates that the object has content that flows logically from
    ///  another AtkObject in a sequential way, (for instance text-flow).
    FlowsFrom,
    /// Indicates a subwindow attached to a component but otherwise has no connection in the UI heirarchy to that component.
    SubwindowOf,
    /// Indicates that the object visually embeds
    ///  another object's content, i.e. this object's content flows around
    ///  another's content.
    Embeds,
    /// Reciprocal of `RelationType::Embeds`, indicates that
    ///  this object's content is visualy embedded in another object.
    EmbeddedBy,
    /// Indicates that an object is a popup for another object.
    PopupFor,
    /// Indicates that an object is a parent window of another object.
    ParentWindowOf,
    /// Reciprocal of `RelationType::DescriptionFor`. Indicates that one
    /// or more target objects provide descriptive information about this object. This relation
    /// type is most appropriate for information that is not essential as its presentation may
    /// be user-configurable and/or limited to an on-demand mechanism such as an assistive
    /// technology command. For brief, essential information such as can be found in a widget's
    /// on-screen label, use `RelationType::LabelledBy`. For an on-screen error message, use
    /// `RelationType::ErrorMessage`. For lengthy extended descriptive information contained in
    /// an on-screen object, consider using `RelationType::Details` as assistive technologies may
    /// provide a means for the user to navigate to objects containing detailed descriptions so
    /// that their content can be more closely reviewed.
    DescribedBy,
    /// Reciprocal of `RelationType::DescribedBy`. Indicates that this
    /// object provides descriptive information about the target object(s). See also
    /// `RelationType::DetailsFor` and `RelationType::ErrorFor`.
    DescriptionFor,
    /// Indicates an object is a cell in a treetable and is expanded to display other cells in the same column.
    NodeParentOf,
    /// Reciprocal of `RelationType::DetailsFor`. Indicates that this object
    /// has a detailed or extended description, the contents of which can be found in the target
    /// object(s). This relation type is most appropriate for information that is sufficiently
    /// lengthy as to make navigation to the container of that information desirable. For less
    /// verbose information suitable for announcement only, see `RelationType::DescribedBy`. If
    /// the detailed information describes an error condition, `RelationType::ErrorFor` should be
    /// used instead. `Since`: ATK-2.26.
    Details,
    /// Reciprocal of `RelationType::Details`. Indicates that this object
    /// provides a detailed or extended description about the target object(s). See also
    /// `RelationType::DescriptionFor` and `RelationType::ErrorFor`. `Since`: ATK-2.26.
    DetailsFor,
    /// Reciprocal of `RelationType::ErrorFor`. Indicates that this object
    /// has one or more errors, the nature of which is described in the contents of the target
    /// object(s). Objects that have this relation type should also contain `StateType::InvalidEntry`
    /// in their `StateSet`. `Since`: ATK-2.26.
    ErrorMessage,
    /// Reciprocal of `RelationType::ErrorMessage`. Indicates that this object
    /// contains an error message describing an invalid condition in the target object(s). `Since`:
    /// ATK_2.26.
    ErrorFor,
    /// Not used, this value indicates the end of the enumeration.
    LastDefined,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for RelationType {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "RelationType::{}",
            match *self {
                RelationType::Null => "Null",
                RelationType::ControlledBy => "ControlledBy",
                RelationType::ControllerFor => "ControllerFor",
                RelationType::LabelFor => "LabelFor",
                RelationType::LabelledBy => "LabelledBy",
                RelationType::MemberOf => "MemberOf",
                RelationType::NodeChildOf => "NodeChildOf",
                RelationType::FlowsTo => "FlowsTo",
                RelationType::FlowsFrom => "FlowsFrom",
                RelationType::SubwindowOf => "SubwindowOf",
                RelationType::Embeds => "Embeds",
                RelationType::EmbeddedBy => "EmbeddedBy",
                RelationType::PopupFor => "PopupFor",
                RelationType::ParentWindowOf => "ParentWindowOf",
                RelationType::DescribedBy => "DescribedBy",
                RelationType::DescriptionFor => "DescriptionFor",
                RelationType::NodeParentOf => "NodeParentOf",
                RelationType::Details => "Details",
                RelationType::DetailsFor => "DetailsFor",
                RelationType::ErrorMessage => "ErrorMessage",
                RelationType::ErrorFor => "ErrorFor",
                RelationType::LastDefined => "LastDefined",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for RelationType {
    type GlibType = atk_sys::AtkRelationType;

    fn to_glib(&self) -> atk_sys::AtkRelationType {
        match *self {
            RelationType::Null => atk_sys::ATK_RELATION_NULL,
            RelationType::ControlledBy => atk_sys::ATK_RELATION_CONTROLLED_BY,
            RelationType::ControllerFor => atk_sys::ATK_RELATION_CONTROLLER_FOR,
            RelationType::LabelFor => atk_sys::ATK_RELATION_LABEL_FOR,
            RelationType::LabelledBy => atk_sys::ATK_RELATION_LABELLED_BY,
            RelationType::MemberOf => atk_sys::ATK_RELATION_MEMBER_OF,
            RelationType::NodeChildOf => atk_sys::ATK_RELATION_NODE_CHILD_OF,
            RelationType::FlowsTo => atk_sys::ATK_RELATION_FLOWS_TO,
            RelationType::FlowsFrom => atk_sys::ATK_RELATION_FLOWS_FROM,
            RelationType::SubwindowOf => atk_sys::ATK_RELATION_SUBWINDOW_OF,
            RelationType::Embeds => atk_sys::ATK_RELATION_EMBEDS,
            RelationType::EmbeddedBy => atk_sys::ATK_RELATION_EMBEDDED_BY,
            RelationType::PopupFor => atk_sys::ATK_RELATION_POPUP_FOR,
            RelationType::ParentWindowOf => atk_sys::ATK_RELATION_PARENT_WINDOW_OF,
            RelationType::DescribedBy => atk_sys::ATK_RELATION_DESCRIBED_BY,
            RelationType::DescriptionFor => atk_sys::ATK_RELATION_DESCRIPTION_FOR,
            RelationType::NodeParentOf => atk_sys::ATK_RELATION_NODE_PARENT_OF,
            RelationType::Details => atk_sys::ATK_RELATION_DETAILS,
            RelationType::DetailsFor => atk_sys::ATK_RELATION_DETAILS_FOR,
            RelationType::ErrorMessage => atk_sys::ATK_RELATION_ERROR_MESSAGE,
            RelationType::ErrorFor => atk_sys::ATK_RELATION_ERROR_FOR,
            RelationType::LastDefined => atk_sys::ATK_RELATION_LAST_DEFINED,
            RelationType::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<atk_sys::AtkRelationType> for RelationType {
    fn from_glib(value: atk_sys::AtkRelationType) -> Self {
        skip_assert_initialized!();
        match value {
            0 => RelationType::Null,
            1 => RelationType::ControlledBy,
            2 => RelationType::ControllerFor,
            3 => RelationType::LabelFor,
            4 => RelationType::LabelledBy,
            5 => RelationType::MemberOf,
            6 => RelationType::NodeChildOf,
            7 => RelationType::FlowsTo,
            8 => RelationType::FlowsFrom,
            9 => RelationType::SubwindowOf,
            10 => RelationType::Embeds,
            11 => RelationType::EmbeddedBy,
            12 => RelationType::PopupFor,
            13 => RelationType::ParentWindowOf,
            14 => RelationType::DescribedBy,
            15 => RelationType::DescriptionFor,
            16 => RelationType::NodeParentOf,
            17 => RelationType::Details,
            18 => RelationType::DetailsFor,
            19 => RelationType::ErrorMessage,
            20 => RelationType::ErrorFor,
            21 => RelationType::LastDefined,
            value => RelationType::__Unknown(value),
        }
    }
}

impl StaticType for RelationType {
    fn static_type() -> Type {
        unsafe { from_glib(atk_sys::atk_relation_type_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for RelationType {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for RelationType {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for RelationType {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

/// Describes the role of an object
///
/// These are the built-in enumerated roles that UI components can have
/// in ATK. Other roles may be added at runtime, so an AtkRole >=
/// `Role::LastDefined` is not necessarily an error.
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum Role {
    /// Invalid role
    Invalid,
    /// A label which represents an accelerator
    AcceleratorLabel,
    /// An object which is an alert to the user. Assistive Technologies typically respond to ATK_ROLE_ALERT by reading the entire onscreen contents of containers advertising this role. Should be used for warning dialogs, etc.
    Alert,
    /// An object which is an animated image
    Animation,
    /// An arrow in one of the four cardinal directions
    Arrow,
    /// An object that displays a calendar and allows the user to select a date
    Calendar,
    /// An object that can be drawn into and is used to trap events
    Canvas,
    /// A choice that can be checked or unchecked and provides a separate indicator for the current state
    CheckBox,
    /// A menu item with a check box
    CheckMenuItem,
    /// A specialized dialog that lets the user choose a color
    ColorChooser,
    /// The header for a column of data
    ColumnHeader,
    /// A collapsible list of choices the user can select from
    ComboBox,
    /// An object whose purpose is to allow a user to edit a date
    DateEditor,
    /// An inconifed internal frame within a DESKTOP_PANE
    DesktopIcon,
    /// A pane that supports internal frames and iconified versions of those internal frames
    DesktopFrame,
    /// An object whose purpose is to allow a user to set a value
    Dial,
    /// A top level window with title bar and a border
    Dialog,
    /// A pane that allows the user to navigate through and select the contents of a directory
    DirectoryPane,
    /// An object used for drawing custom user interface elements
    DrawingArea,
    /// A specialized dialog that lets the user choose a file
    FileChooser,
    /// A object that fills up space in a user interface
    Filler,
    /// A specialized dialog that lets the user choose a font
    FontChooser,
    /// A top level window with a title bar, border, menubar, etc.
    Frame,
    /// A pane that is guaranteed to be painted on top of all panes beneath it
    GlassPane,
    /// A document container for HTML, whose children represent the document content
    HtmlContainer,
    /// A small fixed size picture, typically used to decorate components
    Icon,
    /// An object whose primary purpose is to display an image
    Image,
    /// A frame-like object that is clipped by a desktop pane
    InternalFrame,
    /// An object used to present an icon or short string in an interface
    Label,
    /// A specialized pane that allows its children to be drawn in layers, providing a form of stacking order
    LayeredPane,
    /// An object that presents a list of objects to the user and allows the user to select one or more of them
    List,
    /// An object that represents an element of a list
    ListItem,
    /// An object usually found inside a menu bar that contains a list of actions the user can choose from
    Menu,
    /// An object usually drawn at the top of the primary dialog box of an application that contains a list of menus the user can choose from
    MenuBar,
    /// An object usually contained in a menu that presents an action the user can choose
    MenuItem,
    /// A specialized pane whose primary use is inside a DIALOG
    OptionPane,
    /// An object that is a child of a page tab list
    PageTab,
    /// An object that presents a series of panels (or page tabs), one at a time, through some mechanism provided by the object
    PageTabList,
    /// A generic container that is often used to group objects
    Panel,
    /// A text object uses for passwords, or other places where the text content is not shown visibly to the user
    PasswordText,
    /// A temporary window that is usually used to offer the user a list of choices, and then hides when the user selects one of those choices
    PopupMenu,
    /// An object used to indicate how much of a task has been completed
    ProgressBar,
    /// An object the user can manipulate to tell the application to do something
    PushButton,
    /// A specialized check box that will cause other radio buttons in the same group to become unchecked when this one is checked
    RadioButton,
    /// A check menu item which belongs to a group. At each instant exactly one of the radio menu items from a group is selected
    RadioMenuItem,
    /// A specialized pane that has a glass pane and a layered pane as its children
    RootPane,
    /// The header for a row of data
    RowHeader,
    /// An object usually used to allow a user to incrementally view a large amount of data.
    ScrollBar,
    /// An object that allows a user to incrementally view a large amount of information
    ScrollPane,
    /// An object usually contained in a menu to provide a visible and logical separation of the contents in a menu
    Separator,
    /// An object that allows the user to select from a bounded range
    Slider,
    /// A specialized panel that presents two other panels at the same time
    SplitPane,
    /// An object used to get an integer or floating point number from the user
    SpinButton,
    /// An object which reports messages of minor importance to the user
    Statusbar,
    /// An object used to represent information in terms of rows and columns
    Table,
    /// A cell in a table
    TableCell,
    /// The header for a column of a table
    TableColumnHeader,
    /// The header for a row of a table
    TableRowHeader,
    /// A menu item used to tear off and reattach its menu
    TearOffMenuItem,
    /// An object that represents an accessible terminal. (Since: 0.6)
    Terminal,
    /// An interactive widget that supports multiple lines of text and
    /// optionally accepts user input, but whose purpose is not to solicit user input.
    /// Thus ATK_ROLE_TEXT is appropriate for the text view in a plain text editor
    /// but inappropriate for an input field in a dialog box or web form. For widgets
    /// whose purpose is to solicit input from the user, see ATK_ROLE_ENTRY and
    /// ATK_ROLE_PASSWORD_TEXT. For generic objects which display a brief amount of
    /// textual information, see ATK_ROLE_STATIC.
    Text,
    /// A specialized push button that can be checked or unchecked, but does not provide a separate indicator for the current state
    ToggleButton,
    /// A bar or palette usually composed of push buttons or toggle buttons
    ToolBar,
    /// An object that provides information about another object
    ToolTip,
    /// An object used to represent hierarchical information to the user
    Tree,
    /// An object capable of expanding and collapsing rows as well as showing multiple columns of data. (Since: 0.7)
    TreeTable,
    /// The object contains some Accessible information, but its role is not known
    Unknown,
    /// An object usually used in a scroll pane
    Viewport,
    /// A top level window with no title or border.
    Window,
    /// An object that serves as a document header. (Since: 1.1.1)
    Header,
    /// An object that serves as a document footer. (Since: 1.1.1)
    Footer,
    /// An object which is contains a paragraph of text content. (Since: 1.1.1)
    Paragraph,
    /// An object which describes margins and tab stops, etc. for text objects which it controls (should have CONTROLLER_FOR relation to such). (Since: 1.1.1)
    Ruler,
    /// The object is an application object, which may contain `Role::Frame` objects or other types of accessibles. The root accessible of any application's ATK hierarchy should have ATK_ROLE_APPLICATION. (Since: 1.1.4)
    Application,
    /// The object is a dialog or list containing items for insertion into an entry widget, for instance a list of words for completion of a text entry. (Since: 1.3)
    Autocomplete,
    /// The object is an editable text object in a toolbar. (Since: 1.5)
    EditBar,
    /// The object is an embedded container within a document or panel. This role is a grouping "hint" indicating that the contained objects share a context. (Since: 1.7.2)
    Embedded,
    /// The object is a component whose textual content may be entered or modified by the user, provided `StateType::Editable` is present. (Since: 1.11)
    Entry,
    /// The object is a graphical depiction of quantitative data. It may contain multiple subelements whose attributes and/or description may be queried to obtain both the quantitative data and information about how the data is being presented. The LABELLED_BY relation is particularly important in interpreting objects of this type, as is the accessible-description property. (Since: 1.11)
    Chart,
    /// The object contains descriptive information, usually textual, about another user interface element such as a table, chart, or image. (Since: 1.11)
    Caption,
    /// The object is a visual frame or container which contains a view of document content. Document frames may occur within another Document instance, in which case the second document may be said to be embedded in the containing instance. HTML frames are often ROLE_DOCUMENT_FRAME. Either this object, or a singleton descendant, should implement the Document interface. (Since: 1.11)
    DocumentFrame,
    /// The object serves as a heading for content which follows it in a document. The 'heading level' of the heading, if availabe, may be obtained by querying the object's attributes.
    Heading,
    /// The object is a containing instance which encapsulates a page of information. `Role::Page` is used in documents and content which support a paginated navigation model. (Since: 1.11)
    Page,
    /// The object is a containing instance of document content which constitutes a particular 'logical' section of the document. The type of content within a section, and the nature of the section division itself, may be obtained by querying the object's attributes. Sections may be nested. (Since: 1.11)
    Section,
    /// The object is redundant with another object in the hierarchy, and is exposed for purely technical reasons. Objects of this role should normally be ignored by clients. (Since: 1.11)
    RedundantObject,
    /// The object is a container for form controls, for instance as part of a
    /// web form or user-input form within a document. This role is primarily a tag/convenience for
    /// clients when navigating complex documents, it is not expected that ordinary GUI containers will
    /// always have ATK_ROLE_FORM. (Since: 1.12.0)
    Form,
    /// The object is a hypertext anchor, i.e. a "link" in a
    /// hypertext document. Such objects are distinct from 'inline'
    /// content which may also use the Hypertext/Hyperlink interfaces
    /// to indicate the range/location within a text object where
    /// an inline or embedded object lies. (Since: 1.12.1)
    Link,
    /// The object is a window or similar viewport
    /// which is used to allow composition or input of a 'complex character',
    /// in other words it is an "input method window." (Since: 1.12.1)
    InputMethodWindow,
    /// A row in a table. (Since: 2.1.0)
    TableRow,
    /// An object that represents an element of a tree. (Since: 2.1.0)
    TreeItem,
    /// A document frame which contains a spreadsheet. (Since: 2.1.0)
    DocumentSpreadsheet,
    /// A document frame which contains a presentation or slide content. (Since: 2.1.0)
    DocumentPresentation,
    /// A document frame which contains textual content, such as found in a word processing application. (Since: 2.1.0)
    DocumentText,
    /// A document frame which contains HTML or other markup suitable for display in a web browser. (Since: 2.1.0)
    DocumentWeb,
    /// A document frame which contains email content to be displayed or composed either in plain text or HTML. (Since: 2.1.0)
    DocumentEmail,
    /// An object found within a document and designed to present a comment, note, or other annotation. In some cases, this object might not be visible until activated. (Since: 2.1.0)
    Comment,
    /// A non-collapsible list of choices the user can select from. (Since: 2.1.0)
    ListBox,
    /// A group of related widgets. This group typically has a label. (Since: 2.1.0)
    Grouping,
    /// An image map object. Usually a graphic with multiple hotspots, where each hotspot can be activated resulting in the loading of another document or section of a document. (Since: 2.1.0)
    ImageMap,
    /// A transitory object designed to present a message to the user, typically at the desktop level rather than inside a particular application. (Since: 2.1.0)
    Notification,
    /// An object designed to present a message to the user within an existing window. (Since: 2.1.0)
    InfoBar,
    /// A bar that serves as a level indicator to, for instance, show the strength of a password or the state of a battery. (Since: 2.7.3)
    LevelBar,
    /// A bar that serves as the title of a window or a
    /// dialog. (Since: 2.12)
    TitleBar,
    /// An object which contains a text section
    /// that is quoted from another source. (Since: 2.12)
    BlockQuote,
    /// An object which represents an audio element. (Since: 2.12)
    Audio,
    /// An object which represents a video element. (Since: 2.12)
    Video,
    /// A definition of a term or concept. (Since: 2.12)
    Definition,
    /// A section of a page that consists of a
    /// composition that forms an independent part of a document, page, or
    /// site. Examples: A blog entry, a news story, a forum post. (Since: 2.12)
    Article,
    /// A region of a web page intended as a
    /// navigational landmark. This is designed to allow Assistive
    /// Technologies to provide quick navigation among key regions within a
    /// document. (Since: 2.12)
    Landmark,
    /// A text widget or container holding log content, such
    /// as chat history and error logs. In this role there is a
    /// relationship between the arrival of new items in the log and the
    /// reading order. The log contains a meaningful sequence and new
    /// information is added only to the end of the log, not at arbitrary
    /// points. (Since: 2.12)
    Log,
    /// A container where non-essential information
    /// changes frequently. Common usages of marquee include stock tickers
    /// and ad banners. The primary difference between a marquee and a log
    /// is that logs usually have a meaningful order or sequence of
    /// important content changes. (Since: 2.12)
    Marquee,
    /// A text widget or container that holds a mathematical
    /// expression. (Since: 2.12)
    Math,
    /// A widget whose purpose is to display a rating,
    /// such as the number of stars associated with a song in a media
    /// player. Objects of this role should also implement
    /// AtkValue. (Since: 2.12)
    Rating,
    /// An object containing a numerical counter which
    /// indicates an amount of elapsed time from a start point, or the time
    /// remaining until an end point. (Since: 2.12)
    Timer,
    /// An object that represents a list of
    /// term-value groups. A term-value group represents a individual
    /// description and consist of one or more names
    /// (ATK_ROLE_DESCRIPTION_TERM) followed by one or more values
    /// (ATK_ROLE_DESCRIPTION_VALUE). For each list, there should not be
    /// more than one group with the same term name. (Since: 2.12)
    DescriptionList,
    /// An object that represents a term or phrase
    /// with a corresponding definition. (Since: 2.12)
    DescriptionTerm,
    /// An object that represents the
    /// description, definition or value of a term. (Since: 2.12)
    DescriptionValue,
    /// A generic non-container object whose purpose is to display a
    /// brief amount of information to the user and whose role is known by the
    /// implementor but lacks semantic value for the user. Examples in which
    /// `Role::Static` is appropriate include the message displayed in a message box
    /// and an image used as an alternative means to display text. `Role::Static`
    /// should not be applied to widgets which are traditionally interactive, objects
    /// which display a significant amount of content, or any object which has an
    /// accessible relation pointing to another object. Implementors should expose the
    /// displayed information through the accessible name of the object. If doing so seems
    /// inappropriate, it may indicate that a different role should be used. For
    /// labels which describe another widget, see `Role::Label`. For text views, see
    /// `Role::Text`. For generic containers, see `Role::Panel`. For objects whose
    /// role is not known by the implementor, see `Role::Unknown`. (Since: 2.16)
    Static,
    /// An object that represents a mathematical fraction.
    /// (Since: 2.16)
    MathFraction,
    /// An object that represents a mathematical expression
    /// displayed with a radical. (Since: 2.16)
    MathRoot,
    /// An object that contains text that is displayed as a
    /// subscript. (Since: 2.16)
    Subscript,
    /// An object that contains text that is displayed as a
    /// superscript. (Since: 2.16)
    Superscript,
    /// An object that contains the text of a footnote. (Since: 2.26)
    Footnote,
    /// Content previously deleted or proposed to be
    /// deleted, e.g. in revision history or a content view providing suggestions
    /// from reviewers. (Since: 2.34)
    ContentDeletion,
    /// Content previously inserted or proposed to be
    /// inserted, e.g. in revision history or a content view providing suggestions
    /// from reviewers. (Since: 2.34)
    ContentInsertion,
    /// not a valid role, used for finding end of the enumeration
    LastDefined,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for Role {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "Role::{}",
            match *self {
                Role::Invalid => "Invalid",
                Role::AcceleratorLabel => "AcceleratorLabel",
                Role::Alert => "Alert",
                Role::Animation => "Animation",
                Role::Arrow => "Arrow",
                Role::Calendar => "Calendar",
                Role::Canvas => "Canvas",
                Role::CheckBox => "CheckBox",
                Role::CheckMenuItem => "CheckMenuItem",
                Role::ColorChooser => "ColorChooser",
                Role::ColumnHeader => "ColumnHeader",
                Role::ComboBox => "ComboBox",
                Role::DateEditor => "DateEditor",
                Role::DesktopIcon => "DesktopIcon",
                Role::DesktopFrame => "DesktopFrame",
                Role::Dial => "Dial",
                Role::Dialog => "Dialog",
                Role::DirectoryPane => "DirectoryPane",
                Role::DrawingArea => "DrawingArea",
                Role::FileChooser => "FileChooser",
                Role::Filler => "Filler",
                Role::FontChooser => "FontChooser",
                Role::Frame => "Frame",
                Role::GlassPane => "GlassPane",
                Role::HtmlContainer => "HtmlContainer",
                Role::Icon => "Icon",
                Role::Image => "Image",
                Role::InternalFrame => "InternalFrame",
                Role::Label => "Label",
                Role::LayeredPane => "LayeredPane",
                Role::List => "List",
                Role::ListItem => "ListItem",
                Role::Menu => "Menu",
                Role::MenuBar => "MenuBar",
                Role::MenuItem => "MenuItem",
                Role::OptionPane => "OptionPane",
                Role::PageTab => "PageTab",
                Role::PageTabList => "PageTabList",
                Role::Panel => "Panel",
                Role::PasswordText => "PasswordText",
                Role::PopupMenu => "PopupMenu",
                Role::ProgressBar => "ProgressBar",
                Role::PushButton => "PushButton",
                Role::RadioButton => "RadioButton",
                Role::RadioMenuItem => "RadioMenuItem",
                Role::RootPane => "RootPane",
                Role::RowHeader => "RowHeader",
                Role::ScrollBar => "ScrollBar",
                Role::ScrollPane => "ScrollPane",
                Role::Separator => "Separator",
                Role::Slider => "Slider",
                Role::SplitPane => "SplitPane",
                Role::SpinButton => "SpinButton",
                Role::Statusbar => "Statusbar",
                Role::Table => "Table",
                Role::TableCell => "TableCell",
                Role::TableColumnHeader => "TableColumnHeader",
                Role::TableRowHeader => "TableRowHeader",
                Role::TearOffMenuItem => "TearOffMenuItem",
                Role::Terminal => "Terminal",
                Role::Text => "Text",
                Role::ToggleButton => "ToggleButton",
                Role::ToolBar => "ToolBar",
                Role::ToolTip => "ToolTip",
                Role::Tree => "Tree",
                Role::TreeTable => "TreeTable",
                Role::Unknown => "Unknown",
                Role::Viewport => "Viewport",
                Role::Window => "Window",
                Role::Header => "Header",
                Role::Footer => "Footer",
                Role::Paragraph => "Paragraph",
                Role::Ruler => "Ruler",
                Role::Application => "Application",
                Role::Autocomplete => "Autocomplete",
                Role::EditBar => "EditBar",
                Role::Embedded => "Embedded",
                Role::Entry => "Entry",
                Role::Chart => "Chart",
                Role::Caption => "Caption",
                Role::DocumentFrame => "DocumentFrame",
                Role::Heading => "Heading",
                Role::Page => "Page",
                Role::Section => "Section",
                Role::RedundantObject => "RedundantObject",
                Role::Form => "Form",
                Role::Link => "Link",
                Role::InputMethodWindow => "InputMethodWindow",
                Role::TableRow => "TableRow",
                Role::TreeItem => "TreeItem",
                Role::DocumentSpreadsheet => "DocumentSpreadsheet",
                Role::DocumentPresentation => "DocumentPresentation",
                Role::DocumentText => "DocumentText",
                Role::DocumentWeb => "DocumentWeb",
                Role::DocumentEmail => "DocumentEmail",
                Role::Comment => "Comment",
                Role::ListBox => "ListBox",
                Role::Grouping => "Grouping",
                Role::ImageMap => "ImageMap",
                Role::Notification => "Notification",
                Role::InfoBar => "InfoBar",
                Role::LevelBar => "LevelBar",
                Role::TitleBar => "TitleBar",
                Role::BlockQuote => "BlockQuote",
                Role::Audio => "Audio",
                Role::Video => "Video",
                Role::Definition => "Definition",
                Role::Article => "Article",
                Role::Landmark => "Landmark",
                Role::Log => "Log",
                Role::Marquee => "Marquee",
                Role::Math => "Math",
                Role::Rating => "Rating",
                Role::Timer => "Timer",
                Role::DescriptionList => "DescriptionList",
                Role::DescriptionTerm => "DescriptionTerm",
                Role::DescriptionValue => "DescriptionValue",
                Role::Static => "Static",
                Role::MathFraction => "MathFraction",
                Role::MathRoot => "MathRoot",
                Role::Subscript => "Subscript",
                Role::Superscript => "Superscript",
                Role::Footnote => "Footnote",
                Role::ContentDeletion => "ContentDeletion",
                Role::ContentInsertion => "ContentInsertion",
                Role::LastDefined => "LastDefined",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for Role {
    type GlibType = atk_sys::AtkRole;

    fn to_glib(&self) -> atk_sys::AtkRole {
        match *self {
            Role::Invalid => atk_sys::ATK_ROLE_INVALID,
            Role::AcceleratorLabel => atk_sys::ATK_ROLE_ACCEL_LABEL,
            Role::Alert => atk_sys::ATK_ROLE_ALERT,
            Role::Animation => atk_sys::ATK_ROLE_ANIMATION,
            Role::Arrow => atk_sys::ATK_ROLE_ARROW,
            Role::Calendar => atk_sys::ATK_ROLE_CALENDAR,
            Role::Canvas => atk_sys::ATK_ROLE_CANVAS,
            Role::CheckBox => atk_sys::ATK_ROLE_CHECK_BOX,
            Role::CheckMenuItem => atk_sys::ATK_ROLE_CHECK_MENU_ITEM,
            Role::ColorChooser => atk_sys::ATK_ROLE_COLOR_CHOOSER,
            Role::ColumnHeader => atk_sys::ATK_ROLE_COLUMN_HEADER,
            Role::ComboBox => atk_sys::ATK_ROLE_COMBO_BOX,
            Role::DateEditor => atk_sys::ATK_ROLE_DATE_EDITOR,
            Role::DesktopIcon => atk_sys::ATK_ROLE_DESKTOP_ICON,
            Role::DesktopFrame => atk_sys::ATK_ROLE_DESKTOP_FRAME,
            Role::Dial => atk_sys::ATK_ROLE_DIAL,
            Role::Dialog => atk_sys::ATK_ROLE_DIALOG,
            Role::DirectoryPane => atk_sys::ATK_ROLE_DIRECTORY_PANE,
            Role::DrawingArea => atk_sys::ATK_ROLE_DRAWING_AREA,
            Role::FileChooser => atk_sys::ATK_ROLE_FILE_CHOOSER,
            Role::Filler => atk_sys::ATK_ROLE_FILLER,
            Role::FontChooser => atk_sys::ATK_ROLE_FONT_CHOOSER,
            Role::Frame => atk_sys::ATK_ROLE_FRAME,
            Role::GlassPane => atk_sys::ATK_ROLE_GLASS_PANE,
            Role::HtmlContainer => atk_sys::ATK_ROLE_HTML_CONTAINER,
            Role::Icon => atk_sys::ATK_ROLE_ICON,
            Role::Image => atk_sys::ATK_ROLE_IMAGE,
            Role::InternalFrame => atk_sys::ATK_ROLE_INTERNAL_FRAME,
            Role::Label => atk_sys::ATK_ROLE_LABEL,
            Role::LayeredPane => atk_sys::ATK_ROLE_LAYERED_PANE,
            Role::List => atk_sys::ATK_ROLE_LIST,
            Role::ListItem => atk_sys::ATK_ROLE_LIST_ITEM,
            Role::Menu => atk_sys::ATK_ROLE_MENU,
            Role::MenuBar => atk_sys::ATK_ROLE_MENU_BAR,
            Role::MenuItem => atk_sys::ATK_ROLE_MENU_ITEM,
            Role::OptionPane => atk_sys::ATK_ROLE_OPTION_PANE,
            Role::PageTab => atk_sys::ATK_ROLE_PAGE_TAB,
            Role::PageTabList => atk_sys::ATK_ROLE_PAGE_TAB_LIST,
            Role::Panel => atk_sys::ATK_ROLE_PANEL,
            Role::PasswordText => atk_sys::ATK_ROLE_PASSWORD_TEXT,
            Role::PopupMenu => atk_sys::ATK_ROLE_POPUP_MENU,
            Role::ProgressBar => atk_sys::ATK_ROLE_PROGRESS_BAR,
            Role::PushButton => atk_sys::ATK_ROLE_PUSH_BUTTON,
            Role::RadioButton => atk_sys::ATK_ROLE_RADIO_BUTTON,
            Role::RadioMenuItem => atk_sys::ATK_ROLE_RADIO_MENU_ITEM,
            Role::RootPane => atk_sys::ATK_ROLE_ROOT_PANE,
            Role::RowHeader => atk_sys::ATK_ROLE_ROW_HEADER,
            Role::ScrollBar => atk_sys::ATK_ROLE_SCROLL_BAR,
            Role::ScrollPane => atk_sys::ATK_ROLE_SCROLL_PANE,
            Role::Separator => atk_sys::ATK_ROLE_SEPARATOR,
            Role::Slider => atk_sys::ATK_ROLE_SLIDER,
            Role::SplitPane => atk_sys::ATK_ROLE_SPLIT_PANE,
            Role::SpinButton => atk_sys::ATK_ROLE_SPIN_BUTTON,
            Role::Statusbar => atk_sys::ATK_ROLE_STATUSBAR,
            Role::Table => atk_sys::ATK_ROLE_TABLE,
            Role::TableCell => atk_sys::ATK_ROLE_TABLE_CELL,
            Role::TableColumnHeader => atk_sys::ATK_ROLE_TABLE_COLUMN_HEADER,
            Role::TableRowHeader => atk_sys::ATK_ROLE_TABLE_ROW_HEADER,
            Role::TearOffMenuItem => atk_sys::ATK_ROLE_TEAR_OFF_MENU_ITEM,
            Role::Terminal => atk_sys::ATK_ROLE_TERMINAL,
            Role::Text => atk_sys::ATK_ROLE_TEXT,
            Role::ToggleButton => atk_sys::ATK_ROLE_TOGGLE_BUTTON,
            Role::ToolBar => atk_sys::ATK_ROLE_TOOL_BAR,
            Role::ToolTip => atk_sys::ATK_ROLE_TOOL_TIP,
            Role::Tree => atk_sys::ATK_ROLE_TREE,
            Role::TreeTable => atk_sys::ATK_ROLE_TREE_TABLE,
            Role::Unknown => atk_sys::ATK_ROLE_UNKNOWN,
            Role::Viewport => atk_sys::ATK_ROLE_VIEWPORT,
            Role::Window => atk_sys::ATK_ROLE_WINDOW,
            Role::Header => atk_sys::ATK_ROLE_HEADER,
            Role::Footer => atk_sys::ATK_ROLE_FOOTER,
            Role::Paragraph => atk_sys::ATK_ROLE_PARAGRAPH,
            Role::Ruler => atk_sys::ATK_ROLE_RULER,
            Role::Application => atk_sys::ATK_ROLE_APPLICATION,
            Role::Autocomplete => atk_sys::ATK_ROLE_AUTOCOMPLETE,
            Role::EditBar => atk_sys::ATK_ROLE_EDITBAR,
            Role::Embedded => atk_sys::ATK_ROLE_EMBEDDED,
            Role::Entry => atk_sys::ATK_ROLE_ENTRY,
            Role::Chart => atk_sys::ATK_ROLE_CHART,
            Role::Caption => atk_sys::ATK_ROLE_CAPTION,
            Role::DocumentFrame => atk_sys::ATK_ROLE_DOCUMENT_FRAME,
            Role::Heading => atk_sys::ATK_ROLE_HEADING,
            Role::Page => atk_sys::ATK_ROLE_PAGE,
            Role::Section => atk_sys::ATK_ROLE_SECTION,
            Role::RedundantObject => atk_sys::ATK_ROLE_REDUNDANT_OBJECT,
            Role::Form => atk_sys::ATK_ROLE_FORM,
            Role::Link => atk_sys::ATK_ROLE_LINK,
            Role::InputMethodWindow => atk_sys::ATK_ROLE_INPUT_METHOD_WINDOW,
            Role::TableRow => atk_sys::ATK_ROLE_TABLE_ROW,
            Role::TreeItem => atk_sys::ATK_ROLE_TREE_ITEM,
            Role::DocumentSpreadsheet => atk_sys::ATK_ROLE_DOCUMENT_SPREADSHEET,
            Role::DocumentPresentation => atk_sys::ATK_ROLE_DOCUMENT_PRESENTATION,
            Role::DocumentText => atk_sys::ATK_ROLE_DOCUMENT_TEXT,
            Role::DocumentWeb => atk_sys::ATK_ROLE_DOCUMENT_WEB,
            Role::DocumentEmail => atk_sys::ATK_ROLE_DOCUMENT_EMAIL,
            Role::Comment => atk_sys::ATK_ROLE_COMMENT,
            Role::ListBox => atk_sys::ATK_ROLE_LIST_BOX,
            Role::Grouping => atk_sys::ATK_ROLE_GROUPING,
            Role::ImageMap => atk_sys::ATK_ROLE_IMAGE_MAP,
            Role::Notification => atk_sys::ATK_ROLE_NOTIFICATION,
            Role::InfoBar => atk_sys::ATK_ROLE_INFO_BAR,
            Role::LevelBar => atk_sys::ATK_ROLE_LEVEL_BAR,
            Role::TitleBar => atk_sys::ATK_ROLE_TITLE_BAR,
            Role::BlockQuote => atk_sys::ATK_ROLE_BLOCK_QUOTE,
            Role::Audio => atk_sys::ATK_ROLE_AUDIO,
            Role::Video => atk_sys::ATK_ROLE_VIDEO,
            Role::Definition => atk_sys::ATK_ROLE_DEFINITION,
            Role::Article => atk_sys::ATK_ROLE_ARTICLE,
            Role::Landmark => atk_sys::ATK_ROLE_LANDMARK,
            Role::Log => atk_sys::ATK_ROLE_LOG,
            Role::Marquee => atk_sys::ATK_ROLE_MARQUEE,
            Role::Math => atk_sys::ATK_ROLE_MATH,
            Role::Rating => atk_sys::ATK_ROLE_RATING,
            Role::Timer => atk_sys::ATK_ROLE_TIMER,
            Role::DescriptionList => atk_sys::ATK_ROLE_DESCRIPTION_LIST,
            Role::DescriptionTerm => atk_sys::ATK_ROLE_DESCRIPTION_TERM,
            Role::DescriptionValue => atk_sys::ATK_ROLE_DESCRIPTION_VALUE,
            Role::Static => atk_sys::ATK_ROLE_STATIC,
            Role::MathFraction => atk_sys::ATK_ROLE_MATH_FRACTION,
            Role::MathRoot => atk_sys::ATK_ROLE_MATH_ROOT,
            Role::Subscript => atk_sys::ATK_ROLE_SUBSCRIPT,
            Role::Superscript => atk_sys::ATK_ROLE_SUPERSCRIPT,
            Role::Footnote => atk_sys::ATK_ROLE_FOOTNOTE,
            Role::ContentDeletion => atk_sys::ATK_ROLE_CONTENT_DELETION,
            Role::ContentInsertion => atk_sys::ATK_ROLE_CONTENT_INSERTION,
            Role::LastDefined => atk_sys::ATK_ROLE_LAST_DEFINED,
            Role::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<atk_sys::AtkRole> for Role {
    fn from_glib(value: atk_sys::AtkRole) -> Self {
        skip_assert_initialized!();
        match value {
            0 => Role::Invalid,
            1 => Role::AcceleratorLabel,
            2 => Role::Alert,
            3 => Role::Animation,
            4 => Role::Arrow,
            5 => Role::Calendar,
            6 => Role::Canvas,
            7 => Role::CheckBox,
            8 => Role::CheckMenuItem,
            9 => Role::ColorChooser,
            10 => Role::ColumnHeader,
            11 => Role::ComboBox,
            12 => Role::DateEditor,
            13 => Role::DesktopIcon,
            14 => Role::DesktopFrame,
            15 => Role::Dial,
            16 => Role::Dialog,
            17 => Role::DirectoryPane,
            18 => Role::DrawingArea,
            19 => Role::FileChooser,
            20 => Role::Filler,
            21 => Role::FontChooser,
            22 => Role::Frame,
            23 => Role::GlassPane,
            24 => Role::HtmlContainer,
            25 => Role::Icon,
            26 => Role::Image,
            27 => Role::InternalFrame,
            28 => Role::Label,
            29 => Role::LayeredPane,
            30 => Role::List,
            31 => Role::ListItem,
            32 => Role::Menu,
            33 => Role::MenuBar,
            34 => Role::MenuItem,
            35 => Role::OptionPane,
            36 => Role::PageTab,
            37 => Role::PageTabList,
            38 => Role::Panel,
            39 => Role::PasswordText,
            40 => Role::PopupMenu,
            41 => Role::ProgressBar,
            42 => Role::PushButton,
            43 => Role::RadioButton,
            44 => Role::RadioMenuItem,
            45 => Role::RootPane,
            46 => Role::RowHeader,
            47 => Role::ScrollBar,
            48 => Role::ScrollPane,
            49 => Role::Separator,
            50 => Role::Slider,
            51 => Role::SplitPane,
            52 => Role::SpinButton,
            53 => Role::Statusbar,
            54 => Role::Table,
            55 => Role::TableCell,
            56 => Role::TableColumnHeader,
            57 => Role::TableRowHeader,
            58 => Role::TearOffMenuItem,
            59 => Role::Terminal,
            60 => Role::Text,
            61 => Role::ToggleButton,
            62 => Role::ToolBar,
            63 => Role::ToolTip,
            64 => Role::Tree,
            65 => Role::TreeTable,
            66 => Role::Unknown,
            67 => Role::Viewport,
            68 => Role::Window,
            69 => Role::Header,
            70 => Role::Footer,
            71 => Role::Paragraph,
            72 => Role::Ruler,
            73 => Role::Application,
            74 => Role::Autocomplete,
            75 => Role::EditBar,
            76 => Role::Embedded,
            77 => Role::Entry,
            78 => Role::Chart,
            79 => Role::Caption,
            80 => Role::DocumentFrame,
            81 => Role::Heading,
            82 => Role::Page,
            83 => Role::Section,
            84 => Role::RedundantObject,
            85 => Role::Form,
            86 => Role::Link,
            87 => Role::InputMethodWindow,
            88 => Role::TableRow,
            89 => Role::TreeItem,
            90 => Role::DocumentSpreadsheet,
            91 => Role::DocumentPresentation,
            92 => Role::DocumentText,
            93 => Role::DocumentWeb,
            94 => Role::DocumentEmail,
            95 => Role::Comment,
            96 => Role::ListBox,
            97 => Role::Grouping,
            98 => Role::ImageMap,
            99 => Role::Notification,
            100 => Role::InfoBar,
            101 => Role::LevelBar,
            102 => Role::TitleBar,
            103 => Role::BlockQuote,
            104 => Role::Audio,
            105 => Role::Video,
            106 => Role::Definition,
            107 => Role::Article,
            108 => Role::Landmark,
            109 => Role::Log,
            110 => Role::Marquee,
            111 => Role::Math,
            112 => Role::Rating,
            113 => Role::Timer,
            114 => Role::DescriptionList,
            115 => Role::DescriptionTerm,
            116 => Role::DescriptionValue,
            117 => Role::Static,
            118 => Role::MathFraction,
            119 => Role::MathRoot,
            120 => Role::Subscript,
            121 => Role::Superscript,
            122 => Role::Footnote,
            123 => Role::ContentDeletion,
            124 => Role::ContentInsertion,
            125 => Role::LastDefined,
            value => Role::__Unknown(value),
        }
    }
}

impl StaticType for Role {
    fn static_type() -> Type {
        unsafe { from_glib(atk_sys::atk_role_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for Role {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for Role {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for Role {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

/// Specifies where an object should be placed on the screen when using scroll_to.
#[cfg(any(feature = "v2_30", feature = "dox"))]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum ScrollType {
    /// Scroll the object vertically and horizontally to the top
    ///  left corner of the window.
    TopLeft,
    /// Scroll the object vertically and horizontally to the
    ///  bottom right corner of the window.
    BottomRight,
    /// Scroll the object vertically to the top edge of the
    ///  window.
    TopEdge,
    /// Scroll the object vertically to the bottom edge of
    ///  the window.
    BottomEdge,
    /// Scroll the object vertically and horizontally to the
    ///  left edge of the window.
    LeftEdge,
    /// Scroll the object vertically and horizontally to the
    ///  right edge of the window.
    RightEdge,
    /// Scroll the object vertically and horizontally so that
    ///  as much as possible of the object becomes visible. The exact placement is
    ///  determined by the application.
    ///
    /// Feature: `v2_30`
    ///
    Anywhere,
    #[doc(hidden)]
    __Unknown(i32),
}

#[cfg(any(feature = "v2_30", feature = "dox"))]
impl fmt::Display for ScrollType {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "ScrollType::{}",
            match *self {
                ScrollType::TopLeft => "TopLeft",
                ScrollType::BottomRight => "BottomRight",
                ScrollType::TopEdge => "TopEdge",
                ScrollType::BottomEdge => "BottomEdge",
                ScrollType::LeftEdge => "LeftEdge",
                ScrollType::RightEdge => "RightEdge",
                ScrollType::Anywhere => "Anywhere",
                _ => "Unknown",
            }
        )
    }
}

#[cfg(any(feature = "v2_30", feature = "dox"))]
#[doc(hidden)]
impl ToGlib for ScrollType {
    type GlibType = atk_sys::AtkScrollType;

    fn to_glib(&self) -> atk_sys::AtkScrollType {
        match *self {
            ScrollType::TopLeft => atk_sys::ATK_SCROLL_TOP_LEFT,
            ScrollType::BottomRight => atk_sys::ATK_SCROLL_BOTTOM_RIGHT,
            ScrollType::TopEdge => atk_sys::ATK_SCROLL_TOP_EDGE,
            ScrollType::BottomEdge => atk_sys::ATK_SCROLL_BOTTOM_EDGE,
            ScrollType::LeftEdge => atk_sys::ATK_SCROLL_LEFT_EDGE,
            ScrollType::RightEdge => atk_sys::ATK_SCROLL_RIGHT_EDGE,
            ScrollType::Anywhere => atk_sys::ATK_SCROLL_ANYWHERE,
            ScrollType::__Unknown(value) => value,
        }
    }
}

#[cfg(any(feature = "v2_30", feature = "dox"))]
#[doc(hidden)]
impl FromGlib<atk_sys::AtkScrollType> for ScrollType {
    fn from_glib(value: atk_sys::AtkScrollType) -> Self {
        skip_assert_initialized!();
        match value {
            0 => ScrollType::TopLeft,
            1 => ScrollType::BottomRight,
            2 => ScrollType::TopEdge,
            3 => ScrollType::BottomEdge,
            4 => ScrollType::LeftEdge,
            5 => ScrollType::RightEdge,
            6 => ScrollType::Anywhere,
            value => ScrollType::__Unknown(value),
        }
    }
}

#[cfg(any(feature = "v2_30", feature = "dox"))]
impl StaticType for ScrollType {
    fn static_type() -> Type {
        unsafe { from_glib(atk_sys::atk_scroll_type_get_type()) }
    }
}

#[cfg(any(feature = "v2_30", feature = "dox"))]
impl<'a> FromValueOptional<'a> for ScrollType {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

#[cfg(any(feature = "v2_30", feature = "dox"))]
impl<'a> FromValue<'a> for ScrollType {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

#[cfg(any(feature = "v2_30", feature = "dox"))]
impl SetValue for ScrollType {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

/// The possible types of states of an object
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum StateType {
    /// Indicates an invalid state - probably an error condition.
    Invalid,
    /// Indicates a window is currently the active window, or an object is the active subelement within a container or table. ATK_STATE_ACTIVE should not be used for objects which have ATK_STATE_FOCUSABLE or ATK_STATE_SELECTABLE: Those objects should use ATK_STATE_FOCUSED and ATK_STATE_SELECTED respectively. ATK_STATE_ACTIVE is a means to indicate that an object which is not focusable and not selectable is the currently-active item within its parent container.
    Active,
    /// Indicates that the object is 'armed', i.e. will be activated by if a pointer button-release event occurs within its bounds. Buttons often enter this state when a pointer click occurs within their bounds, as a precursor to activation. ATK_STATE_ARMED has been deprecated since ATK-2.16 and should not be used in newly-written code.
    Armed,
    /// Indicates the current object is busy, i.e. onscreen representation is in the process of changing, or the object is temporarily unavailable for interaction due to activity already in progress. This state may be used by implementors of Document to indicate that content loading is underway. It also may indicate other 'pending' conditions; clients may wish to interrogate this object when the ATK_STATE_BUSY flag is removed.
    Busy,
    /// Indicates this object is currently checked, for instance a checkbox is 'non-empty'.
    Checked,
    /// Indicates that this object no longer has a valid backing widget (for instance, if its peer object has been destroyed)
    Defunct,
    /// Indicates that this object can contain text, and that the
    /// user can change the textual contents of this object by editing those contents
    /// directly. For an object which is expected to be editable due to its type, but
    /// which cannot be edited due to the application or platform preventing the user
    /// from doing so, that object's `StateSet` should lack ATK_STATE_EDITABLE and
    /// should contain ATK_STATE_READ_ONLY.
    Editable,
    /// Indicates that this object is enabled, i.e. that it currently reflects some application state. Objects that are "greyed out" may lack this state, and may lack the STATE_SENSITIVE if direct user interaction cannot cause them to acquire STATE_ENABLED. See also: ATK_STATE_SENSITIVE
    Enabled,
    /// Indicates this object allows progressive disclosure of its children
    Expandable,
    /// Indicates this object its expanded - see ATK_STATE_EXPANDABLE above
    Expanded,
    /// Indicates this object can accept keyboard focus, which means all events resulting from typing on the keyboard will normally be passed to it when it has focus
    Focusable,
    /// Indicates this object currently has the keyboard focus
    Focused,
    /// Indicates the orientation of this object is horizontal; used, for instance, by objects of ATK_ROLE_SCROLL_BAR. For objects where vertical/horizontal orientation is especially meaningful.
    Horizontal,
    /// Indicates this object is minimized and is represented only by an icon
    Iconified,
    /// Indicates something must be done with this object before the user can interact with an object in a different window
    Modal,
    /// Indicates this (text) object can contain multiple lines of text
    MultiLine,
    /// Indicates this object allows more than one of its children to be selected at the same time, or in the case of text objects, that the object supports non-contiguous text selections.
    Multiselectable,
    /// Indicates this object paints every pixel within its rectangular region.
    Opaque,
    /// Indicates this object is currently pressed.
    Pressed,
    /// Indicates the size of this object is not fixed
    Resizable,
    /// Indicates this object is the child of an object that allows its children to be selected and that this child is one of those children that can be selected
    Selectable,
    /// Indicates this object is the child of an object that allows its children to be selected and that this child is one of those children that has been selected
    Selected,
    /// Indicates this object is sensitive, e.g. to user interaction.
    /// STATE_SENSITIVE usually accompanies STATE_ENABLED for user-actionable controls,
    /// but may be found in the absence of STATE_ENABLED if the current visible state of the
    /// control is "disconnected" from the application state. In such cases, direct user interaction
    /// can often result in the object gaining STATE_SENSITIVE, for instance if a user makes
    /// an explicit selection using an object whose current state is ambiguous or undefined.
    /// `see` STATE_ENABLED, STATE_INDETERMINATE.
    Sensitive,
    /// Indicates this object, the object's parent, the object's parent's parent, and so on,
    /// are all 'shown' to the end-user, i.e. subject to "exposure" if blocking or obscuring objects do not interpose
    /// between this object and the top of the window stack.
    Showing,
    /// Indicates this (text) object can contain only a single line of text
    SingleLine,
    /// Indicates that the information returned for this object may no longer be
    /// synchronized with the application state. This is implied if the object has STATE_TRANSIENT,
    /// and can also occur towards the end of the object peer's lifecycle. It can also be used to indicate that
    /// the index associated with this object has changed since the user accessed the object (in lieu of
    /// "index-in-parent-changed" events).
    Stale,
    /// Indicates this object is transient, i.e. a snapshot which may not emit events when its
    /// state changes. Data from objects with ATK_STATE_TRANSIENT should not be cached, since there may be no
    /// notification given when the cached data becomes obsolete.
    Transient,
    /// Indicates the orientation of this object is vertical
    Vertical,
    /// Indicates this object is visible, e.g. has been explicitly marked for exposure to the user.
    /// **note**: `StateType::Visible` is no guarantee that the object is actually unobscured on the screen, only
    /// that it is 'potentially' visible, barring obstruction, being scrolled or clipped out of the
    /// field of view, or having an ancestor container that has not yet made visible.
    /// A widget is potentially onscreen if it has both `StateType::Visible` and `StateType::Showing`.
    /// The absence of `StateType::Visible` and `StateType::Showing` is semantically equivalent to saying
    /// that an object is 'hidden'. See also `StateType::Truncated`, which applies if an object with
    /// `StateType::Visible` and `StateType::Showing` set lies within a viewport which means that its
    /// contents are clipped, e.g. a truncated spreadsheet cell or
    /// an image within a scrolling viewport. Mostly useful for screen-review and magnification
    /// algorithms.
    Visible,
    /// Indicates that "active-descendant-changed" event
    /// is sent when children become 'active' (i.e. are selected or navigated to onscreen).
    /// Used to prevent need to enumerate all children in very large containers, like tables.
    /// The presence of STATE_MANAGES_DESCENDANTS is an indication to the client.
    /// that the children should not, and need not, be enumerated by the client.
    /// Objects implementing this state are expected to provide relevant state
    /// notifications to listening clients, for instance notifications of visibility
    /// changes and activation of their contained child objects, without the client
    /// having previously requested references to those children.
    ManagesDescendants,
    /// Indicates that the value, or some other quantifiable
    /// property, of this AtkObject cannot be fully determined. In the case of a large
    /// data set in which the total number of items in that set is unknown (e.g. 1 of
    /// 999+), implementors should expose the currently-known set size (999) along
    /// with this state. In the case of a check box, this state should be used to
    /// indicate that the check box is a tri-state check box which is currently
    /// neither checked nor unchecked.
    Indeterminate,
    /// Indicates that an object is truncated, e.g. a text value in a speradsheet cell.
    Truncated,
    /// Indicates that explicit user interaction with an object is required by the user interface, e.g. a required field in a "web-form" interface.
    Required,
    /// Indicates that the object has encountered an error condition due to failure of input validation. For instance, a form control may acquire this state in response to invalid or malformed user input.
    InvalidEntry,
    /// Indicates that the object in question implements some form of ¨typeahead¨ or
    /// pre-selection behavior whereby entering the first character of one or more sub-elements
    /// causes those elements to scroll into view or become selected. Subsequent character input
    /// may narrow the selection further as long as one or more sub-elements match the string.
    /// This state is normally only useful and encountered on objects that implement Selection.
    /// In some cases the typeahead behavior may result in full or partial ¨completion¨ of
    /// the data in the input field, in which case these input events may trigger text-changed
    /// events from the AtkText interface. This state supplants `Role::Autocomplete`.
    SupportsAutocompletion,
    /// Indicates that the object in question supports text selection. It should only be exposed on objects which implement the Text interface, in order to distinguish this state from `StateType::Selectable`, which infers that the object in question is a selectable child of an object which implements Selection. While similar, text selection and subelement selection are distinct operations.
    SelectableText,
    /// Indicates that the object is the "default" active component, i.e. the object which is activated by an end-user press of the "Enter" or "Return" key. Typically a "close" or "submit" button.
    Default,
    /// Indicates that the object changes its appearance dynamically as an inherent part of its presentation. This state may come and go if an object is only temporarily animated on the way to a 'final' onscreen presentation.
    /// **note**: some applications, notably content viewers, may not be able to detect
    /// all kinds of animated content. Therefore the absence of this state should not
    /// be taken as definitive evidence that the object's visual representation is
    /// static; this state is advisory.
    Animated,
    /// Indicates that the object (typically a hyperlink) has already been 'activated', and/or its backing data has already been downloaded, rendered, or otherwise "visited".
    Visited,
    /// Indicates this object has the potential to be
    ///  checked, such as a checkbox or toggle-able table cell. `Since`:
    ///  ATK-2.12
    Checkable,
    /// Indicates that the object has a popup context
    /// menu or sub-level menu which may or may not be showing. This means
    /// that activation renders conditional content. Note that ordinary
    /// tooltips are not considered popups in this context. `Since`: ATK-2.12
    HasPopup,
    /// Indicates this object has a tooltip. `Since`: ATK-2.16
    HasTooltip,
    /// Indicates that a widget which is ENABLED and SENSITIVE
    /// has a value which can be read, but not modified, by the user. Note that this
    /// state should only be applied to widget types whose value is normally directly
    /// user modifiable, such as check boxes, radio buttons, spin buttons, text input
    /// fields, and combo boxes, as a means to convey that the expected interaction
    /// with that widget is not possible. When the expected interaction with a
    /// widget does not include modification by the user, as is the case with
    /// labels and containers, ATK_STATE_READ_ONLY should not be applied. See also
    /// ATK_STATE_EDITABLE. `Since`: ATK-2-16
    ReadOnly,
    /// Not a valid state, used for finding end of enumeration
    LastDefined,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for StateType {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "StateType::{}",
            match *self {
                StateType::Invalid => "Invalid",
                StateType::Active => "Active",
                StateType::Armed => "Armed",
                StateType::Busy => "Busy",
                StateType::Checked => "Checked",
                StateType::Defunct => "Defunct",
                StateType::Editable => "Editable",
                StateType::Enabled => "Enabled",
                StateType::Expandable => "Expandable",
                StateType::Expanded => "Expanded",
                StateType::Focusable => "Focusable",
                StateType::Focused => "Focused",
                StateType::Horizontal => "Horizontal",
                StateType::Iconified => "Iconified",
                StateType::Modal => "Modal",
                StateType::MultiLine => "MultiLine",
                StateType::Multiselectable => "Multiselectable",
                StateType::Opaque => "Opaque",
                StateType::Pressed => "Pressed",
                StateType::Resizable => "Resizable",
                StateType::Selectable => "Selectable",
                StateType::Selected => "Selected",
                StateType::Sensitive => "Sensitive",
                StateType::Showing => "Showing",
                StateType::SingleLine => "SingleLine",
                StateType::Stale => "Stale",
                StateType::Transient => "Transient",
                StateType::Vertical => "Vertical",
                StateType::Visible => "Visible",
                StateType::ManagesDescendants => "ManagesDescendants",
                StateType::Indeterminate => "Indeterminate",
                StateType::Truncated => "Truncated",
                StateType::Required => "Required",
                StateType::InvalidEntry => "InvalidEntry",
                StateType::SupportsAutocompletion => "SupportsAutocompletion",
                StateType::SelectableText => "SelectableText",
                StateType::Default => "Default",
                StateType::Animated => "Animated",
                StateType::Visited => "Visited",
                StateType::Checkable => "Checkable",
                StateType::HasPopup => "HasPopup",
                StateType::HasTooltip => "HasTooltip",
                StateType::ReadOnly => "ReadOnly",
                StateType::LastDefined => "LastDefined",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for StateType {
    type GlibType = atk_sys::AtkStateType;

    fn to_glib(&self) -> atk_sys::AtkStateType {
        match *self {
            StateType::Invalid => atk_sys::ATK_STATE_INVALID,
            StateType::Active => atk_sys::ATK_STATE_ACTIVE,
            StateType::Armed => atk_sys::ATK_STATE_ARMED,
            StateType::Busy => atk_sys::ATK_STATE_BUSY,
            StateType::Checked => atk_sys::ATK_STATE_CHECKED,
            StateType::Defunct => atk_sys::ATK_STATE_DEFUNCT,
            StateType::Editable => atk_sys::ATK_STATE_EDITABLE,
            StateType::Enabled => atk_sys::ATK_STATE_ENABLED,
            StateType::Expandable => atk_sys::ATK_STATE_EXPANDABLE,
            StateType::Expanded => atk_sys::ATK_STATE_EXPANDED,
            StateType::Focusable => atk_sys::ATK_STATE_FOCUSABLE,
            StateType::Focused => atk_sys::ATK_STATE_FOCUSED,
            StateType::Horizontal => atk_sys::ATK_STATE_HORIZONTAL,
            StateType::Iconified => atk_sys::ATK_STATE_ICONIFIED,
            StateType::Modal => atk_sys::ATK_STATE_MODAL,
            StateType::MultiLine => atk_sys::ATK_STATE_MULTI_LINE,
            StateType::Multiselectable => atk_sys::ATK_STATE_MULTISELECTABLE,
            StateType::Opaque => atk_sys::ATK_STATE_OPAQUE,
            StateType::Pressed => atk_sys::ATK_STATE_PRESSED,
            StateType::Resizable => atk_sys::ATK_STATE_RESIZABLE,
            StateType::Selectable => atk_sys::ATK_STATE_SELECTABLE,
            StateType::Selected => atk_sys::ATK_STATE_SELECTED,
            StateType::Sensitive => atk_sys::ATK_STATE_SENSITIVE,
            StateType::Showing => atk_sys::ATK_STATE_SHOWING,
            StateType::SingleLine => atk_sys::ATK_STATE_SINGLE_LINE,
            StateType::Stale => atk_sys::ATK_STATE_STALE,
            StateType::Transient => atk_sys::ATK_STATE_TRANSIENT,
            StateType::Vertical => atk_sys::ATK_STATE_VERTICAL,
            StateType::Visible => atk_sys::ATK_STATE_VISIBLE,
            StateType::ManagesDescendants => atk_sys::ATK_STATE_MANAGES_DESCENDANTS,
            StateType::Indeterminate => atk_sys::ATK_STATE_INDETERMINATE,
            StateType::Truncated => atk_sys::ATK_STATE_TRUNCATED,
            StateType::Required => atk_sys::ATK_STATE_REQUIRED,
            StateType::InvalidEntry => atk_sys::ATK_STATE_INVALID_ENTRY,
            StateType::SupportsAutocompletion => atk_sys::ATK_STATE_SUPPORTS_AUTOCOMPLETION,
            StateType::SelectableText => atk_sys::ATK_STATE_SELECTABLE_TEXT,
            StateType::Default => atk_sys::ATK_STATE_DEFAULT,
            StateType::Animated => atk_sys::ATK_STATE_ANIMATED,
            StateType::Visited => atk_sys::ATK_STATE_VISITED,
            StateType::Checkable => atk_sys::ATK_STATE_CHECKABLE,
            StateType::HasPopup => atk_sys::ATK_STATE_HAS_POPUP,
            StateType::HasTooltip => atk_sys::ATK_STATE_HAS_TOOLTIP,
            StateType::ReadOnly => atk_sys::ATK_STATE_READ_ONLY,
            StateType::LastDefined => atk_sys::ATK_STATE_LAST_DEFINED,
            StateType::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<atk_sys::AtkStateType> for StateType {
    fn from_glib(value: atk_sys::AtkStateType) -> Self {
        skip_assert_initialized!();
        match value {
            0 => StateType::Invalid,
            1 => StateType::Active,
            2 => StateType::Armed,
            3 => StateType::Busy,
            4 => StateType::Checked,
            5 => StateType::Defunct,
            6 => StateType::Editable,
            7 => StateType::Enabled,
            8 => StateType::Expandable,
            9 => StateType::Expanded,
            10 => StateType::Focusable,
            11 => StateType::Focused,
            12 => StateType::Horizontal,
            13 => StateType::Iconified,
            14 => StateType::Modal,
            15 => StateType::MultiLine,
            16 => StateType::Multiselectable,
            17 => StateType::Opaque,
            18 => StateType::Pressed,
            19 => StateType::Resizable,
            20 => StateType::Selectable,
            21 => StateType::Selected,
            22 => StateType::Sensitive,
            23 => StateType::Showing,
            24 => StateType::SingleLine,
            25 => StateType::Stale,
            26 => StateType::Transient,
            27 => StateType::Vertical,
            28 => StateType::Visible,
            29 => StateType::ManagesDescendants,
            30 => StateType::Indeterminate,
            31 => StateType::Truncated,
            32 => StateType::Required,
            33 => StateType::InvalidEntry,
            34 => StateType::SupportsAutocompletion,
            35 => StateType::SelectableText,
            36 => StateType::Default,
            37 => StateType::Animated,
            38 => StateType::Visited,
            39 => StateType::Checkable,
            40 => StateType::HasPopup,
            41 => StateType::HasTooltip,
            42 => StateType::ReadOnly,
            43 => StateType::LastDefined,
            value => StateType::__Unknown(value),
        }
    }
}

impl StaticType for StateType {
    fn static_type() -> Type {
        unsafe { from_glib(atk_sys::atk_state_type_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for StateType {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for StateType {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for StateType {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

/// Describes the text attributes supported
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum TextAttribute {
    /// Invalid attribute, like bad spelling or grammar.
    Invalid,
    /// The pixel width of the left margin
    LeftMargin,
    /// The pixel width of the right margin
    RightMargin,
    /// The number of pixels that the text is indented
    Indent,
    /// Either "true" or "false" indicating whether text is visible or not
    Invisible,
    /// Either "true" or "false" indicating whether text is editable or not
    Editable,
    /// Pixels of blank space to leave above each newline-terminated line.
    PixelsAboveLines,
    /// Pixels of blank space to leave below each newline-terminated line.
    PixelsBelowLines,
    /// Pixels of blank space to leave between wrapped lines inside the same newline-terminated line (paragraph).
    PixelsInsideWrap,
    /// "true" or "false" whether to make the background color for each character the height of the highest font used on the current line, or the height of the font used for the current character.
    BgFullHeight,
    /// Number of pixels that the characters are risen above the baseline
    Rise,
    /// "none", "single", "double", "low", or "error"
    Underline,
    /// "true" or "false" whether the text is strikethrough
    Strikethrough,
    /// The size of the characters in points. eg: 10
    Size,
    /// The scale of the characters. The value is a string representation of a double
    Scale,
    /// The weight of the characters.
    Weight,
    /// The language used
    Language,
    /// The font family name
    FamilyName,
    /// The background color. The value is an RGB value of the format "`u`,`u`,`u`"
    BgColor,
    /// The foreground color. The value is an RGB value of the format "`u`,`u`,`u`"
    FgColor,
    /// "true" if a ``GdkBitmap`` is set for stippling the background color.
    BgStipple,
    /// "true" if a ``GdkBitmap`` is set for stippling the foreground color.
    FgStipple,
    /// The wrap mode of the text, if any. Values are "none", "char", "word", or "word_char".
    WrapMode,
    /// The direction of the text, if set. Values are "none", "ltr" or "rtl"
    Direction,
    /// The justification of the text, if set. Values are "left", "right", "center" or "fill"
    Justification,
    /// The stretch of the text, if set. Values are "ultra_condensed", "extra_condensed", "condensed", "semi_condensed", "normal", "semi_expanded", "expanded", "extra_expanded" or "ultra_expanded"
    Stretch,
    /// The capitalization variant of the text, if set. Values are "normal" or "small_caps"
    Variant,
    /// The slant style of the text, if set. Values are "normal", "oblique" or "italic"
    Style,
    /// not a valid text attribute, used for finding end of enumeration
    LastDefined,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for TextAttribute {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "TextAttribute::{}",
            match *self {
                TextAttribute::Invalid => "Invalid",
                TextAttribute::LeftMargin => "LeftMargin",
                TextAttribute::RightMargin => "RightMargin",
                TextAttribute::Indent => "Indent",
                TextAttribute::Invisible => "Invisible",
                TextAttribute::Editable => "Editable",
                TextAttribute::PixelsAboveLines => "PixelsAboveLines",
                TextAttribute::PixelsBelowLines => "PixelsBelowLines",
                TextAttribute::PixelsInsideWrap => "PixelsInsideWrap",
                TextAttribute::BgFullHeight => "BgFullHeight",
                TextAttribute::Rise => "Rise",
                TextAttribute::Underline => "Underline",
                TextAttribute::Strikethrough => "Strikethrough",
                TextAttribute::Size => "Size",
                TextAttribute::Scale => "Scale",
                TextAttribute::Weight => "Weight",
                TextAttribute::Language => "Language",
                TextAttribute::FamilyName => "FamilyName",
                TextAttribute::BgColor => "BgColor",
                TextAttribute::FgColor => "FgColor",
                TextAttribute::BgStipple => "BgStipple",
                TextAttribute::FgStipple => "FgStipple",
                TextAttribute::WrapMode => "WrapMode",
                TextAttribute::Direction => "Direction",
                TextAttribute::Justification => "Justification",
                TextAttribute::Stretch => "Stretch",
                TextAttribute::Variant => "Variant",
                TextAttribute::Style => "Style",
                TextAttribute::LastDefined => "LastDefined",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for TextAttribute {
    type GlibType = atk_sys::AtkTextAttribute;

    fn to_glib(&self) -> atk_sys::AtkTextAttribute {
        match *self {
            TextAttribute::Invalid => atk_sys::ATK_TEXT_ATTR_INVALID,
            TextAttribute::LeftMargin => atk_sys::ATK_TEXT_ATTR_LEFT_MARGIN,
            TextAttribute::RightMargin => atk_sys::ATK_TEXT_ATTR_RIGHT_MARGIN,
            TextAttribute::Indent => atk_sys::ATK_TEXT_ATTR_INDENT,
            TextAttribute::Invisible => atk_sys::ATK_TEXT_ATTR_INVISIBLE,
            TextAttribute::Editable => atk_sys::ATK_TEXT_ATTR_EDITABLE,
            TextAttribute::PixelsAboveLines => atk_sys::ATK_TEXT_ATTR_PIXELS_ABOVE_LINES,
            TextAttribute::PixelsBelowLines => atk_sys::ATK_TEXT_ATTR_PIXELS_BELOW_LINES,
            TextAttribute::PixelsInsideWrap => atk_sys::ATK_TEXT_ATTR_PIXELS_INSIDE_WRAP,
            TextAttribute::BgFullHeight => atk_sys::ATK_TEXT_ATTR_BG_FULL_HEIGHT,
            TextAttribute::Rise => atk_sys::ATK_TEXT_ATTR_RISE,
            TextAttribute::Underline => atk_sys::ATK_TEXT_ATTR_UNDERLINE,
            TextAttribute::Strikethrough => atk_sys::ATK_TEXT_ATTR_STRIKETHROUGH,
            TextAttribute::Size => atk_sys::ATK_TEXT_ATTR_SIZE,
            TextAttribute::Scale => atk_sys::ATK_TEXT_ATTR_SCALE,
            TextAttribute::Weight => atk_sys::ATK_TEXT_ATTR_WEIGHT,
            TextAttribute::Language => atk_sys::ATK_TEXT_ATTR_LANGUAGE,
            TextAttribute::FamilyName => atk_sys::ATK_TEXT_ATTR_FAMILY_NAME,
            TextAttribute::BgColor => atk_sys::ATK_TEXT_ATTR_BG_COLOR,
            TextAttribute::FgColor => atk_sys::ATK_TEXT_ATTR_FG_COLOR,
            TextAttribute::BgStipple => atk_sys::ATK_TEXT_ATTR_BG_STIPPLE,
            TextAttribute::FgStipple => atk_sys::ATK_TEXT_ATTR_FG_STIPPLE,
            TextAttribute::WrapMode => atk_sys::ATK_TEXT_ATTR_WRAP_MODE,
            TextAttribute::Direction => atk_sys::ATK_TEXT_ATTR_DIRECTION,
            TextAttribute::Justification => atk_sys::ATK_TEXT_ATTR_JUSTIFICATION,
            TextAttribute::Stretch => atk_sys::ATK_TEXT_ATTR_STRETCH,
            TextAttribute::Variant => atk_sys::ATK_TEXT_ATTR_VARIANT,
            TextAttribute::Style => atk_sys::ATK_TEXT_ATTR_STYLE,
            TextAttribute::LastDefined => atk_sys::ATK_TEXT_ATTR_LAST_DEFINED,
            TextAttribute::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<atk_sys::AtkTextAttribute> for TextAttribute {
    fn from_glib(value: atk_sys::AtkTextAttribute) -> Self {
        skip_assert_initialized!();
        match value {
            0 => TextAttribute::Invalid,
            1 => TextAttribute::LeftMargin,
            2 => TextAttribute::RightMargin,
            3 => TextAttribute::Indent,
            4 => TextAttribute::Invisible,
            5 => TextAttribute::Editable,
            6 => TextAttribute::PixelsAboveLines,
            7 => TextAttribute::PixelsBelowLines,
            8 => TextAttribute::PixelsInsideWrap,
            9 => TextAttribute::BgFullHeight,
            10 => TextAttribute::Rise,
            11 => TextAttribute::Underline,
            12 => TextAttribute::Strikethrough,
            13 => TextAttribute::Size,
            14 => TextAttribute::Scale,
            15 => TextAttribute::Weight,
            16 => TextAttribute::Language,
            17 => TextAttribute::FamilyName,
            18 => TextAttribute::BgColor,
            19 => TextAttribute::FgColor,
            20 => TextAttribute::BgStipple,
            21 => TextAttribute::FgStipple,
            22 => TextAttribute::WrapMode,
            23 => TextAttribute::Direction,
            24 => TextAttribute::Justification,
            25 => TextAttribute::Stretch,
            26 => TextAttribute::Variant,
            27 => TextAttribute::Style,
            28 => TextAttribute::LastDefined,
            value => TextAttribute::__Unknown(value),
        }
    }
}

impl StaticType for TextAttribute {
    fn static_type() -> Type {
        unsafe { from_glib(atk_sys::atk_text_attribute_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for TextAttribute {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for TextAttribute {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for TextAttribute {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

/// Text boundary types used for specifying boundaries for regions of text.
/// This enumeration is deprecated since 2.9.4 and should not be used. Use
/// AtkTextGranularity with `Text::get_string_at_offset` instead.
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum TextBoundary {
    /// Boundary is the boundary between characters
    /// (including non-printing characters)
    Char,
    /// Boundary is the start (i.e. first character) of a word.
    WordStart,
    /// Boundary is the end (i.e. last
    /// character) of a word.
    WordEnd,
    /// Boundary is the first character in a sentence.
    SentenceStart,
    /// Boundary is the last (terminal)
    /// character in a sentence; in languages which use "sentence stop"
    /// punctuation such as English, the boundary is thus the '.', '?', or
    /// similar terminal punctuation character.
    SentenceEnd,
    /// Boundary is the initial character of the content or a
    /// character immediately following a newline, linefeed, or return character.
    LineStart,
    /// Boundary is the linefeed, or return
    /// character.
    LineEnd,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for TextBoundary {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "TextBoundary::{}",
            match *self {
                TextBoundary::Char => "Char",
                TextBoundary::WordStart => "WordStart",
                TextBoundary::WordEnd => "WordEnd",
                TextBoundary::SentenceStart => "SentenceStart",
                TextBoundary::SentenceEnd => "SentenceEnd",
                TextBoundary::LineStart => "LineStart",
                TextBoundary::LineEnd => "LineEnd",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for TextBoundary {
    type GlibType = atk_sys::AtkTextBoundary;

    fn to_glib(&self) -> atk_sys::AtkTextBoundary {
        match *self {
            TextBoundary::Char => atk_sys::ATK_TEXT_BOUNDARY_CHAR,
            TextBoundary::WordStart => atk_sys::ATK_TEXT_BOUNDARY_WORD_START,
            TextBoundary::WordEnd => atk_sys::ATK_TEXT_BOUNDARY_WORD_END,
            TextBoundary::SentenceStart => atk_sys::ATK_TEXT_BOUNDARY_SENTENCE_START,
            TextBoundary::SentenceEnd => atk_sys::ATK_TEXT_BOUNDARY_SENTENCE_END,
            TextBoundary::LineStart => atk_sys::ATK_TEXT_BOUNDARY_LINE_START,
            TextBoundary::LineEnd => atk_sys::ATK_TEXT_BOUNDARY_LINE_END,
            TextBoundary::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<atk_sys::AtkTextBoundary> for TextBoundary {
    fn from_glib(value: atk_sys::AtkTextBoundary) -> Self {
        skip_assert_initialized!();
        match value {
            0 => TextBoundary::Char,
            1 => TextBoundary::WordStart,
            2 => TextBoundary::WordEnd,
            3 => TextBoundary::SentenceStart,
            4 => TextBoundary::SentenceEnd,
            5 => TextBoundary::LineStart,
            6 => TextBoundary::LineEnd,
            value => TextBoundary::__Unknown(value),
        }
    }
}

impl StaticType for TextBoundary {
    fn static_type() -> Type {
        unsafe { from_glib(atk_sys::atk_text_boundary_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for TextBoundary {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for TextBoundary {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for TextBoundary {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

/// Describes the type of clipping required.
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum TextClipType {
    /// No clipping to be done
    None,
    /// Text clipped by min coordinate is omitted
    Min,
    /// Text clipped by max coordinate is omitted
    Max,
    /// Only text fully within mix/max bound is retained
    Both,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for TextClipType {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "TextClipType::{}",
            match *self {
                TextClipType::None => "None",
                TextClipType::Min => "Min",
                TextClipType::Max => "Max",
                TextClipType::Both => "Both",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for TextClipType {
    type GlibType = atk_sys::AtkTextClipType;

    fn to_glib(&self) -> atk_sys::AtkTextClipType {
        match *self {
            TextClipType::None => atk_sys::ATK_TEXT_CLIP_NONE,
            TextClipType::Min => atk_sys::ATK_TEXT_CLIP_MIN,
            TextClipType::Max => atk_sys::ATK_TEXT_CLIP_MAX,
            TextClipType::Both => atk_sys::ATK_TEXT_CLIP_BOTH,
            TextClipType::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<atk_sys::AtkTextClipType> for TextClipType {
    fn from_glib(value: atk_sys::AtkTextClipType) -> Self {
        skip_assert_initialized!();
        match value {
            0 => TextClipType::None,
            1 => TextClipType::Min,
            2 => TextClipType::Max,
            3 => TextClipType::Both,
            value => TextClipType::__Unknown(value),
        }
    }
}

impl StaticType for TextClipType {
    fn static_type() -> Type {
        unsafe { from_glib(atk_sys::atk_text_clip_type_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for TextClipType {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for TextClipType {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for TextClipType {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

/// Text granularity types used for specifying the granularity of the region of
/// text we are interested in.
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum TextGranularity {
    /// Granularity is defined by the boundaries between characters
    /// (including non-printing characters)
    Char,
    /// Granularity is defined by the boundaries of a word,
    /// starting at the beginning of the current word and finishing at the beginning of
    /// the following one, if present.
    Word,
    /// Granularity is defined by the boundaries of a sentence,
    /// starting at the beginning of the current sentence and finishing at the beginning of
    /// the following one, if present.
    Sentence,
    /// Granularity is defined by the boundaries of a line,
    /// starting at the beginning of the current line and finishing at the beginning of
    /// the following one, if present.
    Line,
    /// Granularity is defined by the boundaries of a paragraph,
    /// starting at the beginning of the current paragraph and finishing at the beginning of
    /// the following one, if present.
    Paragraph,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for TextGranularity {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "TextGranularity::{}",
            match *self {
                TextGranularity::Char => "Char",
                TextGranularity::Word => "Word",
                TextGranularity::Sentence => "Sentence",
                TextGranularity::Line => "Line",
                TextGranularity::Paragraph => "Paragraph",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for TextGranularity {
    type GlibType = atk_sys::AtkTextGranularity;

    fn to_glib(&self) -> atk_sys::AtkTextGranularity {
        match *self {
            TextGranularity::Char => atk_sys::ATK_TEXT_GRANULARITY_CHAR,
            TextGranularity::Word => atk_sys::ATK_TEXT_GRANULARITY_WORD,
            TextGranularity::Sentence => atk_sys::ATK_TEXT_GRANULARITY_SENTENCE,
            TextGranularity::Line => atk_sys::ATK_TEXT_GRANULARITY_LINE,
            TextGranularity::Paragraph => atk_sys::ATK_TEXT_GRANULARITY_PARAGRAPH,
            TextGranularity::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<atk_sys::AtkTextGranularity> for TextGranularity {
    fn from_glib(value: atk_sys::AtkTextGranularity) -> Self {
        skip_assert_initialized!();
        match value {
            0 => TextGranularity::Char,
            1 => TextGranularity::Word,
            2 => TextGranularity::Sentence,
            3 => TextGranularity::Line,
            4 => TextGranularity::Paragraph,
            value => TextGranularity::__Unknown(value),
        }
    }
}

impl StaticType for TextGranularity {
    fn static_type() -> Type {
        unsafe { from_glib(atk_sys::atk_text_granularity_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for TextGranularity {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for TextGranularity {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for TextGranularity {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

/// Default types for a given value. Those are defined in order to
/// easily get localized strings to describe a given value or a given
/// subrange, using `ValueType::get_localized_name`.
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum ValueType {
    VeryWeak,
    Weak,
    Acceptable,
    Strong,
    VeryStrong,
    VeryLow,
    Low,
    Medium,
    High,
    VeryHigh,
    VeryBad,
    Bad,
    Good,
    VeryGood,
    Best,
    LastDefined,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for ValueType {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "ValueType::{}",
            match *self {
                ValueType::VeryWeak => "VeryWeak",
                ValueType::Weak => "Weak",
                ValueType::Acceptable => "Acceptable",
                ValueType::Strong => "Strong",
                ValueType::VeryStrong => "VeryStrong",
                ValueType::VeryLow => "VeryLow",
                ValueType::Low => "Low",
                ValueType::Medium => "Medium",
                ValueType::High => "High",
                ValueType::VeryHigh => "VeryHigh",
                ValueType::VeryBad => "VeryBad",
                ValueType::Bad => "Bad",
                ValueType::Good => "Good",
                ValueType::VeryGood => "VeryGood",
                ValueType::Best => "Best",
                ValueType::LastDefined => "LastDefined",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for ValueType {
    type GlibType = atk_sys::AtkValueType;

    fn to_glib(&self) -> atk_sys::AtkValueType {
        match *self {
            ValueType::VeryWeak => atk_sys::ATK_VALUE_VERY_WEAK,
            ValueType::Weak => atk_sys::ATK_VALUE_WEAK,
            ValueType::Acceptable => atk_sys::ATK_VALUE_ACCEPTABLE,
            ValueType::Strong => atk_sys::ATK_VALUE_STRONG,
            ValueType::VeryStrong => atk_sys::ATK_VALUE_VERY_STRONG,
            ValueType::VeryLow => atk_sys::ATK_VALUE_VERY_LOW,
            ValueType::Low => atk_sys::ATK_VALUE_LOW,
            ValueType::Medium => atk_sys::ATK_VALUE_MEDIUM,
            ValueType::High => atk_sys::ATK_VALUE_HIGH,
            ValueType::VeryHigh => atk_sys::ATK_VALUE_VERY_HIGH,
            ValueType::VeryBad => atk_sys::ATK_VALUE_VERY_BAD,
            ValueType::Bad => atk_sys::ATK_VALUE_BAD,
            ValueType::Good => atk_sys::ATK_VALUE_GOOD,
            ValueType::VeryGood => atk_sys::ATK_VALUE_VERY_GOOD,
            ValueType::Best => atk_sys::ATK_VALUE_BEST,
            ValueType::LastDefined => atk_sys::ATK_VALUE_LAST_DEFINED,
            ValueType::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<atk_sys::AtkValueType> for ValueType {
    fn from_glib(value: atk_sys::AtkValueType) -> Self {
        skip_assert_initialized!();
        match value {
            0 => ValueType::VeryWeak,
            1 => ValueType::Weak,
            2 => ValueType::Acceptable,
            3 => ValueType::Strong,
            4 => ValueType::VeryStrong,
            5 => ValueType::VeryLow,
            6 => ValueType::Low,
            7 => ValueType::Medium,
            8 => ValueType::High,
            9 => ValueType::VeryHigh,
            10 => ValueType::VeryBad,
            11 => ValueType::Bad,
            12 => ValueType::Good,
            13 => ValueType::VeryGood,
            14 => ValueType::Best,
            15 => ValueType::LastDefined,
            value => ValueType::__Unknown(value),
        }
    }
}

impl StaticType for ValueType {
    fn static_type() -> Type {
        unsafe { from_glib(atk_sys::atk_value_type_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for ValueType {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for ValueType {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for ValueType {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}