1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
  27
  28
  29
  30
  31
  32
  33
  34
  35
  36
  37
  38
  39
  40
  41
  42
  43
  44
  45
  46
  47
  48
  49
  50
  51
  52
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
 435
 436
 437
 438
 439
 440
 441
 442
 443
 444
 445
 446
 447
 448
 449
 450
 451
 452
 453
 454
 455
 456
 457
 458
 459
 460
 461
 462
 463
 464
 465
 466
 467
 468
 469
 470
 471
 472
 473
 474
 475
 476
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 519
 520
 521
 522
 523
 524
 525
 526
 527
 528
 529
 530
 531
 532
 533
 534
 535
 536
 537
 538
 539
 540
 541
 542
 543
 544
 545
 546
 547
 548
 549
 550
 551
 552
 553
 554
 555
 556
 557
 558
 559
 560
 561
 562
 563
 564
 565
 566
 567
 568
 569
 570
 571
 572
 573
 574
 575
 576
 577
 578
 579
 580
 581
 582
 583
 584
 585
 586
 587
 588
 589
 590
 591
 592
 593
 594
 595
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605
 606
 607
 608
 609
 610
 611
 612
 613
 614
 615
 616
 617
 618
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8676
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705
8706
8707
8708
8709
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
8805
8806
8807
8808
8809
8810
8811
8812
8813
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
8834
8835
8836
8837
8838
8839
8840
8841
8842
8843
8844
8845
8846
8847
8848
8849
8850
8851
8852
8853
8854
8855
8856
8857
8858
8859
8860
8861
8862
8863
8864
8865
8866
8867
8868
8869
8870
8871
8872
8873
8874
8875
8876
8877
8878
8879
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
8890
8891
8892
8893
8894
8895
8896
8897
8898
8899
8900
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
8911
8912
8913
8914
8915
8916
8917
8918
8919
8920
8921
8922
8923
8924
8925
8926
8927
8928
8929
8930
8931
8932
8933
8934
8935
8936
8937
8938
8939
8940
8941
8942
8943
8944
8945
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956
8957
8958
8959
8960
8961
8962
8963
8964
8965
8966
8967
8968
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986
8987
8988
8989
8990
8991
8992
8993
8994
8995
8996
8997
8998
8999
9000
9001
9002
9003
9004
9005
9006
9007
9008
9009
9010
9011
9012
9013
9014
9015
9016
9017
9018
9019
9020
9021
9022
9023
9024
9025
9026
9027
9028
9029
9030
9031
9032
9033
9034
9035
9036
9037
9038
9039
9040
9041
9042
9043
9044
9045
9046
9047
9048
9049
9050
9051
9052
9053
9054
9055
9056
9057
9058
9059
9060
9061
9062
9063
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073
9074
9075
9076
9077
9078
9079
9080
9081
9082
9083
9084
9085
9086
9087
9088
9089
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
9125
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
// 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 crate::AccelFlags;
use crate::AccelGroup;
use crate::Align;
use crate::Allocation;
use crate::Buildable;
use crate::Clipboard;
use crate::DirectionType;
use crate::DragResult;
use crate::Orientation;
use crate::Requisition;
use crate::SelectionData;
use crate::Settings;
use crate::SizeRequestMode;
use crate::StateFlags;
use crate::StyleContext;
use crate::TargetList;
use crate::TextDirection;
use crate::Tooltip;
use crate::WidgetHelpType;
use crate::WidgetPath;
use crate::Window;
use glib::object::Cast;
use glib::object::IsA;
use glib::object::ObjectExt;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
use glib::StaticType;
use glib::ToValue;
use std::boxed::Box as Box_;
use std::fmt;
use std::mem;
use std::mem::transmute;

glib::wrapper! {
    /// GtkWidget is the base class all widgets in GTK+ derive from. It manages the
    /// widget lifecycle, states and style.
    ///
    /// # Height-for-width Geometry Management # {`geometry`-management}
    ///
    /// GTK+ uses a height-for-width (and width-for-height) geometry management
    /// system. Height-for-width means that a widget can change how much
    /// vertical space it needs, depending on the amount of horizontal space
    /// that it is given (and similar for width-for-height). The most common
    /// example is a label that reflows to fill up the available width, wraps
    /// to fewer lines, and therefore needs less height.
    ///
    /// Height-for-width geometry management is implemented in GTK+ by way
    /// of five virtual methods:
    ///
    /// - `GtkWidgetClass.get_request_mode()`
    /// - `GtkWidgetClass.get_preferred_width()`
    /// - `GtkWidgetClass.get_preferred_height()`
    /// - `GtkWidgetClass.get_preferred_height_for_width()`
    /// - `GtkWidgetClass.get_preferred_width_for_height()`
    /// - `GtkWidgetClass.get_preferred_height_and_baseline_for_width()`
    ///
    /// There are some important things to keep in mind when implementing
    /// height-for-width and when using it in container implementations.
    ///
    /// The geometry management system will query a widget hierarchy in
    /// only one orientation at a time. When widgets are initially queried
    /// for their minimum sizes it is generally done in two initial passes
    /// in the [`SizeRequestMode`][crate::SizeRequestMode] chosen by the toplevel.
    ///
    /// For example, when queried in the normal
    /// [`SizeRequestMode::HeightForWidth`][crate::SizeRequestMode::HeightForWidth] mode:
    /// First, the default minimum and natural width for each widget
    /// in the interface will be computed using [`WidgetExt::preferred_width()`][crate::prelude::WidgetExt::preferred_width()].
    /// Because the preferred widths for each container depend on the preferred
    /// widths of their children, this information propagates up the hierarchy,
    /// and finally a minimum and natural width is determined for the entire
    /// toplevel. Next, the toplevel will use the minimum width to query for the
    /// minimum height contextual to that width using
    /// [`WidgetExt::preferred_height_for_width()`][crate::prelude::WidgetExt::preferred_height_for_width()], which will also be a highly
    /// recursive operation. The minimum height for the minimum width is normally
    /// used to set the minimum size constraint on the toplevel
    /// (unless [`GtkWindowExt::set_geometry_hints()`][crate::prelude::GtkWindowExt::set_geometry_hints()] is explicitly used instead).
    ///
    /// After the toplevel window has initially requested its size in both
    /// dimensions it can go on to allocate itself a reasonable size (or a size
    /// previously specified with [`GtkWindowExt::set_default_size()`][crate::prelude::GtkWindowExt::set_default_size()]). During the
    /// recursive allocation process it’s important to note that request cycles
    /// will be recursively executed while container widgets allocate their children.
    /// Each container widget, once allocated a size, will go on to first share the
    /// space in one orientation among its children and then request each child's
    /// height for its target allocated width or its width for allocated height,
    /// depending. In this way a [`Widget`][crate::Widget] will typically be requested its size
    /// a number of times before actually being allocated a size. The size a
    /// widget is finally allocated can of course differ from the size it has
    /// requested. For this reason, [`Widget`][crate::Widget] caches a small number of results
    /// to avoid re-querying for the same sizes in one allocation cycle.
    ///
    /// See
    /// [GtkContainer’s geometry management section][container-geometry-management]
    /// to learn more about how height-for-width allocations are performed
    /// by container widgets.
    ///
    /// If a widget does move content around to intelligently use up the
    /// allocated size then it must support the request in both
    /// `GtkSizeRequestModes` even if the widget in question only
    /// trades sizes in a single orientation.
    ///
    /// For instance, a [`Label`][crate::Label] that does height-for-width word wrapping
    /// will not expect to have `GtkWidgetClass.get_preferred_height()` called
    /// because that call is specific to a width-for-height request. In this
    /// case the label must return the height required for its own minimum
    /// possible width. By following this rule any widget that handles
    /// height-for-width or width-for-height requests will always be allocated
    /// at least enough space to fit its own content.
    ///
    /// Here are some examples of how a [`SizeRequestMode::HeightForWidth`][crate::SizeRequestMode::HeightForWidth] widget
    /// generally deals with width-for-height requests, for `GtkWidgetClass.get_preferred_height()`
    /// it will do:
    ///
    ///
    ///
    /// **⚠️ The following code is in C ⚠️**
    ///
    /// ```C
    /// static void
    /// foo_widget_get_preferred_height (GtkWidget *widget,
    ///                                  gint *min_height,
    ///                                  gint *nat_height)
    /// {
    ///    if (i_am_in_height_for_width_mode)
    ///      {
    ///        gint min_width, nat_width;
    ///
    ///        GTK_WIDGET_GET_CLASS (widget)->get_preferred_width (widget,
    ///                                                            &min_width,
    ///                                                            &nat_width);
    ///        GTK_WIDGET_GET_CLASS (widget)->get_preferred_height_for_width
    ///                                                           (widget,
    ///                                                            min_width,
    ///                                                            min_height,
    ///                                                            nat_height);
    ///      }
    ///    else
    ///      {
    ///         ... some widgets do both. For instance, if a GtkLabel is
    ///         rotated to 90 degrees it will return the minimum and
    ///         natural height for the rotated label here.
    ///      }
    /// }
    /// ```
    ///
    /// And in `GtkWidgetClass.get_preferred_width_for_height()` it will simply return
    /// the minimum and natural width:
    ///
    ///
    /// **⚠️ The following code is in C ⚠️**
    ///
    /// ```C
    /// static void
    /// foo_widget_get_preferred_width_for_height (GtkWidget *widget,
    ///                                            gint for_height,
    ///                                            gint *min_width,
    ///                                            gint *nat_width)
    /// {
    ///    if (i_am_in_height_for_width_mode)
    ///      {
    ///        GTK_WIDGET_GET_CLASS (widget)->get_preferred_width (widget,
    ///                                                            min_width,
    ///                                                            nat_width);
    ///      }
    ///    else
    ///      {
    ///         ... again if a widget is sometimes operating in
    ///         width-for-height mode (like a rotated GtkLabel) it can go
    ///         ahead and do its real width for height calculation here.
    ///      }
    /// }
    /// ```
    ///
    /// Often a widget needs to get its own request during size request or
    /// allocation. For example, when computing height it may need to also
    /// compute width. Or when deciding how to use an allocation, the widget
    /// may need to know its natural size. In these cases, the widget should
    /// be careful to call its virtual methods directly, like this:
    ///
    ///
    ///
    /// **⚠️ The following code is in C ⚠️**
    ///
    /// ```C
    /// GTK_WIDGET_GET_CLASS(widget)->get_preferred_width (widget,
    ///                                                    &min,
    ///                                                    &natural);
    /// ```
    ///
    /// It will not work to use the wrapper functions, such as
    /// [`WidgetExt::preferred_width()`][crate::prelude::WidgetExt::preferred_width()] inside your own size request
    /// implementation. These return a request adjusted by [`SizeGroup`][crate::SizeGroup]
    /// and by the `GtkWidgetClass.adjust_size_request()` virtual method. If a
    /// widget used the wrappers inside its virtual method implementations,
    /// then the adjustments (such as widget margins) would be applied
    /// twice. GTK+ therefore does not allow this and will warn if you try
    /// to do it.
    ///
    /// Of course if you are getting the size request for
    /// another widget, such as a child of a
    /// container, you must use the wrapper APIs.
    /// Otherwise, you would not properly consider widget margins,
    /// [`SizeGroup`][crate::SizeGroup], and so forth.
    ///
    /// Since 3.10 GTK+ also supports baseline vertical alignment of widgets. This
    /// means that widgets are positioned such that the typographical baseline of
    /// widgets in the same row are aligned. This happens if a widget supports baselines,
    /// has a vertical alignment of [`Align::Baseline`][crate::Align::Baseline], and is inside a container
    /// that supports baselines and has a natural “row” that it aligns to the baseline,
    /// or a baseline assigned to it by the grandparent.
    ///
    /// Baseline alignment support for a widget is done by the `GtkWidgetClass.get_preferred_height_and_baseline_for_width()`
    /// virtual function. It allows you to report a baseline in combination with the
    /// minimum and natural height. If there is no baseline you can return -1 to indicate
    /// this. The default implementation of this virtual function calls into the
    /// `GtkWidgetClass.get_preferred_height()` and `GtkWidgetClass.get_preferred_height_for_width()`,
    /// so if baselines are not supported it doesn’t need to be implemented.
    ///
    /// If a widget ends up baseline aligned it will be allocated all the space in the parent
    /// as if it was [`Align::Fill`][crate::Align::Fill], but the selected baseline can be found via [`WidgetExt::allocated_baseline()`][crate::prelude::WidgetExt::allocated_baseline()].
    /// If this has a value other than -1 you need to align the widget such that the baseline
    /// appears at the position.
    ///
    /// # Style Properties
    ///
    /// [`Widget`][crate::Widget] introduces “style
    /// properties” - these are basically object properties that are stored
    /// not on the object, but in the style object associated to the widget. Style
    /// properties are set in [resource files][gtk3-Resource-Files].
    /// This mechanism is used for configuring such things as the location of the
    /// scrollbar arrows through the theme, giving theme authors more control over the
    /// look of applications without the need to write a theme engine in C.
    ///
    /// Use `gtk_widget_class_install_style_property()` to install style properties for
    /// a widget class, `gtk_widget_class_find_style_property()` or
    /// `gtk_widget_class_list_style_properties()` to get information about existing
    /// style properties and [`WidgetExt::style_get_property()`][crate::prelude::WidgetExt::style_get_property()], `gtk_widget_style_get()` or
    /// `gtk_widget_style_get_valist()` to obtain the value of a style property.
    ///
    /// # GtkWidget as GtkBuildable
    ///
    /// The GtkWidget implementation of the GtkBuildable interface supports a
    /// custom `<accelerator>` element, which has attributes named ”key”, ”modifiers”
    /// and ”signal” and allows to specify accelerators.
    ///
    /// An example of a UI definition fragment specifying an accelerator:
    ///
    ///
    /// **⚠️ The following code is in C ⚠️**
    ///
    /// ```C
    /// static void
    /// foo_widget_class_init (FooWidgetClass *klass)
    /// {
    ///   // ...
    ///
    ///   gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass),
    ///                                                "/com/example/ui/foowidget.ui");
    /// }
    /// ```
    ///
    /// You will also need to call [`WidgetExt::init_template()`][crate::prelude::WidgetExt::init_template()] from the instance
    /// initialization function:
    ///
    ///
    ///
    /// **⚠️ The following code is in C ⚠️**
    ///
    /// ```C
    /// static void
    /// foo_widget_init (FooWidget *self)
    /// {
    ///   // ...
    ///   gtk_widget_init_template (GTK_WIDGET (self));
    /// }
    /// ```
    ///
    /// You can access widgets defined in the template using the
    /// [`WidgetExt::template_child()`][crate::prelude::WidgetExt::template_child()] function, but you will typically declare
    /// a pointer in the instance private data structure of your type using the same
    /// name as the widget in the template definition, and call
    /// `gtk_widget_class_bind_template_child_private()` with that name, e.g.
    ///
    ///
    ///
    /// **⚠️ The following code is in C ⚠️**
    ///
    /// ```C
    /// typedef struct {
    ///   GtkWidget *hello_button;
    ///   GtkWidget *goodbye_button;
    /// } FooWidgetPrivate;
    ///
    /// G_DEFINE_TYPE_WITH_PRIVATE (FooWidget, foo_widget, GTK_TYPE_BOX)
    ///
    /// static void
    /// foo_widget_class_init (FooWidgetClass *klass)
    /// {
    ///   // ...
    ///   gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass),
    ///                                                "/com/example/ui/foowidget.ui");
    ///   gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass),
    ///                                                 FooWidget, hello_button);
    ///   gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass),
    ///                                                 FooWidget, goodbye_button);
    /// }
    ///
    /// static void
    /// foo_widget_init (FooWidget *widget)
    /// {
    ///
    /// }
    /// ```
    ///
    /// You can also use `gtk_widget_class_bind_template_callback()` to connect a signal
    /// callback defined in the template with a function visible in the scope of the
    /// class, e.g.
    ///
    ///
    ///
    /// **⚠️ The following code is in C ⚠️**
    ///
    /// ```C
    /// // the signal handler has the instance and user data swapped
    /// // because of the swapped="yes" attribute in the template XML
    /// static void
    /// hello_button_clicked (FooWidget *self,
    ///                       GtkButton *button)
    /// {
    ///   g_print ("Hello, world!\n");
    /// }
    ///
    /// static void
    /// foo_widget_class_init (FooWidgetClass *klass)
    /// {
    ///   // ...
    ///   gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass),
    ///                                                "/com/example/ui/foowidget.ui");
    ///   gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (klass), hello_button_clicked);
    /// }
    /// ```
    ///
    /// This is an Abstract Base Class, you cannot instantiate it.
    ///
    /// # Implements
    ///
    /// [`WidgetExt`][trait@crate::prelude::WidgetExt], [`trait@glib::ObjectExt`], [`BuildableExt`][trait@crate::prelude::BuildableExt], [`WidgetExtManual`][trait@crate::prelude::WidgetExtManual], [`BuildableExtManual`][trait@crate::prelude::BuildableExtManual]
    #[doc(alias = "GtkWidget")]
    pub struct Widget(Object<ffi::GtkWidget, ffi::GtkWidgetClass>) @implements Buildable;

    match fn {
        type_ => || ffi::gtk_widget_get_type(),
    }
}

impl Widget {
    //#[doc(alias = "gtk_widget_new")]
    //pub fn new(type_: glib::types::Type, first_property_name: &str, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) -> Widget {
    //    unsafe { TODO: call ffi:gtk_widget_new() }
    //}

    /// Obtains the current default reading direction. See
    /// [`set_default_direction()`][Self::set_default_direction()].
    ///
    /// # Returns
    ///
    /// the current default direction.
    #[doc(alias = "gtk_widget_get_default_direction")]
    #[doc(alias = "get_default_direction")]
    pub fn default_direction() -> TextDirection {
        assert_initialized_main_thread!();
        unsafe { from_glib(ffi::gtk_widget_get_default_direction()) }
    }

    /// Sets the default reading direction for widgets where the
    /// direction has not been explicitly set by [`WidgetExt::set_direction()`][crate::prelude::WidgetExt::set_direction()].
    /// ## `dir`
    /// the new default direction. This cannot be
    ///  [`TextDirection::None`][crate::TextDirection::None].
    #[doc(alias = "gtk_widget_set_default_direction")]
    pub fn set_default_direction(dir: TextDirection) {
        assert_initialized_main_thread!();
        unsafe {
            ffi::gtk_widget_set_default_direction(dir.into_glib());
        }
    }
}

impl fmt::Display for Widget {
    #[inline]
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        f.write_str(&WidgetExt::widget_name(self))
    }
}

pub const NONE_WIDGET: Option<&Widget> = None;

/// Trait containing all [`struct@Widget`] methods.
///
/// # Implementors
///
/// [`Actionable`][struct@crate::Actionable], [`AppChooser`][struct@crate::AppChooser], [`Calendar`][struct@crate::Calendar], [`CellEditable`][struct@crate::CellEditable], [`CellView`][struct@crate::CellView], [`Container`][struct@crate::Container], [`DrawingArea`][struct@crate::DrawingArea], [`Entry`][struct@crate::Entry], [`GLArea`][struct@crate::GLArea], [`Invisible`][struct@crate::Invisible], [`LevelBar`][struct@crate::LevelBar], [`Misc`][struct@crate::Misc], [`ProgressBar`][struct@crate::ProgressBar], [`Range`][struct@crate::Range], [`Separator`][struct@crate::Separator], [`Spinner`][struct@crate::Spinner], [`Switch`][struct@crate::Switch], [`ToolShell`][struct@crate::ToolShell], [`Widget`][struct@crate::Widget]
pub trait WidgetExt: 'static {
    /// For widgets that can be “activated” (buttons, menu items, etc.)
    /// this function activates them. Activation is what happens when you
    /// press Enter on a widget during key navigation. If `self` isn't
    /// activatable, the function returns [`false`].
    ///
    /// # Returns
    ///
    /// [`true`] if the widget was activatable
    #[doc(alias = "gtk_widget_activate")]
    fn activate(&self) -> bool;

    /// Installs an accelerator for this `self` in `accel_group` that causes
    /// `accel_signal` to be emitted if the accelerator is activated.
    /// The `accel_group` needs to be added to the widget’s toplevel via
    /// [`GtkWindowExt::add_accel_group()`][crate::prelude::GtkWindowExt::add_accel_group()], and the signal must be of type `G_SIGNAL_ACTION`.
    /// Accelerators added through this function are not user changeable during
    /// runtime. If you want to support accelerators that can be changed by the
    /// user, use `gtk_accel_map_add_entry()` and [`set_accel_path()`][Self::set_accel_path()] or
    /// [`GtkMenuItemExt::set_accel_path()`][crate::prelude::GtkMenuItemExt::set_accel_path()] instead.
    /// ## `accel_signal`
    /// widget signal to emit on accelerator activation
    /// ## `accel_group`
    /// accel group for this widget, added to its toplevel
    /// ## `accel_key`
    /// GDK keyval of the accelerator
    /// ## `accel_mods`
    /// modifier key combination of the accelerator
    /// ## `accel_flags`
    /// flag accelerators, e.g. [`AccelFlags::VISIBLE`][crate::AccelFlags::VISIBLE]
    #[doc(alias = "gtk_widget_add_accelerator")]
    fn add_accelerator<P: IsA<AccelGroup>>(
        &self,
        accel_signal: &str,
        accel_group: &P,
        accel_key: u32,
        accel_mods: gdk::ModifierType,
        accel_flags: AccelFlags,
    );

    /// Adds the device events in the bitfield `events` to the event mask for
    /// `self`. See [`set_device_events()`][Self::set_device_events()] for details.
    /// ## `device`
    /// a [`gdk::Device`][crate::gdk::Device]
    /// ## `events`
    /// an event mask, see [`gdk::EventMask`][crate::gdk::EventMask]
    #[doc(alias = "gtk_widget_add_device_events")]
    fn add_device_events(&self, device: &gdk::Device, events: gdk::EventMask);

    /// Adds a widget to the list of mnemonic labels for
    /// this widget. (See [`list_mnemonic_labels()`][Self::list_mnemonic_labels()]). Note the
    /// list of mnemonic labels for the widget is cleared when the
    /// widget is destroyed, so the caller must make sure to update
    /// its internal state at this point as well, by using a connection
    /// to the `signal::Widget::destroy` signal or a weak notifier.
    /// ## `label`
    /// a [`Widget`][crate::Widget] that acts as a mnemonic label for `self`
    #[doc(alias = "gtk_widget_add_mnemonic_label")]
    fn add_mnemonic_label<P: IsA<Widget>>(&self, label: &P);

    /// Determines whether an accelerator that activates the signal
    /// identified by `signal_id` can currently be activated.
    /// This is done by emitting the `signal::Widget::can-activate-accel`
    /// signal on `self`; if the signal isn’t overridden by a
    /// handler or in a derived widget, then the default check is
    /// that the widget must be sensitive, and the widget and all
    /// its ancestors mapped.
    /// ## `signal_id`
    /// the ID of a signal installed on `self`
    ///
    /// # Returns
    ///
    /// [`true`] if the accelerator can be activated.
    #[doc(alias = "gtk_widget_can_activate_accel")]
    fn can_activate_accel(&self, signal_id: u32) -> bool;

    /// This function is used by custom widget implementations; if you're
    /// writing an app, you’d use [`grab_focus()`][Self::grab_focus()] to move the focus
    /// to a particular widget, and [`ContainerExt::set_focus_chain()`][crate::prelude::ContainerExt::set_focus_chain()] to
    /// change the focus tab order. So you may want to investigate those
    /// functions instead.
    ///
    /// [`child_focus()`][Self::child_focus()] is called by containers as the user moves
    /// around the window using keyboard shortcuts. `direction` indicates
    /// what kind of motion is taking place (up, down, left, right, tab
    /// forward, tab backward). [`child_focus()`][Self::child_focus()] emits the
    /// `signal::Widget::focus` signal; widgets override the default handler
    /// for this signal in order to implement appropriate focus behavior.
    ///
    /// The default ::focus handler for a widget should return [`true`] if
    /// moving in `direction` left the focus on a focusable location inside
    /// that widget, and [`false`] if moving in `direction` moved the focus
    /// outside the widget. If returning [`true`], widgets normally
    /// call [`grab_focus()`][Self::grab_focus()] to place the focus accordingly;
    /// if returning [`false`], they don’t modify the current focus location.
    /// ## `direction`
    /// direction of focus movement
    ///
    /// # Returns
    ///
    /// [`true`] if focus ended up inside `self`
    #[doc(alias = "gtk_widget_child_focus")]
    fn child_focus(&self, direction: DirectionType) -> bool;

    /// Emits a `signal::Widget::child-notify` signal for the
    /// [child property][child-properties] `child_property`
    /// on `self`.
    ///
    /// This is the analogue of [`ObjectExtManual::notify()`][crate::glib::prelude::ObjectExtManual::notify()] for child properties.
    ///
    /// Also see [`ContainerExt::child_notify()`][crate::prelude::ContainerExt::child_notify()].
    /// ## `child_property`
    /// the name of a child property installed on the
    ///  class of `self`’s parent
    #[doc(alias = "gtk_widget_child_notify")]
    fn child_notify(&self, child_property: &str);

    /// Computes whether a container should give this widget extra space
    /// when possible. Containers should check this, rather than
    /// looking at [`hexpands()`][Self::hexpands()] or [`vexpands()`][Self::vexpands()].
    ///
    /// This function already checks whether the widget is visible, so
    /// visibility does not need to be checked separately. Non-visible
    /// widgets are not expanded.
    ///
    /// The computed expand value uses either the expand setting explicitly
    /// set on the widget itself, or, if none has been explicitly set,
    /// the widget may expand if some of its children do.
    /// ## `orientation`
    /// expand direction
    ///
    /// # Returns
    ///
    /// whether widget tree rooted here should be expanded
    #[doc(alias = "gtk_widget_compute_expand")]
    fn compute_expand(&self, orientation: Orientation) -> bool;

    /// Creates a new [`pango::Context`][crate::pango::Context] with the appropriate font map,
    /// font options, font description, and base direction for drawing
    /// text for this widget. See also [`pango_context()`][Self::pango_context()].
    ///
    /// # Returns
    ///
    /// the new [`pango::Context`][crate::pango::Context]
    #[doc(alias = "gtk_widget_create_pango_context")]
    fn create_pango_context(&self) -> pango::Context;

    /// Creates a new [`pango::Layout`][crate::pango::Layout] with the appropriate font map,
    /// font description, and base direction for drawing text for
    /// this widget.
    ///
    /// If you keep a [`pango::Layout`][crate::pango::Layout] created in this way around, you need
    /// to re-create it when the widget [`pango::Context`][crate::pango::Context] is replaced.
    /// This can be tracked by using the `signal::Widget::screen-changed` signal
    /// on the widget.
    /// ## `text`
    /// text to set on the layout (can be [`None`])
    ///
    /// # Returns
    ///
    /// the new [`pango::Layout`][crate::pango::Layout]
    #[doc(alias = "gtk_widget_create_pango_layout")]
    fn create_pango_layout(&self, text: Option<&str>) -> pango::Layout;

    //#[doc(alias = "gtk_widget_destroyed")]
    //fn destroyed<P: IsA<Widget>>(&self, widget_pointer: P);

    /// Returns [`true`] if `device` has been shadowed by a GTK+
    /// device grab on another widget, so it would stop sending
    /// events to `self`. This may be used in the
    /// `signal::Widget::grab-notify` signal to check for specific
    /// devices. See [`device_grab_add()`][crate::device_grab_add()].
    /// ## `device`
    /// a [`gdk::Device`][crate::gdk::Device]
    ///
    /// # Returns
    ///
    /// [`true`] if there is an ongoing grab on `device`
    ///  by another [`Widget`][crate::Widget] than `self`.
    #[doc(alias = "gtk_widget_device_is_shadowed")]
    fn device_is_shadowed(&self, device: &gdk::Device) -> bool;

    /// Initiates a drag on the source side. The function only needs to be used
    /// when the application is starting drags itself, and is not needed when
    /// [`WidgetExtManual::drag_source_set()`][crate::prelude::WidgetExtManual::drag_source_set()] is used.
    ///
    /// The `event` is used to retrieve the timestamp that will be used internally to
    /// grab the pointer. If `event` is [`None`], then `GDK_CURRENT_TIME` will be used.
    /// However, you should try to pass a real event in all cases, since that can be
    /// used to get information about the drag.
    ///
    /// Generally there are three cases when you want to start a drag by hand by
    /// calling this function:
    ///
    /// 1. During a `signal::Widget::button-press-event` handler, if you want to start a drag
    /// immediately when the user presses the mouse button. Pass the `event`
    /// that you have in your `signal::Widget::button-press-event` handler.
    ///
    /// 2. During a `signal::Widget::motion-notify-event` handler, if you want to start a drag
    /// when the mouse moves past a certain threshold distance after a button-press.
    /// Pass the `event` that you have in your `signal::Widget::motion-notify-event` handler.
    ///
    /// 3. During a timeout handler, if you want to start a drag after the mouse
    /// button is held down for some time. Try to save the last event that you got
    /// from the mouse, using `gdk_event_copy()`, and pass it to this function
    /// (remember to free the event with `gdk_event_free()` when you are done).
    /// If you really cannot pass a real event, pass [`None`] instead.
    /// ## `targets`
    /// The targets (data formats) in which the
    ///  source can provide the data
    /// ## `actions`
    /// A bitmask of the allowed drag actions for this drag
    /// ## `button`
    /// The button the user clicked to start the drag
    /// ## `event`
    /// The event that triggered the start of the drag,
    ///  or [`None`] if none can be obtained.
    /// ## `x`
    /// The initial x coordinate to start dragging from, in the coordinate space
    ///  of `self`. If -1 is passed, the coordinates are retrieved from `event` or
    ///  the current pointer position
    /// ## `y`
    /// The initial y coordinate to start dragging from, in the coordinate space
    ///  of `self`. If -1 is passed, the coordinates are retrieved from `event` or
    ///  the current pointer position
    ///
    /// # Returns
    ///
    /// the context for this drag
    #[doc(alias = "gtk_drag_begin_with_coordinates")]
    fn drag_begin_with_coordinates(
        &self,
        targets: &TargetList,
        actions: gdk::DragAction,
        button: i32,
        event: Option<&gdk::Event>,
        x: i32,
        y: i32,
    ) -> Option<gdk::DragContext>;

    /// Checks to see if a mouse drag starting at (`start_x`, `start_y`) and ending
    /// at (`current_x`, `current_y`) has passed the GTK+ drag threshold, and thus
    /// should trigger the beginning of a drag-and-drop operation.
    /// ## `start_x`
    /// X coordinate of start of drag
    /// ## `start_y`
    /// Y coordinate of start of drag
    /// ## `current_x`
    /// current X coordinate
    /// ## `current_y`
    /// current Y coordinate
    ///
    /// # Returns
    ///
    /// [`true`] if the drag threshold has been passed.
    #[doc(alias = "gtk_drag_check_threshold")]
    fn drag_check_threshold(
        &self,
        start_x: i32,
        start_y: i32,
        current_x: i32,
        current_y: i32,
    ) -> bool;

    /// Add the image targets supported by [`SelectionData`][crate::SelectionData] to
    /// the target list of the drag destination. The targets
    /// are added with `info` = 0. If you need another value,
    /// use [`TargetList::add_image_targets()`][crate::TargetList::add_image_targets()] and
    /// [`drag_dest_set_target_list()`][Self::drag_dest_set_target_list()].
    #[doc(alias = "gtk_drag_dest_add_image_targets")]
    fn drag_dest_add_image_targets(&self);

    /// Add the text targets supported by [`SelectionData`][crate::SelectionData] to
    /// the target list of the drag destination. The targets
    /// are added with `info` = 0. If you need another value,
    /// use [`TargetList::add_text_targets()`][crate::TargetList::add_text_targets()] and
    /// [`drag_dest_set_target_list()`][Self::drag_dest_set_target_list()].
    #[doc(alias = "gtk_drag_dest_add_text_targets")]
    fn drag_dest_add_text_targets(&self);

    /// Add the URI targets supported by [`SelectionData`][crate::SelectionData] to
    /// the target list of the drag destination. The targets
    /// are added with `info` = 0. If you need another value,
    /// use [`TargetList::add_uri_targets()`][crate::TargetList::add_uri_targets()] and
    /// [`drag_dest_set_target_list()`][Self::drag_dest_set_target_list()].
    #[doc(alias = "gtk_drag_dest_add_uri_targets")]
    fn drag_dest_add_uri_targets(&self);

    /// Looks for a match between the supported targets of `context` and the
    /// `dest_target_list`, returning the first matching target, otherwise
    /// returning `GDK_NONE`. `dest_target_list` should usually be the return
    /// value from [`drag_dest_get_target_list()`][Self::drag_dest_get_target_list()], but some widgets may
    /// have different valid targets for different parts of the widget; in
    /// that case, they will have to implement a drag_motion handler that
    /// passes the correct target list to this function.
    /// ## `context`
    /// drag context
    /// ## `target_list`
    /// list of droppable targets, or [`None`] to use
    ///  gtk_drag_dest_get_target_list (`self`).
    ///
    /// # Returns
    ///
    /// first target that the source offers
    ///  and the dest can accept, or `GDK_NONE`
    #[doc(alias = "gtk_drag_dest_find_target")]
    fn drag_dest_find_target(
        &self,
        context: &gdk::DragContext,
        target_list: Option<&TargetList>,
    ) -> Option<gdk::Atom>;

    /// Returns the list of targets this widget can accept from
    /// drag-and-drop.
    ///
    /// # Returns
    ///
    /// the [`TargetList`][crate::TargetList], or [`None`] if none
    #[doc(alias = "gtk_drag_dest_get_target_list")]
    fn drag_dest_get_target_list(&self) -> Option<TargetList>;

    /// Returns whether the widget has been configured to always
    /// emit `signal::Widget::drag-motion` signals.
    ///
    /// # Returns
    ///
    /// [`true`] if the widget always emits
    ///  `signal::Widget::drag-motion` events
    #[doc(alias = "gtk_drag_dest_get_track_motion")]
    fn drag_dest_get_track_motion(&self) -> bool;

    /// Sets this widget as a proxy for drops to another window.
    ///
    /// # Deprecated since 3.22
    ///
    /// ## `proxy_window`
    /// the window to which to forward drag events
    /// ## `protocol`
    /// the drag protocol which the `proxy_window` accepts
    ///  (You can use `gdk_drag_get_protocol()` to determine this)
    /// ## `use_coordinates`
    /// If [`true`], send the same coordinates to the
    ///  destination, because it is an embedded
    ///  subwindow.
    #[cfg_attr(feature = "v3_22", deprecated = "Since 3.22")]
    #[doc(alias = "gtk_drag_dest_set_proxy")]
    fn drag_dest_set_proxy(
        &self,
        proxy_window: &gdk::Window,
        protocol: gdk::DragProtocol,
        use_coordinates: bool,
    );

    /// Sets the target types that this widget can accept from drag-and-drop.
    /// The widget must first be made into a drag destination with
    /// [`WidgetExtManual::drag_dest_set()`][crate::prelude::WidgetExtManual::drag_dest_set()].
    /// ## `target_list`
    /// list of droppable targets, or [`None`] for none
    #[doc(alias = "gtk_drag_dest_set_target_list")]
    fn drag_dest_set_target_list(&self, target_list: Option<&TargetList>);

    /// Tells the widget to emit `signal::Widget::drag-motion` and
    /// `signal::Widget::drag-leave` events regardless of the targets and the
    /// [`DestDefaults::MOTION`][crate::DestDefaults::MOTION] flag.
    ///
    /// This may be used when a widget wants to do generic
    /// actions regardless of the targets that the source offers.
    /// ## `track_motion`
    /// whether to accept all targets
    #[doc(alias = "gtk_drag_dest_set_track_motion")]
    fn drag_dest_set_track_motion(&self, track_motion: bool);

    /// Clears information about a drop destination set with
    /// [`WidgetExtManual::drag_dest_set()`][crate::prelude::WidgetExtManual::drag_dest_set()]. The widget will no longer receive
    /// notification of drags.
    #[doc(alias = "gtk_drag_dest_unset")]
    fn drag_dest_unset(&self);

    /// Gets the data associated with a drag. When the data
    /// is received or the retrieval fails, GTK+ will emit a
    /// `signal::Widget::drag-data-received` signal. Failure of the retrieval
    /// is indicated by the length field of the `selection_data`
    /// signal parameter being negative. However, when [`drag_get_data()`][Self::drag_get_data()]
    /// is called implicitely because the [`DestDefaults::DROP`][crate::DestDefaults::DROP] was set,
    /// then the widget will not receive notification of failed
    /// drops.
    /// ## `context`
    /// the drag context
    /// ## `target`
    /// the target (form of the data) to retrieve
    /// ## `time_`
    /// a timestamp for retrieving the data. This will
    ///  generally be the time received in a `signal::Widget::drag-motion`
    ///  or `signal::Widget::drag-drop` signal
    #[doc(alias = "gtk_drag_get_data")]
    fn drag_get_data(&self, context: &gdk::DragContext, target: &gdk::Atom, time_: u32);

    /// Highlights a widget as a currently hovered drop target.
    /// To end the highlight, call [`drag_unhighlight()`][Self::drag_unhighlight()].
    /// GTK+ calls this automatically if [`DestDefaults::HIGHLIGHT`][crate::DestDefaults::HIGHLIGHT] is set.
    #[doc(alias = "gtk_drag_highlight")]
    fn drag_highlight(&self);

    /// Add the writable image targets supported by [`SelectionData`][crate::SelectionData] to
    /// the target list of the drag source. The targets
    /// are added with `info` = 0. If you need another value,
    /// use [`TargetList::add_image_targets()`][crate::TargetList::add_image_targets()] and
    /// [`drag_source_set_target_list()`][Self::drag_source_set_target_list()].
    #[doc(alias = "gtk_drag_source_add_image_targets")]
    fn drag_source_add_image_targets(&self);

    /// Add the text targets supported by [`SelectionData`][crate::SelectionData] to
    /// the target list of the drag source. The targets
    /// are added with `info` = 0. If you need another value,
    /// use [`TargetList::add_text_targets()`][crate::TargetList::add_text_targets()] and
    /// [`drag_source_set_target_list()`][Self::drag_source_set_target_list()].
    #[doc(alias = "gtk_drag_source_add_text_targets")]
    fn drag_source_add_text_targets(&self);

    /// Add the URI targets supported by [`SelectionData`][crate::SelectionData] to
    /// the target list of the drag source. The targets
    /// are added with `info` = 0. If you need another value,
    /// use [`TargetList::add_uri_targets()`][crate::TargetList::add_uri_targets()] and
    /// [`drag_source_set_target_list()`][Self::drag_source_set_target_list()].
    #[doc(alias = "gtk_drag_source_add_uri_targets")]
    fn drag_source_add_uri_targets(&self);

    /// Gets the list of targets this widget can provide for
    /// drag-and-drop.
    ///
    /// # Returns
    ///
    /// the [`TargetList`][crate::TargetList], or [`None`] if none
    #[doc(alias = "gtk_drag_source_get_target_list")]
    fn drag_source_get_target_list(&self) -> Option<TargetList>;

    /// Sets the icon that will be used for drags from a particular source
    /// to `icon`. See the docs for [`IconTheme`][crate::IconTheme] for more details.
    /// ## `icon`
    /// A [`gio::Icon`][crate::gio::Icon]
    #[doc(alias = "gtk_drag_source_set_icon_gicon")]
    fn drag_source_set_icon_gicon<P: IsA<gio::Icon>>(&self, icon: &P);

    /// Sets the icon that will be used for drags from a particular source
    /// to a themed icon. See the docs for [`IconTheme`][crate::IconTheme] for more details.
    /// ## `icon_name`
    /// name of icon to use
    #[doc(alias = "gtk_drag_source_set_icon_name")]
    fn drag_source_set_icon_name(&self, icon_name: &str);

    /// Sets the icon that will be used for drags from a particular widget
    /// from a [`gdk_pixbuf::Pixbuf`][crate::gdk_pixbuf::Pixbuf]. GTK+ retains a reference for `pixbuf` and will
    /// release it when it is no longer needed.
    /// ## `pixbuf`
    /// the [`gdk_pixbuf::Pixbuf`][crate::gdk_pixbuf::Pixbuf] for the drag icon
    #[doc(alias = "gtk_drag_source_set_icon_pixbuf")]
    fn drag_source_set_icon_pixbuf(&self, pixbuf: &gdk_pixbuf::Pixbuf);

    /// Changes the target types that this widget offers for drag-and-drop.
    /// The widget must first be made into a drag source with
    /// [`WidgetExtManual::drag_source_set()`][crate::prelude::WidgetExtManual::drag_source_set()].
    /// ## `target_list`
    /// list of draggable targets, or [`None`] for none
    #[doc(alias = "gtk_drag_source_set_target_list")]
    fn drag_source_set_target_list(&self, target_list: Option<&TargetList>);

    /// Undoes the effects of [`WidgetExtManual::drag_source_set()`][crate::prelude::WidgetExtManual::drag_source_set()].
    #[doc(alias = "gtk_drag_source_unset")]
    fn drag_source_unset(&self);

    /// Removes a highlight set by [`drag_highlight()`][Self::drag_highlight()] from
    /// a widget.
    #[doc(alias = "gtk_drag_unhighlight")]
    fn drag_unhighlight(&self);

    /// Draws `self` to `cr`. The top left corner of the widget will be
    /// drawn to the currently set origin point of `cr`.
    ///
    /// You should pass a cairo context as `cr` argument that is in an
    /// original state. Otherwise the resulting drawing is undefined. For
    /// example changing the operator using `cairo_set_operator()` or the
    /// line width using `cairo_set_line_width()` might have unwanted side
    /// effects.
    /// You may however change the context’s transform matrix - like with
    /// `cairo_scale()`, `cairo_translate()` or `cairo_set_matrix()` and clip
    /// region with `cairo_clip()` prior to calling this function. Also, it
    /// is fine to modify the context with `cairo_save()` and
    /// `cairo_push_group()` prior to calling this function.
    ///
    /// Note that special-purpose widgets may contain special code for
    /// rendering to the screen and might appear differently on screen
    /// and when rendered using [`draw()`][Self::draw()].
    /// ## `cr`
    /// a cairo context to draw to
    #[doc(alias = "gtk_widget_draw")]
    fn draw(&self, cr: &cairo::Context);

    /// Notifies the user about an input-related error on this widget.
    /// If the `property::Settings::gtk-error-bell` setting is [`true`], it calls
    /// [`Window::beep()`][crate::gdk::Window::beep()], otherwise it does nothing.
    ///
    /// Note that the effect of [`Window::beep()`][crate::gdk::Window::beep()] can be configured in many
    /// ways, depending on the windowing backend and the desktop environment
    /// or window manager that is used.
    #[doc(alias = "gtk_widget_error_bell")]
    fn error_bell(&self);

    /// Rarely-used function. This function is used to emit
    /// the event signals on a widget (those signals should never
    /// be emitted without using this function to do so).
    /// If you want to synthesize an event though, don’t use this function;
    /// instead, use [`main_do_event()`][crate::main_do_event()] so the event will behave as if
    /// it were in the event queue. Don’t synthesize expose events; instead,
    /// use [`Window::invalidate_rect()`][crate::gdk::Window::invalidate_rect()] to invalidate a region of the
    /// window.
    /// ## `event`
    /// a `GdkEvent`
    ///
    /// # Returns
    ///
    /// return from the event signal emission ([`true`] if
    ///  the event was handled)
    #[doc(alias = "gtk_widget_event")]
    fn event(&self, event: &gdk::Event) -> bool;

    /// Stops emission of `signal::Widget::child-notify` signals on `self`. The
    /// signals are queued until [`thaw_child_notify()`][Self::thaw_child_notify()] is called
    /// on `self`.
    ///
    /// This is the analogue of [`ObjectExtManual::freeze_notify()`][crate::glib::prelude::ObjectExtManual::freeze_notify()] for child properties.
    #[doc(alias = "gtk_widget_freeze_child_notify")]
    fn freeze_child_notify(&self);

    /// Returns the accessible object that describes the widget to an
    /// assistive technology.
    ///
    /// If accessibility support is not available, this [`atk::Object`][crate::atk::Object]
    /// instance may be a no-op. Likewise, if no class-specific [`atk::Object`][crate::atk::Object]
    /// implementation is available for the widget instance in question,
    /// it will inherit an [`atk::Object`][crate::atk::Object] implementation from the first ancestor
    /// class for which such an implementation is defined.
    ///
    /// The documentation of the
    /// [ATK](http://developer.gnome.org/atk/stable/)
    /// library contains more information about accessible objects and their uses.
    ///
    /// # Returns
    ///
    /// the [`atk::Object`][crate::atk::Object] associated with `self`
    #[doc(alias = "gtk_widget_get_accessible")]
    #[doc(alias = "get_accessible")]
    fn accessible(&self) -> Option<atk::Object>;

    /// Retrieves the [`gio::ActionGroup`][crate::gio::ActionGroup] that was registered using `prefix`. The resulting
    /// [`gio::ActionGroup`][crate::gio::ActionGroup] may have been registered to `self` or any [`Widget`][crate::Widget] in its
    /// ancestry.
    ///
    /// If no action group was found matching `prefix`, then [`None`] is returned.
    /// ## `prefix`
    /// The “prefix” of the action group.
    ///
    /// # Returns
    ///
    /// A [`gio::ActionGroup`][crate::gio::ActionGroup] or [`None`].
    #[doc(alias = "gtk_widget_get_action_group")]
    #[doc(alias = "get_action_group")]
    fn action_group(&self, prefix: &str) -> Option<gio::ActionGroup>;

    /// Returns the baseline that has currently been allocated to `self`.
    /// This function is intended to be used when implementing handlers
    /// for the `signal::Widget::draw` function, and when allocating child
    /// widgets in `signal::Widget::size_allocate`.
    ///
    /// # Returns
    ///
    /// the baseline of the `self`, or -1 if none
    #[doc(alias = "gtk_widget_get_allocated_baseline")]
    #[doc(alias = "get_allocated_baseline")]
    fn allocated_baseline(&self) -> i32;

    /// Returns the height that has currently been allocated to `self`.
    /// This function is intended to be used when implementing handlers
    /// for the `signal::Widget::draw` function.
    ///
    /// # Returns
    ///
    /// the height of the `self`
    #[doc(alias = "gtk_widget_get_allocated_height")]
    #[doc(alias = "get_allocated_height")]
    fn allocated_height(&self) -> i32;

    /// Retrieves the widget’s allocated size.
    ///
    /// This function returns the last values passed to
    /// [`size_allocate_with_baseline()`][Self::size_allocate_with_baseline()]. The value differs from
    /// the size returned in [`allocation()`][Self::allocation()] in that functions
    /// like [`set_halign()`][Self::set_halign()] can adjust the allocation, but not
    /// the value returned by this function.
    ///
    /// If a widget is not visible, its allocated size is 0.
    ///
    /// # Returns
    ///
    ///
    /// ## `allocation`
    /// a pointer to a `GtkAllocation` to copy to
    ///
    /// ## `baseline`
    /// a pointer to an integer to copy to
    #[cfg(any(feature = "v3_20", feature = "dox"))]
    #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
    #[doc(alias = "gtk_widget_get_allocated_size")]
    #[doc(alias = "get_allocated_size")]
    fn allocated_size(&self) -> (Allocation, i32);

    /// Returns the width that has currently been allocated to `self`.
    /// This function is intended to be used when implementing handlers
    /// for the `signal::Widget::draw` function.
    ///
    /// # Returns
    ///
    /// the width of the `self`
    #[doc(alias = "gtk_widget_get_allocated_width")]
    #[doc(alias = "get_allocated_width")]
    fn allocated_width(&self) -> i32;

    /// Retrieves the widget’s allocation.
    ///
    /// Note, when implementing a [`Container`][crate::Container]: a widget’s allocation will
    /// be its “adjusted” allocation, that is, the widget’s parent
    /// container typically calls [`size_allocate()`][Self::size_allocate()] with an
    /// allocation, and that allocation is then adjusted (to handle margin
    /// and alignment for example) before assignment to the widget.
    /// [`allocation()`][Self::allocation()] returns the adjusted allocation that
    /// was actually assigned to the widget. The adjusted allocation is
    /// guaranteed to be completely contained within the
    /// [`size_allocate()`][Self::size_allocate()] allocation, however. So a [`Container`][crate::Container]
    /// is guaranteed that its children stay inside the assigned bounds,
    /// but not that they have exactly the bounds the container assigned.
    /// There is no way to get the original allocation assigned by
    /// [`size_allocate()`][Self::size_allocate()], since it isn’t stored; if a container
    /// implementation needs that information it will have to track it itself.
    ///
    /// # Returns
    ///
    ///
    /// ## `allocation`
    /// a pointer to a `GtkAllocation` to copy to
    #[doc(alias = "gtk_widget_get_allocation")]
    #[doc(alias = "get_allocation")]
    fn allocation(&self) -> Allocation;

    /// Gets the first ancestor of `self` with type `widget_type`. For example,
    /// `gtk_widget_get_ancestor (widget, GTK_TYPE_BOX)` gets
    /// the first [`Box`][crate::Box] that’s an ancestor of `self`. No reference will be
    /// added to the returned widget; it should not be unreferenced. See note
    /// about checking for a toplevel [`Window`][crate::Window] in the docs for
    /// [`toplevel()`][Self::toplevel()].
    ///
    /// Note that unlike [`is_ancestor()`][Self::is_ancestor()], [`ancestor()`][Self::ancestor()]
    /// considers `self` to be an ancestor of itself.
    /// ## `widget_type`
    /// ancestor type
    ///
    /// # Returns
    ///
    /// the ancestor widget, or [`None`] if not found
    #[doc(alias = "gtk_widget_get_ancestor")]
    #[doc(alias = "get_ancestor")]
    fn ancestor(&self, widget_type: glib::types::Type) -> Option<Widget>;

    /// Determines whether the application intends to draw on the widget in
    /// an `signal::Widget::draw` handler.
    ///
    /// See [`set_app_paintable()`][Self::set_app_paintable()]
    ///
    /// # Returns
    ///
    /// [`true`] if the widget is app paintable
    #[doc(alias = "gtk_widget_get_app_paintable")]
    #[doc(alias = "get_app_paintable")]
    fn is_app_paintable(&self) -> bool;

    /// Determines whether `self` can be a default widget. See
    /// [`set_can_default()`][Self::set_can_default()].
    ///
    /// # Returns
    ///
    /// [`true`] if `self` can be a default widget, [`false`] otherwise
    #[doc(alias = "gtk_widget_get_can_default")]
    #[doc(alias = "get_can_default")]
    fn can_default(&self) -> bool;

    /// Determines whether `self` can own the input focus. See
    /// [`set_can_focus()`][Self::set_can_focus()].
    ///
    /// # Returns
    ///
    /// [`true`] if `self` can own the input focus, [`false`] otherwise
    #[doc(alias = "gtk_widget_get_can_focus")]
    #[doc(alias = "get_can_focus")]
    fn can_focus(&self) -> bool;

    /// Gets the value set with [`set_child_visible()`][Self::set_child_visible()].
    /// If you feel a need to use this function, your code probably
    /// needs reorganization.
    ///
    /// This function is only useful for container implementations and
    /// never should be called by an application.
    ///
    /// # Returns
    ///
    /// [`true`] if the widget is mapped with the parent.
    #[doc(alias = "gtk_widget_get_child_visible")]
    #[doc(alias = "get_child_visible")]
    fn is_child_visible(&self) -> bool;

    /// Retrieves the widget’s clip area.
    ///
    /// The clip area is the area in which all of `self`'s drawing will
    /// happen. Other toolkits call it the bounding box.
    ///
    /// Historically, in GTK+ the clip area has been equal to the allocation
    /// retrieved via [`allocation()`][Self::allocation()].
    ///
    /// # Returns
    ///
    ///
    /// ## `clip`
    /// a pointer to a `GtkAllocation` to copy to
    #[doc(alias = "gtk_widget_get_clip")]
    #[doc(alias = "get_clip")]
    fn clip(&self) -> Allocation;

    /// Returns the clipboard object for the given selection to
    /// be used with `self`. `self` must have a [`gdk::Display`][crate::gdk::Display]
    /// associated with it, so must be attached to a toplevel
    /// window.
    /// ## `selection`
    /// a [`gdk::Atom`][crate::gdk::Atom] which identifies the clipboard
    ///  to use. `GDK_SELECTION_CLIPBOARD` gives the
    ///  default clipboard. Another common value
    ///  is `GDK_SELECTION_PRIMARY`, which gives
    ///  the primary X selection.
    ///
    /// # Returns
    ///
    /// the appropriate clipboard object. If no
    ///  clipboard already exists, a new one will
    ///  be created. Once a clipboard object has
    ///  been created, it is persistent for all time.
    #[doc(alias = "gtk_widget_get_clipboard")]
    #[doc(alias = "get_clipboard")]
    fn clipboard(&self, selection: &gdk::Atom) -> Clipboard;

    /// Returns whether `device` can interact with `self` and its
    /// children. See [`set_device_enabled()`][Self::set_device_enabled()].
    /// ## `device`
    /// a [`gdk::Device`][crate::gdk::Device]
    ///
    /// # Returns
    ///
    /// [`true`] is `device` is enabled for `self`
    #[doc(alias = "gtk_widget_get_device_enabled")]
    #[doc(alias = "get_device_enabled")]
    fn device_is_enabled(&self, device: &gdk::Device) -> bool;

    /// Returns the events mask for the widget corresponding to an specific device. These
    /// are the events that the widget will receive when `device` operates on it.
    /// ## `device`
    /// a [`gdk::Device`][crate::gdk::Device]
    ///
    /// # Returns
    ///
    /// device event mask for `self`
    #[doc(alias = "gtk_widget_get_device_events")]
    #[doc(alias = "get_device_events")]
    fn device_events(&self, device: &gdk::Device) -> gdk::EventMask;

    /// Gets the reading direction for a particular widget. See
    /// [`set_direction()`][Self::set_direction()].
    ///
    /// # Returns
    ///
    /// the reading direction for the widget.
    #[doc(alias = "gtk_widget_get_direction")]
    #[doc(alias = "get_direction")]
    fn direction(&self) -> TextDirection;

    /// Get the [`gdk::Display`][crate::gdk::Display] for the toplevel window associated with
    /// this widget. This function can only be called after the widget
    /// has been added to a widget hierarchy with a [`Window`][crate::Window] at the top.
    ///
    /// In general, you should only create display specific
    /// resources when a widget has been realized, and you should
    /// free those resources when the widget is unrealized.
    ///
    /// # Returns
    ///
    /// the [`gdk::Display`][crate::gdk::Display] for the toplevel for this widget.
    #[doc(alias = "gtk_widget_get_display")]
    #[doc(alias = "get_display")]
    fn display(&self) -> gdk::Display;

    /// Determines whether the widget is double buffered.
    ///
    /// See `gtk_widget_set_double_buffered()`
    ///
    /// # Returns
    ///
    /// [`true`] if the widget is double buffered
    #[doc(alias = "gtk_widget_get_double_buffered")]
    #[doc(alias = "get_double_buffered")]
    fn is_double_buffered(&self) -> bool;

    /// Returns whether the widget should grab focus when it is clicked with the mouse.
    /// See [`set_focus_on_click()`][Self::set_focus_on_click()].
    ///
    /// # Returns
    ///
    /// [`true`] if the widget should grab focus when it is clicked with
    ///  the mouse.
    #[cfg(any(feature = "v3_20", feature = "dox"))]
    #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
    #[doc(alias = "gtk_widget_get_focus_on_click")]
    #[doc(alias = "get_focus_on_click")]
    fn gets_focus_on_click(&self) -> bool;

    /// Gets the font map that has been set with [`set_font_map()`][Self::set_font_map()].
    ///
    /// # Returns
    ///
    /// A [`pango::FontMap`][crate::pango::FontMap], or [`None`]
    #[doc(alias = "gtk_widget_get_font_map")]
    #[doc(alias = "get_font_map")]
    fn font_map(&self) -> Option<pango::FontMap>;

    /// Returns the [`cairo::FontOptions`][crate::cairo::FontOptions] used for Pango rendering. When not set,
    /// the defaults font options for the [`gdk::Screen`][crate::gdk::Screen] will be used.
    ///
    /// # Returns
    ///
    /// the [`cairo::FontOptions`][crate::cairo::FontOptions] or [`None`] if not set
    #[doc(alias = "gtk_widget_get_font_options")]
    #[doc(alias = "get_font_options")]
    fn font_options(&self) -> Option<cairo::FontOptions>;

    /// Obtains the frame clock for a widget. The frame clock is a global
    /// “ticker” that can be used to drive animations and repaints. The
    /// most common reason to get the frame clock is to call
    /// [`FrameClock::frame_time()`][crate::gdk::FrameClock::frame_time()], in order to get a time to use for
    /// animating. For example you might record the start of the animation
    /// with an initial value from [`FrameClock::frame_time()`][crate::gdk::FrameClock::frame_time()], and
    /// then update the animation by calling
    /// [`FrameClock::frame_time()`][crate::gdk::FrameClock::frame_time()] again during each repaint.
    ///
    /// [`FrameClock::request_phase()`][crate::gdk::FrameClock::request_phase()] will result in a new frame on the
    /// clock, but won’t necessarily repaint any widgets. To repaint a
    /// widget, you have to use [`queue_draw()`][Self::queue_draw()] which invalidates
    /// the widget (thus scheduling it to receive a draw on the next
    /// frame). [`queue_draw()`][Self::queue_draw()] will also end up requesting a frame
    /// on the appropriate frame clock.
    ///
    /// A widget’s frame clock will not change while the widget is
    /// mapped. Reparenting a widget (which implies a temporary unmap) can
    /// change the widget’s frame clock.
    ///
    /// Unrealized widgets do not have a frame clock.
    ///
    /// # Returns
    ///
    /// a [`gdk::FrameClock`][crate::gdk::FrameClock],
    /// or [`None`] if widget is unrealized
    #[doc(alias = "gtk_widget_get_frame_clock")]
    #[doc(alias = "get_frame_clock")]
    fn frame_clock(&self) -> Option<gdk::FrameClock>;

    /// Gets the value of the `property::Widget::halign` property.
    ///
    /// For backwards compatibility reasons this method will never return
    /// [`Align::Baseline`][crate::Align::Baseline], but instead it will convert it to
    /// [`Align::Fill`][crate::Align::Fill]. Baselines are not supported for horizontal
    /// alignment.
    ///
    /// # Returns
    ///
    /// the horizontal alignment of `self`
    #[doc(alias = "gtk_widget_get_halign")]
    #[doc(alias = "get_halign")]
    fn halign(&self) -> Align;

    /// Returns the current value of the has-tooltip property. See
    /// `property::Widget::has-tooltip` for more information.
    ///
    /// # Returns
    ///
    /// current value of has-tooltip on `self`.
    #[doc(alias = "gtk_widget_get_has_tooltip")]
    #[doc(alias = "get_has_tooltip")]
    fn has_tooltip(&self) -> bool;

    /// Determines whether `self` has a [`gdk::Window`][crate::gdk::Window] of its own. See
    /// [`set_has_window()`][Self::set_has_window()].
    ///
    /// # Returns
    ///
    /// [`true`] if `self` has a window, [`false`] otherwise
    #[doc(alias = "gtk_widget_get_has_window")]
    #[doc(alias = "get_has_window")]
    fn has_window(&self) -> bool;

    /// Gets whether the widget would like any available extra horizontal
    /// space. When a user resizes a [`Window`][crate::Window], widgets with expand=TRUE
    /// generally receive the extra space. For example, a list or
    /// scrollable area or document in your window would often be set to
    /// expand.
    ///
    /// Containers should use [`compute_expand()`][Self::compute_expand()] rather than
    /// this function, to see whether a widget, or any of its children,
    /// has the expand flag set. If any child of a widget wants to
    /// expand, the parent may ask to expand also.
    ///
    /// This function only looks at the widget’s own hexpand flag, rather
    /// than computing whether the entire widget tree rooted at this widget
    /// wants to expand.
    ///
    /// # Returns
    ///
    /// whether hexpand flag is set
    #[doc(alias = "gtk_widget_get_hexpand")]
    #[doc(alias = "get_hexpand")]
    fn hexpands(&self) -> bool;

    /// Gets whether [`set_hexpand()`][Self::set_hexpand()] has been used to
    /// explicitly set the expand flag on this widget.
    ///
    /// If hexpand is set, then it overrides any computed
    /// expand value based on child widgets. If hexpand is not
    /// set, then the expand value depends on whether any
    /// children of the widget would like to expand.
    ///
    /// There are few reasons to use this function, but it’s here
    /// for completeness and consistency.
    ///
    /// # Returns
    ///
    /// whether hexpand has been explicitly set
    #[doc(alias = "gtk_widget_get_hexpand_set")]
    #[doc(alias = "get_hexpand_set")]
    fn is_hexpand_set(&self) -> bool;

    /// Whether the widget is mapped.
    ///
    /// # Returns
    ///
    /// [`true`] if the widget is mapped, [`false`] otherwise.
    #[doc(alias = "gtk_widget_get_mapped")]
    #[doc(alias = "get_mapped")]
    fn is_mapped(&self) -> bool;

    /// Gets the value of the `property::Widget::margin-bottom` property.
    ///
    /// # Returns
    ///
    /// The bottom margin of `self`
    #[doc(alias = "gtk_widget_get_margin_bottom")]
    #[doc(alias = "get_margin_bottom")]
    fn margin_bottom(&self) -> i32;

    /// Gets the value of the `property::Widget::margin-end` property.
    ///
    /// # Returns
    ///
    /// The end margin of `self`
    #[doc(alias = "gtk_widget_get_margin_end")]
    #[doc(alias = "get_margin_end")]
    fn margin_end(&self) -> i32;

    /// Gets the value of the `property::Widget::margin-start` property.
    ///
    /// # Returns
    ///
    /// The start margin of `self`
    #[doc(alias = "gtk_widget_get_margin_start")]
    #[doc(alias = "get_margin_start")]
    fn margin_start(&self) -> i32;

    /// Gets the value of the `property::Widget::margin-top` property.
    ///
    /// # Returns
    ///
    /// The top margin of `self`
    #[doc(alias = "gtk_widget_get_margin_top")]
    #[doc(alias = "get_margin_top")]
    fn margin_top(&self) -> i32;

    /// Returns the modifier mask the `self`’s windowing system backend
    /// uses for a particular purpose.
    ///
    /// See `gdk_keymap_get_modifier_mask()`.
    /// ## `intent`
    /// the use case for the modifier mask
    ///
    /// # Returns
    ///
    /// the modifier mask used for `intent`.
    #[doc(alias = "gtk_widget_get_modifier_mask")]
    #[doc(alias = "get_modifier_mask")]
    fn modifier_mask(&self, intent: gdk::ModifierIntent) -> gdk::ModifierType;

    /// Retrieves the name of a widget. See [`set_widget_name()`][Self::set_widget_name()] for the
    /// significance of widget names.
    ///
    /// # Returns
    ///
    /// name of the widget. This string is owned by GTK+ and
    /// should not be modified or freed
    #[doc(alias = "gtk_widget_get_name")]
    #[doc(alias = "get_name")]
    fn widget_name(&self) -> glib::GString;

    /// Returns the current value of the `property::Widget::no-show-all` property,
    /// which determines whether calls to [`show_all()`][Self::show_all()]
    /// will affect this widget.
    ///
    /// # Returns
    ///
    /// the current value of the “no-show-all” property.
    #[doc(alias = "gtk_widget_get_no_show_all")]
    #[doc(alias = "get_no_show_all")]
    fn is_no_show_all(&self) -> bool;

    /// Fetches the requested opacity for this widget.
    /// See [`set_opacity()`][Self::set_opacity()].
    ///
    /// # Returns
    ///
    /// the requested opacity for this widget.
    #[doc(alias = "gtk_widget_get_opacity")]
    #[doc(alias = "get_opacity")]
    fn opacity(&self) -> f64;

    /// Gets a [`pango::Context`][crate::pango::Context] with the appropriate font map, font description,
    /// and base direction for this widget. Unlike the context returned
    /// by [`create_pango_context()`][Self::create_pango_context()], this context is owned by
    /// the widget (it can be used until the screen for the widget changes
    /// or the widget is removed from its toplevel), and will be updated to
    /// match any changes to the widget’s attributes. This can be tracked
    /// by using the `signal::Widget::screen-changed` signal on the widget.
    ///
    /// # Returns
    ///
    /// the [`pango::Context`][crate::pango::Context] for the widget.
    #[doc(alias = "gtk_widget_get_pango_context")]
    #[doc(alias = "get_pango_context")]
    fn pango_context(&self) -> pango::Context;

    /// Returns the parent container of `self`.
    ///
    /// # Returns
    ///
    /// the parent container of `self`, or [`None`]
    #[doc(alias = "gtk_widget_get_parent")]
    #[doc(alias = "get_parent")]
    fn parent(&self) -> Option<Widget>;

    /// Gets `self`’s parent window, or [`None`] if it does not have one.
    ///
    /// # Returns
    ///
    /// the parent window of `self`, or [`None`]
    /// if it does not have a parent window.
    #[doc(alias = "gtk_widget_get_parent_window")]
    #[doc(alias = "get_parent_window")]
    fn parent_window(&self) -> Option<gdk::Window>;

    /// Returns the [`WidgetPath`][crate::WidgetPath] representing `self`, if the widget
    /// is not connected to a toplevel widget, a partial path will be
    /// created.
    ///
    /// # Returns
    ///
    /// The [`WidgetPath`][crate::WidgetPath] representing `self`
    #[doc(alias = "gtk_widget_get_path")]
    #[doc(alias = "get_path")]
    fn path(&self) -> WidgetPath;

    /// Retrieves a widget’s initial minimum and natural height.
    ///
    /// This call is specific to width-for-height requests.
    ///
    /// The returned request will be modified by the
    /// GtkWidgetClass::adjust_size_request virtual method and by any
    /// `GtkSizeGroups` that have been applied. That is, the returned request
    /// is the one that should be used for layout, not necessarily the one
    /// returned by the widget itself.
    ///
    /// # Returns
    ///
    ///
    /// ## `minimum_height`
    /// location to store the minimum height, or [`None`]
    ///
    /// ## `natural_height`
    /// location to store the natural height, or [`None`]
    #[doc(alias = "gtk_widget_get_preferred_height")]
    #[doc(alias = "get_preferred_height")]
    fn preferred_height(&self) -> (i32, i32);

    /// Retrieves a widget’s minimum and natural height and the corresponding baselines if it would be given
    /// the specified `width`, or the default height if `width` is -1. The baselines may be -1 which means
    /// that no baseline is requested for this widget.
    ///
    /// The returned request will be modified by the
    /// GtkWidgetClass::adjust_size_request and GtkWidgetClass::adjust_baseline_request virtual methods
    /// and by any `GtkSizeGroups` that have been applied. That is, the returned request
    /// is the one that should be used for layout, not necessarily the one
    /// returned by the widget itself.
    /// ## `width`
    /// the width which is available for allocation, or -1 if none
    ///
    /// # Returns
    ///
    ///
    /// ## `minimum_height`
    /// location for storing the minimum height, or [`None`]
    ///
    /// ## `natural_height`
    /// location for storing the natural height, or [`None`]
    ///
    /// ## `minimum_baseline`
    /// location for storing the baseline for the minimum height, or [`None`]
    ///
    /// ## `natural_baseline`
    /// location for storing the baseline for the natural height, or [`None`]
    #[doc(alias = "gtk_widget_get_preferred_height_and_baseline_for_width")]
    #[doc(alias = "get_preferred_height_and_baseline_for_width")]
    fn preferred_height_and_baseline_for_width(&self, width: i32) -> (i32, i32, i32, i32);

    /// Retrieves a widget’s minimum and natural height if it would be given
    /// the specified `width`.
    ///
    /// The returned request will be modified by the
    /// GtkWidgetClass::adjust_size_request virtual method and by any
    /// `GtkSizeGroups` that have been applied. That is, the returned request
    /// is the one that should be used for layout, not necessarily the one
    /// returned by the widget itself.
    /// ## `width`
    /// the width which is available for allocation
    ///
    /// # Returns
    ///
    ///
    /// ## `minimum_height`
    /// location for storing the minimum height, or [`None`]
    ///
    /// ## `natural_height`
    /// location for storing the natural height, or [`None`]
    #[doc(alias = "gtk_widget_get_preferred_height_for_width")]
    #[doc(alias = "get_preferred_height_for_width")]
    fn preferred_height_for_width(&self, width: i32) -> (i32, i32);

    /// Retrieves the minimum and natural size of a widget, taking
    /// into account the widget’s preference for height-for-width management.
    ///
    /// This is used to retrieve a suitable size by container widgets which do
    /// not impose any restrictions on the child placement. It can be used
    /// to deduce toplevel window and menu sizes as well as child widgets in
    /// free-form containers such as GtkLayout.
    ///
    /// Handle with care. Note that the natural height of a height-for-width
    /// widget will generally be a smaller size than the minimum height, since the required
    /// height for the natural width is generally smaller than the required height for
    /// the minimum width.
    ///
    /// Use [`preferred_height_and_baseline_for_width()`][Self::preferred_height_and_baseline_for_width()] if you want to support
    /// baseline alignment.
    ///
    /// # Returns
    ///
    ///
    /// ## `minimum_size`
    /// location for storing the minimum size, or [`None`]
    ///
    /// ## `natural_size`
    /// location for storing the natural size, or [`None`]
    #[doc(alias = "gtk_widget_get_preferred_size")]
    #[doc(alias = "get_preferred_size")]
    fn preferred_size(&self) -> (Requisition, Requisition);

    /// Retrieves a widget’s initial minimum and natural width.
    ///
    /// This call is specific to height-for-width requests.
    ///
    /// The returned request will be modified by the
    /// GtkWidgetClass::adjust_size_request virtual method and by any
    /// `GtkSizeGroups` that have been applied. That is, the returned request
    /// is the one that should be used for layout, not necessarily the one
    /// returned by the widget itself.
    ///
    /// # Returns
    ///
    ///
    /// ## `minimum_width`
    /// location to store the minimum width, or [`None`]
    ///
    /// ## `natural_width`
    /// location to store the natural width, or [`None`]
    #[doc(alias = "gtk_widget_get_preferred_width")]
    #[doc(alias = "get_preferred_width")]
    fn preferred_width(&self) -> (i32, i32);

    /// Retrieves a widget’s minimum and natural width if it would be given
    /// the specified `height`.
    ///
    /// The returned request will be modified by the
    /// GtkWidgetClass::adjust_size_request virtual method and by any
    /// `GtkSizeGroups` that have been applied. That is, the returned request
    /// is the one that should be used for layout, not necessarily the one
    /// returned by the widget itself.
    /// ## `height`
    /// the height which is available for allocation
    ///
    /// # Returns
    ///
    ///
    /// ## `minimum_width`
    /// location for storing the minimum width, or [`None`]
    ///
    /// ## `natural_width`
    /// location for storing the natural width, or [`None`]
    #[doc(alias = "gtk_widget_get_preferred_width_for_height")]
    #[doc(alias = "get_preferred_width_for_height")]
    fn preferred_width_for_height(&self, height: i32) -> (i32, i32);

    /// Determines whether `self` is realized.
    ///
    /// # Returns
    ///
    /// [`true`] if `self` is realized, [`false`] otherwise
    #[doc(alias = "gtk_widget_get_realized")]
    #[doc(alias = "get_realized")]
    fn is_realized(&self) -> bool;

    /// Determines whether `self` is always treated as the default widget
    /// within its toplevel when it has the focus, even if another widget
    /// is the default.
    ///
    /// See [`set_receives_default()`][Self::set_receives_default()].
    ///
    /// # Returns
    ///
    /// [`true`] if `self` acts as the default widget when focused,
    ///  [`false`] otherwise
    #[doc(alias = "gtk_widget_get_receives_default")]
    #[doc(alias = "get_receives_default")]
    fn receives_default(&self) -> bool;

    /// Gets whether the widget prefers a height-for-width layout
    /// or a width-for-height layout.
    ///
    /// [`Bin`][crate::Bin] widgets generally propagate the preference of
    /// their child, container widgets need to request something either in
    /// context of their children or in context of their allocation
    /// capabilities.
    ///
    /// # Returns
    ///
    /// The [`SizeRequestMode`][crate::SizeRequestMode] preferred by `self`.
    #[doc(alias = "gtk_widget_get_request_mode")]
    #[doc(alias = "get_request_mode")]
    fn request_mode(&self) -> SizeRequestMode;

    /// Retrieves the internal scale factor that maps from window coordinates
    /// to the actual device pixels. On traditional systems this is 1, on
    /// high density outputs, it can be a higher value (typically 2).
    ///
    /// See [`Window::scale_factor()`][crate::gdk::Window::scale_factor()].
    ///
    /// # Returns
    ///
    /// the scale factor for `self`
    #[doc(alias = "gtk_widget_get_scale_factor")]
    #[doc(alias = "get_scale_factor")]
    fn scale_factor(&self) -> i32;

    /// Get the [`gdk::Screen`][crate::gdk::Screen] from the toplevel window associated with
    /// this widget. This function can only be called after the widget
    /// has been added to a widget hierarchy with a [`Window`][crate::Window]
    /// at the top.
    ///
    /// In general, you should only create screen specific
    /// resources when a widget has been realized, and you should
    /// free those resources when the widget is unrealized.
    ///
    /// # Returns
    ///
    /// the [`gdk::Screen`][crate::gdk::Screen] for the toplevel for this widget.
    #[doc(alias = "gtk_widget_get_screen")]
    #[doc(alias = "get_screen")]
    fn screen(&self) -> Option<gdk::Screen>;

    /// Returns the widget’s sensitivity (in the sense of returning
    /// the value that has been set using [`set_sensitive()`][Self::set_sensitive()]).
    ///
    /// The effective sensitivity of a widget is however determined by both its
    /// own and its parent widget’s sensitivity. See [`is_sensitive()`][Self::is_sensitive()].
    ///
    /// # Returns
    ///
    /// [`true`] if the widget is sensitive
    #[doc(alias = "gtk_widget_get_sensitive")]
    fn get_sensitive(&self) -> bool;

    /// Gets the settings object holding the settings used for this widget.
    ///
    /// Note that this function can only be called when the [`Widget`][crate::Widget]
    /// is attached to a toplevel, since the settings object is specific
    /// to a particular [`gdk::Screen`][crate::gdk::Screen].
    ///
    /// # Returns
    ///
    /// the relevant [`Settings`][crate::Settings] object
    #[doc(alias = "gtk_widget_get_settings")]
    #[doc(alias = "get_settings")]
    fn settings(&self) -> Option<Settings>;

    /// Gets the size request that was explicitly set for the widget using
    /// [`set_size_request()`][Self::set_size_request()]. A value of -1 stored in `width` or
    /// `height` indicates that that dimension has not been set explicitly
    /// and the natural requisition of the widget will be used instead. See
    /// [`set_size_request()`][Self::set_size_request()]. To get the size a widget will
    /// actually request, call [`preferred_size()`][Self::preferred_size()] instead of
    /// this function.
    ///
    /// # Returns
    ///
    ///
    /// ## `width`
    /// return location for width, or [`None`]
    ///
    /// ## `height`
    /// return location for height, or [`None`]
    #[doc(alias = "gtk_widget_get_size_request")]
    #[doc(alias = "get_size_request")]
    fn size_request(&self) -> (i32, i32);

    /// Returns the widget state as a flag set. It is worth mentioning
    /// that the effective [`StateFlags::INSENSITIVE`][crate::StateFlags::INSENSITIVE] state will be
    /// returned, that is, also based on parent insensitivity, even if
    /// `self` itself is sensitive.
    ///
    /// Also note that if you are looking for a way to obtain the
    /// [`StateFlags`][crate::StateFlags] to pass to a [`StyleContext`][crate::StyleContext] method, you
    /// should look at [`StyleContextExt::state()`][crate::prelude::StyleContextExt::state()].
    ///
    /// # Returns
    ///
    /// The state flags for widget
    #[doc(alias = "gtk_widget_get_state_flags")]
    #[doc(alias = "get_state_flags")]
    fn state_flags(&self) -> StateFlags;

    /// Returns the style context associated to `self`. The returned object is
    /// guaranteed to be the same for the lifetime of `self`.
    ///
    /// # Returns
    ///
    /// a [`StyleContext`][crate::StyleContext]. This memory is owned by `self` and
    ///  must not be freed.
    #[doc(alias = "gtk_widget_get_style_context")]
    #[doc(alias = "get_style_context")]
    fn style_context(&self) -> StyleContext;

    /// Returns [`true`] if `self` is multiple pointer aware. See
    /// [`set_support_multidevice()`][Self::set_support_multidevice()] for more information.
    ///
    /// # Returns
    ///
    /// [`true`] if `self` is multidevice aware.
    #[doc(alias = "gtk_widget_get_support_multidevice")]
    #[doc(alias = "get_support_multidevice")]
    fn supports_multidevice(&self) -> bool;

    /// Fetch an object build from the template XML for `widget_type` in this `self` instance.
    ///
    /// This will only report children which were previously declared with
    /// `gtk_widget_class_bind_template_child_full()` or one of its
    /// variants.
    ///
    /// This function is only meant to be called for code which is private to the `widget_type` which
    /// declared the child and is meant for language bindings which cannot easily make use
    /// of the GObject structure offsets.
    /// ## `widget_type`
    /// The `GType` to get a template child for
    /// ## `name`
    /// The “id” of the child defined in the template XML
    ///
    /// # Returns
    ///
    /// The object built in the template XML with the id `name`
    #[doc(alias = "gtk_widget_get_template_child")]
    #[doc(alias = "get_template_child")]
    fn template_child(&self, widget_type: glib::types::Type, name: &str) -> Option<glib::Object>;

    /// Gets the contents of the tooltip for `self`.
    ///
    /// # Returns
    ///
    /// the tooltip text, or [`None`]. You should free the
    ///  returned string with `g_free()` when done.
    #[doc(alias = "gtk_widget_get_tooltip_markup")]
    #[doc(alias = "get_tooltip_markup")]
    fn tooltip_markup(&self) -> Option<glib::GString>;

    /// Gets the contents of the tooltip for `self`.
    ///
    /// # Returns
    ///
    /// the tooltip text, or [`None`]. You should free the
    ///  returned string with `g_free()` when done.
    #[doc(alias = "gtk_widget_get_tooltip_text")]
    #[doc(alias = "get_tooltip_text")]
    fn tooltip_text(&self) -> Option<glib::GString>;

    /// Returns the [`Window`][crate::Window] of the current tooltip. This can be the
    /// GtkWindow created by default, or the custom tooltip window set
    /// using [`set_tooltip_window()`][Self::set_tooltip_window()].
    ///
    /// # Returns
    ///
    /// The [`Window`][crate::Window] of the current tooltip.
    #[doc(alias = "gtk_widget_get_tooltip_window")]
    #[doc(alias = "get_tooltip_window")]
    fn tooltip_window(&self) -> Option<Window>;

    /// This function returns the topmost widget in the container hierarchy
    /// `self` is a part of. If `self` has no parent widgets, it will be
    /// returned as the topmost widget. No reference will be added to the
    /// returned widget; it should not be unreferenced.
    ///
    /// Note the difference in behavior vs. [`ancestor()`][Self::ancestor()];
    /// `gtk_widget_get_ancestor (widget, GTK_TYPE_WINDOW)`
    /// would return
    /// [`None`] if `self` wasn’t inside a toplevel window, and if the
    /// window was inside a [`Window`][crate::Window]-derived widget which was in turn
    /// inside the toplevel [`Window`][crate::Window]. While the second case may
    /// seem unlikely, it actually happens when a [`Plug`][crate::Plug] is embedded
    /// inside a [`Socket`][crate::Socket] within the same application.
    ///
    /// To reliably find the toplevel [`Window`][crate::Window], use
    /// [`toplevel()`][Self::toplevel()] and call GTK_IS_WINDOW()
    /// on the result. For instance, to get the title of a widget's toplevel
    /// window, one might use:
    ///
    ///
    /// **⚠️ The following code is in C ⚠️**
    ///
    /// ```C
    /// static const char *
    /// get_widget_toplevel_title (GtkWidget *widget)
    /// {
    ///   GtkWidget *toplevel = gtk_widget_get_toplevel (widget);
    ///   if (GTK_IS_WINDOW (toplevel))
    ///     {
    ///       return gtk_window_get_title (GTK_WINDOW (toplevel));
    ///     }
    ///
    ///   return NULL;
    /// }
    /// ```
    ///
    /// # Returns
    ///
    /// the topmost ancestor of `self`, or `self` itself
    ///  if there’s no ancestor.
    #[doc(alias = "gtk_widget_get_toplevel")]
    #[doc(alias = "get_toplevel")]
    fn toplevel(&self) -> Option<Widget>;

    /// Gets the value of the `property::Widget::valign` property.
    ///
    /// For backwards compatibility reasons this method will never return
    /// [`Align::Baseline`][crate::Align::Baseline], but instead it will convert it to
    /// [`Align::Fill`][crate::Align::Fill]. If your widget want to support baseline aligned
    /// children it must use [`valign_with_baseline()`][Self::valign_with_baseline()], or
    /// `g_object_get (widget, "valign", &value, NULL)`, which will
    /// also report the true value.
    ///
    /// # Returns
    ///
    /// the vertical alignment of `self`, ignoring baseline alignment
    #[doc(alias = "gtk_widget_get_valign")]
    #[doc(alias = "get_valign")]
    fn valign(&self) -> Align;

    /// Gets the value of the `property::Widget::valign` property, including
    /// [`Align::Baseline`][crate::Align::Baseline].
    ///
    /// # Returns
    ///
    /// the vertical alignment of `self`
    #[doc(alias = "gtk_widget_get_valign_with_baseline")]
    #[doc(alias = "get_valign_with_baseline")]
    fn valign_with_baseline(&self) -> Align;

    /// Gets whether the widget would like any available extra vertical
    /// space.
    ///
    /// See [`hexpands()`][Self::hexpands()] for more detail.
    ///
    /// # Returns
    ///
    /// whether vexpand flag is set
    #[doc(alias = "gtk_widget_get_vexpand")]
    #[doc(alias = "get_vexpand")]
    fn vexpands(&self) -> bool;

    /// Gets whether [`set_vexpand()`][Self::set_vexpand()] has been used to
    /// explicitly set the expand flag on this widget.
    ///
    /// See [`is_hexpand_set()`][Self::is_hexpand_set()] for more detail.
    ///
    /// # Returns
    ///
    /// whether vexpand has been explicitly set
    #[doc(alias = "gtk_widget_get_vexpand_set")]
    #[doc(alias = "get_vexpand_set")]
    fn is_vexpand_set(&self) -> bool;

    /// Determines whether the widget is visible. If you want to
    /// take into account whether the widget’s parent is also marked as
    /// visible, use [`is_visible()`][Self::is_visible()] instead.
    ///
    /// This function does not check if the widget is obscured in any way.
    ///
    /// See [`set_visible()`][Self::set_visible()].
    ///
    /// # Returns
    ///
    /// [`true`] if the widget is visible
    #[doc(alias = "gtk_widget_get_visible")]
    fn get_visible(&self) -> bool;

    /// Gets the visual that will be used to render `self`.
    ///
    /// # Returns
    ///
    /// the visual for `self`
    #[doc(alias = "gtk_widget_get_visual")]
    #[doc(alias = "get_visual")]
    fn visual(&self) -> Option<gdk::Visual>;

    /// Returns the widget’s window if it is realized, [`None`] otherwise
    ///
    /// # Returns
    ///
    /// `self`’s window.
    #[doc(alias = "gtk_widget_get_window")]
    #[doc(alias = "get_window")]
    fn window(&self) -> Option<gdk::Window>;

    /// Makes `self` the current grabbed widget.
    ///
    /// This means that interaction with other widgets in the same
    /// application is blocked and mouse as well as keyboard events
    /// are delivered to this widget.
    ///
    /// If `self` is not sensitive, it is not set as the current
    /// grabbed widget and this function does nothing.
    #[doc(alias = "gtk_grab_add")]
    fn grab_add(&self);

    /// Causes `self` to become the default widget. `self` must be able to be
    /// a default widget; typically you would ensure this yourself
    /// by calling [`set_can_default()`][Self::set_can_default()] with a [`true`] value.
    /// The default widget is activated when
    /// the user presses Enter in a window. Default widgets must be
    /// activatable, that is, [`activate()`][Self::activate()] should affect them. Note
    /// that [`Entry`][crate::Entry] widgets require the “activates-default” property
    /// set to [`true`] before they activate the default widget when Enter
    /// is pressed and the [`Entry`][crate::Entry] is focused.
    #[doc(alias = "gtk_widget_grab_default")]
    fn grab_default(&self);

    /// Causes `self` to have the keyboard focus for the [`Window`][crate::Window] it's
    /// inside. `self` must be a focusable widget, such as a [`Entry`][crate::Entry];
    /// something like [`Frame`][crate::Frame] won’t work.
    ///
    /// More precisely, it must have the `GTK_CAN_FOCUS` flag set. Use
    /// [`set_can_focus()`][Self::set_can_focus()] to modify that flag.
    ///
    /// The widget also needs to be realized and mapped. This is indicated by the
    /// related signals. Grabbing the focus immediately after creating the widget
    /// will likely fail and cause critical warnings.
    #[doc(alias = "gtk_widget_grab_focus")]
    fn grab_focus(&self);

    /// Removes the grab from the given widget.
    ///
    /// You have to pair calls to [`grab_add()`][Self::grab_add()] and [`grab_remove()`][Self::grab_remove()].
    ///
    /// If `self` does not have the grab, this function does nothing.
    #[doc(alias = "gtk_grab_remove")]
    fn grab_remove(&self);

    /// Determines whether `self` is the current default widget within its
    /// toplevel. See [`set_can_default()`][Self::set_can_default()].
    ///
    /// # Returns
    ///
    /// [`true`] if `self` is the current default widget within
    ///  its toplevel, [`false`] otherwise
    #[doc(alias = "gtk_widget_has_default")]
    fn has_default(&self) -> bool;

    /// Determines if the widget has the global input focus. See
    /// [`is_focus()`][Self::is_focus()] for the difference between having the global
    /// input focus, and only having the focus within a toplevel.
    ///
    /// # Returns
    ///
    /// [`true`] if the widget has the global input focus.
    #[doc(alias = "gtk_widget_has_focus")]
    fn has_focus(&self) -> bool;

    /// Determines whether the widget is currently grabbing events, so it
    /// is the only widget receiving input events (keyboard and mouse).
    ///
    /// See also [`grab_add()`][Self::grab_add()].
    ///
    /// # Returns
    ///
    /// [`true`] if the widget is in the grab_widgets stack
    #[doc(alias = "gtk_widget_has_grab")]
    fn has_grab(&self) -> bool;

    /// Checks whether there is a [`gdk::Screen`][crate::gdk::Screen] is associated with
    /// this widget. All toplevel widgets have an associated
    /// screen, and all widgets added into a hierarchy with a toplevel
    /// window at the top.
    ///
    /// # Returns
    ///
    /// [`true`] if there is a [`gdk::Screen`][crate::gdk::Screen] associated
    ///  with the widget.
    #[doc(alias = "gtk_widget_has_screen")]
    fn has_screen(&self) -> bool;

    /// Determines if the widget should show a visible indication that
    /// it has the global input focus. This is a convenience function for
    /// use in ::draw handlers that takes into account whether focus
    /// indication should currently be shown in the toplevel window of
    /// `self`. See [`GtkWindowExt::gets_focus_visible()`][crate::prelude::GtkWindowExt::gets_focus_visible()] for more information
    /// about focus indication.
    ///
    /// To find out if the widget has the global input focus, use
    /// [`has_focus()`][Self::has_focus()].
    ///
    /// # Returns
    ///
    /// [`true`] if the widget should display a “focus rectangle”
    #[doc(alias = "gtk_widget_has_visible_focus")]
    fn has_visible_focus(&self) -> bool;

    /// Reverses the effects of [`show()`][Self::show()], causing the widget to be
    /// hidden (invisible to the user).
    #[doc(alias = "gtk_widget_hide")]
    fn hide(&self);

    /// Returns whether the widget is currently being destroyed.
    /// This information can sometimes be used to avoid doing
    /// unnecessary work.
    ///
    /// # Returns
    ///
    /// [`true`] if `self` is being destroyed
    #[doc(alias = "gtk_widget_in_destruction")]
    fn in_destruction(&self) -> bool;

    /// Creates and initializes child widgets defined in templates. This
    /// function must be called in the instance initializer for any
    /// class which assigned itself a template using `gtk_widget_class_set_template()`
    ///
    /// It is important to call this function in the instance initializer
    /// of a [`Widget`][crate::Widget] subclass and not in `GObject.constructed()` or
    /// `GObject.constructor()` for two reasons.
    ///
    /// One reason is that generally derived widgets will assume that parent
    /// class composite widgets have been created in their instance
    /// initializers.
    ///
    /// Another reason is that when calling [`glib::Object::new()`][crate::glib::Object::new()] on a widget with
    /// composite templates, it’s important to build the composite widgets
    /// before the construct properties are set. Properties passed to [`glib::Object::new()`][crate::glib::Object::new()]
    /// should take precedence over properties set in the private template XML.
    #[doc(alias = "gtk_widget_init_template")]
    fn init_template(&self);

    /// Sets an input shape for this widget’s GDK window. This allows for
    /// windows which react to mouse click in a nonrectangular region, see
    /// [`Window::input_shape_combine_region()`][crate::gdk::Window::input_shape_combine_region()] for more information.
    /// ## `region`
    /// shape to be added, or [`None`] to remove an existing shape
    #[doc(alias = "gtk_widget_input_shape_combine_region")]
    fn input_shape_combine_region(&self, region: Option<&cairo::Region>);

    /// Inserts `group` into `self`. Children of `self` that implement
    /// [`Actionable`][crate::Actionable] can then be associated with actions in `group` by
    /// setting their “action-name” to
    /// `prefix`.`action-name`.
    ///
    /// If `group` is [`None`], a previously inserted group for `name` is removed
    /// from `self`.
    /// ## `name`
    /// the prefix for actions in `group`
    /// ## `group`
    /// a [`gio::ActionGroup`][crate::gio::ActionGroup], or [`None`]
    #[doc(alias = "gtk_widget_insert_action_group")]
    fn insert_action_group<P: IsA<gio::ActionGroup>>(&self, name: &str, group: Option<&P>);

    /// Determines whether `self` is somewhere inside `ancestor`, possibly with
    /// intermediate containers.
    /// ## `ancestor`
    /// another [`Widget`][crate::Widget]
    ///
    /// # Returns
    ///
    /// [`true`] if `ancestor` contains `self` as a child,
    ///  grandchild, great grandchild, etc.
    #[doc(alias = "gtk_widget_is_ancestor")]
    fn is_ancestor<P: IsA<Widget>>(&self, ancestor: &P) -> bool;

    /// Whether `self` can rely on having its alpha channel
    /// drawn correctly. On X11 this function returns whether a
    /// compositing manager is running for `self`’s screen.
    ///
    /// Please note that the semantics of this call will change
    /// in the future if used on a widget that has a composited
    /// window in its hierarchy (as set by `gdk_window_set_composited()`).
    ///
    /// # Deprecated since 3.22
    ///
    /// Use [`Screen::is_composited()`][crate::gdk::Screen::is_composited()] instead.
    ///
    /// # Returns
    ///
    /// [`true`] if the widget can rely on its alpha
    /// channel being drawn correctly.
    #[cfg_attr(feature = "v3_22", deprecated = "Since 3.22")]
    #[doc(alias = "gtk_widget_is_composited")]
    fn is_composited(&self) -> bool;

    /// Determines whether `self` can be drawn to. A widget can be drawn
    /// to if it is mapped and visible.
    ///
    /// # Returns
    ///
    /// [`true`] if `self` is drawable, [`false`] otherwise
    #[doc(alias = "gtk_widget_is_drawable")]
    fn is_drawable(&self) -> bool;

    /// Determines if the widget is the focus widget within its
    /// toplevel. (This does not mean that the `property::Widget::has-focus` property is
    /// necessarily set; `property::Widget::has-focus` will only be set if the
    /// toplevel widget additionally has the global input focus.)
    ///
    /// # Returns
    ///
    /// [`true`] if the widget is the focus widget.
    #[doc(alias = "gtk_widget_is_focus")]
    fn is_focus(&self) -> bool;

    /// Returns the widget’s effective sensitivity, which means
    /// it is sensitive itself and also its parent widget is sensitive
    ///
    /// # Returns
    ///
    /// [`true`] if the widget is effectively sensitive
    #[doc(alias = "gtk_widget_is_sensitive")]
    fn is_sensitive(&self) -> bool;

    /// Determines whether `self` is a toplevel widget.
    ///
    /// Currently only [`Window`][crate::Window] and [`Invisible`][crate::Invisible] (and out-of-process
    /// `GtkPlugs`) are toplevel widgets. Toplevel widgets have no parent
    /// widget.
    ///
    /// # Returns
    ///
    /// [`true`] if `self` is a toplevel, [`false`] otherwise
    #[doc(alias = "gtk_widget_is_toplevel")]
    fn is_toplevel(&self) -> bool;

    /// Determines whether the widget and all its parents are marked as
    /// visible.
    ///
    /// This function does not check if the widget is obscured in any way.
    ///
    /// See also [`get_visible()`][Self::get_visible()] and [`set_visible()`][Self::set_visible()]
    ///
    /// # Returns
    ///
    /// [`true`] if the widget and all its parents are visible
    #[doc(alias = "gtk_widget_is_visible")]
    fn is_visible(&self) -> bool;

    /// This function should be called whenever keyboard navigation within
    /// a single widget hits a boundary. The function emits the
    /// `signal::Widget::keynav-failed` signal on the widget and its return
    /// value should be interpreted in a way similar to the return value of
    /// [`child_focus()`][Self::child_focus()]:
    ///
    /// When [`true`] is returned, stay in the widget, the failed keyboard
    /// navigation is OK and/or there is nowhere we can/should move the
    /// focus to.
    ///
    /// When [`false`] is returned, the caller should continue with keyboard
    /// navigation outside the widget, e.g. by calling
    /// [`child_focus()`][Self::child_focus()] on the widget’s toplevel.
    ///
    /// The default ::keynav-failed handler returns [`false`] for
    /// [`DirectionType::TabForward`][crate::DirectionType::TabForward] and [`DirectionType::TabBackward`][crate::DirectionType::TabBackward]. For the other
    /// values of [`DirectionType`][crate::DirectionType] it returns [`true`].
    ///
    /// Whenever the default handler returns [`true`], it also calls
    /// [`error_bell()`][Self::error_bell()] to notify the user of the failed keyboard
    /// navigation.
    ///
    /// A use case for providing an own implementation of ::keynav-failed
    /// (either by connecting to it or by overriding it) would be a row of
    /// [`Entry`][crate::Entry] widgets where the user should be able to navigate the
    /// entire row with the cursor keys, as e.g. known from user interfaces
    /// that require entering license keys.
    /// ## `direction`
    /// direction of focus movement
    ///
    /// # Returns
    ///
    /// [`true`] if stopping keyboard navigation is fine, [`false`]
    ///  if the emitting widget should try to handle the keyboard
    ///  navigation attempt in its parent container(s).
    #[doc(alias = "gtk_widget_keynav_failed")]
    fn keynav_failed(&self, direction: DirectionType) -> bool;

    /// Lists the closures used by `self` for accelerator group connections
    /// with [`AccelGroupExtManual::connect_by_path()`][crate::prelude::AccelGroupExtManual::connect_by_path()] or [`AccelGroupExtManual::connect()`][crate::prelude::AccelGroupExtManual::connect()].
    /// The closures can be used to monitor accelerator changes on `self`,
    /// by connecting to the [`AccelGroup`][crate::AccelGroup] signal of the
    /// [`AccelGroup`][crate::AccelGroup] of a closure which can be found out with
    /// [`AccelGroup::from_accel_closure()`][crate::AccelGroup::from_accel_closure()].
    ///
    /// # Returns
    ///
    ///
    ///  a newly allocated `GList` of closures
    #[doc(alias = "gtk_widget_list_accel_closures")]
    fn list_accel_closures(&self) -> Vec<glib::Closure>;

    /// Retrieves a [`None`]-terminated array of strings containing the prefixes of
    /// [`gio::ActionGroup`][crate::gio::ActionGroup]'s available to `self`.
    ///
    /// # Returns
    ///
    /// a [`None`]-terminated array of strings.
    #[doc(alias = "gtk_widget_list_action_prefixes")]
    fn list_action_prefixes(&self) -> Vec<glib::GString>;

    /// Returns a newly allocated list of the widgets, normally labels, for
    /// which this widget is the target of a mnemonic (see for example,
    /// [`LabelExt::set_mnemonic_widget()`][crate::prelude::LabelExt::set_mnemonic_widget()]).
    ///
    /// The widgets in the list are not individually referenced. If you
    /// want to iterate through the list and perform actions involving
    /// callbacks that might destroy the widgets, you
    /// must call `g_list_foreach (result,
    /// (GFunc)g_object_ref, NULL)` first, and then unref all the
    /// widgets afterwards.
    ///
    /// # Returns
    ///
    /// the list of
    ///  mnemonic labels; free this list
    ///  with `g_list_free()` when you are done with it.
    #[doc(alias = "gtk_widget_list_mnemonic_labels")]
    fn list_mnemonic_labels(&self) -> Vec<Widget>;

    /// This function is only for use in widget implementations. Causes
    /// a widget to be mapped if it isn’t already.
    #[doc(alias = "gtk_widget_map")]
    fn map(&self);

    /// Emits the `signal::Widget::mnemonic-activate` signal.
    /// ## `group_cycling`
    /// [`true`] if there are other widgets with the same mnemonic
    ///
    /// # Returns
    ///
    /// [`true`] if the signal has been handled
    #[doc(alias = "gtk_widget_mnemonic_activate")]
    fn mnemonic_activate(&self, group_cycling: bool) -> bool;

    /// This function is only for use in widget implementations.
    ///
    /// Flags the widget for a rerun of the GtkWidgetClass::size_allocate
    /// function. Use this function instead of [`queue_resize()`][Self::queue_resize()]
    /// when the `self`'s size request didn't change but it wants to
    /// reposition its contents.
    ///
    /// An example user of this function is [`set_halign()`][Self::set_halign()].
    #[cfg(any(feature = "v3_20", feature = "dox"))]
    #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
    #[doc(alias = "gtk_widget_queue_allocate")]
    fn queue_allocate(&self);

    /// Mark `self` as needing to recompute its expand flags. Call
    /// this function when setting legacy expand child properties
    /// on the child of a container.
    ///
    /// See [`compute_expand()`][Self::compute_expand()].
    #[doc(alias = "gtk_widget_queue_compute_expand")]
    fn queue_compute_expand(&self);

    /// Equivalent to calling [`queue_draw_area()`][Self::queue_draw_area()] for the
    /// entire area of a widget.
    #[doc(alias = "gtk_widget_queue_draw")]
    fn queue_draw(&self);

    /// Convenience function that calls [`queue_draw_region()`][Self::queue_draw_region()] on
    /// the region created from the given coordinates.
    ///
    /// The region here is specified in widget coordinates.
    /// Widget coordinates are a bit odd; for historical reasons, they are
    /// defined as `self`->window coordinates for widgets that return [`true`] for
    /// [`has_window()`][Self::has_window()], and are relative to `self`->allocation.x,
    /// `self`->allocation.y otherwise.
    ///
    /// `width` or `height` may be 0, in this case this function does
    /// nothing. Negative values for `width` and `height` are not allowed.
    /// ## `x`
    /// x coordinate of upper-left corner of rectangle to redraw
    /// ## `y`
    /// y coordinate of upper-left corner of rectangle to redraw
    /// ## `width`
    /// width of region to draw
    /// ## `height`
    /// height of region to draw
    #[doc(alias = "gtk_widget_queue_draw_area")]
    fn queue_draw_area(&self, x: i32, y: i32, width: i32, height: i32);

    /// Invalidates the area of `self` defined by `region` by calling
    /// [`Window::invalidate_region()`][crate::gdk::Window::invalidate_region()] on the widget’s window and all its
    /// child windows. Once the main loop becomes idle (after the current
    /// batch of events has been processed, roughly), the window will
    /// receive expose events for the union of all regions that have been
    /// invalidated.
    ///
    /// Normally you would only use this function in widget
    /// implementations. You might also use it to schedule a redraw of a
    /// [`DrawingArea`][crate::DrawingArea] or some portion thereof.
    /// ## `region`
    /// region to draw
    #[doc(alias = "gtk_widget_queue_draw_region")]
    fn queue_draw_region(&self, region: &cairo::Region);

    /// This function is only for use in widget implementations.
    /// Flags a widget to have its size renegotiated; should
    /// be called when a widget for some reason has a new size request.
    /// For example, when you change the text in a [`Label`][crate::Label], [`Label`][crate::Label]
    /// queues a resize to ensure there’s enough space for the new text.
    ///
    /// Note that you cannot call [`queue_resize()`][Self::queue_resize()] on a widget
    /// from inside its implementation of the GtkWidgetClass::size_allocate
    /// virtual method. Calls to [`queue_resize()`][Self::queue_resize()] from inside
    /// GtkWidgetClass::size_allocate will be silently ignored.
    #[doc(alias = "gtk_widget_queue_resize")]
    fn queue_resize(&self);

    /// This function works like [`queue_resize()`][Self::queue_resize()],
    /// except that the widget is not invalidated.
    #[doc(alias = "gtk_widget_queue_resize_no_redraw")]
    fn queue_resize_no_redraw(&self);

    /// Creates the GDK (windowing system) resources associated with a
    /// widget. For example, `self`->window will be created when a widget
    /// is realized. Normally realization happens implicitly; if you show
    /// a widget and all its parent containers, then the widget will be
    /// realized and mapped automatically.
    ///
    /// Realizing a widget requires all
    /// the widget’s parent widgets to be realized; calling
    /// [`realize()`][Self::realize()] realizes the widget’s parents in addition to
    /// `self` itself. If a widget is not yet inside a toplevel window
    /// when you realize it, bad things will happen.
    ///
    /// This function is primarily used in widget implementations, and
    /// isn’t very useful otherwise. Many times when you think you might
    /// need it, a better approach is to connect to a signal that will be
    /// called after the widget is realized automatically, such as
    /// `signal::Widget::draw`. Or simply g_signal_connect () to the
    /// `signal::Widget::realize` signal.
    #[doc(alias = "gtk_widget_realize")]
    fn realize(&self);

    /// Registers a [`gdk::Window`][crate::gdk::Window] with the widget and sets it up so that
    /// the widget receives events for it. Call [`unregister_window()`][Self::unregister_window()]
    /// when destroying the window.
    ///
    /// Before 3.8 you needed to call [`Window::set_user_data()`][crate::gdk::Window::set_user_data()] directly to set
    /// this up. This is now deprecated and you should use [`register_window()`][Self::register_window()]
    /// instead. Old code will keep working as is, although some new features like
    /// transparency might not work perfectly.
    /// ## `window`
    /// a [`gdk::Window`][crate::gdk::Window]
    #[doc(alias = "gtk_widget_register_window")]
    fn register_window(&self, window: &gdk::Window);

    /// Removes an accelerator from `self`, previously installed with
    /// [`add_accelerator()`][Self::add_accelerator()].
    /// ## `accel_group`
    /// accel group for this widget
    /// ## `accel_key`
    /// GDK keyval of the accelerator
    /// ## `accel_mods`
    /// modifier key combination of the accelerator
    ///
    /// # Returns
    ///
    /// whether an accelerator was installed and could be removed
    #[doc(alias = "gtk_widget_remove_accelerator")]
    fn remove_accelerator<P: IsA<AccelGroup>>(
        &self,
        accel_group: &P,
        accel_key: u32,
        accel_mods: gdk::ModifierType,
    ) -> bool;

    /// Removes a widget from the list of mnemonic labels for
    /// this widget. (See [`list_mnemonic_labels()`][Self::list_mnemonic_labels()]). The widget
    /// must have previously been added to the list with
    /// [`add_mnemonic_label()`][Self::add_mnemonic_label()].
    /// ## `label`
    /// a [`Widget`][crate::Widget] that was previously set as a mnemonic label for
    ///  `self` with [`add_mnemonic_label()`][Self::add_mnemonic_label()].
    #[doc(alias = "gtk_widget_remove_mnemonic_label")]
    fn remove_mnemonic_label<P: IsA<Widget>>(&self, label: &P);

    /// Updates the style context of `self` and all descendants
    /// by updating its widget path. `GtkContainers` may want
    /// to use this on a child when reordering it in a way that a different
    /// style might apply to it. See also [`ContainerExt::path_for_child()`][crate::prelude::ContainerExt::path_for_child()].
    #[doc(alias = "gtk_widget_reset_style")]
    fn reset_style(&self);

    /// Very rarely-used function. This function is used to emit
    /// an expose event on a widget. This function is not normally used
    /// directly. The only time it is used is when propagating an expose
    /// event to a windowless child widget ([`has_window()`][Self::has_window()] is [`false`]),
    /// and that is normally done using [`ContainerExt::propagate_draw()`][crate::prelude::ContainerExt::propagate_draw()].
    ///
    /// If you want to force an area of a window to be redrawn,
    /// use [`Window::invalidate_rect()`][crate::gdk::Window::invalidate_rect()] or [`Window::invalidate_region()`][crate::gdk::Window::invalidate_region()].
    /// To cause the redraw to be done immediately, follow that call
    /// with a call to [`Window::process_updates()`][crate::gdk::Window::process_updates()].
    ///
    /// # Deprecated since 3.22
    ///
    /// Application and widget code should not handle
    ///  expose events directly; invalidation should use the [`Widget`][crate::Widget]
    ///  API, and drawing should only happen inside `signal::Widget::draw`
    ///  implementations
    /// ## `event`
    /// a expose `GdkEvent`
    ///
    /// # Returns
    ///
    /// return from the event signal emission ([`true`] if
    ///  the event was handled)
    #[cfg_attr(feature = "v3_22", deprecated = "Since 3.22")]
    #[doc(alias = "gtk_widget_send_expose")]
    fn send_expose(&self, event: &gdk::Event) -> i32;

    /// Sends the focus change `event` to `self`
    ///
    /// This function is not meant to be used by applications. The only time it
    /// should be used is when it is necessary for a [`Widget`][crate::Widget] to assign focus
    /// to a widget that is semantically owned by the first widget even though
    /// it’s not a direct child - for instance, a search entry in a floating
    /// window similar to the quick search in [`TreeView`][crate::TreeView].
    ///
    /// An example of its usage is:
    ///
    ///
    ///
    /// **⚠️ The following code is in C ⚠️**
    ///
    /// ```C
    ///   GdkEvent *fevent = gdk_event_new (GDK_FOCUS_CHANGE);
    ///
    ///   fevent->focus_change.type = GDK_FOCUS_CHANGE;
    ///   fevent->focus_change.in = TRUE;
    ///   fevent->focus_change.window = _gtk_widget_get_window (widget);
    ///   if (fevent->focus_change.window != NULL)
    ///     g_object_ref (fevent->focus_change.window);
    ///
    ///   gtk_widget_send_focus_change (widget, fevent);
    ///
    ///   gdk_event_free (event);
    /// ```
    /// ## `event`
    /// a `GdkEvent` of type GDK_FOCUS_CHANGE
    ///
    /// # Returns
    ///
    /// the return value from the event signal emission: [`true`]
    ///  if the event was handled, and [`false`] otherwise
    #[doc(alias = "gtk_widget_send_focus_change")]
    fn send_focus_change(&self, event: &gdk::Event) -> bool;

    /// Given an accelerator group, `accel_group`, and an accelerator path,
    /// `accel_path`, sets up an accelerator in `accel_group` so whenever the
    /// key binding that is defined for `accel_path` is pressed, `self`
    /// will be activated. This removes any accelerators (for any
    /// accelerator group) installed by previous calls to
    /// [`set_accel_path()`][Self::set_accel_path()]. Associating accelerators with
    /// paths allows them to be modified by the user and the modifications
    /// to be saved for future use. (See `gtk_accel_map_save()`.)
    ///
    /// This function is a low level function that would most likely
    /// be used by a menu creation system like `GtkUIManager`. If you
    /// use `GtkUIManager`, setting up accelerator paths will be done
    /// automatically.
    ///
    /// Even when you you aren’t using `GtkUIManager`, if you only want to
    /// set up accelerators on menu items [`GtkMenuItemExt::set_accel_path()`][crate::prelude::GtkMenuItemExt::set_accel_path()]
    /// provides a somewhat more convenient interface.
    ///
    /// Note that `accel_path` string will be stored in a `GQuark`. Therefore, if you
    /// pass a static string, you can save some memory by interning it first with
    /// `g_intern_static_string()`.
    /// ## `accel_path`
    /// path used to look up the accelerator
    /// ## `accel_group`
    /// a [`AccelGroup`][crate::AccelGroup].
    #[doc(alias = "gtk_widget_set_accel_path")]
    fn set_accel_path<P: IsA<AccelGroup>>(&self, accel_path: Option<&str>, accel_group: Option<&P>);

    /// Sets the widget’s allocation. This should not be used
    /// directly, but from within a widget’s size_allocate method.
    ///
    /// The allocation set should be the “adjusted” or actual
    /// allocation. If you’re implementing a [`Container`][crate::Container], you want to use
    /// [`size_allocate()`][Self::size_allocate()] instead of [`set_allocation()`][Self::set_allocation()].
    /// The GtkWidgetClass::adjust_size_allocation virtual method adjusts the
    /// allocation inside [`size_allocate()`][Self::size_allocate()] to create an adjusted
    /// allocation.
    /// ## `allocation`
    /// a pointer to a `GtkAllocation` to copy from
    #[doc(alias = "gtk_widget_set_allocation")]
    fn set_allocation(&self, allocation: &Allocation);

    /// Sets whether the application intends to draw on the widget in
    /// an `signal::Widget::draw` handler.
    ///
    /// This is a hint to the widget and does not affect the behavior of
    /// the GTK+ core; many widgets ignore this flag entirely. For widgets
    /// that do pay attention to the flag, such as [`EventBox`][crate::EventBox] and [`Window`][crate::Window],
    /// the effect is to suppress default themed drawing of the widget's
    /// background. (Children of the widget will still be drawn.) The application
    /// is then entirely responsible for drawing the widget background.
    ///
    /// Note that the background is still drawn when the widget is mapped.
    /// ## `app_paintable`
    /// [`true`] if the application will paint on the widget
    #[doc(alias = "gtk_widget_set_app_paintable")]
    fn set_app_paintable(&self, app_paintable: bool);

    /// Specifies whether `self` can be a default widget. See
    /// [`grab_default()`][Self::grab_default()] for details about the meaning of
    /// “default”.
    /// ## `can_default`
    /// whether or not `self` can be a default widget.
    #[doc(alias = "gtk_widget_set_can_default")]
    fn set_can_default(&self, can_default: bool);

    /// Specifies whether `self` can own the input focus. See
    /// [`grab_focus()`][Self::grab_focus()] for actually setting the input focus on a
    /// widget.
    /// ## `can_focus`
    /// whether or not `self` can own the input focus.
    #[doc(alias = "gtk_widget_set_can_focus")]
    fn set_can_focus(&self, can_focus: bool);

    /// Sets whether `self` should be mapped along with its when its parent
    /// is mapped and `self` has been shown with [`show()`][Self::show()].
    ///
    /// The child visibility can be set for widget before it is added to
    /// a container with [`set_parent()`][Self::set_parent()], to avoid mapping
    /// children unnecessary before immediately unmapping them. However
    /// it will be reset to its default state of [`true`] when the widget
    /// is removed from a container.
    ///
    /// Note that changing the child visibility of a widget does not
    /// queue a resize on the widget. Most of the time, the size of
    /// a widget is computed from all visible children, whether or
    /// not they are mapped. If this is not the case, the container
    /// can queue a resize itself.
    ///
    /// This function is only useful for container implementations and
    /// never should be called by an application.
    /// ## `is_visible`
    /// if [`true`], `self` should be mapped along with its parent.
    #[doc(alias = "gtk_widget_set_child_visible")]
    fn set_child_visible(&self, is_visible: bool);

    /// Sets the widget’s clip. This must not be used directly,
    /// but from within a widget’s size_allocate method.
    /// It must be called after [`set_allocation()`][Self::set_allocation()] (or after chaining up
    /// to the parent class), because that function resets the clip.
    ///
    /// The clip set should be the area that `self` draws on. If `self` is a
    /// [`Container`][crate::Container], the area must contain all children's clips.
    ///
    /// If this function is not called by `self` during a ::size-allocate handler,
    /// the clip will be set to `self`'s allocation.
    /// ## `clip`
    /// a pointer to a `GtkAllocation` to copy from
    #[doc(alias = "gtk_widget_set_clip")]
    fn set_clip(&self, clip: &Allocation);

    /// Enables or disables a [`gdk::Device`][crate::gdk::Device] to interact with `self`
    /// and all its children.
    ///
    /// It does so by descending through the [`gdk::Window`][crate::gdk::Window] hierarchy
    /// and enabling the same mask that is has for core events
    /// (i.e. the one that [`Window::events()`][crate::gdk::Window::events()] returns).
    /// ## `device`
    /// a [`gdk::Device`][crate::gdk::Device]
    /// ## `enabled`
    /// whether to enable the device
    #[doc(alias = "gtk_widget_set_device_enabled")]
    fn set_device_enabled(&self, device: &gdk::Device, enabled: bool);

    /// Sets the device event mask (see [`gdk::EventMask`][crate::gdk::EventMask]) for a widget. The event
    /// mask determines which events a widget will receive from `device`. Keep
    /// in mind that different widgets have different default event masks, and by
    /// changing the event mask you may disrupt a widget’s functionality,
    /// so be careful. This function must be called while a widget is
    /// unrealized. Consider [`add_device_events()`][Self::add_device_events()] for widgets that are
    /// already realized, or if you want to preserve the existing event
    /// mask. This function can’t be used with windowless widgets (which return
    /// [`false`] from [`has_window()`][Self::has_window()]);
    /// to get events on those widgets, place them inside a [`EventBox`][crate::EventBox]
    /// and receive events on the event box.
    /// ## `device`
    /// a [`gdk::Device`][crate::gdk::Device]
    /// ## `events`
    /// event mask
    #[doc(alias = "gtk_widget_set_device_events")]
    fn set_device_events(&self, device: &gdk::Device, events: gdk::EventMask);

    /// Sets the reading direction on a particular widget. This direction
    /// controls the primary direction for widgets containing text,
    /// and also the direction in which the children of a container are
    /// packed. The ability to set the direction is present in order
    /// so that correct localization into languages with right-to-left
    /// reading directions can be done. Generally, applications will
    /// let the default reading direction present, except for containers
    /// where the containers are arranged in an order that is explicitly
    /// visual rather than logical (such as buttons for text justification).
    ///
    /// If the direction is set to [`TextDirection::None`][crate::TextDirection::None], then the value
    /// set by [`Widget::set_default_direction()`][crate::Widget::set_default_direction()] will be used.
    /// ## `dir`
    /// the new direction
    #[doc(alias = "gtk_widget_set_direction")]
    fn set_direction(&self, dir: TextDirection);

    /// Sets whether the widget should grab focus when it is clicked with the mouse.
    /// Making mouse clicks not grab focus is useful in places like toolbars where
    /// you don’t want the keyboard focus removed from the main area of the
    /// application.
    /// ## `focus_on_click`
    /// whether the widget should grab focus when clicked with the mouse
    #[cfg(any(feature = "v3_20", feature = "dox"))]
    #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
    #[doc(alias = "gtk_widget_set_focus_on_click")]
    fn set_focus_on_click(&self, focus_on_click: bool);

    /// Sets the font map to use for Pango rendering. When not set, the widget
    /// will inherit the font map from its parent.
    /// ## `font_map`
    /// a [`pango::FontMap`][crate::pango::FontMap], or [`None`] to unset any previously
    ///  set font map
    #[doc(alias = "gtk_widget_set_font_map")]
    fn set_font_map<P: IsA<pango::FontMap>>(&self, font_map: Option<&P>);

    /// Sets the [`cairo::FontOptions`][crate::cairo::FontOptions] used for Pango rendering in this widget.
    /// When not set, the default font options for the [`gdk::Screen`][crate::gdk::Screen] will be used.
    /// ## `options`
    /// a [`cairo::FontOptions`][crate::cairo::FontOptions], or [`None`] to unset any
    ///  previously set default font options.
    #[doc(alias = "gtk_widget_set_font_options")]
    fn set_font_options(&self, options: Option<&cairo::FontOptions>);

    /// Sets the horizontal alignment of `self`.
    /// See the `property::Widget::halign` property.
    /// ## `align`
    /// the horizontal alignment
    #[doc(alias = "gtk_widget_set_halign")]
    fn set_halign(&self, align: Align);

    /// Sets the has-tooltip property on `self` to `has_tooltip`. See
    /// `property::Widget::has-tooltip` for more information.
    /// ## `has_tooltip`
    /// whether or not `self` has a tooltip.
    #[doc(alias = "gtk_widget_set_has_tooltip")]
    fn set_has_tooltip(&self, has_tooltip: bool);

    /// Specifies whether `self` has a [`gdk::Window`][crate::gdk::Window] of its own. Note that
    /// all realized widgets have a non-[`None`] “window” pointer
    /// ([`window()`][Self::window()] never returns a [`None`] window when a widget
    /// is realized), but for many of them it’s actually the [`gdk::Window`][crate::gdk::Window] of
    /// one of its parent widgets. Widgets that do not create a `window` for
    /// themselves in `signal::Widget::realize` must announce this by
    /// calling this function with `has_window` = [`false`].
    ///
    /// This function should only be called by widget implementations,
    /// and they should call it in their `init()` function.
    /// ## `has_window`
    /// whether or not `self` has a window.
    #[doc(alias = "gtk_widget_set_has_window")]
    fn set_has_window(&self, has_window: bool);

    /// Sets whether the widget would like any available extra horizontal
    /// space. When a user resizes a [`Window`][crate::Window], widgets with expand=TRUE
    /// generally receive the extra space. For example, a list or
    /// scrollable area or document in your window would often be set to
    /// expand.
    ///
    /// Call this function to set the expand flag if you would like your
    /// widget to become larger horizontally when the window has extra
    /// room.
    ///
    /// By default, widgets automatically expand if any of their children
    /// want to expand. (To see if a widget will automatically expand given
    /// its current children and state, call [`compute_expand()`][Self::compute_expand()]. A
    /// container can decide how the expandability of children affects the
    /// expansion of the container by overriding the compute_expand virtual
    /// method on [`Widget`][crate::Widget].).
    ///
    /// Setting hexpand explicitly with this function will override the
    /// automatic expand behavior.
    ///
    /// This function forces the widget to expand or not to expand,
    /// regardless of children. The override occurs because
    /// [`set_hexpand()`][Self::set_hexpand()] sets the hexpand-set property (see
    /// [`set_hexpand_set()`][Self::set_hexpand_set()]) which causes the widget’s hexpand
    /// value to be used, rather than looking at children and widget state.
    /// ## `expand`
    /// whether to expand
    #[doc(alias = "gtk_widget_set_hexpand")]
    fn set_hexpand(&self, expand: bool);

    /// Sets whether the hexpand flag (see [`hexpands()`][Self::hexpands()]) will
    /// be used.
    ///
    /// The hexpand-set property will be set automatically when you call
    /// [`set_hexpand()`][Self::set_hexpand()] to set hexpand, so the most likely
    /// reason to use this function would be to unset an explicit expand
    /// flag.
    ///
    /// If hexpand is set, then it overrides any computed
    /// expand value based on child widgets. If hexpand is not
    /// set, then the expand value depends on whether any
    /// children of the widget would like to expand.
    ///
    /// There are few reasons to use this function, but it’s here
    /// for completeness and consistency.
    /// ## `set`
    /// value for hexpand-set property
    #[doc(alias = "gtk_widget_set_hexpand_set")]
    fn set_hexpand_set(&self, set: bool);

    /// Marks the widget as being mapped.
    ///
    /// This function should only ever be called in a derived widget's
    /// “map” or “unmap” implementation.
    /// ## `mapped`
    /// [`true`] to mark the widget as mapped
    #[doc(alias = "gtk_widget_set_mapped")]
    fn set_mapped(&self, mapped: bool);

    /// Sets the bottom margin of `self`.
    /// See the `property::Widget::margin-bottom` property.
    /// ## `margin`
    /// the bottom margin
    #[doc(alias = "gtk_widget_set_margin_bottom")]
    fn set_margin_bottom(&self, margin: i32);

    /// Sets the end margin of `self`.
    /// See the `property::Widget::margin-end` property.
    /// ## `margin`
    /// the end margin
    #[doc(alias = "gtk_widget_set_margin_end")]
    fn set_margin_end(&self, margin: i32);

    /// Sets the start margin of `self`.
    /// See the `property::Widget::margin-start` property.
    /// ## `margin`
    /// the start margin
    #[doc(alias = "gtk_widget_set_margin_start")]
    fn set_margin_start(&self, margin: i32);

    /// Sets the top margin of `self`.
    /// See the `property::Widget::margin-top` property.
    /// ## `margin`
    /// the top margin
    #[doc(alias = "gtk_widget_set_margin_top")]
    fn set_margin_top(&self, margin: i32);

    /// Widgets can be named, which allows you to refer to them from a
    /// CSS file. You can apply a style to widgets with a particular name
    /// in the CSS file. See the documentation for the CSS syntax (on the
    /// same page as the docs for [`StyleContext`][crate::StyleContext]).
    ///
    /// Note that the CSS syntax has certain special characters to delimit
    /// and represent elements in a selector (period, #, >, *...), so using
    /// these will make your widget impossible to match by name. Any combination
    /// of alphanumeric symbols, dashes and underscores will suffice.
    /// ## `name`
    /// name for the widget
    #[doc(alias = "gtk_widget_set_name")]
    #[doc(alias = "set_name")]
    fn set_widget_name(&self, name: &str);

    /// Sets the `property::Widget::no-show-all` property, which determines whether
    /// calls to [`show_all()`][Self::show_all()] will affect this widget.
    ///
    /// This is mostly for use in constructing widget hierarchies with externally
    /// controlled visibility, see `GtkUIManager`.
    /// ## `no_show_all`
    /// the new value for the “no-show-all” property
    #[doc(alias = "gtk_widget_set_no_show_all")]
    fn set_no_show_all(&self, no_show_all: bool);

    /// Request the `self` to be rendered partially transparent,
    /// with opacity 0 being fully transparent and 1 fully opaque. (Opacity values
    /// are clamped to the [0,1] range.).
    /// This works on both toplevel widget, and child widgets, although there
    /// are some limitations:
    ///
    /// For toplevel widgets this depends on the capabilities of the windowing
    /// system. On X11 this has any effect only on X screens with a compositing manager
    /// running. See [`is_composited()`][Self::is_composited()]. On Windows it should work
    /// always, although setting a window’s opacity after the window has been
    /// shown causes it to flicker once on Windows.
    ///
    /// For child widgets it doesn’t work if any affected widget has a native window, or
    /// disables double buffering.
    /// ## `opacity`
    /// desired opacity, between 0 and 1
    #[doc(alias = "gtk_widget_set_opacity")]
    fn set_opacity(&self, opacity: f64);

    /// This function is useful only when implementing subclasses of
    /// [`Container`][crate::Container].
    /// Sets the container as the parent of `self`, and takes care of
    /// some details such as updating the state and style of the child
    /// to reflect its new location. The opposite function is
    /// [`unparent()`][Self::unparent()].
    /// ## `parent`
    /// parent container
    #[doc(alias = "gtk_widget_set_parent")]
    fn set_parent<P: IsA<Widget>>(&self, parent: &P);

    /// Sets a non default parent window for `self`.
    ///
    /// For [`Window`][crate::Window] classes, setting a `parent_window` effects whether
    /// the window is a toplevel window or can be embedded into other
    /// widgets.
    ///
    /// For [`Window`][crate::Window] classes, this needs to be called before the
    /// window is realized.
    /// ## `parent_window`
    /// the new parent window.
    #[doc(alias = "gtk_widget_set_parent_window")]
    fn set_parent_window(&self, parent_window: &gdk::Window);

    /// Marks the widget as being realized. This function must only be
    /// called after all `GdkWindows` for the `self` have been created
    /// and registered.
    ///
    /// This function should only ever be called in a derived widget's
    /// “realize” or “unrealize” implementation.
    /// ## `realized`
    /// [`true`] to mark the widget as realized
    #[doc(alias = "gtk_widget_set_realized")]
    fn set_realized(&self, realized: bool);

    /// Specifies whether `self` will be treated as the default widget
    /// within its toplevel when it has the focus, even if another widget
    /// is the default.
    ///
    /// See [`grab_default()`][Self::grab_default()] for details about the meaning of
    /// “default”.
    /// ## `receives_default`
    /// whether or not `self` can be a default widget.
    #[doc(alias = "gtk_widget_set_receives_default")]
    fn set_receives_default(&self, receives_default: bool);

    /// Sets whether the entire widget is queued for drawing when its size
    /// allocation changes. By default, this setting is [`true`] and
    /// the entire widget is redrawn on every size change. If your widget
    /// leaves the upper left unchanged when made bigger, turning this
    /// setting off will improve performance.
    ///
    /// Note that for widgets where [`has_window()`][Self::has_window()] is [`false`]
    /// setting this flag to [`false`] turns off all allocation on resizing:
    /// the widget will not even redraw if its position changes; this is to
    /// allow containers that don’t draw anything to avoid excess
    /// invalidations. If you set this flag on a widget with no window that
    /// does draw on `self`->window, you are
    /// responsible for invalidating both the old and new allocation of the
    /// widget when the widget is moved and responsible for invalidating
    /// regions newly when the widget increases size.
    /// ## `redraw_on_allocate`
    /// if [`true`], the entire widget will be redrawn
    ///  when it is allocated to a new size. Otherwise, only the
    ///  new portion of the widget will be redrawn.
    #[doc(alias = "gtk_widget_set_redraw_on_allocate")]
    fn set_redraw_on_allocate(&self, redraw_on_allocate: bool);

    /// Sets the sensitivity of a widget. A widget is sensitive if the user
    /// can interact with it. Insensitive widgets are “grayed out” and the
    /// user can’t interact with them. Insensitive widgets are known as
    /// “inactive”, “disabled”, or “ghosted” in some other toolkits.
    /// ## `sensitive`
    /// [`true`] to make the widget sensitive
    #[doc(alias = "gtk_widget_set_sensitive")]
    fn set_sensitive(&self, sensitive: bool);

    /// Sets the minimum size of a widget; that is, the widget’s size
    /// request will be at least `width` by `height`. You can use this
    /// function to force a widget to be larger than it normally would be.
    ///
    /// In most cases, [`GtkWindowExt::set_default_size()`][crate::prelude::GtkWindowExt::set_default_size()] is a better choice for
    /// toplevel windows than this function; setting the default size will
    /// still allow users to shrink the window. Setting the size request
    /// will force them to leave the window at least as large as the size
    /// request. When dealing with window sizes,
    /// [`GtkWindowExt::set_geometry_hints()`][crate::prelude::GtkWindowExt::set_geometry_hints()] can be a useful function as well.
    ///
    /// Note the inherent danger of setting any fixed size - themes,
    /// translations into other languages, different fonts, and user action
    /// can all change the appropriate size for a given widget. So, it's
    /// basically impossible to hardcode a size that will always be
    /// correct.
    ///
    /// The size request of a widget is the smallest size a widget can
    /// accept while still functioning well and drawing itself correctly.
    /// However in some strange cases a widget may be allocated less than
    /// its requested size, and in many cases a widget may be allocated more
    /// space than it requested.
    ///
    /// If the size request in a given direction is -1 (unset), then
    /// the “natural” size request of the widget will be used instead.
    ///
    /// The size request set here does not include any margin from the
    /// [`Widget`][crate::Widget] properties margin-left, margin-right, margin-top, and
    /// margin-bottom, but it does include pretty much all other padding
    /// or border properties set by any subclass of [`Widget`][crate::Widget].
    /// ## `width`
    /// width `self` should request, or -1 to unset
    /// ## `height`
    /// height `self` should request, or -1 to unset
    #[doc(alias = "gtk_widget_set_size_request")]
    fn set_size_request(&self, width: i32, height: i32);

    /// This function is for use in widget implementations. Turns on flag
    /// values in the current widget state (insensitive, prelighted, etc.).
    ///
    /// This function accepts the values [`StateFlags::DIR_LTR`][crate::StateFlags::DIR_LTR] and
    /// [`StateFlags::DIR_RTL`][crate::StateFlags::DIR_RTL] but ignores them. If you want to set the widget's
    /// direction, use [`set_direction()`][Self::set_direction()].
    ///
    /// It is worth mentioning that any other state than [`StateFlags::INSENSITIVE`][crate::StateFlags::INSENSITIVE],
    /// will be propagated down to all non-internal children if `self` is a
    /// [`Container`][crate::Container], while [`StateFlags::INSENSITIVE`][crate::StateFlags::INSENSITIVE] itself will be propagated
    /// down to all [`Container`][crate::Container] children by different means than turning on the
    /// state flag down the hierarchy, both [`state_flags()`][Self::state_flags()] and
    /// [`is_sensitive()`][Self::is_sensitive()] will make use of these.
    /// ## `flags`
    /// State flags to turn on
    /// ## `clear`
    /// Whether to clear state before turning on `flags`
    #[doc(alias = "gtk_widget_set_state_flags")]
    fn set_state_flags(&self, flags: StateFlags, clear: bool);

    /// Enables or disables multiple pointer awareness. If this setting is [`true`],
    /// `self` will start receiving multiple, per device enter/leave events. Note
    /// that if custom `GdkWindows` are created in `signal::Widget::realize`,
    /// [`Window::set_support_multidevice()`][crate::gdk::Window::set_support_multidevice()] will have to be called manually on them.
    /// ## `support_multidevice`
    /// [`true`] to support input from multiple devices.
    #[doc(alias = "gtk_widget_set_support_multidevice")]
    fn set_support_multidevice(&self, support_multidevice: bool);

    /// Sets `markup` as the contents of the tooltip, which is marked up with
    ///  the [Pango text markup language][PangoMarkupFormat].
    ///
    /// This function will take care of setting `property::Widget::has-tooltip` to [`true`]
    /// and of the default handler for the `signal::Widget::query-tooltip` signal.
    ///
    /// See also the `property::Widget::tooltip-markup` property and
    /// [`Tooltip::set_markup()`][crate::Tooltip::set_markup()].
    /// ## `markup`
    /// the contents of the tooltip for `self`, or [`None`]
    #[doc(alias = "gtk_widget_set_tooltip_markup")]
    fn set_tooltip_markup(&self, markup: Option<&str>);

    /// Sets `text` as the contents of the tooltip. This function will take
    /// care of setting `property::Widget::has-tooltip` to [`true`] and of the default
    /// handler for the `signal::Widget::query-tooltip` signal.
    ///
    /// See also the `property::Widget::tooltip-text` property and [`Tooltip::set_text()`][crate::Tooltip::set_text()].
    /// ## `text`
    /// the contents of the tooltip for `self`
    #[doc(alias = "gtk_widget_set_tooltip_text")]
    fn set_tooltip_text(&self, text: Option<&str>);

    /// Replaces the default window used for displaying
    /// tooltips with `custom_window`. GTK+ will take care of showing and
    /// hiding `custom_window` at the right moment, to behave likewise as
    /// the default tooltip window. If `custom_window` is [`None`], the default
    /// tooltip window will be used.
    /// ## `custom_window`
    /// a [`Window`][crate::Window], or [`None`]
    #[doc(alias = "gtk_widget_set_tooltip_window")]
    fn set_tooltip_window<P: IsA<Window>>(&self, custom_window: Option<&P>);

    /// Sets the vertical alignment of `self`.
    /// See the `property::Widget::valign` property.
    /// ## `align`
    /// the vertical alignment
    #[doc(alias = "gtk_widget_set_valign")]
    fn set_valign(&self, align: Align);

    /// Sets whether the widget would like any available extra vertical
    /// space.
    ///
    /// See [`set_hexpand()`][Self::set_hexpand()] for more detail.
    /// ## `expand`
    /// whether to expand
    #[doc(alias = "gtk_widget_set_vexpand")]
    fn set_vexpand(&self, expand: bool);

    /// Sets whether the vexpand flag (see [`vexpands()`][Self::vexpands()]) will
    /// be used.
    ///
    /// See [`set_hexpand_set()`][Self::set_hexpand_set()] for more detail.
    /// ## `set`
    /// value for vexpand-set property
    #[doc(alias = "gtk_widget_set_vexpand_set")]
    fn set_vexpand_set(&self, set: bool);

    /// Sets the visibility state of `self`. Note that setting this to
    /// [`true`] doesn’t mean the widget is actually viewable, see
    /// [`get_visible()`][Self::get_visible()].
    ///
    /// This function simply calls [`show()`][Self::show()] or [`hide()`][Self::hide()]
    /// but is nicer to use when the visibility of the widget depends on
    /// some condition.
    /// ## `visible`
    /// whether the widget should be shown or not
    #[doc(alias = "gtk_widget_set_visible")]
    fn set_visible(&self, visible: bool);

    /// Sets the visual that should be used for by widget and its children for
    /// creating `GdkWindows`. The visual must be on the same [`gdk::Screen`][crate::gdk::Screen] as
    /// returned by [`screen()`][Self::screen()], so handling the
    /// `signal::Widget::screen-changed` signal is necessary.
    ///
    /// Setting a new `visual` will not cause `self` to recreate its windows,
    /// so you should call this function before `self` is realized.
    /// ## `visual`
    /// visual to be used or [`None`] to unset a previous one
    #[doc(alias = "gtk_widget_set_visual")]
    fn set_visual(&self, visual: Option<&gdk::Visual>);

    /// Sets a widget’s window. This function should only be used in a
    /// widget’s `signal::Widget::realize` implementation. The `window` passed is
    /// usually either new window created with [`gdk::Window::new()`][crate::gdk::Window::new()], or the
    /// window of its parent widget as returned by
    /// [`parent_window()`][Self::parent_window()].
    ///
    /// Widgets must indicate whether they will create their own [`gdk::Window`][crate::gdk::Window]
    /// by calling [`set_has_window()`][Self::set_has_window()]. This is usually done in the
    /// widget’s `init()` function.
    ///
    /// Note that this function does not add any reference to `window`.
    /// ## `window`
    /// a [`gdk::Window`][crate::gdk::Window]
    #[doc(alias = "gtk_widget_set_window")]
    fn set_window(&self, window: &gdk::Window);

    /// Sets a shape for this widget’s GDK window. This allows for
    /// transparent windows etc., see [`Window::shape_combine_region()`][crate::gdk::Window::shape_combine_region()]
    /// for more information.
    /// ## `region`
    /// shape to be added, or [`None`] to remove an existing shape
    #[doc(alias = "gtk_widget_shape_combine_region")]
    fn shape_combine_region(&self, region: Option<&cairo::Region>);

    /// Flags a widget to be displayed. Any widget that isn’t shown will
    /// not appear on the screen. If you want to show all the widgets in a
    /// container, it’s easier to call [`show_all()`][Self::show_all()] on the
    /// container, instead of individually showing the widgets.
    ///
    /// Remember that you have to show the containers containing a widget,
    /// in addition to the widget itself, before it will appear onscreen.
    ///
    /// When a toplevel container is shown, it is immediately realized and
    /// mapped; other shown widgets are realized and mapped when their
    /// toplevel container is realized and mapped.
    #[doc(alias = "gtk_widget_show")]
    fn show(&self);

    /// Recursively shows a widget, and any child widgets (if the widget is
    /// a container).
    #[doc(alias = "gtk_widget_show_all")]
    fn show_all(&self);

    /// Shows a widget. If the widget is an unmapped toplevel widget
    /// (i.e. a [`Window`][crate::Window] that has not yet been shown), enter the main
    /// loop and wait for the window to actually be mapped. Be careful;
    /// because the main loop is running, anything can happen during
    /// this function.
    #[doc(alias = "gtk_widget_show_now")]
    fn show_now(&self);

    /// This function is only used by [`Container`][crate::Container] subclasses, to assign a size
    /// and position to their child widgets.
    ///
    /// In this function, the allocation may be adjusted. It will be forced
    /// to a 1x1 minimum size, and the adjust_size_allocation virtual
    /// method on the child will be used to adjust the allocation. Standard
    /// adjustments include removing the widget’s margins, and applying the
    /// widget’s `property::Widget::halign` and `property::Widget::valign` properties.
    ///
    /// For baseline support in containers you need to use [`size_allocate_with_baseline()`][Self::size_allocate_with_baseline()]
    /// instead.
    /// ## `allocation`
    /// position and size to be allocated to `self`
    #[doc(alias = "gtk_widget_size_allocate")]
    fn size_allocate(&self, allocation: &Allocation);

    /// This function is only used by [`Container`][crate::Container] subclasses, to assign a size,
    /// position and (optionally) baseline to their child widgets.
    ///
    /// In this function, the allocation and baseline may be adjusted. It
    /// will be forced to a 1x1 minimum size, and the
    /// adjust_size_allocation virtual and adjust_baseline_allocation
    /// methods on the child will be used to adjust the allocation and
    /// baseline. Standard adjustments include removing the widget's
    /// margins, and applying the widget’s `property::Widget::halign` and
    /// `property::Widget::valign` properties.
    ///
    /// If the child widget does not have a valign of [`Align::Baseline`][crate::Align::Baseline] the
    /// baseline argument is ignored and -1 is used instead.
    /// ## `allocation`
    /// position and size to be allocated to `self`
    /// ## `baseline`
    /// The baseline of the child, or -1
    #[doc(alias = "gtk_widget_size_allocate_with_baseline")]
    fn size_allocate_with_baseline(&self, allocation: &mut Allocation, baseline: i32);

    //#[doc(alias = "gtk_widget_style_get")]
    //fn style_get(&self, first_property_name: &str, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs);

    /// Gets the value of a style property of `self`.
    /// ## `property_name`
    /// the name of a style property
    ///
    /// # Returns
    ///
    ///
    /// ## `value`
    /// location to return the property value
    #[doc(alias = "gtk_widget_style_get_property")]
    fn style_get_property(&self, property_name: &str) -> glib::Value;

    //#[doc(alias = "gtk_widget_style_get_valist")]
    //fn style_get_valist(&self, first_property_name: &str, var_args: /*Unknown conversion*//*Unimplemented*/Unsupported);

    /// Reverts the effect of a previous call to [`freeze_child_notify()`][Self::freeze_child_notify()].
    /// This causes all queued `signal::Widget::child-notify` signals on `self` to be
    /// emitted.
    #[doc(alias = "gtk_widget_thaw_child_notify")]
    fn thaw_child_notify(&self);

    /// Translate coordinates relative to `self`’s allocation to coordinates
    /// relative to `dest_widget`’s allocations. In order to perform this
    /// operation, both widgets must be realized, and must share a common
    /// toplevel.
    /// ## `dest_widget`
    /// a [`Widget`][crate::Widget]
    /// ## `src_x`
    /// X position relative to `self`
    /// ## `src_y`
    /// Y position relative to `self`
    ///
    /// # Returns
    ///
    /// [`false`] if either widget was not realized, or there
    ///  was no common ancestor. In this case, nothing is stored in
    ///  *`dest_x` and *`dest_y`. Otherwise [`true`].
    ///
    /// ## `dest_x`
    /// location to store X position relative to `dest_widget`
    ///
    /// ## `dest_y`
    /// location to store Y position relative to `dest_widget`
    #[doc(alias = "gtk_widget_translate_coordinates")]
    fn translate_coordinates<P: IsA<Widget>>(
        &self,
        dest_widget: &P,
        src_x: i32,
        src_y: i32,
    ) -> Option<(i32, i32)>;

    /// Triggers a tooltip query on the display where the toplevel of `self`
    /// is located. See [`Tooltip::trigger_tooltip_query()`][crate::Tooltip::trigger_tooltip_query()] for more
    /// information.
    #[doc(alias = "gtk_widget_trigger_tooltip_query")]
    fn trigger_tooltip_query(&self);

    /// This function is only for use in widget implementations. Causes
    /// a widget to be unmapped if it’s currently mapped.
    #[doc(alias = "gtk_widget_unmap")]
    fn unmap(&self);

    /// This function is only for use in widget implementations.
    /// Should be called by implementations of the remove method
    /// on [`Container`][crate::Container], to dissociate a child from the container.
    #[doc(alias = "gtk_widget_unparent")]
    fn unparent(&self);

    /// This function is only useful in widget implementations.
    /// Causes a widget to be unrealized (frees all GDK resources
    /// associated with the widget, such as `self`->window).
    #[doc(alias = "gtk_widget_unrealize")]
    fn unrealize(&self);

    /// Unregisters a [`gdk::Window`][crate::gdk::Window] from the widget that was previously set up with
    /// [`register_window()`][Self::register_window()]. You need to call this when the window is
    /// no longer used by the widget, such as when you destroy it.
    /// ## `window`
    /// a [`gdk::Window`][crate::gdk::Window]
    #[doc(alias = "gtk_widget_unregister_window")]
    fn unregister_window(&self, window: &gdk::Window);

    /// This function is for use in widget implementations. Turns off flag
    /// values for the current widget state (insensitive, prelighted, etc.).
    /// See [`set_state_flags()`][Self::set_state_flags()].
    /// ## `flags`
    /// State flags to turn off
    #[doc(alias = "gtk_widget_unset_state_flags")]
    fn unset_state_flags(&self, flags: StateFlags);

    #[doc(alias = "composite-child")]
    fn is_composite_child(&self) -> bool;

    /// Whether to expand in both directions. Setting this sets both `property::Widget::hexpand` and `property::Widget::vexpand`
    fn expands(&self) -> bool;

    /// Whether to expand in both directions. Setting this sets both `property::Widget::hexpand` and `property::Widget::vexpand`
    fn set_expand(&self, expand: bool);

    #[doc(alias = "has-default")]
    fn set_has_default(&self, has_default: bool);

    #[doc(alias = "has-focus")]
    fn set_has_focus(&self, has_focus: bool);

    #[doc(alias = "height-request")]
    fn height_request(&self) -> i32;

    #[doc(alias = "height-request")]
    fn set_height_request(&self, height_request: i32);

    #[doc(alias = "is-focus")]
    fn set_is_focus(&self, is_focus: bool);

    /// Sets all four sides' margin at once. If read, returns max
    /// margin on any side.
    fn margin(&self) -> i32;

    /// Sets all four sides' margin at once. If read, returns max
    /// margin on any side.
    fn set_margin(&self, margin: i32);

    #[doc(alias = "width-request")]
    fn width_request(&self) -> i32;

    #[doc(alias = "width-request")]
    fn set_width_request(&self, width_request: i32);

    #[doc(alias = "accel-closures-changed")]
    fn connect_accel_closures_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;

    /// The ::button-press-event signal will be emitted when a button
    /// (typically from a mouse) is pressed.
    ///
    /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the
    /// widget needs to enable the [`gdk::EventMask::BUTTON_PRESS_MASK`][crate::gdk::EventMask::BUTTON_PRESS_MASK] mask.
    ///
    /// This signal will be sent to the grab widget if there is one.
    /// ## `event`
    /// the [`gdk::EventButton`][crate::gdk::EventButton] which triggered
    ///  this signal.
    ///
    /// # Returns
    ///
    /// [`true`] to stop other handlers from being invoked for the event.
    ///  [`false`] to propagate the event further.
    #[doc(alias = "button-press-event")]
    fn connect_button_press_event<
        F: Fn(&Self, &gdk::EventButton) -> glib::signal::Inhibit + 'static,
    >(
        &self,
        f: F,
    ) -> SignalHandlerId;

    /// The ::button-release-event signal will be emitted when a button
    /// (typically from a mouse) is released.
    ///
    /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the
    /// widget needs to enable the [`gdk::EventMask::BUTTON_RELEASE_MASK`][crate::gdk::EventMask::BUTTON_RELEASE_MASK] mask.
    ///
    /// This signal will be sent to the grab widget if there is one.
    /// ## `event`
    /// the [`gdk::EventButton`][crate::gdk::EventButton] which triggered
    ///  this signal.
    ///
    /// # Returns
    ///
    /// [`true`] to stop other handlers from being invoked for the event.
    ///  [`false`] to propagate the event further.
    #[doc(alias = "button-release-event")]
    fn connect_button_release_event<
        F: Fn(&Self, &gdk::EventButton) -> glib::signal::Inhibit + 'static,
    >(
        &self,
        f: F,
    ) -> SignalHandlerId;

    /// Determines whether an accelerator that activates the signal
    /// identified by `signal_id` can currently be activated.
    /// This signal is present to allow applications and derived
    /// widgets to override the default [`Widget`][crate::Widget] handling
    /// for determining whether an accelerator can be activated.
    /// ## `signal_id`
    /// the ID of a signal installed on `widget`
    ///
    /// # Returns
    ///
    /// [`true`] if the signal can be activated.
    #[doc(alias = "can-activate-accel")]
    fn connect_can_activate_accel<F: Fn(&Self, u32) -> bool + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId;

    /// The ::child-notify signal is emitted for each
    /// [child property][child-properties] that has
    /// changed on an object. The signal's detail holds the property name.
    /// ## `child_property`
    /// the [`glib::ParamSpec`][crate::glib::ParamSpec] of the changed child property
    #[doc(alias = "child-notify")]
    fn connect_child_notify<F: Fn(&Self, &glib::ParamSpec) + 'static>(
        &self,
        detail: Option<&str>,
        f: F,
    ) -> SignalHandlerId;

    /// The ::composited-changed signal is emitted when the composited
    /// status of `widgets` screen changes.
    /// See [`Screen::is_composited()`][crate::gdk::Screen::is_composited()].
    ///
    /// # Deprecated since 3.22
    ///
    /// Use GdkScreen::composited-changed instead.
    #[cfg_attr(feature = "v3_22", deprecated = "Since 3.22")]
    #[doc(alias = "composited-changed")]
    fn connect_composited_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;

    #[cfg_attr(feature = "v3_22", deprecated = "Since 3.22")]
    fn emit_composited_changed(&self);

    /// The ::configure-event signal will be emitted when the size, position or
    /// stacking of the `widget`'s window has changed.
    ///
    /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
    /// to enable the [`gdk::EventMask::STRUCTURE_MASK`][crate::gdk::EventMask::STRUCTURE_MASK] mask. GDK will enable this mask
    /// automatically for all new windows.
    /// ## `event`
    /// the [`gdk::EventConfigure`][crate::gdk::EventConfigure] which triggered
    ///  this signal.
    ///
    /// # Returns
    ///
    /// [`true`] to stop other handlers from being invoked for the event.
    ///  [`false`] to propagate the event further.
    #[doc(alias = "configure-event")]
    fn connect_configure_event<F: Fn(&Self, &gdk::EventConfigure) -> bool + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId;

    /// Emitted when a redirected window belonging to `widget` gets drawn into.
    /// The region/area members of the event shows what area of the redirected
    /// drawable was drawn into.
    /// ## `event`
    /// the [`gdk::EventExpose`][crate::gdk::EventExpose] event
    ///
    /// # Returns
    ///
    /// [`true`] to stop other handlers from being invoked for the event.
    ///  [`false`] to propagate the event further.
    #[doc(alias = "damage-event")]
    fn connect_damage_event<F: Fn(&Self, &gdk::EventExpose) -> bool + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId;

    /// The ::delete-event signal is emitted if a user requests that
    /// a toplevel window is closed. The default handler for this signal
    /// destroys the window. Connecting [`WidgetExtManual::hide_on_delete()`][crate::prelude::WidgetExtManual::hide_on_delete()] to
    /// this signal will cause the window to be hidden instead, so that
    /// it can later be shown again without reconstructing it.
    /// ## `event`
    /// the event which triggered this signal
    ///
    /// # Returns
    ///
    /// [`true`] to stop other handlers from being invoked for the event.
    ///  [`false`] to propagate the event further.
    #[doc(alias = "delete-event")]
    fn connect_delete_event<F: Fn(&Self, &gdk::Event) -> glib::signal::Inhibit + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId;

    /// Signals that all holders of a reference to the widget should release
    /// the reference that they hold. May result in finalization of the widget
    /// if all references are released.
    ///
    /// This signal is not suitable for saving widget state.
    #[doc(alias = "destroy")]
    fn connect_destroy<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;

    /// The ::destroy-event signal is emitted when a [`gdk::Window`][crate::gdk::Window] is destroyed.
    /// You rarely get this signal, because most widgets disconnect themselves
    /// from their window before they destroy it, so no widget owns the
    /// window at destroy time.
    ///
    /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
    /// to enable the [`gdk::EventMask::STRUCTURE_MASK`][crate::gdk::EventMask::STRUCTURE_MASK] mask. GDK will enable this mask
    /// automatically for all new windows.
    /// ## `event`
    /// the event which triggered this signal
    ///
    /// # Returns
    ///
    /// [`true`] to stop other handlers from being invoked for the event.
    ///  [`false`] to propagate the event further.
    #[doc(alias = "destroy-event")]
    fn connect_destroy_event<F: Fn(&Self, &gdk::Event) -> glib::signal::Inhibit + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId;

    /// The ::direction-changed signal is emitted when the text direction
    /// of a widget changes.
    /// ## `previous_direction`
    /// the previous text direction of `widget`
    #[doc(alias = "direction-changed")]
    fn connect_direction_changed<F: Fn(&Self, TextDirection) + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId;

    /// The ::drag-begin signal is emitted on the drag source when a drag is
    /// started. A typical reason to connect to this signal is to set up a
    /// custom drag icon with e.g. [`drag_source_set_icon_pixbuf()`][Self::drag_source_set_icon_pixbuf()].
    ///
    /// Note that some widgets set up a drag icon in the default handler of
    /// this signal, so you may have to use `g_signal_connect_after()` to
    /// override what the default handler did.
    /// ## `context`
    /// the drag context
    #[doc(alias = "drag-begin")]
    fn connect_drag_begin<F: Fn(&Self, &gdk::DragContext) + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId;

    /// The ::drag-data-delete signal is emitted on the drag source when a drag
    /// with the action [`gdk::DragAction::MOVE`][crate::gdk::DragAction::MOVE] is successfully completed. The signal
    /// handler is responsible for deleting the data that has been dropped. What
    /// "delete" means depends on the context of the drag operation.
    /// ## `context`
    /// the drag context
    #[doc(alias = "drag-data-delete")]
    fn connect_drag_data_delete<F: Fn(&Self, &gdk::DragContext) + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId;

    /// The ::drag-data-get signal is emitted on the drag source when the drop
    /// site requests the data which is dragged. It is the responsibility of
    /// the signal handler to fill `data` with the data in the format which
    /// is indicated by `info`. See [`SelectionData::set()`][crate::SelectionData::set()] and
    /// [`SelectionData::set_text()`][crate::SelectionData::set_text()].
    /// ## `context`
    /// the drag context
    /// ## `data`
    /// the [`SelectionData`][crate::SelectionData] to be filled with the dragged data
    /// ## `info`
    /// the info that has been registered with the target in the
    ///  [`TargetList`][crate::TargetList]
    /// ## `time`
    /// the timestamp at which the data was requested
    #[doc(alias = "drag-data-get")]
    fn connect_drag_data_get<F: Fn(&Self, &gdk::DragContext, &SelectionData, u32, u32) + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId;

    /// The ::drag-data-received signal is emitted on the drop site when the
    /// dragged data has been received. If the data was received in order to
    /// determine whether the drop will be accepted, the handler is expected
    /// to call `gdk_drag_status()` and not finish the drag.
    /// If the data was received in response to a `signal::Widget::drag-drop` signal
    /// (and this is the last target to be received), the handler for this
    /// signal is expected to process the received data and then call
    /// `gtk_drag_finish()`, setting the `success` parameter depending on
    /// whether the data was processed successfully.
    ///
    /// Applications must create some means to determine why the signal was emitted
    /// and therefore whether to call `gdk_drag_status()` or `gtk_drag_finish()`.
    ///
    /// The handler may inspect the selected action with
    /// [`DragContext::selected_action()`][crate::gdk::DragContext::selected_action()] before calling
    /// `gtk_drag_finish()`, e.g. to implement [`gdk::DragAction::ASK`][crate::gdk::DragAction::ASK] as
    /// shown in the following example:
    ///
    ///
    /// **⚠️ The following code is in C ⚠️**
    ///
    /// ```C
    /// void
    /// drag_data_received (GtkWidget          *widget,
    ///                     GdkDragContext     *context,
    ///                     gint                x,
    ///                     gint                y,
    ///                     GtkSelectionData   *data,
    ///                     guint               info,
    ///                     guint               time)
    /// {
    ///   if ((data->length >= 0) && (data->format == 8))
    ///     {
    ///       GdkDragAction action;
    ///
    ///       // handle data here
    ///
    ///       action = gdk_drag_context_get_selected_action (context);
    ///       if (action == GDK_ACTION_ASK)
    ///         {
    ///           GtkWidget *dialog;
    ///           gint response;
    ///
    ///           dialog = gtk_message_dialog_new (NULL,
    ///                                            GTK_DIALOG_MODAL |
    ///                                            GTK_DIALOG_DESTROY_WITH_PARENT,
    ///                                            GTK_MESSAGE_INFO,
    ///                                            GTK_BUTTONS_YES_NO,
    ///                                            "Move the data ?\n");
    ///           response = gtk_dialog_run (GTK_DIALOG (dialog));
    ///           gtk_widget_destroy (dialog);
    ///
    ///           if (response == GTK_RESPONSE_YES)
    ///             action = GDK_ACTION_MOVE;
    ///           else
    ///             action = GDK_ACTION_COPY;
    ///          }
    ///
    ///       gtk_drag_finish (context, TRUE, action == GDK_ACTION_MOVE, time);
    ///     }
    ///   else
    ///     gtk_drag_finish (context, FALSE, FALSE, time);
    ///  }
    /// ```
    /// ## `context`
    /// the drag context
    /// ## `x`
    /// where the drop happened
    /// ## `y`
    /// where the drop happened
    /// ## `data`
    /// the received data
    /// ## `info`
    /// the info that has been registered with the target in the
    ///  [`TargetList`][crate::TargetList]
    /// ## `time`
    /// the timestamp at which the data was received
    #[doc(alias = "drag-data-received")]
    fn connect_drag_data_received<
        F: Fn(&Self, &gdk::DragContext, i32, i32, &SelectionData, u32, u32) + 'static,
    >(
        &self,
        f: F,
    ) -> SignalHandlerId;

    /// The ::drag-drop signal is emitted on the drop site when the user drops
    /// the data onto the widget. The signal handler must determine whether
    /// the cursor position is in a drop zone or not. If it is not in a drop
    /// zone, it returns [`false`] and no further processing is necessary.
    /// Otherwise, the handler returns [`true`]. In this case, the handler must
    /// ensure that `gtk_drag_finish()` is called to let the source know that
    /// the drop is done. The call to `gtk_drag_finish()` can be done either
    /// directly or in a `signal::Widget::drag-data-received` handler which gets
    /// triggered by calling [`drag_get_data()`][Self::drag_get_data()] to receive the data for one
    /// or more of the supported targets.
    /// ## `context`
    /// the drag context
    /// ## `x`
    /// the x coordinate of the current cursor position
    /// ## `y`
    /// the y coordinate of the current cursor position
    /// ## `time`
    /// the timestamp of the motion event
    ///
    /// # Returns
    ///
    /// whether the cursor position is in a drop zone
    #[doc(alias = "drag-drop")]
    fn connect_drag_drop<F: Fn(&Self, &gdk::DragContext, i32, i32, u32) -> bool + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId;

    /// The ::drag-end signal is emitted on the drag source when a drag is
    /// finished. A typical reason to connect to this signal is to undo
    /// things done in `signal::Widget::drag-begin`.
    /// ## `context`
    /// the drag context
    #[doc(alias = "drag-end")]
    fn connect_drag_end<F: Fn(&Self, &gdk::DragContext) + 'static>(&self, f: F) -> SignalHandlerId;

    /// The ::drag-failed signal is emitted on the drag source when a drag has
    /// failed. The signal handler may hook custom code to handle a failed DnD
    /// operation based on the type of error, it returns [`true`] is the failure has
    /// been already handled (not showing the default "drag operation failed"
    /// animation), otherwise it returns [`false`].
    /// ## `context`
    /// the drag context
    /// ## `result`
    /// the result of the drag operation
    ///
    /// # Returns
    ///
    /// [`true`] if the failed drag operation has been already handled.
    #[doc(alias = "drag-failed")]
    fn connect_drag_failed<
        F: Fn(&Self, &gdk::DragContext, DragResult) -> glib::signal::Inhibit + 'static,
    >(
        &self,
        f: F,
    ) -> SignalHandlerId;

    /// The ::drag-leave signal is emitted on the drop site when the cursor
    /// leaves the widget. A typical reason to connect to this signal is to
    /// undo things done in `signal::Widget::drag-motion`, e.g. undo highlighting
    /// with [`drag_unhighlight()`][Self::drag_unhighlight()].
    ///
    ///
    /// Likewise, the `signal::Widget::drag-leave` signal is also emitted before the
    /// ::drag-drop signal, for instance to allow cleaning up of a preview item
    /// created in the `signal::Widget::drag-motion` signal handler.
    /// ## `context`
    /// the drag context
    /// ## `time`
    /// the timestamp of the motion event
    #[doc(alias = "drag-leave")]
    fn connect_drag_leave<F: Fn(&Self, &gdk::DragContext, u32) + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId;

    /// The ::drag-motion signal is emitted on the drop site when the user
    /// moves the cursor over the widget during a drag. The signal handler
    /// must determine whether the cursor position is in a drop zone or not.
    /// If it is not in a drop zone, it returns [`false`] and no further processing
    /// is necessary. Otherwise, the handler returns [`true`]. In this case, the
    /// handler is responsible for providing the necessary information for
    /// displaying feedback to the user, by calling `gdk_drag_status()`.
    ///
    /// If the decision whether the drop will be accepted or rejected can't be
    /// made based solely on the cursor position and the type of the data, the
    /// handler may inspect the dragged data by calling [`drag_get_data()`][Self::drag_get_data()] and
    /// defer the `gdk_drag_status()` call to the `signal::Widget::drag-data-received`
    /// handler. Note that you must pass [`DestDefaults::DROP`][crate::DestDefaults::DROP],
    /// [`DestDefaults::MOTION`][crate::DestDefaults::MOTION] or [`DestDefaults::ALL`][crate::DestDefaults::ALL] to [`WidgetExtManual::drag_dest_set()`][crate::prelude::WidgetExtManual::drag_dest_set()]
    /// when using the drag-motion signal that way.
    ///
    /// Also note that there is no drag-enter signal. The drag receiver has to
    /// keep track of whether he has received any drag-motion signals since the
    /// last `signal::Widget::drag-leave` and if not, treat the drag-motion signal as
    /// an "enter" signal. Upon an "enter", the handler will typically highlight
    /// the drop site with [`drag_highlight()`][Self::drag_highlight()].
    ///
    ///
    /// **⚠️ The following code is in C ⚠️**
    ///
    /// ```C
    /// static void
    /// drag_motion (GtkWidget      *widget,
    ///              GdkDragContext *context,
    ///              gint            x,
    ///              gint            y,
    ///              guint           time)
    /// {
    ///   GdkAtom target;
    ///
    ///   PrivateData *private_data = GET_PRIVATE_DATA (widget);
    ///
    ///   if (!private_data->drag_highlight)
    ///    {
    ///      private_data->drag_highlight = 1;
    ///      gtk_drag_highlight (widget);
    ///    }
    ///
    ///   target = gtk_drag_dest_find_target (widget, context, NULL);
    ///   if (target == GDK_NONE)
    ///     gdk_drag_status (context, 0, time);
    ///   else
    ///    {
    ///      private_data->pending_status
    ///         = gdk_drag_context_get_suggested_action (context);
    ///      gtk_drag_get_data (widget, context, target, time);
    ///    }
    ///
    ///   return TRUE;
    /// }
    ///
    /// static void
    /// drag_data_received (GtkWidget        *widget,
    ///                     GdkDragContext   *context,
    ///                     gint              x,
    ///                     gint              y,
    ///                     GtkSelectionData *selection_data,
    ///                     guint             info,
    ///                     guint             time)
    /// {
    ///   PrivateData *private_data = GET_PRIVATE_DATA (widget);
    ///
    ///   if (private_data->suggested_action)
    ///    {
    ///      private_data->suggested_action = 0;
    ///
    ///      // We are getting this data due to a request in drag_motion,
    ///      // rather than due to a request in drag_drop, so we are just
    ///      // supposed to call gdk_drag_status(), not actually paste in
    ///      // the data.
    ///
    ///      str = gtk_selection_data_get_text (selection_data);
    ///      if (!data_is_acceptable (str))
    ///        gdk_drag_status (context, 0, time);
    ///      else
    ///        gdk_drag_status (context,
    ///                         private_data->suggested_action,
    ///                         time);
    ///    }
    ///   else
    ///    {
    ///      // accept the drop
    ///    }
    /// }
    /// ```
    /// ## `context`
    /// the drag context
    /// ## `x`
    /// the x coordinate of the current cursor position
    /// ## `y`
    /// the y coordinate of the current cursor position
    /// ## `time`
    /// the timestamp of the motion event
    ///
    /// # Returns
    ///
    /// whether the cursor position is in a drop zone
    #[doc(alias = "drag-motion")]
    fn connect_drag_motion<F: Fn(&Self, &gdk::DragContext, i32, i32, u32) -> bool + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId;

    /// This signal is emitted when a widget is supposed to render itself.
    /// The `widget`'s top left corner must be painted at the origin of
    /// the passed in context and be sized to the values returned by
    /// [`allocated_width()`][Self::allocated_width()] and
    /// [`allocated_height()`][Self::allocated_height()].
    ///
    /// Signal handlers connected to this signal can modify the cairo
    /// context passed as `cr` in any way they like and don't need to
    /// restore it. The signal emission takes care of calling `cairo_save()`
    /// before and `cairo_restore()` after invoking the handler.
    ///
    /// The signal handler will get a `cr` with a clip region already set to the
    /// widget's dirty region, i.e. to the area that needs repainting. Complicated
    /// widgets that want to avoid redrawing themselves completely can get the full
    /// extents of the clip region with `gdk_cairo_get_clip_rectangle()`, or they can
    /// get a finer-grained representation of the dirty region with
    /// `cairo_copy_clip_rectangle_list()`.
    /// ## `cr`
    /// the cairo context to draw to
    ///
    /// # Returns
    ///
    /// [`true`] to stop other handlers from being invoked for the event.
    /// [`false`] to propagate the event further.
    #[doc(alias = "draw")]
    fn connect_draw<F: Fn(&Self, &cairo::Context) -> glib::signal::Inhibit + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId;

    /// The ::enter-notify-event will be emitted when the pointer enters
    /// the `widget`'s window.
    ///
    /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
    /// to enable the [`gdk::EventMask::ENTER_NOTIFY_MASK`][crate::gdk::EventMask::ENTER_NOTIFY_MASK] mask.
    ///
    /// This signal will be sent to the grab widget if there is one.
    /// ## `event`
    /// the [`gdk::EventCrossing`][crate::gdk::EventCrossing] which triggered
    ///  this signal.
    ///
    /// # Returns
    ///
    /// [`true`] to stop other handlers from being invoked for the event.
    ///  [`false`] to propagate the event further.
    #[doc(alias = "enter-notify-event")]
    fn connect_enter_notify_event<
        F: Fn(&Self, &gdk::EventCrossing) -> glib::signal::Inhibit + 'static,
    >(
        &self,
        f: F,
    ) -> SignalHandlerId;

    /// The GTK+ main loop will emit three signals for each GDK event delivered
    /// to a widget: one generic ::event signal, another, more specific,
    /// signal that matches the type of event delivered (e.g.
    /// `signal::Widget::key-press-event`) and finally a generic
    /// `signal::Widget::event-after` signal.
    /// ## `event`
    /// the `GdkEvent` which triggered this signal
    ///
    /// # Returns
    ///
    /// [`true`] to stop other handlers from being invoked for the event
    /// and to cancel the emission of the second specific ::event signal.
    ///  [`false`] to propagate the event further and to allow the emission of
    ///  the second signal. The ::event-after signal is emitted regardless of
    ///  the return value.
    #[doc(alias = "event")]
    fn connect_event<F: Fn(&Self, &gdk::Event) -> glib::signal::Inhibit + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId;

    /// After the emission of the `signal::Widget::event` signal and (optionally)
    /// the second more specific signal, ::event-after will be emitted
    /// regardless of the previous two signals handlers return values.
    /// ## `event`
    /// the `GdkEvent` which triggered this signal
    #[doc(alias = "event-after")]
    fn connect_event_after<F: Fn(&Self, &gdk::Event) + 'static>(&self, f: F) -> SignalHandlerId;

    ///
    /// # Returns
    ///
    /// [`true`] to stop other handlers from being invoked for the event. [`false`] to propagate the event further.
    #[doc(alias = "focus")]
    fn connect_focus<F: Fn(&Self, DirectionType) -> glib::signal::Inhibit + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId;

    /// The ::focus-in-event signal will be emitted when the keyboard focus
    /// enters the `widget`'s window.
    ///
    /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
    /// to enable the [`gdk::EventMask::FOCUS_CHANGE_MASK`][crate::gdk::EventMask::FOCUS_CHANGE_MASK] mask.
    /// ## `event`
    /// the [`gdk::EventFocus`][crate::gdk::EventFocus] which triggered
    ///  this signal.
    ///
    /// # Returns
    ///
    /// [`true`] to stop other handlers from being invoked for the event.
    ///  [`false`] to propagate the event further.
    #[doc(alias = "focus-in-event")]
    fn connect_focus_in_event<F: Fn(&Self, &gdk::EventFocus) -> glib::signal::Inhibit + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId;

    /// The ::focus-out-event signal will be emitted when the keyboard focus
    /// leaves the `widget`'s window.
    ///
    /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
    /// to enable the [`gdk::EventMask::FOCUS_CHANGE_MASK`][crate::gdk::EventMask::FOCUS_CHANGE_MASK] mask.
    /// ## `event`
    /// the [`gdk::EventFocus`][crate::gdk::EventFocus] which triggered this
    ///  signal.
    ///
    /// # Returns
    ///
    /// [`true`] to stop other handlers from being invoked for the event.
    ///  [`false`] to propagate the event further.
    #[doc(alias = "focus-out-event")]
    fn connect_focus_out_event<F: Fn(&Self, &gdk::EventFocus) -> glib::signal::Inhibit + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId;

    /// Emitted when a pointer or keyboard grab on a window belonging
    /// to `widget` gets broken.
    ///
    /// On X11, this happens when the grab window becomes unviewable
    /// (i.e. it or one of its ancestors is unmapped), or if the same
    /// application grabs the pointer or keyboard again.
    /// ## `event`
    /// the [`gdk::EventGrabBroken`][crate::gdk::EventGrabBroken] event
    ///
    /// # Returns
    ///
    /// [`true`] to stop other handlers from being invoked for
    ///  the event. [`false`] to propagate the event further.
    #[doc(alias = "grab-broken-event")]
    fn connect_grab_broken_event<
        F: Fn(&Self, &gdk::EventGrabBroken) -> glib::signal::Inhibit + 'static,
    >(
        &self,
        f: F,
    ) -> SignalHandlerId;

    #[doc(alias = "grab-focus")]
    fn connect_grab_focus<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;

    fn emit_grab_focus(&self);

    /// The ::grab-notify signal is emitted when a widget becomes
    /// shadowed by a GTK+ grab (not a pointer or keyboard grab) on
    /// another widget, or when it becomes unshadowed due to a grab
    /// being removed.
    ///
    /// A widget is shadowed by a [`grab_add()`][Self::grab_add()] when the topmost
    /// grab widget in the grab stack of its window group is not
    /// its ancestor.
    /// ## `was_grabbed`
    /// [`false`] if the widget becomes shadowed, [`true`]
    ///  if it becomes unshadowed
    #[doc(alias = "grab-notify")]
    fn connect_grab_notify<F: Fn(&Self, bool) + 'static>(&self, f: F) -> SignalHandlerId;

    /// The ::hide signal is emitted when `widget` is hidden, for example with
    /// [`hide()`][Self::hide()].
    #[doc(alias = "hide")]
    fn connect_hide<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;

    /// The ::hierarchy-changed signal is emitted when the
    /// anchored state of a widget changes. A widget is
    /// “anchored” when its toplevel
    /// ancestor is a [`Window`][crate::Window]. This signal is emitted when
    /// a widget changes from un-anchored to anchored or vice-versa.
    /// ## `previous_toplevel`
    /// the previous toplevel ancestor, or [`None`]
    ///  if the widget was previously unanchored
    #[doc(alias = "hierarchy-changed")]
    fn connect_hierarchy_changed<F: Fn(&Self, Option<&Widget>) + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId;

    /// The ::key-press-event signal is emitted when a key is pressed. The signal
    /// emission will reoccur at the key-repeat rate when the key is kept pressed.
    ///
    /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
    /// to enable the [`gdk::EventMask::KEY_PRESS_MASK`][crate::gdk::EventMask::KEY_PRESS_MASK] mask.
    ///
    /// This signal will be sent to the grab widget if there is one.
    /// ## `event`
    /// the [`gdk::EventKey`][crate::gdk::EventKey] which triggered this signal.
    ///
    /// # Returns
    ///
    /// [`true`] to stop other handlers from being invoked for the event.
    ///  [`false`] to propagate the event further.
    #[doc(alias = "key-press-event")]
    fn connect_key_press_event<F: Fn(&Self, &gdk::EventKey) -> glib::signal::Inhibit + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId;

    /// The ::key-release-event signal is emitted when a key is released.
    ///
    /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
    /// to enable the [`gdk::EventMask::KEY_RELEASE_MASK`][crate::gdk::EventMask::KEY_RELEASE_MASK] mask.
    ///
    /// This signal will be sent to the grab widget if there is one.
    /// ## `event`
    /// the [`gdk::EventKey`][crate::gdk::EventKey] which triggered this signal.
    ///
    /// # Returns
    ///
    /// [`true`] to stop other handlers from being invoked for the event.
    ///  [`false`] to propagate the event further.
    #[doc(alias = "key-release-event")]
    fn connect_key_release_event<F: Fn(&Self, &gdk::EventKey) -> glib::signal::Inhibit + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId;

    /// Gets emitted if keyboard navigation fails.
    /// See [`keynav_failed()`][Self::keynav_failed()] for details.
    /// ## `direction`
    /// the direction of movement
    ///
    /// # Returns
    ///
    /// [`true`] if stopping keyboard navigation is fine, [`false`]
    ///  if the emitting widget should try to handle the keyboard
    ///  navigation attempt in its parent container(s).
    #[doc(alias = "keynav-failed")]
    fn connect_keynav_failed<F: Fn(&Self, DirectionType) -> glib::signal::Inhibit + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId;

    /// The ::leave-notify-event will be emitted when the pointer leaves
    /// the `widget`'s window.
    ///
    /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
    /// to enable the [`gdk::EventMask::LEAVE_NOTIFY_MASK`][crate::gdk::EventMask::LEAVE_NOTIFY_MASK] mask.
    ///
    /// This signal will be sent to the grab widget if there is one.
    /// ## `event`
    /// the [`gdk::EventCrossing`][crate::gdk::EventCrossing] which triggered
    ///  this signal.
    ///
    /// # Returns
    ///
    /// [`true`] to stop other handlers from being invoked for the event.
    ///  [`false`] to propagate the event further.
    #[doc(alias = "leave-notify-event")]
    fn connect_leave_notify_event<
        F: Fn(&Self, &gdk::EventCrossing) -> glib::signal::Inhibit + 'static,
    >(
        &self,
        f: F,
    ) -> SignalHandlerId;

    /// The ::map signal is emitted when `widget` is going to be mapped, that is
    /// when the widget is visible (which is controlled with
    /// [`set_visible()`][Self::set_visible()]) and all its parents up to the toplevel widget
    /// are also visible. Once the map has occurred, `signal::Widget::map-event` will
    /// be emitted.
    ///
    /// The ::map signal can be used to determine whether a widget will be drawn,
    /// for instance it can resume an animation that was stopped during the
    /// emission of `signal::Widget::unmap`.
    #[doc(alias = "map")]
    fn connect_map<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;

    /// The default handler for this signal activates `widget` if `group_cycling`
    /// is [`false`], or just makes `widget` grab focus if `group_cycling` is [`true`].
    /// ## `group_cycling`
    /// [`true`] if there are other widgets with the same mnemonic
    ///
    /// # Returns
    ///
    /// [`true`] to stop other handlers from being invoked for the event.
    /// [`false`] to propagate the event further.
    #[doc(alias = "mnemonic-activate")]
    fn connect_mnemonic_activate<F: Fn(&Self, bool) -> glib::signal::Inhibit + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId;

    /// The ::motion-notify-event signal is emitted when the pointer moves
    /// over the widget's [`gdk::Window`][crate::gdk::Window].
    ///
    /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget
    /// needs to enable the [`gdk::EventMask::POINTER_MOTION_MASK`][crate::gdk::EventMask::POINTER_MOTION_MASK] mask.
    ///
    /// This signal will be sent to the grab widget if there is one.
    /// ## `event`
    /// the [`gdk::EventMotion`][crate::gdk::EventMotion] which triggered
    ///  this signal.
    ///
    /// # Returns
    ///
    /// [`true`] to stop other handlers from being invoked for the event.
    ///  [`false`] to propagate the event further.
    #[doc(alias = "motion-notify-event")]
    fn connect_motion_notify_event<
        F: Fn(&Self, &gdk::EventMotion) -> glib::signal::Inhibit + 'static,
    >(
        &self,
        f: F,
    ) -> SignalHandlerId;

    #[doc(alias = "move-focus")]
    fn connect_move_focus<F: Fn(&Self, DirectionType) + 'static>(&self, f: F) -> SignalHandlerId;

    fn emit_move_focus(&self, direction: DirectionType);

    /// The ::parent-set signal is emitted when a new parent
    /// has been set on a widget.
    /// ## `old_parent`
    /// the previous parent, or [`None`] if the widget
    ///  just got its initial parent.
    #[doc(alias = "parent-set")]
    fn connect_parent_set<F: Fn(&Self, Option<&Widget>) + 'static>(&self, f: F) -> SignalHandlerId;

    /// This signal gets emitted whenever a widget should pop up a context
    /// menu. This usually happens through the standard key binding mechanism;
    /// by pressing a certain key while a widget is focused, the user can cause
    /// the widget to pop up a menu. For example, the [`Entry`][crate::Entry] widget creates
    /// a menu with clipboard commands. See the
    /// [Popup Menu Migration Checklist][checklist-popup-menu]
    /// for an example of how to use this signal.
    ///
    /// # Returns
    ///
    /// [`true`] if a menu was activated
    #[doc(alias = "popup-menu")]
    fn connect_popup_menu<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId;

    fn emit_popup_menu(&self) -> bool;

    /// The ::property-notify-event signal will be emitted when a property on
    /// the `widget`'s window has been changed or deleted.
    ///
    /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
    /// to enable the [`gdk::EventMask::PROPERTY_CHANGE_MASK`][crate::gdk::EventMask::PROPERTY_CHANGE_MASK] mask.
    /// ## `event`
    /// the [`gdk::EventProperty`][crate::gdk::EventProperty] which triggered
    ///  this signal.
    ///
    /// # Returns
    ///
    /// [`true`] to stop other handlers from being invoked for the event.
    ///  [`false`] to propagate the event further.
    #[doc(alias = "property-notify-event")]
    fn connect_property_notify_event<
        F: Fn(&Self, &gdk::EventProperty) -> glib::signal::Inhibit + 'static,
    >(
        &self,
        f: F,
    ) -> SignalHandlerId;

    /// To receive this signal the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
    /// to enable the [`gdk::EventMask::PROXIMITY_IN_MASK`][crate::gdk::EventMask::PROXIMITY_IN_MASK] mask.
    ///
    /// This signal will be sent to the grab widget if there is one.
    /// ## `event`
    /// the [`gdk::EventProximity`][crate::gdk::EventProximity] which triggered
    ///  this signal.
    ///
    /// # Returns
    ///
    /// [`true`] to stop other handlers from being invoked for the event.
    ///  [`false`] to propagate the event further.
    #[doc(alias = "proximity-in-event")]
    fn connect_proximity_in_event<
        F: Fn(&Self, &gdk::EventProximity) -> glib::signal::Inhibit + 'static,
    >(
        &self,
        f: F,
    ) -> SignalHandlerId;

    /// To receive this signal the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
    /// to enable the [`gdk::EventMask::PROXIMITY_OUT_MASK`][crate::gdk::EventMask::PROXIMITY_OUT_MASK] mask.
    ///
    /// This signal will be sent to the grab widget if there is one.
    /// ## `event`
    /// the [`gdk::EventProximity`][crate::gdk::EventProximity] which triggered
    ///  this signal.
    ///
    /// # Returns
    ///
    /// [`true`] to stop other handlers from being invoked for the event.
    ///  [`false`] to propagate the event further.
    #[doc(alias = "proximity-out-event")]
    fn connect_proximity_out_event<
        F: Fn(&Self, &gdk::EventProximity) -> glib::signal::Inhibit + 'static,
    >(
        &self,
        f: F,
    ) -> SignalHandlerId;

    /// Emitted when `property::Widget::has-tooltip` is [`true`] and the hover timeout
    /// has expired with the cursor hovering "above" `widget`; or emitted when `widget` got
    /// focus in keyboard mode.
    ///
    /// Using the given coordinates, the signal handler should determine
    /// whether a tooltip should be shown for `widget`. If this is the case
    /// [`true`] should be returned, [`false`] otherwise. Note that if
    /// `keyboard_mode` is [`true`], the values of `x` and `y` are undefined and
    /// should not be used.
    ///
    /// The signal handler is free to manipulate `tooltip` with the therefore
    /// destined function calls.
    /// ## `x`
    /// the x coordinate of the cursor position where the request has
    ///  been emitted, relative to `widget`'s left side
    /// ## `y`
    /// the y coordinate of the cursor position where the request has
    ///  been emitted, relative to `widget`'s top
    /// ## `keyboard_mode`
    /// [`true`] if the tooltip was triggered using the keyboard
    /// ## `tooltip`
    /// a [`Tooltip`][crate::Tooltip]
    ///
    /// # Returns
    ///
    /// [`true`] if `tooltip` should be shown right now, [`false`] otherwise.
    #[doc(alias = "query-tooltip")]
    fn connect_query_tooltip<F: Fn(&Self, i32, i32, bool, &Tooltip) -> bool + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId;

    /// The ::realize signal is emitted when `widget` is associated with a
    /// [`gdk::Window`][crate::gdk::Window], which means that [`realize()`][Self::realize()] has been called or the
    /// widget has been mapped (that is, it is going to be drawn).
    #[doc(alias = "realize")]
    fn connect_realize<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;

    /// The ::screen-changed signal gets emitted when the
    /// screen of a widget has changed.
    /// ## `previous_screen`
    /// the previous screen, or [`None`] if the
    ///  widget was not associated with a screen before
    #[doc(alias = "screen-changed")]
    fn connect_screen_changed<F: Fn(&Self, Option<&gdk::Screen>) + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId;

    /// The ::scroll-event signal is emitted when a button in the 4 to 7
    /// range is pressed. Wheel mice are usually configured to generate
    /// button press events for buttons 4 and 5 when the wheel is turned.
    ///
    /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
    /// to enable the [`gdk::EventMask::SCROLL_MASK`][crate::gdk::EventMask::SCROLL_MASK] mask.
    ///
    /// This signal will be sent to the grab widget if there is one.
    /// ## `event`
    /// the [`gdk::EventScroll`][crate::gdk::EventScroll] which triggered
    ///  this signal.
    ///
    /// # Returns
    ///
    /// [`true`] to stop other handlers from being invoked for the event.
    ///  [`false`] to propagate the event further.
    #[doc(alias = "scroll-event")]
    fn connect_scroll_event<F: Fn(&Self, &gdk::EventScroll) -> glib::signal::Inhibit + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId;

    /// The ::selection-clear-event signal will be emitted when the
    /// the `widget`'s window has lost ownership of a selection.
    /// ## `event`
    /// the [`gdk::EventSelection`][crate::gdk::EventSelection] which triggered
    ///  this signal.
    ///
    /// # Returns
    ///
    /// [`true`] to stop other handlers from being invoked for the event.
    ///  [`false`] to propagate the event further.
    #[doc(alias = "selection-clear-event")]
    fn connect_selection_clear_event<
        F: Fn(&Self, &gdk::EventSelection) -> glib::signal::Inhibit + 'static,
    >(
        &self,
        f: F,
    ) -> SignalHandlerId;

    #[doc(alias = "selection-get")]
    fn connect_selection_get<F: Fn(&Self, &SelectionData, u32, u32) + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId;

    ///
    /// # Returns
    ///
    /// [`true`] to stop other handlers from being invoked for the event. [`false`] to propagate the event further.
    #[doc(alias = "selection-notify-event")]
    fn connect_selection_notify_event<
        F: Fn(&Self, &gdk::EventSelection) -> glib::signal::Inhibit + 'static,
    >(
        &self,
        f: F,
    ) -> SignalHandlerId;

    #[doc(alias = "selection-received")]
    fn connect_selection_received<F: Fn(&Self, &SelectionData, u32) + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId;

    /// The ::selection-request-event signal will be emitted when
    /// another client requests ownership of the selection owned by
    /// the `widget`'s window.
    /// ## `event`
    /// the [`gdk::EventSelection`][crate::gdk::EventSelection] which triggered
    ///  this signal.
    ///
    /// # Returns
    ///
    /// [`true`] to stop other handlers from being invoked for the event.
    ///  [`false`] to propagate the event further.
    #[doc(alias = "selection-request-event")]
    fn connect_selection_request_event<
        F: Fn(&Self, &gdk::EventSelection) -> glib::signal::Inhibit + 'static,
    >(
        &self,
        f: F,
    ) -> SignalHandlerId;

    /// The ::show signal is emitted when `widget` is shown, for example with
    /// [`show()`][Self::show()].
    #[doc(alias = "show")]
    fn connect_show<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;

    ///
    /// # Returns
    ///
    /// [`true`] to stop other handlers from being invoked for the event.
    /// [`false`] to propagate the event further.
    #[doc(alias = "show-help")]
    fn connect_show_help<F: Fn(&Self, WidgetHelpType) -> bool + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId;

    fn emit_show_help(&self, help_type: WidgetHelpType) -> bool;

    /// ## `allocation`
    /// the region which has been
    ///  allocated to the widget.
    #[doc(alias = "size-allocate")]
    fn connect_size_allocate<F: Fn(&Self, &Allocation) + 'static>(&self, f: F) -> SignalHandlerId;

    /// The ::state-flags-changed signal is emitted when the widget state
    /// changes, see [`state_flags()`][Self::state_flags()].
    /// ## `flags`
    /// The previous state flags.
    #[doc(alias = "state-flags-changed")]
    fn connect_state_flags_changed<F: Fn(&Self, StateFlags) + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId;

    /// The ::style-updated signal is a convenience signal that is emitted when the
    /// `signal::StyleContext::changed` signal is emitted on the `widget`'s associated
    /// [`StyleContext`][crate::StyleContext] as returned by [`style_context()`][Self::style_context()].
    ///
    /// Note that style-modifying functions like `gtk_widget_override_color()` also
    /// cause this signal to be emitted.
    #[doc(alias = "style-updated")]
    fn connect_style_updated<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;

    #[doc(alias = "touch-event")]
    fn connect_touch_event<F: Fn(&Self, &gdk::Event) -> glib::signal::Inhibit + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId;

    /// The ::unmap signal is emitted when `widget` is going to be unmapped, which
    /// means that either it or any of its parents up to the toplevel widget have
    /// been set as hidden.
    ///
    /// As ::unmap indicates that a widget will not be shown any longer, it can be
    /// used to, for example, stop an animation on the widget.
    #[doc(alias = "unmap")]
    fn connect_unmap<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;

    /// The ::unrealize signal is emitted when the [`gdk::Window`][crate::gdk::Window] associated with
    /// `widget` is destroyed, which means that [`unrealize()`][Self::unrealize()] has been
    /// called or the widget has been unmapped (that is, it is going to be
    /// hidden).
    #[doc(alias = "unrealize")]
    fn connect_unrealize<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;

    /// The ::window-state-event will be emitted when the state of the
    /// toplevel window associated to the `widget` changes.
    ///
    /// To receive this signal the [`gdk::Window`][crate::gdk::Window] associated to the widget
    /// needs to enable the [`gdk::EventMask::STRUCTURE_MASK`][crate::gdk::EventMask::STRUCTURE_MASK] mask. GDK will enable
    /// this mask automatically for all new windows.
    /// ## `event`
    /// the [`gdk::EventWindowState`][crate::gdk::EventWindowState] which
    ///  triggered this signal.
    ///
    /// # Returns
    ///
    /// [`true`] to stop other handlers from being invoked for the
    ///  event. [`false`] to propagate the event further.
    #[doc(alias = "window-state-event")]
    fn connect_window_state_event<
        F: Fn(&Self, &gdk::EventWindowState) -> glib::signal::Inhibit + 'static,
    >(
        &self,
        f: F,
    ) -> SignalHandlerId;

    #[doc(alias = "app-paintable")]
    fn connect_app_paintable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;

    #[doc(alias = "can-default")]
    fn connect_can_default_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;

    #[doc(alias = "can-focus")]
    fn connect_can_focus_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;

    #[doc(alias = "composite-child")]
    fn connect_composite_child_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;

    #[doc(alias = "events")]
    fn connect_events_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;

    #[doc(alias = "expand")]
    fn connect_expand_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;

    #[cfg(any(feature = "v3_20", feature = "dox"))]
    #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
    #[doc(alias = "focus-on-click")]
    fn connect_focus_on_click_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;

    #[doc(alias = "halign")]
    fn connect_halign_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;

    #[doc(alias = "has-default")]
    fn connect_has_default_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;

    #[doc(alias = "has-focus")]
    fn connect_has_focus_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;

    #[doc(alias = "has-tooltip")]
    fn connect_has_tooltip_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;

    #[doc(alias = "height-request")]
    fn connect_height_request_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;

    #[doc(alias = "hexpand")]
    fn connect_hexpand_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;

    #[doc(alias = "hexpand-set")]
    fn connect_hexpand_set_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;

    #[doc(alias = "is-focus")]
    fn connect_is_focus_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;

    #[doc(alias = "margin")]
    fn connect_margin_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;

    #[doc(alias = "margin-bottom")]
    fn connect_margin_bottom_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;

    #[doc(alias = "margin-end")]
    fn connect_margin_end_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;

    #[doc(alias = "margin-start")]
    fn connect_margin_start_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;

    #[doc(alias = "margin-top")]
    fn connect_margin_top_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;

    #[doc(alias = "name")]
    fn connect_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;

    #[doc(alias = "no-show-all")]
    fn connect_no_show_all_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;

    #[doc(alias = "opacity")]
    fn connect_opacity_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;

    #[doc(alias = "parent")]
    fn connect_parent_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;

    #[doc(alias = "receives-default")]
    fn connect_receives_default_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;

    #[doc(alias = "scale-factor")]
    fn connect_scale_factor_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;

    #[doc(alias = "sensitive")]
    fn connect_sensitive_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;

    #[doc(alias = "tooltip-markup")]
    fn connect_tooltip_markup_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;

    #[doc(alias = "tooltip-text")]
    fn connect_tooltip_text_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;

    #[doc(alias = "valign")]
    fn connect_valign_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;

    #[doc(alias = "vexpand")]
    fn connect_vexpand_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;

    #[doc(alias = "vexpand-set")]
    fn connect_vexpand_set_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;

    #[doc(alias = "visible")]
    fn connect_visible_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;

    #[doc(alias = "width-request")]
    fn connect_width_request_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;

    #[doc(alias = "window")]
    fn connect_window_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
}

impl<O: IsA<Widget>> WidgetExt for O {
    fn activate(&self) -> bool {
        unsafe { from_glib(ffi::gtk_widget_activate(self.as_ref().to_glib_none().0)) }
    }

    fn add_accelerator<P: IsA<AccelGroup>>(
        &self,
        accel_signal: &str,
        accel_group: &P,
        accel_key: u32,
        accel_mods: gdk::ModifierType,
        accel_flags: AccelFlags,
    ) {
        unsafe {
            ffi::gtk_widget_add_accelerator(
                self.as_ref().to_glib_none().0,
                accel_signal.to_glib_none().0,
                accel_group.as_ref().to_glib_none().0,
                accel_key,
                accel_mods.into_glib(),
                accel_flags.into_glib(),
            );
        }
    }

    fn add_device_events(&self, device: &gdk::Device, events: gdk::EventMask) {
        unsafe {
            ffi::gtk_widget_add_device_events(
                self.as_ref().to_glib_none().0,
                device.to_glib_none().0,
                events.into_glib(),
            );
        }
    }

    fn add_mnemonic_label<P: IsA<Widget>>(&self, label: &P) {
        unsafe {
            ffi::gtk_widget_add_mnemonic_label(
                self.as_ref().to_glib_none().0,
                label.as_ref().to_glib_none().0,
            );
        }
    }

    fn can_activate_accel(&self, signal_id: u32) -> bool {
        unsafe {
            from_glib(ffi::gtk_widget_can_activate_accel(
                self.as_ref().to_glib_none().0,
                signal_id,
            ))
        }
    }

    fn child_focus(&self, direction: DirectionType) -> bool {
        unsafe {
            from_glib(ffi::gtk_widget_child_focus(
                self.as_ref().to_glib_none().0,
                direction.into_glib(),
            ))
        }
    }

    fn child_notify(&self, child_property: &str) {
        unsafe {
            ffi::gtk_widget_child_notify(
                self.as_ref().to_glib_none().0,
                child_property.to_glib_none().0,
            );
        }
    }

    fn compute_expand(&self, orientation: Orientation) -> bool {
        unsafe {
            from_glib(ffi::gtk_widget_compute_expand(
                self.as_ref().to_glib_none().0,
                orientation.into_glib(),
            ))
        }
    }

    fn create_pango_context(&self) -> pango::Context {
        unsafe {
            from_glib_full(ffi::gtk_widget_create_pango_context(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    fn create_pango_layout(&self, text: Option<&str>) -> pango::Layout {
        unsafe {
            from_glib_full(ffi::gtk_widget_create_pango_layout(
                self.as_ref().to_glib_none().0,
                text.to_glib_none().0,
            ))
        }
    }

    //fn destroyed<P: IsA<Widget>>(&self, widget_pointer: P) {
    //    unsafe { TODO: call ffi:gtk_widget_destroyed() }
    //}

    fn device_is_shadowed(&self, device: &gdk::Device) -> bool {
        unsafe {
            from_glib(ffi::gtk_widget_device_is_shadowed(
                self.as_ref().to_glib_none().0,
                device.to_glib_none().0,
            ))
        }
    }

    fn drag_begin_with_coordinates(
        &self,
        targets: &TargetList,
        actions: gdk::DragAction,
        button: i32,
        event: Option<&gdk::Event>,
        x: i32,
        y: i32,
    ) -> Option<gdk::DragContext> {
        unsafe {
            from_glib_none(ffi::gtk_drag_begin_with_coordinates(
                self.as_ref().to_glib_none().0,
                targets.to_glib_none().0,
                actions.into_glib(),
                button,
                mut_override(event.to_glib_none().0),
                x,
                y,
            ))
        }
    }

    fn drag_check_threshold(
        &self,
        start_x: i32,
        start_y: i32,
        current_x: i32,
        current_y: i32,
    ) -> bool {
        unsafe {
            from_glib(ffi::gtk_drag_check_threshold(
                self.as_ref().to_glib_none().0,
                start_x,
                start_y,
                current_x,
                current_y,
            ))
        }
    }

    fn drag_dest_add_image_targets(&self) {
        unsafe {
            ffi::gtk_drag_dest_add_image_targets(self.as_ref().to_glib_none().0);
        }
    }

    fn drag_dest_add_text_targets(&self) {
        unsafe {
            ffi::gtk_drag_dest_add_text_targets(self.as_ref().to_glib_none().0);
        }
    }

    fn drag_dest_add_uri_targets(&self) {
        unsafe {
            ffi::gtk_drag_dest_add_uri_targets(self.as_ref().to_glib_none().0);
        }
    }

    fn drag_dest_find_target(
        &self,
        context: &gdk::DragContext,
        target_list: Option<&TargetList>,
    ) -> Option<gdk::Atom> {
        unsafe {
            from_glib_none(ffi::gtk_drag_dest_find_target(
                self.as_ref().to_glib_none().0,
                context.to_glib_none().0,
                target_list.to_glib_none().0,
            ))
        }
    }

    fn drag_dest_get_target_list(&self) -> Option<TargetList> {
        unsafe {
            from_glib_none(ffi::gtk_drag_dest_get_target_list(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    fn drag_dest_get_track_motion(&self) -> bool {
        unsafe {
            from_glib(ffi::gtk_drag_dest_get_track_motion(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    fn drag_dest_set_proxy(
        &self,
        proxy_window: &gdk::Window,
        protocol: gdk::DragProtocol,
        use_coordinates: bool,
    ) {
        unsafe {
            ffi::gtk_drag_dest_set_proxy(
                self.as_ref().to_glib_none().0,
                proxy_window.to_glib_none().0,
                protocol.into_glib(),
                use_coordinates.into_glib(),
            );
        }
    }

    fn drag_dest_set_target_list(&self, target_list: Option<&TargetList>) {
        unsafe {
            ffi::gtk_drag_dest_set_target_list(
                self.as_ref().to_glib_none().0,
                target_list.to_glib_none().0,
            );
        }
    }

    fn drag_dest_set_track_motion(&self, track_motion: bool) {
        unsafe {
            ffi::gtk_drag_dest_set_track_motion(
                self.as_ref().to_glib_none().0,
                track_motion.into_glib(),
            );
        }
    }

    fn drag_dest_unset(&self) {
        unsafe {
            ffi::gtk_drag_dest_unset(self.as_ref().to_glib_none().0);
        }
    }

    fn drag_get_data(&self, context: &gdk::DragContext, target: &gdk::Atom, time_: u32) {
        unsafe {
            ffi::gtk_drag_get_data(
                self.as_ref().to_glib_none().0,
                context.to_glib_none().0,
                target.to_glib_none().0,
                time_,
            );
        }
    }

    fn drag_highlight(&self) {
        unsafe {
            ffi::gtk_drag_highlight(self.as_ref().to_glib_none().0);
        }
    }

    fn drag_source_add_image_targets(&self) {
        unsafe {
            ffi::gtk_drag_source_add_image_targets(self.as_ref().to_glib_none().0);
        }
    }

    fn drag_source_add_text_targets(&self) {
        unsafe {
            ffi::gtk_drag_source_add_text_targets(self.as_ref().to_glib_none().0);
        }
    }

    fn drag_source_add_uri_targets(&self) {
        unsafe {
            ffi::gtk_drag_source_add_uri_targets(self.as_ref().to_glib_none().0);
        }
    }

    fn drag_source_get_target_list(&self) -> Option<TargetList> {
        unsafe {
            from_glib_none(ffi::gtk_drag_source_get_target_list(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    fn drag_source_set_icon_gicon<P: IsA<gio::Icon>>(&self, icon: &P) {
        unsafe {
            ffi::gtk_drag_source_set_icon_gicon(
                self.as_ref().to_glib_none().0,
                icon.as_ref().to_glib_none().0,
            );
        }
    }

    fn drag_source_set_icon_name(&self, icon_name: &str) {
        unsafe {
            ffi::gtk_drag_source_set_icon_name(
                self.as_ref().to_glib_none().0,
                icon_name.to_glib_none().0,
            );
        }
    }

    fn drag_source_set_icon_pixbuf(&self, pixbuf: &gdk_pixbuf::Pixbuf) {
        unsafe {
            ffi::gtk_drag_source_set_icon_pixbuf(
                self.as_ref().to_glib_none().0,
                pixbuf.to_glib_none().0,
            );
        }
    }

    fn drag_source_set_target_list(&self, target_list: Option<&TargetList>) {
        unsafe {
            ffi::gtk_drag_source_set_target_list(
                self.as_ref().to_glib_none().0,
                target_list.to_glib_none().0,
            );
        }
    }

    fn drag_source_unset(&self) {
        unsafe {
            ffi::gtk_drag_source_unset(self.as_ref().to_glib_none().0);
        }
    }

    fn drag_unhighlight(&self) {
        unsafe {
            ffi::gtk_drag_unhighlight(self.as_ref().to_glib_none().0);
        }
    }

    fn draw(&self, cr: &cairo::Context) {
        unsafe {
            ffi::gtk_widget_draw(
                self.as_ref().to_glib_none().0,
                mut_override(cr.to_glib_none().0),
            );
        }
    }

    fn error_bell(&self) {
        unsafe {
            ffi::gtk_widget_error_bell(self.as_ref().to_glib_none().0);
        }
    }

    fn event(&self, event: &gdk::Event) -> bool {
        unsafe {
            from_glib(ffi::gtk_widget_event(
                self.as_ref().to_glib_none().0,
                mut_override(event.to_glib_none().0),
            ))
        }
    }

    fn freeze_child_notify(&self) {
        unsafe {
            ffi::gtk_widget_freeze_child_notify(self.as_ref().to_glib_none().0);
        }
    }

    fn accessible(&self) -> Option<atk::Object> {
        unsafe {
            from_glib_none(ffi::gtk_widget_get_accessible(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    fn action_group(&self, prefix: &str) -> Option<gio::ActionGroup> {
        unsafe {
            from_glib_none(ffi::gtk_widget_get_action_group(
                self.as_ref().to_glib_none().0,
                prefix.to_glib_none().0,
            ))
        }
    }

    fn allocated_baseline(&self) -> i32 {
        unsafe { ffi::gtk_widget_get_allocated_baseline(self.as_ref().to_glib_none().0) }
    }

    fn allocated_height(&self) -> i32 {
        unsafe { ffi::gtk_widget_get_allocated_height(self.as_ref().to_glib_none().0) }
    }

    #[cfg(any(feature = "v3_20", feature = "dox"))]
    #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
    fn allocated_size(&self) -> (Allocation, i32) {
        unsafe {
            let mut allocation = Allocation::uninitialized();
            let mut baseline = mem::MaybeUninit::uninit();
            ffi::gtk_widget_get_allocated_size(
                self.as_ref().to_glib_none().0,
                allocation.to_glib_none_mut().0,
                baseline.as_mut_ptr(),
            );
            let baseline = baseline.assume_init();
            (allocation, baseline)
        }
    }

    fn allocated_width(&self) -> i32 {
        unsafe { ffi::gtk_widget_get_allocated_width(self.as_ref().to_glib_none().0) }
    }

    fn allocation(&self) -> Allocation {
        unsafe {
            let mut allocation = Allocation::uninitialized();
            ffi::gtk_widget_get_allocation(
                self.as_ref().to_glib_none().0,
                allocation.to_glib_none_mut().0,
            );
            allocation
        }
    }

    fn ancestor(&self, widget_type: glib::types::Type) -> Option<Widget> {
        unsafe {
            from_glib_none(ffi::gtk_widget_get_ancestor(
                self.as_ref().to_glib_none().0,
                widget_type.into_glib(),
            ))
        }
    }

    fn is_app_paintable(&self) -> bool {
        unsafe {
            from_glib(ffi::gtk_widget_get_app_paintable(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    fn can_default(&self) -> bool {
        unsafe {
            from_glib(ffi::gtk_widget_get_can_default(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    fn can_focus(&self) -> bool {
        unsafe {
            from_glib(ffi::gtk_widget_get_can_focus(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    fn is_child_visible(&self) -> bool {
        unsafe {
            from_glib(ffi::gtk_widget_get_child_visible(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    fn clip(&self) -> Allocation {
        unsafe {
            let mut clip = Allocation::uninitialized();
            ffi::gtk_widget_get_clip(self.as_ref().to_glib_none().0, clip.to_glib_none_mut().0);
            clip
        }
    }

    fn clipboard(&self, selection: &gdk::Atom) -> Clipboard {
        unsafe {
            from_glib_none(ffi::gtk_widget_get_clipboard(
                self.as_ref().to_glib_none().0,
                selection.to_glib_none().0,
            ))
        }
    }

    fn device_is_enabled(&self, device: &gdk::Device) -> bool {
        unsafe {
            from_glib(ffi::gtk_widget_get_device_enabled(
                self.as_ref().to_glib_none().0,
                device.to_glib_none().0,
            ))
        }
    }

    fn device_events(&self, device: &gdk::Device) -> gdk::EventMask {
        unsafe {
            from_glib(ffi::gtk_widget_get_device_events(
                self.as_ref().to_glib_none().0,
                device.to_glib_none().0,
            ))
        }
    }

    fn direction(&self) -> TextDirection {
        unsafe {
            from_glib(ffi::gtk_widget_get_direction(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    fn display(&self) -> gdk::Display {
        unsafe { from_glib_none(ffi::gtk_widget_get_display(self.as_ref().to_glib_none().0)) }
    }

    fn is_double_buffered(&self) -> bool {
        unsafe {
            from_glib(ffi::gtk_widget_get_double_buffered(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    #[cfg(any(feature = "v3_20", feature = "dox"))]
    #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
    fn gets_focus_on_click(&self) -> bool {
        unsafe {
            from_glib(ffi::gtk_widget_get_focus_on_click(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    fn font_map(&self) -> Option<pango::FontMap> {
        unsafe { from_glib_none(ffi::gtk_widget_get_font_map(self.as_ref().to_glib_none().0)) }
    }

    fn font_options(&self) -> Option<cairo::FontOptions> {
        unsafe {
            from_glib_none(ffi::gtk_widget_get_font_options(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    fn frame_clock(&self) -> Option<gdk::FrameClock> {
        unsafe {
            from_glib_none(ffi::gtk_widget_get_frame_clock(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    fn halign(&self) -> Align {
        unsafe { from_glib(ffi::gtk_widget_get_halign(self.as_ref().to_glib_none().0)) }
    }

    fn has_tooltip(&self) -> bool {
        unsafe {
            from_glib(ffi::gtk_widget_get_has_tooltip(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    fn has_window(&self) -> bool {
        unsafe {
            from_glib(ffi::gtk_widget_get_has_window(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    fn hexpands(&self) -> bool {
        unsafe { from_glib(ffi::gtk_widget_get_hexpand(self.as_ref().to_glib_none().0)) }
    }

    fn is_hexpand_set(&self) -> bool {
        unsafe {
            from_glib(ffi::gtk_widget_get_hexpand_set(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    fn is_mapped(&self) -> bool {
        unsafe { from_glib(ffi::gtk_widget_get_mapped(self.as_ref().to_glib_none().0)) }
    }

    fn margin_bottom(&self) -> i32 {
        unsafe { ffi::gtk_widget_get_margin_bottom(self.as_ref().to_glib_none().0) }
    }

    fn margin_end(&self) -> i32 {
        unsafe { ffi::gtk_widget_get_margin_end(self.as_ref().to_glib_none().0) }
    }

    fn margin_start(&self) -> i32 {
        unsafe { ffi::gtk_widget_get_margin_start(self.as_ref().to_glib_none().0) }
    }

    fn margin_top(&self) -> i32 {
        unsafe { ffi::gtk_widget_get_margin_top(self.as_ref().to_glib_none().0) }
    }

    fn modifier_mask(&self, intent: gdk::ModifierIntent) -> gdk::ModifierType {
        unsafe {
            from_glib(ffi::gtk_widget_get_modifier_mask(
                self.as_ref().to_glib_none().0,
                intent.into_glib(),
            ))
        }
    }

    fn widget_name(&self) -> glib::GString {
        unsafe { from_glib_none(ffi::gtk_widget_get_name(self.as_ref().to_glib_none().0)) }
    }

    fn is_no_show_all(&self) -> bool {
        unsafe {
            from_glib(ffi::gtk_widget_get_no_show_all(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    fn opacity(&self) -> f64 {
        unsafe { ffi::gtk_widget_get_opacity(self.as_ref().to_glib_none().0) }
    }

    fn pango_context(&self) -> pango::Context {
        unsafe {
            from_glib_none(ffi::gtk_widget_get_pango_context(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    fn parent(&self) -> Option<Widget> {
        unsafe { from_glib_none(ffi::gtk_widget_get_parent(self.as_ref().to_glib_none().0)) }
    }

    fn parent_window(&self) -> Option<gdk::Window> {
        unsafe {
            from_glib_none(ffi::gtk_widget_get_parent_window(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    fn path(&self) -> WidgetPath {
        unsafe { from_glib_none(ffi::gtk_widget_get_path(self.as_ref().to_glib_none().0)) }
    }

    fn preferred_height(&self) -> (i32, i32) {
        unsafe {
            let mut minimum_height = mem::MaybeUninit::uninit();
            let mut natural_height = mem::MaybeUninit::uninit();
            ffi::gtk_widget_get_preferred_height(
                self.as_ref().to_glib_none().0,
                minimum_height.as_mut_ptr(),
                natural_height.as_mut_ptr(),
            );
            let minimum_height = minimum_height.assume_init();
            let natural_height = natural_height.assume_init();
            (minimum_height, natural_height)
        }
    }

    fn preferred_height_and_baseline_for_width(&self, width: i32) -> (i32, i32, i32, i32) {
        unsafe {
            let mut minimum_height = mem::MaybeUninit::uninit();
            let mut natural_height = mem::MaybeUninit::uninit();
            let mut minimum_baseline = mem::MaybeUninit::uninit();
            let mut natural_baseline = mem::MaybeUninit::uninit();
            ffi::gtk_widget_get_preferred_height_and_baseline_for_width(
                self.as_ref().to_glib_none().0,
                width,
                minimum_height.as_mut_ptr(),
                natural_height.as_mut_ptr(),
                minimum_baseline.as_mut_ptr(),
                natural_baseline.as_mut_ptr(),
            );
            let minimum_height = minimum_height.assume_init();
            let natural_height = natural_height.assume_init();
            let minimum_baseline = minimum_baseline.assume_init();
            let natural_baseline = natural_baseline.assume_init();
            (
                minimum_height,
                natural_height,
                minimum_baseline,
                natural_baseline,
            )
        }
    }

    fn preferred_height_for_width(&self, width: i32) -> (i32, i32) {
        unsafe {
            let mut minimum_height = mem::MaybeUninit::uninit();
            let mut natural_height = mem::MaybeUninit::uninit();
            ffi::gtk_widget_get_preferred_height_for_width(
                self.as_ref().to_glib_none().0,
                width,
                minimum_height.as_mut_ptr(),
                natural_height.as_mut_ptr(),
            );
            let minimum_height = minimum_height.assume_init();
            let natural_height = natural_height.assume_init();
            (minimum_height, natural_height)
        }
    }

    fn preferred_size(&self) -> (Requisition, Requisition) {
        unsafe {
            let mut minimum_size = Requisition::uninitialized();
            let mut natural_size = Requisition::uninitialized();
            ffi::gtk_widget_get_preferred_size(
                self.as_ref().to_glib_none().0,
                minimum_size.to_glib_none_mut().0,
                natural_size.to_glib_none_mut().0,
            );
            (minimum_size, natural_size)
        }
    }

    fn preferred_width(&self) -> (i32, i32) {
        unsafe {
            let mut minimum_width = mem::MaybeUninit::uninit();
            let mut natural_width = mem::MaybeUninit::uninit();
            ffi::gtk_widget_get_preferred_width(
                self.as_ref().to_glib_none().0,
                minimum_width.as_mut_ptr(),
                natural_width.as_mut_ptr(),
            );
            let minimum_width = minimum_width.assume_init();
            let natural_width = natural_width.assume_init();
            (minimum_width, natural_width)
        }
    }

    fn preferred_width_for_height(&self, height: i32) -> (i32, i32) {
        unsafe {
            let mut minimum_width = mem::MaybeUninit::uninit();
            let mut natural_width = mem::MaybeUninit::uninit();
            ffi::gtk_widget_get_preferred_width_for_height(
                self.as_ref().to_glib_none().0,
                height,
                minimum_width.as_mut_ptr(),
                natural_width.as_mut_ptr(),
            );
            let minimum_width = minimum_width.assume_init();
            let natural_width = natural_width.assume_init();
            (minimum_width, natural_width)
        }
    }

    fn is_realized(&self) -> bool {
        unsafe { from_glib(ffi::gtk_widget_get_realized(self.as_ref().to_glib_none().0)) }
    }

    fn receives_default(&self) -> bool {
        unsafe {
            from_glib(ffi::gtk_widget_get_receives_default(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    fn request_mode(&self) -> SizeRequestMode {
        unsafe {
            from_glib(ffi::gtk_widget_get_request_mode(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    fn scale_factor(&self) -> i32 {
        unsafe { ffi::gtk_widget_get_scale_factor(self.as_ref().to_glib_none().0) }
    }

    fn screen(&self) -> Option<gdk::Screen> {
        unsafe { from_glib_none(ffi::gtk_widget_get_screen(self.as_ref().to_glib_none().0)) }
    }

    fn get_sensitive(&self) -> bool {
        unsafe {
            from_glib(ffi::gtk_widget_get_sensitive(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    fn settings(&self) -> Option<Settings> {
        unsafe { from_glib_none(ffi::gtk_widget_get_settings(self.as_ref().to_glib_none().0)) }
    }

    fn size_request(&self) -> (i32, i32) {
        unsafe {
            let mut width = mem::MaybeUninit::uninit();
            let mut height = mem::MaybeUninit::uninit();
            ffi::gtk_widget_get_size_request(
                self.as_ref().to_glib_none().0,
                width.as_mut_ptr(),
                height.as_mut_ptr(),
            );
            let width = width.assume_init();
            let height = height.assume_init();
            (width, height)
        }
    }

    fn state_flags(&self) -> StateFlags {
        unsafe {
            from_glib(ffi::gtk_widget_get_state_flags(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    fn style_context(&self) -> StyleContext {
        unsafe {
            from_glib_none(ffi::gtk_widget_get_style_context(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    fn supports_multidevice(&self) -> bool {
        unsafe {
            from_glib(ffi::gtk_widget_get_support_multidevice(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    fn template_child(&self, widget_type: glib::types::Type, name: &str) -> Option<glib::Object> {
        unsafe {
            from_glib_none(ffi::gtk_widget_get_template_child(
                self.as_ref().to_glib_none().0,
                widget_type.into_glib(),
                name.to_glib_none().0,
            ))
        }
    }

    fn tooltip_markup(&self) -> Option<glib::GString> {
        unsafe {
            from_glib_full(ffi::gtk_widget_get_tooltip_markup(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    fn tooltip_text(&self) -> Option<glib::GString> {
        unsafe {
            from_glib_full(ffi::gtk_widget_get_tooltip_text(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    fn tooltip_window(&self) -> Option<Window> {
        unsafe {
            from_glib_none(ffi::gtk_widget_get_tooltip_window(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    fn toplevel(&self) -> Option<Widget> {
        unsafe { from_glib_none(ffi::gtk_widget_get_toplevel(self.as_ref().to_glib_none().0)) }
    }

    fn valign(&self) -> Align {
        unsafe { from_glib(ffi::gtk_widget_get_valign(self.as_ref().to_glib_none().0)) }
    }

    fn valign_with_baseline(&self) -> Align {
        unsafe {
            from_glib(ffi::gtk_widget_get_valign_with_baseline(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    fn vexpands(&self) -> bool {
        unsafe { from_glib(ffi::gtk_widget_get_vexpand(self.as_ref().to_glib_none().0)) }
    }

    fn is_vexpand_set(&self) -> bool {
        unsafe {
            from_glib(ffi::gtk_widget_get_vexpand_set(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    fn get_visible(&self) -> bool {
        unsafe { from_glib(ffi::gtk_widget_get_visible(self.as_ref().to_glib_none().0)) }
    }

    fn visual(&self) -> Option<gdk::Visual> {
        unsafe { from_glib_none(ffi::gtk_widget_get_visual(self.as_ref().to_glib_none().0)) }
    }

    fn window(&self) -> Option<gdk::Window> {
        unsafe { from_glib_none(ffi::gtk_widget_get_window(self.as_ref().to_glib_none().0)) }
    }

    fn grab_add(&self) {
        unsafe {
            ffi::gtk_grab_add(self.as_ref().to_glib_none().0);
        }
    }

    fn grab_default(&self) {
        unsafe {
            ffi::gtk_widget_grab_default(self.as_ref().to_glib_none().0);
        }
    }

    fn grab_focus(&self) {
        unsafe {
            ffi::gtk_widget_grab_focus(self.as_ref().to_glib_none().0);
        }
    }

    fn grab_remove(&self) {
        unsafe {
            ffi::gtk_grab_remove(self.as_ref().to_glib_none().0);
        }
    }

    fn has_default(&self) -> bool {
        unsafe { from_glib(ffi::gtk_widget_has_default(self.as_ref().to_glib_none().0)) }
    }

    fn has_focus(&self) -> bool {
        unsafe { from_glib(ffi::gtk_widget_has_focus(self.as_ref().to_glib_none().0)) }
    }

    fn has_grab(&self) -> bool {
        unsafe { from_glib(ffi::gtk_widget_has_grab(self.as_ref().to_glib_none().0)) }
    }

    fn has_screen(&self) -> bool {
        unsafe { from_glib(ffi::gtk_widget_has_screen(self.as_ref().to_glib_none().0)) }
    }

    fn has_visible_focus(&self) -> bool {
        unsafe {
            from_glib(ffi::gtk_widget_has_visible_focus(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    fn hide(&self) {
        unsafe {
            ffi::gtk_widget_hide(self.as_ref().to_glib_none().0);
        }
    }

    fn in_destruction(&self) -> bool {
        unsafe {
            from_glib(ffi::gtk_widget_in_destruction(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    fn init_template(&self) {
        unsafe {
            ffi::gtk_widget_init_template(self.as_ref().to_glib_none().0);
        }
    }

    fn input_shape_combine_region(&self, region: Option<&cairo::Region>) {
        unsafe {
            ffi::gtk_widget_input_shape_combine_region(
                self.as_ref().to_glib_none().0,
                mut_override(region.to_glib_none().0),
            );
        }
    }

    fn insert_action_group<P: IsA<gio::ActionGroup>>(&self, name: &str, group: Option<&P>) {
        unsafe {
            ffi::gtk_widget_insert_action_group(
                self.as_ref().to_glib_none().0,
                name.to_glib_none().0,
                group.map(|p| p.as_ref()).to_glib_none().0,
            );
        }
    }

    fn is_ancestor<P: IsA<Widget>>(&self, ancestor: &P) -> bool {
        unsafe {
            from_glib(ffi::gtk_widget_is_ancestor(
                self.as_ref().to_glib_none().0,
                ancestor.as_ref().to_glib_none().0,
            ))
        }
    }

    fn is_composited(&self) -> bool {
        unsafe {
            from_glib(ffi::gtk_widget_is_composited(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    fn is_drawable(&self) -> bool {
        unsafe { from_glib(ffi::gtk_widget_is_drawable(self.as_ref().to_glib_none().0)) }
    }

    fn is_focus(&self) -> bool {
        unsafe { from_glib(ffi::gtk_widget_is_focus(self.as_ref().to_glib_none().0)) }
    }

    fn is_sensitive(&self) -> bool {
        unsafe { from_glib(ffi::gtk_widget_is_sensitive(self.as_ref().to_glib_none().0)) }
    }

    fn is_toplevel(&self) -> bool {
        unsafe { from_glib(ffi::gtk_widget_is_toplevel(self.as_ref().to_glib_none().0)) }
    }

    fn is_visible(&self) -> bool {
        unsafe { from_glib(ffi::gtk_widget_is_visible(self.as_ref().to_glib_none().0)) }
    }

    fn keynav_failed(&self, direction: DirectionType) -> bool {
        unsafe {
            from_glib(ffi::gtk_widget_keynav_failed(
                self.as_ref().to_glib_none().0,
                direction.into_glib(),
            ))
        }
    }

    fn list_accel_closures(&self) -> Vec<glib::Closure> {
        unsafe {
            FromGlibPtrContainer::from_glib_container(ffi::gtk_widget_list_accel_closures(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    fn list_action_prefixes(&self) -> Vec<glib::GString> {
        unsafe {
            FromGlibPtrContainer::from_glib_container(ffi::gtk_widget_list_action_prefixes(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    fn list_mnemonic_labels(&self) -> Vec<Widget> {
        unsafe {
            FromGlibPtrContainer::from_glib_container(ffi::gtk_widget_list_mnemonic_labels(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    fn map(&self) {
        unsafe {
            ffi::gtk_widget_map(self.as_ref().to_glib_none().0);
        }
    }

    fn mnemonic_activate(&self, group_cycling: bool) -> bool {
        unsafe {
            from_glib(ffi::gtk_widget_mnemonic_activate(
                self.as_ref().to_glib_none().0,
                group_cycling.into_glib(),
            ))
        }
    }

    #[cfg(any(feature = "v3_20", feature = "dox"))]
    #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
    fn queue_allocate(&self) {
        unsafe {
            ffi::gtk_widget_queue_allocate(self.as_ref().to_glib_none().0);
        }
    }

    fn queue_compute_expand(&self) {
        unsafe {
            ffi::gtk_widget_queue_compute_expand(self.as_ref().to_glib_none().0);
        }
    }

    fn queue_draw(&self) {
        unsafe {
            ffi::gtk_widget_queue_draw(self.as_ref().to_glib_none().0);
        }
    }

    fn queue_draw_area(&self, x: i32, y: i32, width: i32, height: i32) {
        unsafe {
            ffi::gtk_widget_queue_draw_area(self.as_ref().to_glib_none().0, x, y, width, height);
        }
    }

    fn queue_draw_region(&self, region: &cairo::Region) {
        unsafe {
            ffi::gtk_widget_queue_draw_region(
                self.as_ref().to_glib_none().0,
                region.to_glib_none().0,
            );
        }
    }

    fn queue_resize(&self) {
        unsafe {
            ffi::gtk_widget_queue_resize(self.as_ref().to_glib_none().0);
        }
    }

    fn queue_resize_no_redraw(&self) {
        unsafe {
            ffi::gtk_widget_queue_resize_no_redraw(self.as_ref().to_glib_none().0);
        }
    }

    fn realize(&self) {
        unsafe {
            ffi::gtk_widget_realize(self.as_ref().to_glib_none().0);
        }
    }

    fn register_window(&self, window: &gdk::Window) {
        unsafe {
            ffi::gtk_widget_register_window(
                self.as_ref().to_glib_none().0,
                window.to_glib_none().0,
            );
        }
    }

    fn remove_accelerator<P: IsA<AccelGroup>>(
        &self,
        accel_group: &P,
        accel_key: u32,
        accel_mods: gdk::ModifierType,
    ) -> bool {
        unsafe {
            from_glib(ffi::gtk_widget_remove_accelerator(
                self.as_ref().to_glib_none().0,
                accel_group.as_ref().to_glib_none().0,
                accel_key,
                accel_mods.into_glib(),
            ))
        }
    }

    fn remove_mnemonic_label<P: IsA<Widget>>(&self, label: &P) {
        unsafe {
            ffi::gtk_widget_remove_mnemonic_label(
                self.as_ref().to_glib_none().0,
                label.as_ref().to_glib_none().0,
            );
        }
    }

    fn reset_style(&self) {
        unsafe {
            ffi::gtk_widget_reset_style(self.as_ref().to_glib_none().0);
        }
    }

    fn send_expose(&self, event: &gdk::Event) -> i32 {
        unsafe {
            ffi::gtk_widget_send_expose(
                self.as_ref().to_glib_none().0,
                mut_override(event.to_glib_none().0),
            )
        }
    }

    fn send_focus_change(&self, event: &gdk::Event) -> bool {
        unsafe {
            from_glib(ffi::gtk_widget_send_focus_change(
                self.as_ref().to_glib_none().0,
                mut_override(event.to_glib_none().0),
            ))
        }
    }

    fn set_accel_path<P: IsA<AccelGroup>>(
        &self,
        accel_path: Option<&str>,
        accel_group: Option<&P>,
    ) {
        unsafe {
            ffi::gtk_widget_set_accel_path(
                self.as_ref().to_glib_none().0,
                accel_path.to_glib_none().0,
                accel_group.map(|p| p.as_ref()).to_glib_none().0,
            );
        }
    }

    fn set_allocation(&self, allocation: &Allocation) {
        unsafe {
            ffi::gtk_widget_set_allocation(
                self.as_ref().to_glib_none().0,
                allocation.to_glib_none().0,
            );
        }
    }

    fn set_app_paintable(&self, app_paintable: bool) {
        unsafe {
            ffi::gtk_widget_set_app_paintable(
                self.as_ref().to_glib_none().0,
                app_paintable.into_glib(),
            );
        }
    }

    fn set_can_default(&self, can_default: bool) {
        unsafe {
            ffi::gtk_widget_set_can_default(
                self.as_ref().to_glib_none().0,
                can_default.into_glib(),
            );
        }
    }

    fn set_can_focus(&self, can_focus: bool) {
        unsafe {
            ffi::gtk_widget_set_can_focus(self.as_ref().to_glib_none().0, can_focus.into_glib());
        }
    }

    fn set_child_visible(&self, is_visible: bool) {
        unsafe {
            ffi::gtk_widget_set_child_visible(
                self.as_ref().to_glib_none().0,
                is_visible.into_glib(),
            );
        }
    }

    fn set_clip(&self, clip: &Allocation) {
        unsafe {
            ffi::gtk_widget_set_clip(self.as_ref().to_glib_none().0, clip.to_glib_none().0);
        }
    }

    fn set_device_enabled(&self, device: &gdk::Device, enabled: bool) {
        unsafe {
            ffi::gtk_widget_set_device_enabled(
                self.as_ref().to_glib_none().0,
                device.to_glib_none().0,
                enabled.into_glib(),
            );
        }
    }

    fn set_device_events(&self, device: &gdk::Device, events: gdk::EventMask) {
        unsafe {
            ffi::gtk_widget_set_device_events(
                self.as_ref().to_glib_none().0,
                device.to_glib_none().0,
                events.into_glib(),
            );
        }
    }

    fn set_direction(&self, dir: TextDirection) {
        unsafe {
            ffi::gtk_widget_set_direction(self.as_ref().to_glib_none().0, dir.into_glib());
        }
    }

    #[cfg(any(feature = "v3_20", feature = "dox"))]
    #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
    fn set_focus_on_click(&self, focus_on_click: bool) {
        unsafe {
            ffi::gtk_widget_set_focus_on_click(
                self.as_ref().to_glib_none().0,
                focus_on_click.into_glib(),
            );
        }
    }

    fn set_font_map<P: IsA<pango::FontMap>>(&self, font_map: Option<&P>) {
        unsafe {
            ffi::gtk_widget_set_font_map(
                self.as_ref().to_glib_none().0,
                font_map.map(|p| p.as_ref()).to_glib_none().0,
            );
        }
    }

    fn set_font_options(&self, options: Option<&cairo::FontOptions>) {
        unsafe {
            ffi::gtk_widget_set_font_options(
                self.as_ref().to_glib_none().0,
                options.to_glib_none().0,
            );
        }
    }

    fn set_halign(&self, align: Align) {
        unsafe {
            ffi::gtk_widget_set_halign(self.as_ref().to_glib_none().0, align.into_glib());
        }
    }

    fn set_has_tooltip(&self, has_tooltip: bool) {
        unsafe {
            ffi::gtk_widget_set_has_tooltip(
                self.as_ref().to_glib_none().0,
                has_tooltip.into_glib(),
            );
        }
    }

    fn set_has_window(&self, has_window: bool) {
        unsafe {
            ffi::gtk_widget_set_has_window(self.as_ref().to_glib_none().0, has_window.into_glib());
        }
    }

    fn set_hexpand(&self, expand: bool) {
        unsafe {
            ffi::gtk_widget_set_hexpand(self.as_ref().to_glib_none().0, expand.into_glib());
        }
    }

    fn set_hexpand_set(&self, set: bool) {
        unsafe {
            ffi::gtk_widget_set_hexpand_set(self.as_ref().to_glib_none().0, set.into_glib());
        }
    }

    fn set_mapped(&self, mapped: bool) {
        unsafe {
            ffi::gtk_widget_set_mapped(self.as_ref().to_glib_none().0, mapped.into_glib());
        }
    }

    fn set_margin_bottom(&self, margin: i32) {
        unsafe {
            ffi::gtk_widget_set_margin_bottom(self.as_ref().to_glib_none().0, margin);
        }
    }

    fn set_margin_end(&self, margin: i32) {
        unsafe {
            ffi::gtk_widget_set_margin_end(self.as_ref().to_glib_none().0, margin);
        }
    }

    fn set_margin_start(&self, margin: i32) {
        unsafe {
            ffi::gtk_widget_set_margin_start(self.as_ref().to_glib_none().0, margin);
        }
    }

    fn set_margin_top(&self, margin: i32) {
        unsafe {
            ffi::gtk_widget_set_margin_top(self.as_ref().to_glib_none().0, margin);
        }
    }

    fn set_widget_name(&self, name: &str) {
        unsafe {
            ffi::gtk_widget_set_name(self.as_ref().to_glib_none().0, name.to_glib_none().0);
        }
    }

    fn set_no_show_all(&self, no_show_all: bool) {
        unsafe {
            ffi::gtk_widget_set_no_show_all(
                self.as_ref().to_glib_none().0,
                no_show_all.into_glib(),
            );
        }
    }

    fn set_opacity(&self, opacity: f64) {
        unsafe {
            ffi::gtk_widget_set_opacity(self.as_ref().to_glib_none().0, opacity);
        }
    }

    fn set_parent<P: IsA<Widget>>(&self, parent: &P) {
        unsafe {
            ffi::gtk_widget_set_parent(
                self.as_ref().to_glib_none().0,
                parent.as_ref().to_glib_none().0,
            );
        }
    }

    fn set_parent_window(&self, parent_window: &gdk::Window) {
        unsafe {
            ffi::gtk_widget_set_parent_window(
                self.as_ref().to_glib_none().0,
                parent_window.to_glib_none().0,
            );
        }
    }

    fn set_realized(&self, realized: bool) {
        unsafe {
            ffi::gtk_widget_set_realized(self.as_ref().to_glib_none().0, realized.into_glib());
        }
    }

    fn set_receives_default(&self, receives_default: bool) {
        unsafe {
            ffi::gtk_widget_set_receives_default(
                self.as_ref().to_glib_none().0,
                receives_default.into_glib(),
            );
        }
    }

    fn set_redraw_on_allocate(&self, redraw_on_allocate: bool) {
        unsafe {
            ffi::gtk_widget_set_redraw_on_allocate(
                self.as_ref().to_glib_none().0,
                redraw_on_allocate.into_glib(),
            );
        }
    }

    fn set_sensitive(&self, sensitive: bool) {
        unsafe {
            ffi::gtk_widget_set_sensitive(self.as_ref().to_glib_none().0, sensitive.into_glib());
        }
    }

    fn set_size_request(&self, width: i32, height: i32) {
        unsafe {
            ffi::gtk_widget_set_size_request(self.as_ref().to_glib_none().0, width, height);
        }
    }

    fn set_state_flags(&self, flags: StateFlags, clear: bool) {
        unsafe {
            ffi::gtk_widget_set_state_flags(
                self.as_ref().to_glib_none().0,
                flags.into_glib(),
                clear.into_glib(),
            );
        }
    }

    fn set_support_multidevice(&self, support_multidevice: bool) {
        unsafe {
            ffi::gtk_widget_set_support_multidevice(
                self.as_ref().to_glib_none().0,
                support_multidevice.into_glib(),
            );
        }
    }

    fn set_tooltip_markup(&self, markup: Option<&str>) {
        unsafe {
            ffi::gtk_widget_set_tooltip_markup(
                self.as_ref().to_glib_none().0,
                markup.to_glib_none().0,
            );
        }
    }

    fn set_tooltip_text(&self, text: Option<&str>) {
        unsafe {
            ffi::gtk_widget_set_tooltip_text(self.as_ref().to_glib_none().0, text.to_glib_none().0);
        }
    }

    fn set_tooltip_window<P: IsA<Window>>(&self, custom_window: Option<&P>) {
        unsafe {
            ffi::gtk_widget_set_tooltip_window(
                self.as_ref().to_glib_none().0,
                custom_window.map(|p| p.as_ref()).to_glib_none().0,
            );
        }
    }

    fn set_valign(&self, align: Align) {
        unsafe {
            ffi::gtk_widget_set_valign(self.as_ref().to_glib_none().0, align.into_glib());
        }
    }

    fn set_vexpand(&self, expand: bool) {
        unsafe {
            ffi::gtk_widget_set_vexpand(self.as_ref().to_glib_none().0, expand.into_glib());
        }
    }

    fn set_vexpand_set(&self, set: bool) {
        unsafe {
            ffi::gtk_widget_set_vexpand_set(self.as_ref().to_glib_none().0, set.into_glib());
        }
    }

    fn set_visible(&self, visible: bool) {
        unsafe {
            ffi::gtk_widget_set_visible(self.as_ref().to_glib_none().0, visible.into_glib());
        }
    }

    fn set_visual(&self, visual: Option<&gdk::Visual>) {
        unsafe {
            ffi::gtk_widget_set_visual(self.as_ref().to_glib_none().0, visual.to_glib_none().0);
        }
    }

    fn set_window(&self, window: &gdk::Window) {
        unsafe {
            ffi::gtk_widget_set_window(self.as_ref().to_glib_none().0, window.to_glib_full());
        }
    }

    fn shape_combine_region(&self, region: Option<&cairo::Region>) {
        unsafe {
            ffi::gtk_widget_shape_combine_region(
                self.as_ref().to_glib_none().0,
                mut_override(region.to_glib_none().0),
            );
        }
    }

    fn show(&self) {
        unsafe {
            ffi::gtk_widget_show(self.as_ref().to_glib_none().0);
        }
    }

    fn show_all(&self) {
        unsafe {
            ffi::gtk_widget_show_all(self.as_ref().to_glib_none().0);
        }
    }

    fn show_now(&self) {
        unsafe {
            ffi::gtk_widget_show_now(self.as_ref().to_glib_none().0);
        }
    }

    fn size_allocate(&self, allocation: &Allocation) {
        unsafe {
            ffi::gtk_widget_size_allocate(
                self.as_ref().to_glib_none().0,
                mut_override(allocation.to_glib_none().0),
            );
        }
    }

    fn size_allocate_with_baseline(&self, allocation: &mut Allocation, baseline: i32) {
        unsafe {
            ffi::gtk_widget_size_allocate_with_baseline(
                self.as_ref().to_glib_none().0,
                allocation.to_glib_none_mut().0,
                baseline,
            );
        }
    }

    //fn style_get(&self, first_property_name: &str, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) {
    //    unsafe { TODO: call ffi:gtk_widget_style_get() }
    //}

    fn style_get_property(&self, property_name: &str) -> glib::Value {
        unsafe {
            let mut value = glib::Value::uninitialized();
            ffi::gtk_widget_style_get_property(
                self.as_ref().to_glib_none().0,
                property_name.to_glib_none().0,
                value.to_glib_none_mut().0,
            );
            value
        }
    }

    //fn style_get_valist(&self, first_property_name: &str, var_args: /*Unknown conversion*//*Unimplemented*/Unsupported) {
    //    unsafe { TODO: call ffi:gtk_widget_style_get_valist() }
    //}

    fn thaw_child_notify(&self) {
        unsafe {
            ffi::gtk_widget_thaw_child_notify(self.as_ref().to_glib_none().0);
        }
    }

    fn translate_coordinates<P: IsA<Widget>>(
        &self,
        dest_widget: &P,
        src_x: i32,
        src_y: i32,
    ) -> Option<(i32, i32)> {
        unsafe {
            let mut dest_x = mem::MaybeUninit::uninit();
            let mut dest_y = mem::MaybeUninit::uninit();
            let ret = from_glib(ffi::gtk_widget_translate_coordinates(
                self.as_ref().to_glib_none().0,
                dest_widget.as_ref().to_glib_none().0,
                src_x,
                src_y,
                dest_x.as_mut_ptr(),
                dest_y.as_mut_ptr(),
            ));
            let dest_x = dest_x.assume_init();
            let dest_y = dest_y.assume_init();
            if ret {
                Some((dest_x, dest_y))
            } else {
                None
            }
        }
    }

    fn trigger_tooltip_query(&self) {
        unsafe {
            ffi::gtk_widget_trigger_tooltip_query(self.as_ref().to_glib_none().0);
        }
    }

    fn unmap(&self) {
        unsafe {
            ffi::gtk_widget_unmap(self.as_ref().to_glib_none().0);
        }
    }

    fn unparent(&self) {
        unsafe {
            ffi::gtk_widget_unparent(self.as_ref().to_glib_none().0);
        }
    }

    fn unrealize(&self) {
        unsafe {
            ffi::gtk_widget_unrealize(self.as_ref().to_glib_none().0);
        }
    }

    fn unregister_window(&self, window: &gdk::Window) {
        unsafe {
            ffi::gtk_widget_unregister_window(
                self.as_ref().to_glib_none().0,
                window.to_glib_none().0,
            );
        }
    }

    fn unset_state_flags(&self, flags: StateFlags) {
        unsafe {
            ffi::gtk_widget_unset_state_flags(self.as_ref().to_glib_none().0, flags.into_glib());
        }
    }

    fn is_composite_child(&self) -> bool {
        unsafe {
            let mut value = glib::Value::from_type(<bool as StaticType>::static_type());
            glib::gobject_ffi::g_object_get_property(
                self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
                b"composite-child\0".as_ptr() as *const _,
                value.to_glib_none_mut().0,
            );
            value
                .get()
                .expect("Return Value for property `composite-child` getter")
        }
    }

    fn expands(&self) -> bool {
        unsafe {
            let mut value = glib::Value::from_type(<bool as StaticType>::static_type());
            glib::gobject_ffi::g_object_get_property(
                self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
                b"expand\0".as_ptr() as *const _,
                value.to_glib_none_mut().0,
            );
            value
                .get()
                .expect("Return Value for property `expand` getter")
        }
    }

    fn set_expand(&self, expand: bool) {
        unsafe {
            glib::gobject_ffi::g_object_set_property(
                self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
                b"expand\0".as_ptr() as *const _,
                expand.to_value().to_glib_none().0,
            );
        }
    }

    fn set_has_default(&self, has_default: bool) {
        unsafe {
            glib::gobject_ffi::g_object_set_property(
                self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
                b"has-default\0".as_ptr() as *const _,
                has_default.to_value().to_glib_none().0,
            );
        }
    }

    fn set_has_focus(&self, has_focus: bool) {
        unsafe {
            glib::gobject_ffi::g_object_set_property(
                self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
                b"has-focus\0".as_ptr() as *const _,
                has_focus.to_value().to_glib_none().0,
            );
        }
    }

    fn height_request(&self) -> i32 {
        unsafe {
            let mut value = glib::Value::from_type(<i32 as StaticType>::static_type());
            glib::gobject_ffi::g_object_get_property(
                self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
                b"height-request\0".as_ptr() as *const _,
                value.to_glib_none_mut().0,
            );
            value
                .get()
                .expect("Return Value for property `height-request` getter")
        }
    }

    fn set_height_request(&self, height_request: i32) {
        unsafe {
            glib::gobject_ffi::g_object_set_property(
                self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
                b"height-request\0".as_ptr() as *const _,
                height_request.to_value().to_glib_none().0,
            );
        }
    }

    fn set_is_focus(&self, is_focus: bool) {
        unsafe {
            glib::gobject_ffi::g_object_set_property(
                self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
                b"is-focus\0".as_ptr() as *const _,
                is_focus.to_value().to_glib_none().0,
            );
        }
    }

    fn margin(&self) -> i32 {
        unsafe {
            let mut value = glib::Value::from_type(<i32 as StaticType>::static_type());
            glib::gobject_ffi::g_object_get_property(
                self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
                b"margin\0".as_ptr() as *const _,
                value.to_glib_none_mut().0,
            );
            value
                .get()
                .expect("Return Value for property `margin` getter")
        }
    }

    fn set_margin(&self, margin: i32) {
        unsafe {
            glib::gobject_ffi::g_object_set_property(
                self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
                b"margin\0".as_ptr() as *const _,
                margin.to_value().to_glib_none().0,
            );
        }
    }

    fn width_request(&self) -> i32 {
        unsafe {
            let mut value = glib::Value::from_type(<i32 as StaticType>::static_type());
            glib::gobject_ffi::g_object_get_property(
                self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
                b"width-request\0".as_ptr() as *const _,
                value.to_glib_none_mut().0,
            );
            value
                .get()
                .expect("Return Value for property `width-request` getter")
        }
    }

    fn set_width_request(&self, width_request: i32) {
        unsafe {
            glib::gobject_ffi::g_object_set_property(
                self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
                b"width-request\0".as_ptr() as *const _,
                width_request.to_value().to_glib_none().0,
            );
        }
    }

    fn connect_accel_closures_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn accel_closures_changed_trampoline<
            P: IsA<Widget>,
            F: Fn(&P) + 'static,
        >(
            this: *mut ffi::GtkWidget,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"accel-closures-changed\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    accel_closures_changed_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_button_press_event<
        F: Fn(&Self, &gdk::EventButton) -> glib::signal::Inhibit + 'static,
    >(
        &self,
        f: F,
    ) -> SignalHandlerId {
        unsafe extern "C" fn button_press_event_trampoline<
            P: IsA<Widget>,
            F: Fn(&P, &gdk::EventButton) -> glib::signal::Inhibit + 'static,
        >(
            this: *mut ffi::GtkWidget,
            event: *mut gdk::ffi::GdkEventButton,
            f: glib::ffi::gpointer,
        ) -> glib::ffi::gboolean {
            let f: &F = &*(f as *const F);
            f(
                Widget::from_glib_borrow(this).unsafe_cast_ref(),
                &from_glib_borrow(event),
            )
            .into_glib()
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"button-press-event\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    button_press_event_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_button_release_event<
        F: Fn(&Self, &gdk::EventButton) -> glib::signal::Inhibit + 'static,
    >(
        &self,
        f: F,
    ) -> SignalHandlerId {
        unsafe extern "C" fn button_release_event_trampoline<
            P: IsA<Widget>,
            F: Fn(&P, &gdk::EventButton) -> glib::signal::Inhibit + 'static,
        >(
            this: *mut ffi::GtkWidget,
            event: *mut gdk::ffi::GdkEventButton,
            f: glib::ffi::gpointer,
        ) -> glib::ffi::gboolean {
            let f: &F = &*(f as *const F);
            f(
                Widget::from_glib_borrow(this).unsafe_cast_ref(),
                &from_glib_borrow(event),
            )
            .into_glib()
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"button-release-event\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    button_release_event_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_can_activate_accel<F: Fn(&Self, u32) -> bool + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId {
        unsafe extern "C" fn can_activate_accel_trampoline<
            P: IsA<Widget>,
            F: Fn(&P, u32) -> bool + 'static,
        >(
            this: *mut ffi::GtkWidget,
            signal_id: libc::c_uint,
            f: glib::ffi::gpointer,
        ) -> glib::ffi::gboolean {
            let f: &F = &*(f as *const F);
            f(Widget::from_glib_borrow(this).unsafe_cast_ref(), signal_id).into_glib()
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"can-activate-accel\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    can_activate_accel_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_child_notify<F: Fn(&Self, &glib::ParamSpec) + 'static>(
        &self,
        detail: Option<&str>,
        f: F,
    ) -> SignalHandlerId {
        unsafe extern "C" fn child_notify_trampoline<
            P: IsA<Widget>,
            F: Fn(&P, &glib::ParamSpec) + 'static,
        >(
            this: *mut ffi::GtkWidget,
            child_property: *mut glib::gobject_ffi::GParamSpec,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(
                Widget::from_glib_borrow(this).unsafe_cast_ref(),
                &from_glib_borrow(child_property),
            )
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            let detailed_signal_name = detail.map(|name| format!("child-notify::{}\0", name));
            let signal_name: &[u8] = detailed_signal_name
                .as_ref()
                .map_or(&b"child-notify\0"[..], |n| n.as_bytes());
            connect_raw(
                self.as_ptr() as *mut _,
                signal_name.as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    child_notify_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_composited_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn composited_changed_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
            this: *mut ffi::GtkWidget,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"composited-changed\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    composited_changed_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn emit_composited_changed(&self) {
        let _ = unsafe {
            glib::Object::from_glib_borrow(self.as_ptr() as *mut glib::gobject_ffi::GObject)
                .emit_by_name("composited-changed", &[])
                .unwrap()
        };
    }

    fn connect_configure_event<F: Fn(&Self, &gdk::EventConfigure) -> bool + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId {
        unsafe extern "C" fn configure_event_trampoline<
            P: IsA<Widget>,
            F: Fn(&P, &gdk::EventConfigure) -> bool + 'static,
        >(
            this: *mut ffi::GtkWidget,
            event: *mut gdk::ffi::GdkEventConfigure,
            f: glib::ffi::gpointer,
        ) -> glib::ffi::gboolean {
            let f: &F = &*(f as *const F);
            f(
                Widget::from_glib_borrow(this).unsafe_cast_ref(),
                &from_glib_borrow(event),
            )
            .into_glib()
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"configure-event\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    configure_event_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_damage_event<F: Fn(&Self, &gdk::EventExpose) -> bool + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId {
        unsafe extern "C" fn damage_event_trampoline<
            P: IsA<Widget>,
            F: Fn(&P, &gdk::EventExpose) -> bool + 'static,
        >(
            this: *mut ffi::GtkWidget,
            event: *mut gdk::ffi::GdkEventExpose,
            f: glib::ffi::gpointer,
        ) -> glib::ffi::gboolean {
            let f: &F = &*(f as *const F);
            f(
                Widget::from_glib_borrow(this).unsafe_cast_ref(),
                &from_glib_borrow(event),
            )
            .into_glib()
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"damage-event\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    damage_event_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_delete_event<F: Fn(&Self, &gdk::Event) -> glib::signal::Inhibit + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId {
        unsafe extern "C" fn delete_event_trampoline<
            P: IsA<Widget>,
            F: Fn(&P, &gdk::Event) -> glib::signal::Inhibit + 'static,
        >(
            this: *mut ffi::GtkWidget,
            event: *mut gdk::ffi::GdkEvent,
            f: glib::ffi::gpointer,
        ) -> glib::ffi::gboolean {
            let f: &F = &*(f as *const F);
            f(
                Widget::from_glib_borrow(this).unsafe_cast_ref(),
                &from_glib_none(event),
            )
            .into_glib()
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"delete-event\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    delete_event_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_destroy<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn destroy_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
            this: *mut ffi::GtkWidget,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"destroy\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    destroy_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_destroy_event<F: Fn(&Self, &gdk::Event) -> glib::signal::Inhibit + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId {
        unsafe extern "C" fn destroy_event_trampoline<
            P: IsA<Widget>,
            F: Fn(&P, &gdk::Event) -> glib::signal::Inhibit + 'static,
        >(
            this: *mut ffi::GtkWidget,
            event: *mut gdk::ffi::GdkEvent,
            f: glib::ffi::gpointer,
        ) -> glib::ffi::gboolean {
            let f: &F = &*(f as *const F);
            f(
                Widget::from_glib_borrow(this).unsafe_cast_ref(),
                &from_glib_none(event),
            )
            .into_glib()
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"destroy-event\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    destroy_event_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_direction_changed<F: Fn(&Self, TextDirection) + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId {
        unsafe extern "C" fn direction_changed_trampoline<
            P: IsA<Widget>,
            F: Fn(&P, TextDirection) + 'static,
        >(
            this: *mut ffi::GtkWidget,
            previous_direction: ffi::GtkTextDirection,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(
                Widget::from_glib_borrow(this).unsafe_cast_ref(),
                from_glib(previous_direction),
            )
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"direction-changed\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    direction_changed_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_drag_begin<F: Fn(&Self, &gdk::DragContext) + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId {
        unsafe extern "C" fn drag_begin_trampoline<
            P: IsA<Widget>,
            F: Fn(&P, &gdk::DragContext) + 'static,
        >(
            this: *mut ffi::GtkWidget,
            context: *mut gdk::ffi::GdkDragContext,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(
                Widget::from_glib_borrow(this).unsafe_cast_ref(),
                &from_glib_borrow(context),
            )
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"drag-begin\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    drag_begin_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_drag_data_delete<F: Fn(&Self, &gdk::DragContext) + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId {
        unsafe extern "C" fn drag_data_delete_trampoline<
            P: IsA<Widget>,
            F: Fn(&P, &gdk::DragContext) + 'static,
        >(
            this: *mut ffi::GtkWidget,
            context: *mut gdk::ffi::GdkDragContext,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(
                Widget::from_glib_borrow(this).unsafe_cast_ref(),
                &from_glib_borrow(context),
            )
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"drag-data-delete\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    drag_data_delete_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_drag_data_get<
        F: Fn(&Self, &gdk::DragContext, &SelectionData, u32, u32) + 'static,
    >(
        &self,
        f: F,
    ) -> SignalHandlerId {
        unsafe extern "C" fn drag_data_get_trampoline<
            P: IsA<Widget>,
            F: Fn(&P, &gdk::DragContext, &SelectionData, u32, u32) + 'static,
        >(
            this: *mut ffi::GtkWidget,
            context: *mut gdk::ffi::GdkDragContext,
            data: *mut ffi::GtkSelectionData,
            info: libc::c_uint,
            time: libc::c_uint,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(
                Widget::from_glib_borrow(this).unsafe_cast_ref(),
                &from_glib_borrow(context),
                &from_glib_borrow(data),
                info,
                time,
            )
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"drag-data-get\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    drag_data_get_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_drag_data_received<
        F: Fn(&Self, &gdk::DragContext, i32, i32, &SelectionData, u32, u32) + 'static,
    >(
        &self,
        f: F,
    ) -> SignalHandlerId {
        unsafe extern "C" fn drag_data_received_trampoline<
            P: IsA<Widget>,
            F: Fn(&P, &gdk::DragContext, i32, i32, &SelectionData, u32, u32) + 'static,
        >(
            this: *mut ffi::GtkWidget,
            context: *mut gdk::ffi::GdkDragContext,
            x: libc::c_int,
            y: libc::c_int,
            data: *mut ffi::GtkSelectionData,
            info: libc::c_uint,
            time: libc::c_uint,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(
                Widget::from_glib_borrow(this).unsafe_cast_ref(),
                &from_glib_borrow(context),
                x,
                y,
                &from_glib_borrow(data),
                info,
                time,
            )
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"drag-data-received\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    drag_data_received_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_drag_drop<F: Fn(&Self, &gdk::DragContext, i32, i32, u32) -> bool + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId {
        unsafe extern "C" fn drag_drop_trampoline<
            P: IsA<Widget>,
            F: Fn(&P, &gdk::DragContext, i32, i32, u32) -> bool + 'static,
        >(
            this: *mut ffi::GtkWidget,
            context: *mut gdk::ffi::GdkDragContext,
            x: libc::c_int,
            y: libc::c_int,
            time: libc::c_uint,
            f: glib::ffi::gpointer,
        ) -> glib::ffi::gboolean {
            let f: &F = &*(f as *const F);
            f(
                Widget::from_glib_borrow(this).unsafe_cast_ref(),
                &from_glib_borrow(context),
                x,
                y,
                time,
            )
            .into_glib()
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"drag-drop\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    drag_drop_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_drag_end<F: Fn(&Self, &gdk::DragContext) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn drag_end_trampoline<
            P: IsA<Widget>,
            F: Fn(&P, &gdk::DragContext) + 'static,
        >(
            this: *mut ffi::GtkWidget,
            context: *mut gdk::ffi::GdkDragContext,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(
                Widget::from_glib_borrow(this).unsafe_cast_ref(),
                &from_glib_borrow(context),
            )
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"drag-end\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    drag_end_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_drag_failed<
        F: Fn(&Self, &gdk::DragContext, DragResult) -> glib::signal::Inhibit + 'static,
    >(
        &self,
        f: F,
    ) -> SignalHandlerId {
        unsafe extern "C" fn drag_failed_trampoline<
            P: IsA<Widget>,
            F: Fn(&P, &gdk::DragContext, DragResult) -> glib::signal::Inhibit + 'static,
        >(
            this: *mut ffi::GtkWidget,
            context: *mut gdk::ffi::GdkDragContext,
            result: ffi::GtkDragResult,
            f: glib::ffi::gpointer,
        ) -> glib::ffi::gboolean {
            let f: &F = &*(f as *const F);
            f(
                Widget::from_glib_borrow(this).unsafe_cast_ref(),
                &from_glib_borrow(context),
                from_glib(result),
            )
            .into_glib()
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"drag-failed\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    drag_failed_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_drag_leave<F: Fn(&Self, &gdk::DragContext, u32) + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId {
        unsafe extern "C" fn drag_leave_trampoline<
            P: IsA<Widget>,
            F: Fn(&P, &gdk::DragContext, u32) + 'static,
        >(
            this: *mut ffi::GtkWidget,
            context: *mut gdk::ffi::GdkDragContext,
            time: libc::c_uint,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(
                Widget::from_glib_borrow(this).unsafe_cast_ref(),
                &from_glib_borrow(context),
                time,
            )
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"drag-leave\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    drag_leave_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_drag_motion<F: Fn(&Self, &gdk::DragContext, i32, i32, u32) -> bool + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId {
        unsafe extern "C" fn drag_motion_trampoline<
            P: IsA<Widget>,
            F: Fn(&P, &gdk::DragContext, i32, i32, u32) -> bool + 'static,
        >(
            this: *mut ffi::GtkWidget,
            context: *mut gdk::ffi::GdkDragContext,
            x: libc::c_int,
            y: libc::c_int,
            time: libc::c_uint,
            f: glib::ffi::gpointer,
        ) -> glib::ffi::gboolean {
            let f: &F = &*(f as *const F);
            f(
                Widget::from_glib_borrow(this).unsafe_cast_ref(),
                &from_glib_borrow(context),
                x,
                y,
                time,
            )
            .into_glib()
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"drag-motion\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    drag_motion_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_draw<F: Fn(&Self, &cairo::Context) -> glib::signal::Inhibit + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId {
        unsafe extern "C" fn draw_trampoline<
            P: IsA<Widget>,
            F: Fn(&P, &cairo::Context) -> glib::signal::Inhibit + 'static,
        >(
            this: *mut ffi::GtkWidget,
            cr: *mut cairo::ffi::cairo_t,
            f: glib::ffi::gpointer,
        ) -> glib::ffi::gboolean {
            let f: &F = &*(f as *const F);
            f(
                Widget::from_glib_borrow(this).unsafe_cast_ref(),
                &from_glib_borrow(cr),
            )
            .into_glib()
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"draw\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    draw_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_enter_notify_event<
        F: Fn(&Self, &gdk::EventCrossing) -> glib::signal::Inhibit + 'static,
    >(
        &self,
        f: F,
    ) -> SignalHandlerId {
        unsafe extern "C" fn enter_notify_event_trampoline<
            P: IsA<Widget>,
            F: Fn(&P, &gdk::EventCrossing) -> glib::signal::Inhibit + 'static,
        >(
            this: *mut ffi::GtkWidget,
            event: *mut gdk::ffi::GdkEventCrossing,
            f: glib::ffi::gpointer,
        ) -> glib::ffi::gboolean {
            let f: &F = &*(f as *const F);
            f(
                Widget::from_glib_borrow(this).unsafe_cast_ref(),
                &from_glib_borrow(event),
            )
            .into_glib()
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"enter-notify-event\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    enter_notify_event_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_event<F: Fn(&Self, &gdk::Event) -> glib::signal::Inhibit + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId {
        unsafe extern "C" fn event_trampoline<
            P: IsA<Widget>,
            F: Fn(&P, &gdk::Event) -> glib::signal::Inhibit + 'static,
        >(
            this: *mut ffi::GtkWidget,
            event: *mut gdk::ffi::GdkEvent,
            f: glib::ffi::gpointer,
        ) -> glib::ffi::gboolean {
            let f: &F = &*(f as *const F);
            f(
                Widget::from_glib_borrow(this).unsafe_cast_ref(),
                &from_glib_none(event),
            )
            .into_glib()
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"event\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    event_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_event_after<F: Fn(&Self, &gdk::Event) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn event_after_trampoline<
            P: IsA<Widget>,
            F: Fn(&P, &gdk::Event) + 'static,
        >(
            this: *mut ffi::GtkWidget,
            event: *mut gdk::ffi::GdkEvent,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(
                Widget::from_glib_borrow(this).unsafe_cast_ref(),
                &from_glib_none(event),
            )
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"event-after\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    event_after_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_focus<F: Fn(&Self, DirectionType) -> glib::signal::Inhibit + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId {
        unsafe extern "C" fn focus_trampoline<
            P: IsA<Widget>,
            F: Fn(&P, DirectionType) -> glib::signal::Inhibit + 'static,
        >(
            this: *mut ffi::GtkWidget,
            direction: ffi::GtkDirectionType,
            f: glib::ffi::gpointer,
        ) -> glib::ffi::gboolean {
            let f: &F = &*(f as *const F);
            f(
                Widget::from_glib_borrow(this).unsafe_cast_ref(),
                from_glib(direction),
            )
            .into_glib()
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"focus\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    focus_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_focus_in_event<F: Fn(&Self, &gdk::EventFocus) -> glib::signal::Inhibit + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId {
        unsafe extern "C" fn focus_in_event_trampoline<
            P: IsA<Widget>,
            F: Fn(&P, &gdk::EventFocus) -> glib::signal::Inhibit + 'static,
        >(
            this: *mut ffi::GtkWidget,
            event: *mut gdk::ffi::GdkEventFocus,
            f: glib::ffi::gpointer,
        ) -> glib::ffi::gboolean {
            let f: &F = &*(f as *const F);
            f(
                Widget::from_glib_borrow(this).unsafe_cast_ref(),
                &from_glib_borrow(event),
            )
            .into_glib()
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"focus-in-event\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    focus_in_event_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_focus_out_event<
        F: Fn(&Self, &gdk::EventFocus) -> glib::signal::Inhibit + 'static,
    >(
        &self,
        f: F,
    ) -> SignalHandlerId {
        unsafe extern "C" fn focus_out_event_trampoline<
            P: IsA<Widget>,
            F: Fn(&P, &gdk::EventFocus) -> glib::signal::Inhibit + 'static,
        >(
            this: *mut ffi::GtkWidget,
            event: *mut gdk::ffi::GdkEventFocus,
            f: glib::ffi::gpointer,
        ) -> glib::ffi::gboolean {
            let f: &F = &*(f as *const F);
            f(
                Widget::from_glib_borrow(this).unsafe_cast_ref(),
                &from_glib_borrow(event),
            )
            .into_glib()
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"focus-out-event\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    focus_out_event_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_grab_broken_event<
        F: Fn(&Self, &gdk::EventGrabBroken) -> glib::signal::Inhibit + 'static,
    >(
        &self,
        f: F,
    ) -> SignalHandlerId {
        unsafe extern "C" fn grab_broken_event_trampoline<
            P: IsA<Widget>,
            F: Fn(&P, &gdk::EventGrabBroken) -> glib::signal::Inhibit + 'static,
        >(
            this: *mut ffi::GtkWidget,
            event: *mut gdk::ffi::GdkEventGrabBroken,
            f: glib::ffi::gpointer,
        ) -> glib::ffi::gboolean {
            let f: &F = &*(f as *const F);
            f(
                Widget::from_glib_borrow(this).unsafe_cast_ref(),
                &from_glib_borrow(event),
            )
            .into_glib()
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"grab-broken-event\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    grab_broken_event_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_grab_focus<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn grab_focus_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
            this: *mut ffi::GtkWidget,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"grab-focus\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    grab_focus_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn emit_grab_focus(&self) {
        let _ = unsafe {
            glib::Object::from_glib_borrow(self.as_ptr() as *mut glib::gobject_ffi::GObject)
                .emit_by_name("grab-focus", &[])
                .unwrap()
        };
    }

    fn connect_grab_notify<F: Fn(&Self, bool) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn grab_notify_trampoline<P: IsA<Widget>, F: Fn(&P, bool) + 'static>(
            this: *mut ffi::GtkWidget,
            was_grabbed: glib::ffi::gboolean,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(
                Widget::from_glib_borrow(this).unsafe_cast_ref(),
                from_glib(was_grabbed),
            )
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"grab-notify\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    grab_notify_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_hide<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn hide_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
            this: *mut ffi::GtkWidget,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"hide\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    hide_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_hierarchy_changed<F: Fn(&Self, Option<&Widget>) + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId {
        unsafe extern "C" fn hierarchy_changed_trampoline<
            P: IsA<Widget>,
            F: Fn(&P, Option<&Widget>) + 'static,
        >(
            this: *mut ffi::GtkWidget,
            previous_toplevel: *mut ffi::GtkWidget,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(
                Widget::from_glib_borrow(this).unsafe_cast_ref(),
                Option::<Widget>::from_glib_borrow(previous_toplevel)
                    .as_ref()
                    .as_ref(),
            )
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"hierarchy-changed\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    hierarchy_changed_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_key_press_event<F: Fn(&Self, &gdk::EventKey) -> glib::signal::Inhibit + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId {
        unsafe extern "C" fn key_press_event_trampoline<
            P: IsA<Widget>,
            F: Fn(&P, &gdk::EventKey) -> glib::signal::Inhibit + 'static,
        >(
            this: *mut ffi::GtkWidget,
            event: *mut gdk::ffi::GdkEventKey,
            f: glib::ffi::gpointer,
        ) -> glib::ffi::gboolean {
            let f: &F = &*(f as *const F);
            f(
                Widget::from_glib_borrow(this).unsafe_cast_ref(),
                &from_glib_borrow(event),
            )
            .into_glib()
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"key-press-event\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    key_press_event_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_key_release_event<
        F: Fn(&Self, &gdk::EventKey) -> glib::signal::Inhibit + 'static,
    >(
        &self,
        f: F,
    ) -> SignalHandlerId {
        unsafe extern "C" fn key_release_event_trampoline<
            P: IsA<Widget>,
            F: Fn(&P, &gdk::EventKey) -> glib::signal::Inhibit + 'static,
        >(
            this: *mut ffi::GtkWidget,
            event: *mut gdk::ffi::GdkEventKey,
            f: glib::ffi::gpointer,
        ) -> glib::ffi::gboolean {
            let f: &F = &*(f as *const F);
            f(
                Widget::from_glib_borrow(this).unsafe_cast_ref(),
                &from_glib_borrow(event),
            )
            .into_glib()
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"key-release-event\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    key_release_event_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_keynav_failed<F: Fn(&Self, DirectionType) -> glib::signal::Inhibit + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId {
        unsafe extern "C" fn keynav_failed_trampoline<
            P: IsA<Widget>,
            F: Fn(&P, DirectionType) -> glib::signal::Inhibit + 'static,
        >(
            this: *mut ffi::GtkWidget,
            direction: ffi::GtkDirectionType,
            f: glib::ffi::gpointer,
        ) -> glib::ffi::gboolean {
            let f: &F = &*(f as *const F);
            f(
                Widget::from_glib_borrow(this).unsafe_cast_ref(),
                from_glib(direction),
            )
            .into_glib()
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"keynav-failed\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    keynav_failed_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_leave_notify_event<
        F: Fn(&Self, &gdk::EventCrossing) -> glib::signal::Inhibit + 'static,
    >(
        &self,
        f: F,
    ) -> SignalHandlerId {
        unsafe extern "C" fn leave_notify_event_trampoline<
            P: IsA<Widget>,
            F: Fn(&P, &gdk::EventCrossing) -> glib::signal::Inhibit + 'static,
        >(
            this: *mut ffi::GtkWidget,
            event: *mut gdk::ffi::GdkEventCrossing,
            f: glib::ffi::gpointer,
        ) -> glib::ffi::gboolean {
            let f: &F = &*(f as *const F);
            f(
                Widget::from_glib_borrow(this).unsafe_cast_ref(),
                &from_glib_borrow(event),
            )
            .into_glib()
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"leave-notify-event\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    leave_notify_event_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_map<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn map_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
            this: *mut ffi::GtkWidget,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"map\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    map_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_mnemonic_activate<F: Fn(&Self, bool) -> glib::signal::Inhibit + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId {
        unsafe extern "C" fn mnemonic_activate_trampoline<
            P: IsA<Widget>,
            F: Fn(&P, bool) -> glib::signal::Inhibit + 'static,
        >(
            this: *mut ffi::GtkWidget,
            group_cycling: glib::ffi::gboolean,
            f: glib::ffi::gpointer,
        ) -> glib::ffi::gboolean {
            let f: &F = &*(f as *const F);
            f(
                Widget::from_glib_borrow(this).unsafe_cast_ref(),
                from_glib(group_cycling),
            )
            .into_glib()
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"mnemonic-activate\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    mnemonic_activate_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_motion_notify_event<
        F: Fn(&Self, &gdk::EventMotion) -> glib::signal::Inhibit + 'static,
    >(
        &self,
        f: F,
    ) -> SignalHandlerId {
        unsafe extern "C" fn motion_notify_event_trampoline<
            P: IsA<Widget>,
            F: Fn(&P, &gdk::EventMotion) -> glib::signal::Inhibit + 'static,
        >(
            this: *mut ffi::GtkWidget,
            event: *mut gdk::ffi::GdkEventMotion,
            f: glib::ffi::gpointer,
        ) -> glib::ffi::gboolean {
            let f: &F = &*(f as *const F);
            f(
                Widget::from_glib_borrow(this).unsafe_cast_ref(),
                &from_glib_borrow(event),
            )
            .into_glib()
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"motion-notify-event\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    motion_notify_event_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_move_focus<F: Fn(&Self, DirectionType) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn move_focus_trampoline<
            P: IsA<Widget>,
            F: Fn(&P, DirectionType) + 'static,
        >(
            this: *mut ffi::GtkWidget,
            direction: ffi::GtkDirectionType,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(
                Widget::from_glib_borrow(this).unsafe_cast_ref(),
                from_glib(direction),
            )
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"move-focus\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    move_focus_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn emit_move_focus(&self, direction: DirectionType) {
        let _ = unsafe {
            glib::Object::from_glib_borrow(self.as_ptr() as *mut glib::gobject_ffi::GObject)
                .emit_by_name("move-focus", &[&direction])
                .unwrap()
        };
    }

    fn connect_parent_set<F: Fn(&Self, Option<&Widget>) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn parent_set_trampoline<
            P: IsA<Widget>,
            F: Fn(&P, Option<&Widget>) + 'static,
        >(
            this: *mut ffi::GtkWidget,
            old_parent: *mut ffi::GtkWidget,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(
                Widget::from_glib_borrow(this).unsafe_cast_ref(),
                Option::<Widget>::from_glib_borrow(old_parent)
                    .as_ref()
                    .as_ref(),
            )
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"parent-set\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    parent_set_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_popup_menu<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn popup_menu_trampoline<P: IsA<Widget>, F: Fn(&P) -> bool + 'static>(
            this: *mut ffi::GtkWidget,
            f: glib::ffi::gpointer,
        ) -> glib::ffi::gboolean {
            let f: &F = &*(f as *const F);
            f(Widget::from_glib_borrow(this).unsafe_cast_ref()).into_glib()
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"popup-menu\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    popup_menu_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn emit_popup_menu(&self) -> bool {
        let res = unsafe {
            glib::Object::from_glib_borrow(self.as_ptr() as *mut glib::gobject_ffi::GObject)
                .emit_by_name("popup-menu", &[])
                .unwrap()
        };
        res.unwrap()
            .get()
            .expect("Return Value for `emit_popup_menu`")
    }

    fn connect_property_notify_event<
        F: Fn(&Self, &gdk::EventProperty) -> glib::signal::Inhibit + 'static,
    >(
        &self,
        f: F,
    ) -> SignalHandlerId {
        unsafe extern "C" fn property_notify_event_trampoline<
            P: IsA<Widget>,
            F: Fn(&P, &gdk::EventProperty) -> glib::signal::Inhibit + 'static,
        >(
            this: *mut ffi::GtkWidget,
            event: *mut gdk::ffi::GdkEventProperty,
            f: glib::ffi::gpointer,
        ) -> glib::ffi::gboolean {
            let f: &F = &*(f as *const F);
            f(
                Widget::from_glib_borrow(this).unsafe_cast_ref(),
                &from_glib_borrow(event),
            )
            .into_glib()
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"property-notify-event\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    property_notify_event_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_proximity_in_event<
        F: Fn(&Self, &gdk::EventProximity) -> glib::signal::Inhibit + 'static,
    >(
        &self,
        f: F,
    ) -> SignalHandlerId {
        unsafe extern "C" fn proximity_in_event_trampoline<
            P: IsA<Widget>,
            F: Fn(&P, &gdk::EventProximity) -> glib::signal::Inhibit + 'static,
        >(
            this: *mut ffi::GtkWidget,
            event: *mut gdk::ffi::GdkEventProximity,
            f: glib::ffi::gpointer,
        ) -> glib::ffi::gboolean {
            let f: &F = &*(f as *const F);
            f(
                Widget::from_glib_borrow(this).unsafe_cast_ref(),
                &from_glib_borrow(event),
            )
            .into_glib()
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"proximity-in-event\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    proximity_in_event_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_proximity_out_event<
        F: Fn(&Self, &gdk::EventProximity) -> glib::signal::Inhibit + 'static,
    >(
        &self,
        f: F,
    ) -> SignalHandlerId {
        unsafe extern "C" fn proximity_out_event_trampoline<
            P: IsA<Widget>,
            F: Fn(&P, &gdk::EventProximity) -> glib::signal::Inhibit + 'static,
        >(
            this: *mut ffi::GtkWidget,
            event: *mut gdk::ffi::GdkEventProximity,
            f: glib::ffi::gpointer,
        ) -> glib::ffi::gboolean {
            let f: &F = &*(f as *const F);
            f(
                Widget::from_glib_borrow(this).unsafe_cast_ref(),
                &from_glib_borrow(event),
            )
            .into_glib()
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"proximity-out-event\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    proximity_out_event_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_query_tooltip<F: Fn(&Self, i32, i32, bool, &Tooltip) -> bool + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId {
        unsafe extern "C" fn query_tooltip_trampoline<
            P: IsA<Widget>,
            F: Fn(&P, i32, i32, bool, &Tooltip) -> bool + 'static,
        >(
            this: *mut ffi::GtkWidget,
            x: libc::c_int,
            y: libc::c_int,
            keyboard_mode: glib::ffi::gboolean,
            tooltip: *mut ffi::GtkTooltip,
            f: glib::ffi::gpointer,
        ) -> glib::ffi::gboolean {
            let f: &F = &*(f as *const F);
            f(
                Widget::from_glib_borrow(this).unsafe_cast_ref(),
                x,
                y,
                from_glib(keyboard_mode),
                &from_glib_borrow(tooltip),
            )
            .into_glib()
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"query-tooltip\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    query_tooltip_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_realize<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn realize_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
            this: *mut ffi::GtkWidget,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"realize\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    realize_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_screen_changed<F: Fn(&Self, Option<&gdk::Screen>) + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId {
        unsafe extern "C" fn screen_changed_trampoline<
            P: IsA<Widget>,
            F: Fn(&P, Option<&gdk::Screen>) + 'static,
        >(
            this: *mut ffi::GtkWidget,
            previous_screen: *mut gdk::ffi::GdkScreen,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(
                Widget::from_glib_borrow(this).unsafe_cast_ref(),
                Option::<gdk::Screen>::from_glib_borrow(previous_screen)
                    .as_ref()
                    .as_ref(),
            )
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"screen-changed\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    screen_changed_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_scroll_event<F: Fn(&Self, &gdk::EventScroll) -> glib::signal::Inhibit + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId {
        unsafe extern "C" fn scroll_event_trampoline<
            P: IsA<Widget>,
            F: Fn(&P, &gdk::EventScroll) -> glib::signal::Inhibit + 'static,
        >(
            this: *mut ffi::GtkWidget,
            event: *mut gdk::ffi::GdkEventScroll,
            f: glib::ffi::gpointer,
        ) -> glib::ffi::gboolean {
            let f: &F = &*(f as *const F);
            f(
                Widget::from_glib_borrow(this).unsafe_cast_ref(),
                &from_glib_borrow(event),
            )
            .into_glib()
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"scroll-event\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    scroll_event_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_selection_clear_event<
        F: Fn(&Self, &gdk::EventSelection) -> glib::signal::Inhibit + 'static,
    >(
        &self,
        f: F,
    ) -> SignalHandlerId {
        unsafe extern "C" fn selection_clear_event_trampoline<
            P: IsA<Widget>,
            F: Fn(&P, &gdk::EventSelection) -> glib::signal::Inhibit + 'static,
        >(
            this: *mut ffi::GtkWidget,
            event: *mut gdk::ffi::GdkEventSelection,
            f: glib::ffi::gpointer,
        ) -> glib::ffi::gboolean {
            let f: &F = &*(f as *const F);
            f(
                Widget::from_glib_borrow(this).unsafe_cast_ref(),
                &from_glib_borrow(event),
            )
            .into_glib()
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"selection-clear-event\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    selection_clear_event_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_selection_get<F: Fn(&Self, &SelectionData, u32, u32) + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId {
        unsafe extern "C" fn selection_get_trampoline<
            P: IsA<Widget>,
            F: Fn(&P, &SelectionData, u32, u32) + 'static,
        >(
            this: *mut ffi::GtkWidget,
            data: *mut ffi::GtkSelectionData,
            info: libc::c_uint,
            time: libc::c_uint,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(
                Widget::from_glib_borrow(this).unsafe_cast_ref(),
                &from_glib_borrow(data),
                info,
                time,
            )
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"selection-get\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    selection_get_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_selection_notify_event<
        F: Fn(&Self, &gdk::EventSelection) -> glib::signal::Inhibit + 'static,
    >(
        &self,
        f: F,
    ) -> SignalHandlerId {
        unsafe extern "C" fn selection_notify_event_trampoline<
            P: IsA<Widget>,
            F: Fn(&P, &gdk::EventSelection) -> glib::signal::Inhibit + 'static,
        >(
            this: *mut ffi::GtkWidget,
            event: *mut gdk::ffi::GdkEventSelection,
            f: glib::ffi::gpointer,
        ) -> glib::ffi::gboolean {
            let f: &F = &*(f as *const F);
            f(
                Widget::from_glib_borrow(this).unsafe_cast_ref(),
                &from_glib_borrow(event),
            )
            .into_glib()
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"selection-notify-event\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    selection_notify_event_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_selection_received<F: Fn(&Self, &SelectionData, u32) + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId {
        unsafe extern "C" fn selection_received_trampoline<
            P: IsA<Widget>,
            F: Fn(&P, &SelectionData, u32) + 'static,
        >(
            this: *mut ffi::GtkWidget,
            data: *mut ffi::GtkSelectionData,
            time: libc::c_uint,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(
                Widget::from_glib_borrow(this).unsafe_cast_ref(),
                &from_glib_borrow(data),
                time,
            )
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"selection-received\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    selection_received_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_selection_request_event<
        F: Fn(&Self, &gdk::EventSelection) -> glib::signal::Inhibit + 'static,
    >(
        &self,
        f: F,
    ) -> SignalHandlerId {
        unsafe extern "C" fn selection_request_event_trampoline<
            P: IsA<Widget>,
            F: Fn(&P, &gdk::EventSelection) -> glib::signal::Inhibit + 'static,
        >(
            this: *mut ffi::GtkWidget,
            event: *mut gdk::ffi::GdkEventSelection,
            f: glib::ffi::gpointer,
        ) -> glib::ffi::gboolean {
            let f: &F = &*(f as *const F);
            f(
                Widget::from_glib_borrow(this).unsafe_cast_ref(),
                &from_glib_borrow(event),
            )
            .into_glib()
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"selection-request-event\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    selection_request_event_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_show<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn show_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
            this: *mut ffi::GtkWidget,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"show\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    show_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_show_help<F: Fn(&Self, WidgetHelpType) -> bool + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId {
        unsafe extern "C" fn show_help_trampoline<
            P: IsA<Widget>,
            F: Fn(&P, WidgetHelpType) -> bool + 'static,
        >(
            this: *mut ffi::GtkWidget,
            help_type: ffi::GtkWidgetHelpType,
            f: glib::ffi::gpointer,
        ) -> glib::ffi::gboolean {
            let f: &F = &*(f as *const F);
            f(
                Widget::from_glib_borrow(this).unsafe_cast_ref(),
                from_glib(help_type),
            )
            .into_glib()
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"show-help\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    show_help_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn emit_show_help(&self, help_type: WidgetHelpType) -> bool {
        let res = unsafe {
            glib::Object::from_glib_borrow(self.as_ptr() as *mut glib::gobject_ffi::GObject)
                .emit_by_name("show-help", &[&help_type])
                .unwrap()
        };
        res.unwrap()
            .get()
            .expect("Return Value for `emit_show_help`")
    }

    fn connect_size_allocate<F: Fn(&Self, &Allocation) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn size_allocate_trampoline<
            P: IsA<Widget>,
            F: Fn(&P, &Allocation) + 'static,
        >(
            this: *mut ffi::GtkWidget,
            allocation: *mut ffi::GtkAllocation,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(
                Widget::from_glib_borrow(this).unsafe_cast_ref(),
                &from_glib_none(allocation),
            )
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"size-allocate\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    size_allocate_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_state_flags_changed<F: Fn(&Self, StateFlags) + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId {
        unsafe extern "C" fn state_flags_changed_trampoline<
            P: IsA<Widget>,
            F: Fn(&P, StateFlags) + 'static,
        >(
            this: *mut ffi::GtkWidget,
            flags: ffi::GtkStateFlags,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(
                Widget::from_glib_borrow(this).unsafe_cast_ref(),
                from_glib(flags),
            )
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"state-flags-changed\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    state_flags_changed_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_style_updated<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn style_updated_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
            this: *mut ffi::GtkWidget,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"style-updated\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    style_updated_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_touch_event<F: Fn(&Self, &gdk::Event) -> glib::signal::Inhibit + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId {
        unsafe extern "C" fn touch_event_trampoline<
            P: IsA<Widget>,
            F: Fn(&P, &gdk::Event) -> glib::signal::Inhibit + 'static,
        >(
            this: *mut ffi::GtkWidget,
            object: *mut gdk::ffi::GdkEvent,
            f: glib::ffi::gpointer,
        ) -> glib::ffi::gboolean {
            let f: &F = &*(f as *const F);
            f(
                Widget::from_glib_borrow(this).unsafe_cast_ref(),
                &from_glib_none(object),
            )
            .into_glib()
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"touch-event\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    touch_event_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_unmap<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn unmap_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
            this: *mut ffi::GtkWidget,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"unmap\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    unmap_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_unrealize<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn unrealize_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
            this: *mut ffi::GtkWidget,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"unrealize\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    unrealize_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_window_state_event<
        F: Fn(&Self, &gdk::EventWindowState) -> glib::signal::Inhibit + 'static,
    >(
        &self,
        f: F,
    ) -> SignalHandlerId {
        unsafe extern "C" fn window_state_event_trampoline<
            P: IsA<Widget>,
            F: Fn(&P, &gdk::EventWindowState) -> glib::signal::Inhibit + 'static,
        >(
            this: *mut ffi::GtkWidget,
            event: *mut gdk::ffi::GdkEventWindowState,
            f: glib::ffi::gpointer,
        ) -> glib::ffi::gboolean {
            let f: &F = &*(f as *const F);
            f(
                Widget::from_glib_borrow(this).unsafe_cast_ref(),
                &from_glib_borrow(event),
            )
            .into_glib()
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"window-state-event\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    window_state_event_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_app_paintable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_app_paintable_trampoline<
            P: IsA<Widget>,
            F: Fn(&P) + 'static,
        >(
            this: *mut ffi::GtkWidget,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::app-paintable\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_app_paintable_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_can_default_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_can_default_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
            this: *mut ffi::GtkWidget,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::can-default\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_can_default_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_can_focus_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_can_focus_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
            this: *mut ffi::GtkWidget,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::can-focus\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_can_focus_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_composite_child_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_composite_child_trampoline<
            P: IsA<Widget>,
            F: Fn(&P) + 'static,
        >(
            this: *mut ffi::GtkWidget,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::composite-child\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_composite_child_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_events_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_events_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
            this: *mut ffi::GtkWidget,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::events\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_events_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_expand_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_expand_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
            this: *mut ffi::GtkWidget,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::expand\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_expand_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    #[cfg(any(feature = "v3_20", feature = "dox"))]
    #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
    fn connect_focus_on_click_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_focus_on_click_trampoline<
            P: IsA<Widget>,
            F: Fn(&P) + 'static,
        >(
            this: *mut ffi::GtkWidget,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::focus-on-click\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_focus_on_click_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_halign_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_halign_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
            this: *mut ffi::GtkWidget,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::halign\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_halign_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_has_default_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_has_default_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
            this: *mut ffi::GtkWidget,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::has-default\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_has_default_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_has_focus_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_has_focus_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
            this: *mut ffi::GtkWidget,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::has-focus\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_has_focus_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_has_tooltip_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_has_tooltip_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
            this: *mut ffi::GtkWidget,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::has-tooltip\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_has_tooltip_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_height_request_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_height_request_trampoline<
            P: IsA<Widget>,
            F: Fn(&P) + 'static,
        >(
            this: *mut ffi::GtkWidget,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::height-request\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_height_request_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_hexpand_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_hexpand_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
            this: *mut ffi::GtkWidget,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::hexpand\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_hexpand_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_hexpand_set_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_hexpand_set_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
            this: *mut ffi::GtkWidget,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::hexpand-set\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_hexpand_set_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_is_focus_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_is_focus_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
            this: *mut ffi::GtkWidget,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::is-focus\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_is_focus_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_margin_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_margin_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
            this: *mut ffi::GtkWidget,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::margin\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_margin_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_margin_bottom_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_margin_bottom_trampoline<
            P: IsA<Widget>,
            F: Fn(&P) + 'static,
        >(
            this: *mut ffi::GtkWidget,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::margin-bottom\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_margin_bottom_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_margin_end_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_margin_end_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
            this: *mut ffi::GtkWidget,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::margin-end\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_margin_end_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_margin_start_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_margin_start_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
            this: *mut ffi::GtkWidget,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::margin-start\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_margin_start_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_margin_top_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_margin_top_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
            this: *mut ffi::GtkWidget,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::margin-top\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_margin_top_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_name_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
            this: *mut ffi::GtkWidget,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::name\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_name_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_no_show_all_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_no_show_all_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
            this: *mut ffi::GtkWidget,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::no-show-all\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_no_show_all_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_opacity_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_opacity_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
            this: *mut ffi::GtkWidget,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::opacity\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_opacity_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_parent_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_parent_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
            this: *mut ffi::GtkWidget,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::parent\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_parent_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_receives_default_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_receives_default_trampoline<
            P: IsA<Widget>,
            F: Fn(&P) + 'static,
        >(
            this: *mut ffi::GtkWidget,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::receives-default\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_receives_default_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_scale_factor_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_scale_factor_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
            this: *mut ffi::GtkWidget,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::scale-factor\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_scale_factor_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_sensitive_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_sensitive_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
            this: *mut ffi::GtkWidget,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::sensitive\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_sensitive_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_tooltip_markup_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_tooltip_markup_trampoline<
            P: IsA<Widget>,
            F: Fn(&P) + 'static,
        >(
            this: *mut ffi::GtkWidget,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::tooltip-markup\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_tooltip_markup_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_tooltip_text_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_tooltip_text_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
            this: *mut ffi::GtkWidget,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::tooltip-text\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_tooltip_text_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_valign_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_valign_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
            this: *mut ffi::GtkWidget,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::valign\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_valign_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_vexpand_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_vexpand_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
            this: *mut ffi::GtkWidget,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::vexpand\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_vexpand_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_vexpand_set_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_vexpand_set_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
            this: *mut ffi::GtkWidget,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::vexpand-set\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_vexpand_set_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_visible_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_visible_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
            this: *mut ffi::GtkWidget,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::visible\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_visible_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_width_request_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_width_request_trampoline<
            P: IsA<Widget>,
            F: Fn(&P) + 'static,
        >(
            this: *mut ffi::GtkWidget,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::width-request\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_width_request_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_window_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_window_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
            this: *mut ffi::GtkWidget,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Widget::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::window\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_window_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }
}