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
// 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::AccelGroup;
use crate::Align;
use crate::Application;
use crate::Bin;
use crate::Buildable;
use crate::Container;
use crate::ResizeMode;
use crate::Widget;
use crate::WindowGroup;
use crate::WindowPosition;
use crate::WindowType;
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;
use std::ptr;

glib::wrapper! {
    /// A GtkWindow is a toplevel window which can contain other widgets.
    /// Windows normally have decorations that are under the control
    /// of the windowing system and allow the user to manipulate the window
    /// (resize it, move it, close it,...).
    ///
    /// # GtkWindow as GtkBuildable
    ///
    /// The GtkWindow implementation of the [`Buildable`][crate::Buildable] interface supports a
    /// custom ``<accel-groups>`` element, which supports any number of ``<group>``
    /// elements representing the [`AccelGroup`][crate::AccelGroup] objects you want to add to
    /// your window (synonymous with [`GtkWindowExt::add_accel_group()`][crate::prelude::GtkWindowExt::add_accel_group()].
    ///
    /// It also supports the ``<initial-focus>`` element, whose name property names
    /// the widget to receive the focus when the window is mapped.
    ///
    /// An example of a UI definition fragment with accel groups:
    ///
    ///
    ///
    /// **⚠️ The following code is in xml ⚠️**
    ///
    /// ```xml
    /// <object class="GtkWindow">
    ///   <accel-groups>
    ///     <group name="accelgroup1"/>
    ///   </accel-groups>
    ///   <initial-focus name="thunderclap"/>
    /// </object>
    ///
    /// ...
    ///
    /// <object class="GtkAccelGroup" id="accelgroup1"/>
    /// ```
    ///
    /// The GtkWindow implementation of the [`Buildable`][crate::Buildable] interface supports
    /// setting a child as the titlebar by specifying “titlebar” as the “type”
    /// attribute of a ``<child>`` element.
    ///
    /// # CSS nodes
    ///
    ///
    ///
    /// **⚠️ The following code is in plain ⚠️**
    ///
    /// ```plain
    /// window.background
    /// ├── decoration
    /// ├── <titlebar child>.titlebar [.default-decoration]
    /// ╰── <child>
    /// ```
    ///
    /// GtkWindow has a main CSS node with name window and style class .background,
    /// and a subnode with name decoration.
    ///
    /// Style classes that are typically used with the main CSS node are .csd (when
    /// client-side decorations are in use), .solid-csd (for client-side decorations
    /// without invisible borders), .ssd (used by mutter when rendering server-side
    /// decorations). GtkWindow also represents window states with the following
    /// style classes on the main node: .tiled, .maximized, .fullscreen. Specialized
    /// types of window often add their own discriminating style classes, such as
    /// .popup or .tooltip.
    ///
    /// GtkWindow adds the .titlebar and .default-decoration style classes to the
    /// widget that is added as a titlebar child.
    ///
    /// # Implements
    ///
    /// [`GtkWindowExt`][trait@crate::prelude::GtkWindowExt], [`BinExt`][trait@crate::prelude::BinExt], [`ContainerExt`][trait@crate::prelude::ContainerExt], [`WidgetExt`][trait@crate::prelude::WidgetExt], [`trait@glib::ObjectExt`], [`BuildableExt`][trait@crate::prelude::BuildableExt], [`GtkWindowExtManual`][trait@crate::prelude::GtkWindowExtManual], [`ContainerExtManual`][trait@crate::prelude::ContainerExtManual], [`WidgetExtManual`][trait@crate::prelude::WidgetExtManual], [`BuildableExtManual`][trait@crate::prelude::BuildableExtManual]
    #[doc(alias = "GtkWindow")]
    pub struct Window(Object<ffi::GtkWindow, ffi::GtkWindowClass>) @extends Bin, Container, Widget, @implements Buildable;

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

impl Window {
    pub const NONE: Option<&'static Window> = None;

    /// Creates a new [`Window`][crate::Window], which is a toplevel window that can
    /// contain other widgets. Nearly always, the type of the window should
    /// be [`WindowType::Toplevel`][crate::WindowType::Toplevel]. If you’re implementing something like a
    /// popup menu from scratch (which is a bad idea, just use [`Menu`][crate::Menu]),
    /// you might use [`WindowType::Popup`][crate::WindowType::Popup]. [`WindowType::Popup`][crate::WindowType::Popup] is not for
    /// dialogs, though in some other toolkits dialogs are called “popups”.
    /// In GTK+, [`WindowType::Popup`][crate::WindowType::Popup] means a pop-up menu or pop-up tooltip.
    /// On X11, popup windows are not controlled by the
    /// [window manager][gtk-X11-arch].
    ///
    /// If you simply want an undecorated window (no window borders), use
    /// [`GtkWindowExt::set_decorated()`][crate::prelude::GtkWindowExt::set_decorated()], don’t use [`WindowType::Popup`][crate::WindowType::Popup].
    ///
    /// All top-level windows created by [`new()`][Self::new()] are stored in
    /// an internal top-level window list. This list can be obtained from
    /// [`list_toplevels()`][Self::list_toplevels()]. Due to Gtk+ keeping a reference to
    /// the window internally, [`new()`][Self::new()] does not return a reference
    /// to the caller.
    ///
    /// To delete a [`Window`][crate::Window], call `gtk_widget_destroy()`.
    /// ## `type_`
    /// type of window
    ///
    /// # Returns
    ///
    /// a new [`Window`][crate::Window].
    #[doc(alias = "gtk_window_new")]
    pub fn new(type_: WindowType) -> Window {
        assert_initialized_main_thread!();
        unsafe { Widget::from_glib_none(ffi::gtk_window_new(type_.into_glib())).unsafe_cast() }
    }

    // rustdoc-stripper-ignore-next
    /// Creates a new builder-pattern struct instance to construct [`Window`] objects.
    ///
    /// This method returns an instance of [`WindowBuilder`](crate::builders::WindowBuilder) which can be used to create [`Window`] objects.
    pub fn builder() -> WindowBuilder {
        WindowBuilder::default()
    }

    /// Gets the value set by [`set_default_icon_list()`][Self::set_default_icon_list()].
    /// The list is a copy and should be freed with `g_list_free()`,
    /// but the pixbufs in the list have not had their reference count
    /// incremented.
    ///
    /// # Returns
    ///
    /// copy of default icon list
    #[doc(alias = "gtk_window_get_default_icon_list")]
    #[doc(alias = "get_default_icon_list")]
    pub fn default_icon_list() -> Vec<gdk_pixbuf::Pixbuf> {
        assert_initialized_main_thread!();
        unsafe {
            FromGlibPtrContainer::from_glib_container(ffi::gtk_window_get_default_icon_list())
        }
    }

    /// Returns the fallback icon name for windows that has been set
    /// with [`set_default_icon_name()`][Self::set_default_icon_name()]. The returned
    /// string is owned by GTK+ and should not be modified. It
    /// is only valid until the next call to
    /// [`set_default_icon_name()`][Self::set_default_icon_name()].
    ///
    /// # Returns
    ///
    /// the fallback icon name for windows
    #[doc(alias = "gtk_window_get_default_icon_name")]
    #[doc(alias = "get_default_icon_name")]
    pub fn default_icon_name() -> Option<glib::GString> {
        assert_initialized_main_thread!();
        unsafe { from_glib_none(ffi::gtk_window_get_default_icon_name()) }
    }

    /// Returns a list of all existing toplevel windows. 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
    ///
    /// list of toplevel widgets
    #[doc(alias = "gtk_window_list_toplevels")]
    pub fn list_toplevels() -> Vec<Widget> {
        assert_initialized_main_thread!();
        unsafe { FromGlibPtrContainer::from_glib_container(ffi::gtk_window_list_toplevels()) }
    }

    /// By default, after showing the first [`Window`][crate::Window], GTK+ calls
    /// `gdk_notify_startup_complete()`. Call this function to disable
    /// the automatic startup notification. You might do this if your
    /// first window is a splash screen, and you want to delay notification
    /// until after your real main window has been shown, for example.
    ///
    /// In that example, you would disable startup notification
    /// temporarily, show your splash screen, then re-enable it so that
    /// showing the main window would automatically result in notification.
    /// ## `setting`
    /// [`true`] to automatically do startup notification
    #[doc(alias = "gtk_window_set_auto_startup_notification")]
    pub fn set_auto_startup_notification(setting: bool) {
        assert_initialized_main_thread!();
        unsafe {
            ffi::gtk_window_set_auto_startup_notification(setting.into_glib());
        }
    }

    /// Sets an icon to be used as fallback for windows that haven't
    /// had [`GtkWindowExt::set_icon()`][crate::prelude::GtkWindowExt::set_icon()] called on them from a pixbuf.
    /// ## `icon`
    /// the icon
    #[doc(alias = "gtk_window_set_default_icon")]
    pub fn set_default_icon(icon: &gdk_pixbuf::Pixbuf) {
        assert_initialized_main_thread!();
        unsafe {
            ffi::gtk_window_set_default_icon(icon.to_glib_none().0);
        }
    }

    /// Sets an icon to be used as fallback for windows that haven't
    /// had [`GtkWindowExt::set_icon_list()`][crate::prelude::GtkWindowExt::set_icon_list()] called on them from a file
    /// on disk. Warns on failure if `err` is [`None`].
    /// ## `filename`
    /// location of icon file
    ///
    /// # Returns
    ///
    /// [`true`] if setting the icon succeeded.
    #[doc(alias = "gtk_window_set_default_icon_from_file")]
    pub fn set_default_icon_from_file(
        filename: impl AsRef<std::path::Path>,
    ) -> Result<(), glib::Error> {
        assert_initialized_main_thread!();
        unsafe {
            let mut error = ptr::null_mut();
            let is_ok = ffi::gtk_window_set_default_icon_from_file(
                filename.as_ref().to_glib_none().0,
                &mut error,
            );
            assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
            if error.is_null() {
                Ok(())
            } else {
                Err(from_glib_full(error))
            }
        }
    }

    /// Sets an icon list to be used as fallback for windows that haven't
    /// had [`GtkWindowExt::set_icon_list()`][crate::prelude::GtkWindowExt::set_icon_list()] called on them to set up a
    /// window-specific icon list. This function allows you to set up the
    /// icon for all windows in your app at once.
    ///
    /// See [`GtkWindowExt::set_icon_list()`][crate::prelude::GtkWindowExt::set_icon_list()] for more details.
    /// ## `list`
    /// a list of [`gdk_pixbuf::Pixbuf`][crate::gdk_pixbuf::Pixbuf]
    #[doc(alias = "gtk_window_set_default_icon_list")]
    pub fn set_default_icon_list(list: &[gdk_pixbuf::Pixbuf]) {
        assert_initialized_main_thread!();
        unsafe {
            ffi::gtk_window_set_default_icon_list(list.to_glib_container().0);
        }
    }

    /// Sets an icon to be used as fallback for windows that haven't
    /// had [`GtkWindowExt::set_icon_list()`][crate::prelude::GtkWindowExt::set_icon_list()] called on them from a named
    /// themed icon, see [`GtkWindowExt::set_icon_name()`][crate::prelude::GtkWindowExt::set_icon_name()].
    /// ## `name`
    /// the name of the themed icon
    #[doc(alias = "gtk_window_set_default_icon_name")]
    pub fn set_default_icon_name(name: &str) {
        assert_initialized_main_thread!();
        unsafe {
            ffi::gtk_window_set_default_icon_name(name.to_glib_none().0);
        }
    }

    /// Opens or closes the [interactive debugger][interactive-debugging],
    /// which offers access to the widget hierarchy of the application
    /// and to useful debugging tools.
    /// ## `enable`
    /// [`true`] to enable interactive debugging
    #[doc(alias = "gtk_window_set_interactive_debugging")]
    pub fn set_interactive_debugging(enable: bool) {
        assert_initialized_main_thread!();
        unsafe {
            ffi::gtk_window_set_interactive_debugging(enable.into_glib());
        }
    }
}

impl Default for Window {
    fn default() -> Self {
        glib::object::Object::new::<Self>(&[])
            .expect("Can't construct Window object with default parameters")
    }
}

#[derive(Clone, Default)]
// rustdoc-stripper-ignore-next
/// A [builder-pattern] type to construct [`Window`] objects.
///
/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
#[must_use = "The builder must be built to be used"]
pub struct WindowBuilder {
    accept_focus: Option<bool>,
    application: Option<Application>,
    attached_to: Option<Widget>,
    decorated: Option<bool>,
    default_height: Option<i32>,
    default_width: Option<i32>,
    deletable: Option<bool>,
    destroy_with_parent: Option<bool>,
    focus_on_map: Option<bool>,
    focus_visible: Option<bool>,
    gravity: Option<gdk::Gravity>,
    hide_titlebar_when_maximized: Option<bool>,
    icon: Option<gdk_pixbuf::Pixbuf>,
    icon_name: Option<String>,
    mnemonics_visible: Option<bool>,
    modal: Option<bool>,
    resizable: Option<bool>,
    role: Option<String>,
    screen: Option<gdk::Screen>,
    skip_pager_hint: Option<bool>,
    skip_taskbar_hint: Option<bool>,
    startup_id: Option<String>,
    title: Option<String>,
    transient_for: Option<Window>,
    type_: Option<WindowType>,
    type_hint: Option<gdk::WindowTypeHint>,
    urgency_hint: Option<bool>,
    window_position: Option<WindowPosition>,
    border_width: Option<u32>,
    child: Option<Widget>,
    resize_mode: Option<ResizeMode>,
    app_paintable: Option<bool>,
    can_default: Option<bool>,
    can_focus: Option<bool>,
    events: Option<gdk::EventMask>,
    expand: Option<bool>,
    #[cfg(any(feature = "v3_20", feature = "dox"))]
    #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
    focus_on_click: Option<bool>,
    halign: Option<Align>,
    has_default: Option<bool>,
    has_focus: Option<bool>,
    has_tooltip: Option<bool>,
    height_request: Option<i32>,
    hexpand: Option<bool>,
    hexpand_set: Option<bool>,
    is_focus: Option<bool>,
    margin: Option<i32>,
    margin_bottom: Option<i32>,
    margin_end: Option<i32>,
    margin_start: Option<i32>,
    margin_top: Option<i32>,
    name: Option<String>,
    no_show_all: Option<bool>,
    opacity: Option<f64>,
    parent: Option<Container>,
    receives_default: Option<bool>,
    sensitive: Option<bool>,
    tooltip_markup: Option<String>,
    tooltip_text: Option<String>,
    valign: Option<Align>,
    vexpand: Option<bool>,
    vexpand_set: Option<bool>,
    visible: Option<bool>,
    width_request: Option<i32>,
}

impl WindowBuilder {
    // rustdoc-stripper-ignore-next
    /// Create a new [`WindowBuilder`].
    pub fn new() -> Self {
        Self::default()
    }

    // rustdoc-stripper-ignore-next
    /// Build the [`Window`].
    #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
    pub fn build(self) -> Window {
        let mut properties: Vec<(&str, &dyn ToValue)> = vec![];
        if let Some(ref accept_focus) = self.accept_focus {
            properties.push(("accept-focus", accept_focus));
        }
        if let Some(ref application) = self.application {
            properties.push(("application", application));
        }
        if let Some(ref attached_to) = self.attached_to {
            properties.push(("attached-to", attached_to));
        }
        if let Some(ref decorated) = self.decorated {
            properties.push(("decorated", decorated));
        }
        if let Some(ref default_height) = self.default_height {
            properties.push(("default-height", default_height));
        }
        if let Some(ref default_width) = self.default_width {
            properties.push(("default-width", default_width));
        }
        if let Some(ref deletable) = self.deletable {
            properties.push(("deletable", deletable));
        }
        if let Some(ref destroy_with_parent) = self.destroy_with_parent {
            properties.push(("destroy-with-parent", destroy_with_parent));
        }
        if let Some(ref focus_on_map) = self.focus_on_map {
            properties.push(("focus-on-map", focus_on_map));
        }
        if let Some(ref focus_visible) = self.focus_visible {
            properties.push(("focus-visible", focus_visible));
        }
        if let Some(ref gravity) = self.gravity {
            properties.push(("gravity", gravity));
        }
        if let Some(ref hide_titlebar_when_maximized) = self.hide_titlebar_when_maximized {
            properties.push(("hide-titlebar-when-maximized", hide_titlebar_when_maximized));
        }
        if let Some(ref icon) = self.icon {
            properties.push(("icon", icon));
        }
        if let Some(ref icon_name) = self.icon_name {
            properties.push(("icon-name", icon_name));
        }
        if let Some(ref mnemonics_visible) = self.mnemonics_visible {
            properties.push(("mnemonics-visible", mnemonics_visible));
        }
        if let Some(ref modal) = self.modal {
            properties.push(("modal", modal));
        }
        if let Some(ref resizable) = self.resizable {
            properties.push(("resizable", resizable));
        }
        if let Some(ref role) = self.role {
            properties.push(("role", role));
        }
        if let Some(ref screen) = self.screen {
            properties.push(("screen", screen));
        }
        if let Some(ref skip_pager_hint) = self.skip_pager_hint {
            properties.push(("skip-pager-hint", skip_pager_hint));
        }
        if let Some(ref skip_taskbar_hint) = self.skip_taskbar_hint {
            properties.push(("skip-taskbar-hint", skip_taskbar_hint));
        }
        if let Some(ref startup_id) = self.startup_id {
            properties.push(("startup-id", startup_id));
        }
        if let Some(ref title) = self.title {
            properties.push(("title", title));
        }
        if let Some(ref transient_for) = self.transient_for {
            properties.push(("transient-for", transient_for));
        }
        if let Some(ref type_) = self.type_ {
            properties.push(("type", type_));
        }
        if let Some(ref type_hint) = self.type_hint {
            properties.push(("type-hint", type_hint));
        }
        if let Some(ref urgency_hint) = self.urgency_hint {
            properties.push(("urgency-hint", urgency_hint));
        }
        if let Some(ref window_position) = self.window_position {
            properties.push(("window-position", window_position));
        }
        if let Some(ref border_width) = self.border_width {
            properties.push(("border-width", border_width));
        }
        if let Some(ref child) = self.child {
            properties.push(("child", child));
        }
        if let Some(ref resize_mode) = self.resize_mode {
            properties.push(("resize-mode", resize_mode));
        }
        if let Some(ref app_paintable) = self.app_paintable {
            properties.push(("app-paintable", app_paintable));
        }
        if let Some(ref can_default) = self.can_default {
            properties.push(("can-default", can_default));
        }
        if let Some(ref can_focus) = self.can_focus {
            properties.push(("can-focus", can_focus));
        }
        if let Some(ref events) = self.events {
            properties.push(("events", events));
        }
        if let Some(ref expand) = self.expand {
            properties.push(("expand", expand));
        }
        #[cfg(any(feature = "v3_20", feature = "dox"))]
        if let Some(ref focus_on_click) = self.focus_on_click {
            properties.push(("focus-on-click", focus_on_click));
        }
        if let Some(ref halign) = self.halign {
            properties.push(("halign", halign));
        }
        if let Some(ref has_default) = self.has_default {
            properties.push(("has-default", has_default));
        }
        if let Some(ref has_focus) = self.has_focus {
            properties.push(("has-focus", has_focus));
        }
        if let Some(ref has_tooltip) = self.has_tooltip {
            properties.push(("has-tooltip", has_tooltip));
        }
        if let Some(ref height_request) = self.height_request {
            properties.push(("height-request", height_request));
        }
        if let Some(ref hexpand) = self.hexpand {
            properties.push(("hexpand", hexpand));
        }
        if let Some(ref hexpand_set) = self.hexpand_set {
            properties.push(("hexpand-set", hexpand_set));
        }
        if let Some(ref is_focus) = self.is_focus {
            properties.push(("is-focus", is_focus));
        }
        if let Some(ref margin) = self.margin {
            properties.push(("margin", margin));
        }
        if let Some(ref margin_bottom) = self.margin_bottom {
            properties.push(("margin-bottom", margin_bottom));
        }
        if let Some(ref margin_end) = self.margin_end {
            properties.push(("margin-end", margin_end));
        }
        if let Some(ref margin_start) = self.margin_start {
            properties.push(("margin-start", margin_start));
        }
        if let Some(ref margin_top) = self.margin_top {
            properties.push(("margin-top", margin_top));
        }
        if let Some(ref name) = self.name {
            properties.push(("name", name));
        }
        if let Some(ref no_show_all) = self.no_show_all {
            properties.push(("no-show-all", no_show_all));
        }
        if let Some(ref opacity) = self.opacity {
            properties.push(("opacity", opacity));
        }
        if let Some(ref parent) = self.parent {
            properties.push(("parent", parent));
        }
        if let Some(ref receives_default) = self.receives_default {
            properties.push(("receives-default", receives_default));
        }
        if let Some(ref sensitive) = self.sensitive {
            properties.push(("sensitive", sensitive));
        }
        if let Some(ref tooltip_markup) = self.tooltip_markup {
            properties.push(("tooltip-markup", tooltip_markup));
        }
        if let Some(ref tooltip_text) = self.tooltip_text {
            properties.push(("tooltip-text", tooltip_text));
        }
        if let Some(ref valign) = self.valign {
            properties.push(("valign", valign));
        }
        if let Some(ref vexpand) = self.vexpand {
            properties.push(("vexpand", vexpand));
        }
        if let Some(ref vexpand_set) = self.vexpand_set {
            properties.push(("vexpand-set", vexpand_set));
        }
        if let Some(ref visible) = self.visible {
            properties.push(("visible", visible));
        }
        if let Some(ref width_request) = self.width_request {
            properties.push(("width-request", width_request));
        }
        glib::Object::new::<Window>(&properties).expect("Failed to create an instance of Window")
    }

    /// Whether the window should receive the input focus.
    pub fn accept_focus(mut self, accept_focus: bool) -> Self {
        self.accept_focus = Some(accept_focus);
        self
    }

    /// The [`Application`][crate::Application] associated with the window.
    ///
    /// The application will be kept alive for at least as long as it
    /// has any windows associated with it (see [`ApplicationExtManual::hold()`][crate::gio::prelude::ApplicationExtManual::hold()]
    /// for a way to keep it alive without windows).
    ///
    /// Normally, the connection between the application and the window
    /// will remain until the window is destroyed, but you can explicitly
    /// remove it by setting the :application property to [`None`].
    pub fn application(mut self, application: &impl IsA<Application>) -> Self {
        self.application = Some(application.clone().upcast());
        self
    }

    /// The widget to which this window is attached.
    /// See [`GtkWindowExt::set_attached_to()`][crate::prelude::GtkWindowExt::set_attached_to()].
    ///
    /// Examples of places where specifying this relation is useful are
    /// for instance a [`Menu`][crate::Menu] created by a [`ComboBox`][crate::ComboBox], a completion
    /// popup window created by [`Entry`][crate::Entry] or a typeahead search entry
    /// created by [`TreeView`][crate::TreeView].
    pub fn attached_to(mut self, attached_to: &impl IsA<Widget>) -> Self {
        self.attached_to = Some(attached_to.clone().upcast());
        self
    }

    /// Whether the window should be decorated by the window manager.
    pub fn decorated(mut self, decorated: bool) -> Self {
        self.decorated = Some(decorated);
        self
    }

    pub fn default_height(mut self, default_height: i32) -> Self {
        self.default_height = Some(default_height);
        self
    }

    pub fn default_width(mut self, default_width: i32) -> Self {
        self.default_width = Some(default_width);
        self
    }

    /// Whether the window frame should have a close button.
    pub fn deletable(mut self, deletable: bool) -> Self {
        self.deletable = Some(deletable);
        self
    }

    pub fn destroy_with_parent(mut self, destroy_with_parent: bool) -> Self {
        self.destroy_with_parent = Some(destroy_with_parent);
        self
    }

    /// Whether the window should receive the input focus when mapped.
    pub fn focus_on_map(mut self, focus_on_map: bool) -> Self {
        self.focus_on_map = Some(focus_on_map);
        self
    }

    /// Whether 'focus rectangles' are currently visible in this window.
    ///
    /// This property is maintained by GTK+ based on user input
    /// and should not be set by applications.
    pub fn focus_visible(mut self, focus_visible: bool) -> Self {
        self.focus_visible = Some(focus_visible);
        self
    }

    /// The window gravity of the window. See [`GtkWindowExt::move_()`][crate::prelude::GtkWindowExt::move_()] and [`gdk::Gravity`][crate::gdk::Gravity] for
    /// more details about window gravity.
    pub fn gravity(mut self, gravity: gdk::Gravity) -> Self {
        self.gravity = Some(gravity);
        self
    }

    /// Whether the titlebar should be hidden during maximization.
    pub fn hide_titlebar_when_maximized(mut self, hide_titlebar_when_maximized: bool) -> Self {
        self.hide_titlebar_when_maximized = Some(hide_titlebar_when_maximized);
        self
    }

    pub fn icon(mut self, icon: &gdk_pixbuf::Pixbuf) -> Self {
        self.icon = Some(icon.clone());
        self
    }

    /// The :icon-name property specifies the name of the themed icon to
    /// use as the window icon. See [`IconTheme`][crate::IconTheme] for more details.
    pub fn icon_name(mut self, icon_name: &str) -> Self {
        self.icon_name = Some(icon_name.to_string());
        self
    }

    /// Whether mnemonics are currently visible in this window.
    ///
    /// This property is maintained by GTK+ based on user input,
    /// and should not be set by applications.
    pub fn mnemonics_visible(mut self, mnemonics_visible: bool) -> Self {
        self.mnemonics_visible = Some(mnemonics_visible);
        self
    }

    pub fn modal(mut self, modal: bool) -> Self {
        self.modal = Some(modal);
        self
    }

    pub fn resizable(mut self, resizable: bool) -> Self {
        self.resizable = Some(resizable);
        self
    }

    pub fn role(mut self, role: &str) -> Self {
        self.role = Some(role.to_string());
        self
    }

    pub fn screen(mut self, screen: &gdk::Screen) -> Self {
        self.screen = Some(screen.clone());
        self
    }

    pub fn skip_pager_hint(mut self, skip_pager_hint: bool) -> Self {
        self.skip_pager_hint = Some(skip_pager_hint);
        self
    }

    pub fn skip_taskbar_hint(mut self, skip_taskbar_hint: bool) -> Self {
        self.skip_taskbar_hint = Some(skip_taskbar_hint);
        self
    }

    /// The :startup-id is a write-only property for setting window's
    /// startup notification identifier. See [`GtkWindowExt::set_startup_id()`][crate::prelude::GtkWindowExt::set_startup_id()]
    /// for more details.
    pub fn startup_id(mut self, startup_id: &str) -> Self {
        self.startup_id = Some(startup_id.to_string());
        self
    }

    pub fn title(mut self, title: &str) -> Self {
        self.title = Some(title.to_string());
        self
    }

    /// The transient parent of the window. See [`GtkWindowExt::set_transient_for()`][crate::prelude::GtkWindowExt::set_transient_for()] for
    /// more details about transient windows.
    pub fn transient_for(mut self, transient_for: &impl IsA<Window>) -> Self {
        self.transient_for = Some(transient_for.clone().upcast());
        self
    }

    pub fn type_(mut self, type_: WindowType) -> Self {
        self.type_ = Some(type_);
        self
    }

    pub fn type_hint(mut self, type_hint: gdk::WindowTypeHint) -> Self {
        self.type_hint = Some(type_hint);
        self
    }

    pub fn urgency_hint(mut self, urgency_hint: bool) -> Self {
        self.urgency_hint = Some(urgency_hint);
        self
    }

    pub fn window_position(mut self, window_position: WindowPosition) -> Self {
        self.window_position = Some(window_position);
        self
    }

    pub fn border_width(mut self, border_width: u32) -> Self {
        self.border_width = Some(border_width);
        self
    }

    pub fn child(mut self, child: &impl IsA<Widget>) -> Self {
        self.child = Some(child.clone().upcast());
        self
    }

    pub fn resize_mode(mut self, resize_mode: ResizeMode) -> Self {
        self.resize_mode = Some(resize_mode);
        self
    }

    pub fn app_paintable(mut self, app_paintable: bool) -> Self {
        self.app_paintable = Some(app_paintable);
        self
    }

    pub fn can_default(mut self, can_default: bool) -> Self {
        self.can_default = Some(can_default);
        self
    }

    pub fn can_focus(mut self, can_focus: bool) -> Self {
        self.can_focus = Some(can_focus);
        self
    }

    pub fn events(mut self, events: gdk::EventMask) -> Self {
        self.events = Some(events);
        self
    }

    /// Whether to expand in both directions. Setting this sets both `property::Widget::hexpand` and `property::Widget::vexpand`
    pub fn expand(mut self, expand: bool) -> Self {
        self.expand = Some(expand);
        self
    }

    /// Whether the widget should grab focus when it is clicked with the mouse.
    ///
    /// This property is only relevant for widgets that can take focus.
    ///
    /// Before 3.20, several widgets (GtkButton, GtkFileChooserButton,
    /// GtkComboBox) implemented this property individually.
    #[cfg(any(feature = "v3_20", feature = "dox"))]
    #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
    pub fn focus_on_click(mut self, focus_on_click: bool) -> Self {
        self.focus_on_click = Some(focus_on_click);
        self
    }

    /// How to distribute horizontal space if widget gets extra space, see [`Align`][crate::Align]
    pub fn halign(mut self, halign: Align) -> Self {
        self.halign = Some(halign);
        self
    }

    pub fn has_default(mut self, has_default: bool) -> Self {
        self.has_default = Some(has_default);
        self
    }

    pub fn has_focus(mut self, has_focus: bool) -> Self {
        self.has_focus = Some(has_focus);
        self
    }

    /// Enables or disables the emission of `signal::Widget::query-tooltip` on `widget`.
    /// A value of [`true`] indicates that `widget` can have a tooltip, in this case
    /// the widget will be queried using `signal::Widget::query-tooltip` to determine
    /// whether it will provide a tooltip or not.
    ///
    /// Note that setting this property to [`true`] for the first time will change
    /// the event masks of the GdkWindows of this widget to include leave-notify
    /// and motion-notify events. This cannot and will not be undone when the
    /// property is set to [`false`] again.
    pub fn has_tooltip(mut self, has_tooltip: bool) -> Self {
        self.has_tooltip = Some(has_tooltip);
        self
    }

    pub fn height_request(mut self, height_request: i32) -> Self {
        self.height_request = Some(height_request);
        self
    }

    /// Whether to expand horizontally. See [`WidgetExt::set_hexpand()`][crate::prelude::WidgetExt::set_hexpand()].
    pub fn hexpand(mut self, hexpand: bool) -> Self {
        self.hexpand = Some(hexpand);
        self
    }

    /// Whether to use the `property::Widget::hexpand` property. See [`WidgetExt::is_hexpand_set()`][crate::prelude::WidgetExt::is_hexpand_set()].
    pub fn hexpand_set(mut self, hexpand_set: bool) -> Self {
        self.hexpand_set = Some(hexpand_set);
        self
    }

    pub fn is_focus(mut self, is_focus: bool) -> Self {
        self.is_focus = Some(is_focus);
        self
    }

    /// Sets all four sides' margin at once. If read, returns max
    /// margin on any side.
    pub fn margin(mut self, margin: i32) -> Self {
        self.margin = Some(margin);
        self
    }

    /// Margin on bottom side of widget.
    ///
    /// This property adds margin outside of the widget's normal size
    /// request, the margin will be added in addition to the size from
    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
    pub fn margin_bottom(mut self, margin_bottom: i32) -> Self {
        self.margin_bottom = Some(margin_bottom);
        self
    }

    /// Margin on end of widget, horizontally. This property supports
    /// left-to-right and right-to-left text directions.
    ///
    /// This property adds margin outside of the widget's normal size
    /// request, the margin will be added in addition to the size from
    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
    pub fn margin_end(mut self, margin_end: i32) -> Self {
        self.margin_end = Some(margin_end);
        self
    }

    /// Margin on start of widget, horizontally. This property supports
    /// left-to-right and right-to-left text directions.
    ///
    /// This property adds margin outside of the widget's normal size
    /// request, the margin will be added in addition to the size from
    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
    pub fn margin_start(mut self, margin_start: i32) -> Self {
        self.margin_start = Some(margin_start);
        self
    }

    /// Margin on top side of widget.
    ///
    /// This property adds margin outside of the widget's normal size
    /// request, the margin will be added in addition to the size from
    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
    pub fn margin_top(mut self, margin_top: i32) -> Self {
        self.margin_top = Some(margin_top);
        self
    }

    pub fn name(mut self, name: &str) -> Self {
        self.name = Some(name.to_string());
        self
    }

    pub fn no_show_all(mut self, no_show_all: bool) -> Self {
        self.no_show_all = Some(no_show_all);
        self
    }

    /// The requested opacity of the widget. See [`WidgetExt::set_opacity()`][crate::prelude::WidgetExt::set_opacity()] for
    /// more details about window opacity.
    ///
    /// Before 3.8 this was only available in GtkWindow
    pub fn opacity(mut self, opacity: f64) -> Self {
        self.opacity = Some(opacity);
        self
    }

    pub fn parent(mut self, parent: &impl IsA<Container>) -> Self {
        self.parent = Some(parent.clone().upcast());
        self
    }

    pub fn receives_default(mut self, receives_default: bool) -> Self {
        self.receives_default = Some(receives_default);
        self
    }

    pub fn sensitive(mut self, sensitive: bool) -> Self {
        self.sensitive = Some(sensitive);
        self
    }

    /// Sets the text of tooltip to be the given string, which is marked up
    /// with the [Pango text markup language][PangoMarkupFormat].
    /// Also see [`Tooltip::set_markup()`][crate::Tooltip::set_markup()].
    ///
    /// This is a convenience property which will take care of getting the
    /// tooltip shown if the given string is not [`None`]: `property::Widget::has-tooltip`
    /// will automatically be set to [`true`] and there will be taken care of
    /// `signal::Widget::query-tooltip` in the default signal handler.
    ///
    /// Note that if both `property::Widget::tooltip-text` and `property::Widget::tooltip-markup`
    /// are set, the last one wins.
    pub fn tooltip_markup(mut self, tooltip_markup: &str) -> Self {
        self.tooltip_markup = Some(tooltip_markup.to_string());
        self
    }

    /// Sets the text of tooltip to be the given string.
    ///
    /// Also see [`Tooltip::set_text()`][crate::Tooltip::set_text()].
    ///
    /// This is a convenience property which will take care of getting the
    /// tooltip shown if the given string is not [`None`]: `property::Widget::has-tooltip`
    /// will automatically be set to [`true`] and there will be taken care of
    /// `signal::Widget::query-tooltip` in the default signal handler.
    ///
    /// Note that if both `property::Widget::tooltip-text` and `property::Widget::tooltip-markup`
    /// are set, the last one wins.
    pub fn tooltip_text(mut self, tooltip_text: &str) -> Self {
        self.tooltip_text = Some(tooltip_text.to_string());
        self
    }

    /// How to distribute vertical space if widget gets extra space, see [`Align`][crate::Align]
    pub fn valign(mut self, valign: Align) -> Self {
        self.valign = Some(valign);
        self
    }

    /// Whether to expand vertically. See [`WidgetExt::set_vexpand()`][crate::prelude::WidgetExt::set_vexpand()].
    pub fn vexpand(mut self, vexpand: bool) -> Self {
        self.vexpand = Some(vexpand);
        self
    }

    /// Whether to use the `property::Widget::vexpand` property. See [`WidgetExt::is_vexpand_set()`][crate::prelude::WidgetExt::is_vexpand_set()].
    pub fn vexpand_set(mut self, vexpand_set: bool) -> Self {
        self.vexpand_set = Some(vexpand_set);
        self
    }

    pub fn visible(mut self, visible: bool) -> Self {
        self.visible = Some(visible);
        self
    }

    pub fn width_request(mut self, width_request: i32) -> Self {
        self.width_request = Some(width_request);
        self
    }
}

/// Trait containing all [`struct@Window`] methods.
///
/// # Implementors
///
/// [`ApplicationWindow`][struct@crate::ApplicationWindow], [`Assistant`][struct@crate::Assistant], [`Dialog`][struct@crate::Dialog], [`OffscreenWindow`][struct@crate::OffscreenWindow], [`Plug`][struct@crate::Plug], [`ShortcutsWindow`][struct@crate::ShortcutsWindow], [`Window`][struct@crate::Window]
pub trait GtkWindowExt: 'static {
    /// Activates the default widget for the window, unless the current
    /// focused widget has been configured to receive the default action
    /// (see [`WidgetExt::set_receives_default()`][crate::prelude::WidgetExt::set_receives_default()]), in which case the
    /// focused widget is activated.
    ///
    /// # Returns
    ///
    /// [`true`] if a widget got activated.
    #[doc(alias = "gtk_window_activate_default")]
    fn activate_default(&self) -> bool;

    /// Activates the current focused widget within the window.
    ///
    /// # Returns
    ///
    /// [`true`] if a widget got activated.
    #[doc(alias = "gtk_window_activate_focus")]
    fn activate_focus(&self) -> bool;

    /// Activates mnemonics and accelerators for this [`Window`][crate::Window]. This is normally
    /// called by the default ::key_press_event handler for toplevel windows,
    /// however in some cases it may be useful to call this directly when
    /// overriding the standard key handling for a toplevel window.
    /// ## `event`
    /// a [`gdk::EventKey`][crate::gdk::EventKey]
    ///
    /// # Returns
    ///
    /// [`true`] if a mnemonic or accelerator was found and activated.
    #[doc(alias = "gtk_window_activate_key")]
    fn activate_key(&self, event: &gdk::EventKey) -> bool;

    /// Associate `accel_group` with `self`, such that calling
    /// [`accel_groups_activate()`][crate::accel_groups_activate()] on `self` will activate accelerators
    /// in `accel_group`.
    /// ## `accel_group`
    /// a [`AccelGroup`][crate::AccelGroup]
    #[doc(alias = "gtk_window_add_accel_group")]
    fn add_accel_group(&self, accel_group: &impl IsA<AccelGroup>);

    /// Adds a mnemonic to this window.
    /// ## `keyval`
    /// the mnemonic
    /// ## `target`
    /// the widget that gets activated by the mnemonic
    #[doc(alias = "gtk_window_add_mnemonic")]
    fn add_mnemonic(&self, keyval: u32, target: &impl IsA<Widget>);

    /// Starts moving a window. This function is used if an application has
    /// window movement grips. When GDK can support it, the window movement
    /// will be done using the standard mechanism for the
    /// [window manager][gtk-X11-arch] or windowing
    /// system. Otherwise, GDK will try to emulate window movement,
    /// potentially not all that well, depending on the windowing system.
    /// ## `button`
    /// mouse button that initiated the drag
    /// ## `root_x`
    /// X position where the user clicked to initiate the drag, in root window coordinates
    /// ## `root_y`
    /// Y position where the user clicked to initiate the drag
    /// ## `timestamp`
    /// timestamp from the click event that initiated the drag
    #[doc(alias = "gtk_window_begin_move_drag")]
    fn begin_move_drag(&self, button: i32, root_x: i32, root_y: i32, timestamp: u32);

    /// Starts resizing a window. This function is used if an application
    /// has window resizing controls. When GDK can support it, the resize
    /// will be done using the standard mechanism for the
    /// [window manager][gtk-X11-arch] or windowing
    /// system. Otherwise, GDK will try to emulate window resizing,
    /// potentially not all that well, depending on the windowing system.
    /// ## `edge`
    /// position of the resize control
    /// ## `button`
    /// mouse button that initiated the drag
    /// ## `root_x`
    /// X position where the user clicked to initiate the drag, in root window coordinates
    /// ## `root_y`
    /// Y position where the user clicked to initiate the drag
    /// ## `timestamp`
    /// timestamp from the click event that initiated the drag
    #[doc(alias = "gtk_window_begin_resize_drag")]
    fn begin_resize_drag(
        &self,
        edge: gdk::WindowEdge,
        button: i32,
        root_x: i32,
        root_y: i32,
        timestamp: u32,
    );

    /// Requests that the window is closed, similar to what happens
    /// when a window manager close button is clicked.
    ///
    /// This function can be used with close buttons in custom
    /// titlebars.
    #[doc(alias = "gtk_window_close")]
    fn close(&self);

    /// Asks to deiconify (i.e. unminimize) the specified `self`. Note
    /// that you shouldn’t assume the window is definitely deiconified
    /// afterward, because other entities (e.g. the user or
    /// [window manager][gtk-X11-arch])) could iconify it
    /// again before your code which assumes deiconification gets to run.
    ///
    /// You can track iconification via the “window-state-event” signal
    /// on [`Widget`][crate::Widget].
    #[doc(alias = "gtk_window_deiconify")]
    fn deiconify(&self);

    /// Asks to place `self` in the fullscreen state. Note that you
    /// shouldn’t assume the window is definitely full screen afterward,
    /// because other entities (e.g. the user or
    /// [window manager][gtk-X11-arch]) could unfullscreen it
    /// again, and not all window managers honor requests to fullscreen
    /// windows. But normally the window will end up fullscreen. Just
    /// don’t write code that crashes if not.
    ///
    /// You can track the fullscreen state via the “window-state-event” signal
    /// on [`Widget`][crate::Widget].
    #[doc(alias = "gtk_window_fullscreen")]
    fn fullscreen(&self);

    /// Asks to place `self` in the fullscreen state. Note that you shouldn't assume
    /// the window is definitely full screen afterward.
    ///
    /// You can track the fullscreen state via the "window-state-event" signal
    /// on [`Widget`][crate::Widget].
    /// ## `screen`
    /// a [`gdk::Screen`][crate::gdk::Screen] to draw to
    /// ## `monitor`
    /// which monitor to go fullscreen on
    #[doc(alias = "gtk_window_fullscreen_on_monitor")]
    fn fullscreen_on_monitor(&self, screen: &gdk::Screen, monitor: i32);

    /// Gets the value set by [`set_accept_focus()`][Self::set_accept_focus()].
    ///
    /// # Returns
    ///
    /// [`true`] if window should receive the input focus
    #[doc(alias = "gtk_window_get_accept_focus")]
    #[doc(alias = "get_accept_focus")]
    fn accepts_focus(&self) -> bool;

    /// Gets the [`Application`][crate::Application] associated with the window (if any).
    ///
    /// # Returns
    ///
    /// a [`Application`][crate::Application], or [`None`]
    #[doc(alias = "gtk_window_get_application")]
    #[doc(alias = "get_application")]
    fn application(&self) -> Option<Application>;

    /// Fetches the attach widget for this window. See
    /// [`set_attached_to()`][Self::set_attached_to()].
    ///
    /// # Returns
    ///
    /// the widget where the window
    /// is attached, or [`None`] if the window is not attached to any widget.
    #[doc(alias = "gtk_window_get_attached_to")]
    #[doc(alias = "get_attached_to")]
    fn attached_to(&self) -> Option<Widget>;

    /// Returns whether the window has been set to have decorations
    /// such as a title bar via [`set_decorated()`][Self::set_decorated()].
    ///
    /// # Returns
    ///
    /// [`true`] if the window has been set to have decorations
    #[doc(alias = "gtk_window_get_decorated")]
    #[doc(alias = "get_decorated")]
    fn is_decorated(&self) -> bool;

    /// Gets the default size of the window. A value of -1 for the width or
    /// height indicates that a default size has not been explicitly set
    /// for that dimension, so the “natural” size of the window will be
    /// used.
    ///
    /// # Returns
    ///
    ///
    /// ## `width`
    /// location to store the default width, or [`None`]
    ///
    /// ## `height`
    /// location to store the default height, or [`None`]
    #[doc(alias = "gtk_window_get_default_size")]
    #[doc(alias = "get_default_size")]
    fn default_size(&self) -> (i32, i32);

    /// Returns the default widget for `self`. See
    /// [`set_default()`][Self::set_default()] for more details.
    ///
    /// # Returns
    ///
    /// the default widget, or [`None`]
    /// if there is none.
    #[doc(alias = "gtk_window_get_default_widget")]
    #[doc(alias = "get_default_widget")]
    fn default_widget(&self) -> Option<Widget>;

    /// Returns whether the window has been set to have a close button
    /// via [`set_deletable()`][Self::set_deletable()].
    ///
    /// # Returns
    ///
    /// [`true`] if the window has been set to have a close button
    #[doc(alias = "gtk_window_get_deletable")]
    #[doc(alias = "get_deletable")]
    fn is_deletable(&self) -> bool;

    /// Returns whether the window will be destroyed with its transient parent. See
    /// gtk_window_set_destroy_with_parent ().
    ///
    /// # Returns
    ///
    /// [`true`] if the window will be destroyed with its transient parent.
    #[doc(alias = "gtk_window_get_destroy_with_parent")]
    #[doc(alias = "get_destroy_with_parent")]
    fn must_destroy_with_parent(&self) -> bool;

    /// Retrieves the current focused widget within the window.
    /// Note that this is the widget that would have the focus
    /// if the toplevel window focused; if the toplevel window
    /// is not focused then `gtk_widget_has_focus (widget)` will
    /// not be [`true`] for the widget.
    ///
    /// # Returns
    ///
    /// the currently focused widget,
    /// or [`None`] if there is none.
    #[doc(alias = "gtk_window_get_focus")]
    #[doc(alias = "get_focus")]
    fn focused_widget(&self) -> Option<Widget>;

    /// Gets the value set by [`set_focus_on_map()`][Self::set_focus_on_map()].
    ///
    /// # Returns
    ///
    /// [`true`] if window should receive the input focus when
    /// mapped.
    #[doc(alias = "gtk_window_get_focus_on_map")]
    #[doc(alias = "get_focus_on_map")]
    fn gets_focus_on_map(&self) -> bool;

    /// Gets the value of the `property::Window::focus-visible` property.
    ///
    /// # Returns
    ///
    /// [`true`] if “focus rectangles” are supposed to be visible
    ///  in this window.
    #[doc(alias = "gtk_window_get_focus_visible")]
    #[doc(alias = "get_focus_visible")]
    fn gets_focus_visible(&self) -> bool;

    /// Gets the value set by [`set_gravity()`][Self::set_gravity()].
    ///
    /// # Returns
    ///
    /// window gravity
    #[doc(alias = "gtk_window_get_gravity")]
    #[doc(alias = "get_gravity")]
    fn gravity(&self) -> gdk::Gravity;

    /// Returns the group for `self` or the default group, if
    /// `self` is [`None`] or if `self` does not have an explicit
    /// window group.
    ///
    /// # Returns
    ///
    /// the [`WindowGroup`][crate::WindowGroup] for a window or the default group
    #[doc(alias = "gtk_window_get_group")]
    #[doc(alias = "get_group")]
    fn group(&self) -> Option<WindowGroup>;

    /// Returns whether the window has requested to have its titlebar hidden
    /// when maximized. See gtk_window_set_hide_titlebar_when_maximized ().
    ///
    /// # Returns
    ///
    /// [`true`] if the window has requested to have its titlebar
    ///  hidden when maximized
    #[doc(alias = "gtk_window_get_hide_titlebar_when_maximized")]
    #[doc(alias = "get_hide_titlebar_when_maximized")]
    fn hides_titlebar_when_maximized(&self) -> bool;

    /// Gets the value set by [`set_icon()`][Self::set_icon()] (or if you've
    /// called [`set_icon_list()`][Self::set_icon_list()], gets the first icon in
    /// the icon list).
    ///
    /// # Returns
    ///
    /// icon for window or [`None`] if none
    #[doc(alias = "gtk_window_get_icon")]
    #[doc(alias = "get_icon")]
    fn icon(&self) -> Option<gdk_pixbuf::Pixbuf>;

    /// Retrieves the list of icons set by [`set_icon_list()`][Self::set_icon_list()].
    /// The list is copied, but the reference count on each
    /// member won’t be incremented.
    ///
    /// # Returns
    ///
    /// copy of window’s icon list
    #[doc(alias = "gtk_window_get_icon_list")]
    #[doc(alias = "get_icon_list")]
    fn icon_list(&self) -> Vec<gdk_pixbuf::Pixbuf>;

    /// Returns the name of the themed icon for the window,
    /// see [`set_icon_name()`][Self::set_icon_name()].
    ///
    /// # Returns
    ///
    /// the icon name or [`None`] if the window has
    /// no themed icon
    #[doc(alias = "gtk_window_get_icon_name")]
    #[doc(alias = "get_icon_name")]
    fn icon_name(&self) -> Option<glib::GString>;

    /// Returns the mnemonic modifier for this window. See
    /// [`set_mnemonic_modifier()`][Self::set_mnemonic_modifier()].
    ///
    /// # Returns
    ///
    /// the modifier mask used to activate
    ///  mnemonics on this window.
    #[doc(alias = "gtk_window_get_mnemonic_modifier")]
    #[doc(alias = "get_mnemonic_modifier")]
    fn mnemonic_modifier(&self) -> gdk::ModifierType;

    /// Gets the value of the `property::Window::mnemonics-visible` property.
    ///
    /// # Returns
    ///
    /// [`true`] if mnemonics are supposed to be visible
    /// in this window.
    #[doc(alias = "gtk_window_get_mnemonics_visible")]
    #[doc(alias = "get_mnemonics_visible")]
    fn is_mnemonics_visible(&self) -> bool;

    /// Returns whether the window is modal. See [`set_modal()`][Self::set_modal()].
    ///
    /// # Returns
    ///
    /// [`true`] if the window is set to be modal and
    ///  establishes a grab when shown
    #[doc(alias = "gtk_window_get_modal")]
    #[doc(alias = "get_modal")]
    fn is_modal(&self) -> bool;

    /// This function returns the position you need to pass to
    /// [`move_()`][Self::move_()] to keep `self` in its current position.
    /// This means that the meaning of the returned value varies with
    /// window gravity. See [`move_()`][Self::move_()] for more details.
    ///
    /// The reliability of this function depends on the windowing system
    /// currently in use. Some windowing systems, such as Wayland, do not
    /// support a global coordinate system, and thus the position of the
    /// window will always be (0, 0). Others, like X11, do not have a reliable
    /// way to obtain the geometry of the decorations of a window if they are
    /// provided by the window manager. Additionally, on X11, window manager
    /// have been known to mismanage window gravity, which result in windows
    /// moving even if you use the coordinates of the current position as
    /// returned by this function.
    ///
    /// If you haven’t changed the window gravity, its gravity will be
    /// [`gdk::Gravity::NorthWest`][crate::gdk::Gravity::NorthWest]. This means that [`position()`][Self::position()]
    /// gets the position of the top-left corner of the window manager
    /// frame for the window. [`move_()`][Self::move_()] sets the position of this
    /// same top-left corner.
    ///
    /// If a window has gravity [`gdk::Gravity::Static`][crate::gdk::Gravity::Static] the window manager
    /// frame is not relevant, and thus [`position()`][Self::position()] will
    /// always produce accurate results. However you can’t use static
    /// gravity to do things like place a window in a corner of the screen,
    /// because static gravity ignores the window manager decorations.
    ///
    /// Ideally, this function should return appropriate values if the
    /// window has client side decorations, assuming that the windowing
    /// system supports global coordinates.
    ///
    /// In practice, saving the window position should not be left to
    /// applications, as they lack enough knowledge of the windowing
    /// system and the window manager state to effectively do so. The
    /// appropriate way to implement saving the window position is to
    /// use a platform-specific protocol, wherever that is available.
    ///
    /// # Returns
    ///
    ///
    /// ## `root_x`
    /// return location for X coordinate of
    ///  gravity-determined reference point, or [`None`]
    ///
    /// ## `root_y`
    /// return location for Y coordinate of
    ///  gravity-determined reference point, or [`None`]
    #[doc(alias = "gtk_window_get_position")]
    #[doc(alias = "get_position")]
    fn position(&self) -> (i32, i32);

    /// Gets the value set by [`set_resizable()`][Self::set_resizable()].
    ///
    /// # Returns
    ///
    /// [`true`] if the user can resize the window
    #[doc(alias = "gtk_window_get_resizable")]
    #[doc(alias = "get_resizable")]
    fn is_resizable(&self) -> bool;

    /// Returns the role of the window. See [`set_role()`][Self::set_role()] for
    /// further explanation.
    ///
    /// # Returns
    ///
    /// the role of the window if set, or [`None`]. The
    /// returned is owned by the widget and must not be modified or freed.
    #[doc(alias = "gtk_window_get_role")]
    #[doc(alias = "get_role")]
    fn role(&self) -> Option<glib::GString>;

    /// Obtains the current size of `self`.
    ///
    /// If `self` is not visible on screen, this function return the size GTK+
    /// will suggest to the [window manager][gtk-X11-arch] for the initial window
    /// size (but this is not reliably the same as the size the window manager
    /// will actually select). See: [`set_default_size()`][Self::set_default_size()].
    ///
    /// Depending on the windowing system and the window manager constraints,
    /// the size returned by this function may not match the size set using
    /// [`resize()`][Self::resize()]; additionally, since [`resize()`][Self::resize()] may be
    /// implemented as an asynchronous operation, GTK+ cannot guarantee in any
    /// way that this code:
    ///
    ///
    ///
    /// **⚠️ The following code is in C ⚠️**
    ///
    /// ```C
    ///   // width and height are set elsewhere
    ///   gtk_window_resize (window, width, height);
    ///
    ///   int new_width, new_height;
    ///   gtk_window_get_size (window, &new_width, &new_height);
    /// ```
    ///
    /// will result in `new_width` and `new_height` matching `width` and
    /// `height`, respectively.
    ///
    /// This function will return the logical size of the [`Window`][crate::Window],
    /// excluding the widgets used in client side decorations; there is,
    /// however, no guarantee that the result will be completely accurate
    /// because client side decoration may include widgets that depend on
    /// the user preferences and that may not be visibile at the time you
    /// call this function.
    ///
    /// The dimensions returned by this function are suitable for being
    /// stored across sessions; use [`set_default_size()`][Self::set_default_size()] to
    /// restore them when before showing the window.
    ///
    /// To avoid potential race conditions, you should only call this
    /// function in response to a size change notification, for instance
    /// inside a handler for the `signal::Widget::size-allocate` signal, or
    /// inside a handler for the `signal::Widget::configure-event` signal:
    ///
    ///
    ///
    /// **⚠️ The following code is in C ⚠️**
    ///
    /// ```C
    /// static void
    /// on_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
    /// {
    ///   int new_width, new_height;
    ///
    ///   gtk_window_get_size (GTK_WINDOW (widget), &new_width, &new_height);
    ///
    ///   ...
    /// }
    /// ```
    ///
    /// Note that, if you connect to the `signal::Widget::size-allocate` signal,
    /// you should not use the dimensions of the `GtkAllocation` passed to
    /// the signal handler, as the allocation may contain client side
    /// decorations added by GTK+, depending on the windowing system in
    /// use.
    ///
    /// If you are getting a window size in order to position the window
    /// on the screen, you should, instead, simply set the window’s semantic
    /// type with [`set_type_hint()`][Self::set_type_hint()], which allows the window manager
    /// to e.g. center dialogs. Also, if you set the transient parent of
    /// dialogs with [`set_transient_for()`][Self::set_transient_for()] window managers will
    /// often center the dialog over its parent window. It's much preferred
    /// to let the window manager handle these cases rather than doing it
    /// yourself, because all apps will behave consistently and according to
    /// user or system preferences, if the window manager handles it. Also,
    /// the window manager can take into account the size of the window
    /// decorations and border that it may add, and of which GTK+ has no
    /// knowledge. Additionally, positioning windows in global screen coordinates
    /// may not be allowed by the windowing system. For more information,
    /// see: [`set_position()`][Self::set_position()].
    ///
    /// # Returns
    ///
    ///
    /// ## `width`
    /// return location for width, or [`None`]
    ///
    /// ## `height`
    /// return location for height, or [`None`]
    #[doc(alias = "gtk_window_get_size")]
    #[doc(alias = "get_size")]
    fn size(&self) -> (i32, i32);

    /// Gets the value set by [`set_skip_pager_hint()`][Self::set_skip_pager_hint()].
    ///
    /// # Returns
    ///
    /// [`true`] if window shouldn’t be in pager
    #[doc(alias = "gtk_window_get_skip_pager_hint")]
    #[doc(alias = "get_skip_pager_hint")]
    fn skips_pager_hint(&self) -> bool;

    /// Gets the value set by [`set_skip_taskbar_hint()`][Self::set_skip_taskbar_hint()]
    ///
    /// # Returns
    ///
    /// [`true`] if window shouldn’t be in taskbar
    #[doc(alias = "gtk_window_get_skip_taskbar_hint")]
    #[doc(alias = "get_skip_taskbar_hint")]
    fn skips_taskbar_hint(&self) -> bool;

    /// Retrieves the title of the window. See [`set_title()`][Self::set_title()].
    ///
    /// # Returns
    ///
    /// the title of the window, or [`None`] if none has
    /// been set explicitly. The returned string is owned by the widget
    /// and must not be modified or freed.
    #[doc(alias = "gtk_window_get_title")]
    #[doc(alias = "get_title")]
    fn title(&self) -> Option<glib::GString>;

    /// Returns the custom titlebar that has been set with
    /// [`set_titlebar()`][Self::set_titlebar()].
    ///
    /// # Returns
    ///
    /// the custom titlebar, or [`None`]
    #[doc(alias = "gtk_window_get_titlebar")]
    #[doc(alias = "get_titlebar")]
    fn titlebar(&self) -> Option<Widget>;

    /// Fetches the transient parent for this window. See
    /// [`set_transient_for()`][Self::set_transient_for()].
    ///
    /// # Returns
    ///
    /// the transient parent for this
    /// window, or [`None`] if no transient parent has been set.
    #[doc(alias = "gtk_window_get_transient_for")]
    #[doc(alias = "get_transient_for")]
    #[must_use]
    fn transient_for(&self) -> Option<Window>;

    /// Gets the type hint for this window. See [`set_type_hint()`][Self::set_type_hint()].
    ///
    /// # Returns
    ///
    /// the type hint for `self`.
    #[doc(alias = "gtk_window_get_type_hint")]
    #[doc(alias = "get_type_hint")]
    fn type_hint(&self) -> gdk::WindowTypeHint;

    /// Gets the value set by [`set_urgency_hint()`][Self::set_urgency_hint()]
    ///
    /// # Returns
    ///
    /// [`true`] if window is urgent
    #[doc(alias = "gtk_window_get_urgency_hint")]
    #[doc(alias = "get_urgency_hint")]
    fn is_urgency_hint(&self) -> bool;

    /// Gets the type of the window. See [`WindowType`][crate::WindowType].
    ///
    /// # Returns
    ///
    /// the type of the window
    #[doc(alias = "gtk_window_get_window_type")]
    #[doc(alias = "get_window_type")]
    fn window_type(&self) -> WindowType;

    /// Returns whether `self` has an explicit window group.
    ///
    /// # Returns
    ///
    /// [`true`] if `self` has an explicit window group.
    ///
    /// Since 2.22
    #[doc(alias = "gtk_window_has_group")]
    fn has_group(&self) -> bool;

    /// Returns whether the input focus is within this GtkWindow.
    /// For real toplevel windows, this is identical to [`is_active()`][Self::is_active()],
    /// but for embedded windows, like [`Plug`][crate::Plug], the results will differ.
    ///
    /// # Returns
    ///
    /// [`true`] if the input focus is within this GtkWindow
    #[doc(alias = "gtk_window_has_toplevel_focus")]
    fn has_toplevel_focus(&self) -> bool;

    /// Asks to iconify (i.e. minimize) the specified `self`. Note that
    /// you shouldn’t assume the window is definitely iconified afterward,
    /// because other entities (e.g. the user or
    /// [window manager][gtk-X11-arch]) could deiconify it
    /// again, or there may not be a window manager in which case
    /// iconification isn’t possible, etc. But normally the window will end
    /// up iconified. Just don’t write code that crashes if not.
    ///
    /// It’s permitted to call this function before showing a window,
    /// in which case the window will be iconified before it ever appears
    /// onscreen.
    ///
    /// You can track iconification via the “window-state-event” signal
    /// on [`Widget`][crate::Widget].
    #[doc(alias = "gtk_window_iconify")]
    fn iconify(&self);

    /// Returns whether the window is part of the current active toplevel.
    /// (That is, the toplevel window receiving keystrokes.)
    /// The return value is [`true`] if the window is active toplevel
    /// itself, but also if it is, say, a [`Plug`][crate::Plug] embedded in the active toplevel.
    /// You might use this function if you wanted to draw a widget
    /// differently in an active window from a widget in an inactive window.
    /// See [`has_toplevel_focus()`][Self::has_toplevel_focus()]
    ///
    /// # Returns
    ///
    /// [`true`] if the window part of the current active window.
    #[doc(alias = "gtk_window_is_active")]
    fn is_active(&self) -> bool;

    /// Retrieves the current maximized state of `self`.
    ///
    /// Note that since maximization is ultimately handled by the window
    /// manager and happens asynchronously to an application request, you
    /// shouldn’t assume the return value of this function changing
    /// immediately (or at all), as an effect of calling
    /// [`maximize()`][Self::maximize()] or [`unmaximize()`][Self::unmaximize()].
    ///
    /// # Returns
    ///
    /// whether the window has a maximized state.
    #[doc(alias = "gtk_window_is_maximized")]
    fn is_maximized(&self) -> bool;

    /// Asks to maximize `self`, so that it becomes full-screen. Note that
    /// you shouldn’t assume the window is definitely maximized afterward,
    /// because other entities (e.g. the user or
    /// [window manager][gtk-X11-arch]) could unmaximize it
    /// again, and not all window managers support maximization. But
    /// normally the window will end up maximized. Just don’t write code
    /// that crashes if not.
    ///
    /// It’s permitted to call this function before showing a window,
    /// in which case the window will be maximized when it appears onscreen
    /// initially.
    ///
    /// You can track maximization via the “window-state-event” signal
    /// on [`Widget`][crate::Widget], or by listening to notifications on the
    /// `property::Window::is-maximized` property.
    #[doc(alias = "gtk_window_maximize")]
    fn maximize(&self);

    /// Activates the targets associated with the mnemonic.
    /// ## `keyval`
    /// the mnemonic
    /// ## `modifier`
    /// the modifiers
    ///
    /// # Returns
    ///
    /// [`true`] if the activation is done.
    #[doc(alias = "gtk_window_mnemonic_activate")]
    fn mnemonic_activate(&self, keyval: u32, modifier: gdk::ModifierType) -> bool;

    #[doc(alias = "gtk_window_move")]
    #[doc(alias = "move")]
    fn move_(&self, x: i32, y: i32);

    /// Parses a standard X Window System geometry string - see the
    /// manual page for X (type “man X”) for details on this.
    /// [`parse_geometry()`][Self::parse_geometry()] does work on all GTK+ ports
    /// including Win32 but is primarily intended for an X environment.
    ///
    /// If either a size or a position can be extracted from the
    /// geometry string, [`parse_geometry()`][Self::parse_geometry()] returns [`true`]
    /// and calls [`set_default_size()`][Self::set_default_size()] and/or [`move_()`][Self::move_()]
    /// to resize/move the window.
    ///
    /// If [`parse_geometry()`][Self::parse_geometry()] returns [`true`], it will also
    /// set the [`gdk::WindowHints::USER_POS`][crate::gdk::WindowHints::USER_POS] and/or [`gdk::WindowHints::USER_SIZE`][crate::gdk::WindowHints::USER_SIZE] hints
    /// indicating to the window manager that the size/position of
    /// the window was user-specified. This causes most window
    /// managers to honor the geometry.
    ///
    /// Note that for [`parse_geometry()`][Self::parse_geometry()] to work as expected, it has
    /// to be called when the window has its “final” size, i.e. after calling
    /// [`WidgetExt::show_all()`][crate::prelude::WidgetExt::show_all()] on the contents and [`set_geometry_hints()`][Self::set_geometry_hints()]
    /// on the window.
    ///
    ///
    /// **⚠️ The following code is in C ⚠️**
    ///
    /// ```C
    /// #include <gtk/gtk.h>
    ///
    /// static void
    /// fill_with_content (GtkWidget *vbox)
    /// {
    ///   // fill with content...
    /// }
    ///
    /// int
    /// main (int argc, char *argv[])
    /// {
    ///   GtkWidget *window, *vbox;
    ///   GdkGeometry size_hints = {
    ///     100, 50, 0, 0, 100, 50, 10,
    ///     10, 0.0, 0.0, GDK_GRAVITY_NORTH_WEST
    ///   };
    ///
    ///   gtk_init (&argc, &argv);
    ///
    ///   window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
    ///   vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
    ///
    ///   gtk_container_add (GTK_CONTAINER (window), vbox);
    ///   fill_with_content (vbox);
    ///   gtk_widget_show_all (vbox);
    ///
    ///   gtk_window_set_geometry_hints (GTK_WINDOW (window),
    ///                       NULL,
    ///                     &size_hints,
    ///                     GDK_HINT_MIN_SIZE |
    ///                     GDK_HINT_BASE_SIZE |
    ///                     GDK_HINT_RESIZE_INC);
    ///
    ///   if (argc > 1)
    ///     {
    ///       gboolean res;
    ///       res = gtk_window_parse_geometry (GTK_WINDOW (window),
    ///                                        argv[1]);
    ///       if (! res)
    ///         fprintf (stderr,
    ///                  "Failed to parse “%s”\n",
    ///                  argv[1]);
    ///     }
    ///
    ///   gtk_widget_show_all (window);
    ///   gtk_main ();
    ///
    ///   return 0;
    /// }
    /// ```
    ///
    /// # Deprecated since 3.20
    ///
    /// Geometry handling in GTK is deprecated.
    /// ## `geometry`
    /// geometry string
    ///
    /// # Returns
    ///
    /// [`true`] if string was parsed successfully
    #[cfg_attr(feature = "v3_20", deprecated = "Since 3.20")]
    #[doc(alias = "gtk_window_parse_geometry")]
    fn parse_geometry(&self, geometry: &str) -> bool;

    /// Presents a window to the user. This function should not be used
    /// as when it is called, it is too late to gather a valid timestamp
    /// to allow focus stealing prevention to work correctly.
    #[doc(alias = "gtk_window_present")]
    fn present(&self);

    /// Presents a window to the user. This may mean raising the window
    /// in the stacking order, deiconifying it, moving it to the current
    /// desktop, and/or giving it the keyboard focus, possibly dependent
    /// on the user’s platform, window manager, and preferences.
    ///
    /// If `self` is hidden, this function calls [`WidgetExt::show()`][crate::prelude::WidgetExt::show()]
    /// as well.
    ///
    /// This function should be used when the user tries to open a window
    /// that’s already open. Say for example the preferences dialog is
    /// currently open, and the user chooses Preferences from the menu
    /// a second time; use [`present()`][Self::present()] to move the already-open dialog
    /// where the user can see it.
    ///
    /// Presents a window to the user in response to a user interaction. The
    /// timestamp should be gathered when the window was requested to be shown
    /// (when clicking a link for example), rather than once the window is
    /// ready to be shown.
    /// ## `timestamp`
    /// the timestamp of the user interaction (typically a
    ///  button or key press event) which triggered this call
    #[doc(alias = "gtk_window_present_with_time")]
    fn present_with_time(&self, timestamp: u32);

    /// Propagate a key press or release event to the focus widget and
    /// up the focus container chain until a widget handles `event`.
    /// This is normally called by the default ::key_press_event and
    /// ::key_release_event handlers for toplevel windows,
    /// however in some cases it may be useful to call this directly when
    /// overriding the standard key handling for a toplevel window.
    /// ## `event`
    /// a [`gdk::EventKey`][crate::gdk::EventKey]
    ///
    /// # Returns
    ///
    /// [`true`] if a widget in the focus chain handled the event.
    #[doc(alias = "gtk_window_propagate_key_event")]
    fn propagate_key_event(&self, event: &gdk::EventKey) -> bool;

    /// Reverses the effects of [`add_accel_group()`][Self::add_accel_group()].
    /// ## `accel_group`
    /// a [`AccelGroup`][crate::AccelGroup]
    #[doc(alias = "gtk_window_remove_accel_group")]
    fn remove_accel_group(&self, accel_group: &impl IsA<AccelGroup>);

    /// Removes a mnemonic from this window.
    /// ## `keyval`
    /// the mnemonic
    /// ## `target`
    /// the widget that gets activated by the mnemonic
    #[doc(alias = "gtk_window_remove_mnemonic")]
    fn remove_mnemonic(&self, keyval: u32, target: &impl IsA<Widget>);

    /// Resizes the window as if the user had done so, obeying geometry
    /// constraints. The default geometry constraint is that windows may
    /// not be smaller than their size request; to override this
    /// constraint, call [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] to set the window's
    /// request to a smaller value.
    ///
    /// If [`resize()`][Self::resize()] is called before showing a window for the
    /// first time, it overrides any default size set with
    /// [`set_default_size()`][Self::set_default_size()].
    ///
    /// Windows may not be resized smaller than 1 by 1 pixels.
    ///
    /// When using client side decorations, GTK+ will do its best to adjust
    /// the given size so that the resulting window size matches the
    /// requested size without the title bar, borders and shadows added for
    /// the client side decorations, but there is no guarantee that the
    /// result will be totally accurate because these widgets added for
    /// client side decorations depend on the theme and may not be realized
    /// or visible at the time [`resize()`][Self::resize()] is issued.
    ///
    /// If the GtkWindow has a titlebar widget (see [`set_titlebar()`][Self::set_titlebar()]), then
    /// typically, [`resize()`][Self::resize()] will compensate for the height of the titlebar
    /// widget only if the height is known when the resulting GtkWindow configuration
    /// is issued.
    /// For example, if new widgets are added after the GtkWindow configuration
    /// and cause the titlebar widget to grow in height, this will result in a
    /// window content smaller that specified by [`resize()`][Self::resize()] and not
    /// a larger window.
    /// ## `width`
    /// width in pixels to resize the window to
    /// ## `height`
    /// height in pixels to resize the window to
    #[doc(alias = "gtk_window_resize")]
    fn resize(&self, width: i32, height: i32);

    /// Like [`resize()`][Self::resize()], but `width` and `height` are interpreted
    /// in terms of the base size and increment set with
    /// gtk_window_set_geometry_hints.
    ///
    /// # Deprecated since 3.20
    ///
    /// This function does nothing. Use
    ///  [`resize()`][Self::resize()] and compute the geometry yourself.
    /// ## `width`
    /// width in resize increments to resize the window to
    /// ## `height`
    /// height in resize increments to resize the window to
    #[cfg_attr(feature = "v3_20", deprecated = "Since 3.20")]
    #[doc(alias = "gtk_window_resize_to_geometry")]
    fn resize_to_geometry(&self, width: i32, height: i32);

    /// Windows may set a hint asking the desktop environment not to receive
    /// the input focus. This function sets this hint.
    /// ## `setting`
    /// [`true`] to let this window receive input focus
    #[doc(alias = "gtk_window_set_accept_focus")]
    fn set_accept_focus(&self, setting: bool);

    /// Sets or unsets the [`Application`][crate::Application] associated with the window.
    ///
    /// The application will be kept alive for at least as long as it has any windows
    /// associated with it (see [`ApplicationExtManual::hold()`][crate::gio::prelude::ApplicationExtManual::hold()] for a way to keep it alive
    /// without windows).
    ///
    /// Normally, the connection between the application and the window will remain
    /// until the window is destroyed, but you can explicitly remove it by setting
    /// the `application` to [`None`].
    ///
    /// This is equivalent to calling [`GtkApplicationExt::remove_window()`][crate::prelude::GtkApplicationExt::remove_window()] and/or
    /// [`GtkApplicationExt::add_window()`][crate::prelude::GtkApplicationExt::add_window()] on the old/new applications as relevant.
    /// ## `application`
    /// a [`Application`][crate::Application], or [`None`] to unset
    #[doc(alias = "gtk_window_set_application")]
    fn set_application(&self, application: Option<&impl IsA<Application>>);

    /// Marks `self` as attached to `attach_widget`. This creates a logical binding
    /// between the window and the widget it belongs to, which is used by GTK+ to
    /// propagate information such as styling or accessibility to `self` as if it
    /// was a children of `attach_widget`.
    ///
    /// Examples of places where specifying this relation is useful are for instance
    /// a [`Menu`][crate::Menu] created by a [`ComboBox`][crate::ComboBox], a completion popup window
    /// created by [`Entry`][crate::Entry] or a typeahead search entry created by [`TreeView`][crate::TreeView].
    ///
    /// Note that this function should not be confused with
    /// [`set_transient_for()`][Self::set_transient_for()], which specifies a window manager relation
    /// between two toplevels instead.
    ///
    /// Passing [`None`] for `attach_widget` detaches the window.
    /// ## `attach_widget`
    /// a [`Widget`][crate::Widget], or [`None`]
    #[doc(alias = "gtk_window_set_attached_to")]
    fn set_attached_to(&self, attach_widget: Option<&impl IsA<Widget>>);

    /// By default, windows are decorated with a title bar, resize
    /// controls, etc. Some [window managers][gtk-X11-arch]
    /// allow GTK+ to disable these decorations, creating a
    /// borderless window. If you set the decorated property to [`false`]
    /// using this function, GTK+ will do its best to convince the window
    /// manager not to decorate the window. Depending on the system, this
    /// function may not have any effect when called on a window that is
    /// already visible, so you should call it before calling [`WidgetExt::show()`][crate::prelude::WidgetExt::show()].
    ///
    /// On Windows, this function always works, since there’s no window manager
    /// policy involved.
    /// ## `setting`
    /// [`true`] to decorate the window
    #[doc(alias = "gtk_window_set_decorated")]
    fn set_decorated(&self, setting: bool);

    /// The default widget is the widget that’s activated when the user
    /// presses Enter in a dialog (for example). This function sets or
    /// unsets the default widget for a [`Window`][crate::Window]. When setting (rather
    /// than unsetting) the default widget it’s generally easier to call
    /// [`WidgetExt::grab_default()`][crate::prelude::WidgetExt::grab_default()] on the widget. Before making a widget
    /// the default widget, you must call [`WidgetExt::set_can_default()`][crate::prelude::WidgetExt::set_can_default()] on
    /// the widget you’d like to make the default.
    /// ## `default_widget`
    /// widget to be the default, or [`None`]
    ///  to unset the default widget for the toplevel
    #[doc(alias = "gtk_window_set_default")]
    fn set_default(&self, default_widget: Option<&impl IsA<Widget>>);

    /// Like [`set_default_size()`][Self::set_default_size()], but `width` and `height` are interpreted
    /// in terms of the base size and increment set with
    /// gtk_window_set_geometry_hints.
    ///
    /// # Deprecated since 3.20
    ///
    /// This function does nothing. If you want to set a default
    ///  size, use [`set_default_size()`][Self::set_default_size()] instead.
    /// ## `width`
    /// width in resize increments, or -1 to unset the default width
    /// ## `height`
    /// height in resize increments, or -1 to unset the default height
    #[cfg_attr(feature = "v3_20", deprecated = "Since 3.20")]
    #[doc(alias = "gtk_window_set_default_geometry")]
    fn set_default_geometry(&self, width: i32, height: i32);

    /// Sets the default size of a window. If the window’s “natural” size
    /// (its size request) is larger than the default, the default will be
    /// ignored. More generally, if the default size does not obey the
    /// geometry hints for the window ([`set_geometry_hints()`][Self::set_geometry_hints()] can
    /// be used to set these explicitly), the default size will be clamped
    /// to the nearest permitted size.
    ///
    /// Unlike [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()], which sets a size request for
    /// a widget and thus would keep users from shrinking the window, this
    /// function only sets the initial size, just as if the user had
    /// resized the window themselves. Users can still shrink the window
    /// again as they normally would. Setting a default size of -1 means to
    /// use the “natural” default size (the size request of the window).
    ///
    /// For more control over a window’s initial size and how resizing works,
    /// investigate [`set_geometry_hints()`][Self::set_geometry_hints()].
    ///
    /// For some uses, [`resize()`][Self::resize()] is a more appropriate function.
    /// [`resize()`][Self::resize()] changes the current size of the window, rather
    /// than the size to be used on initial display. [`resize()`][Self::resize()] always
    /// affects the window itself, not the geometry widget.
    ///
    /// The default size of a window only affects the first time a window is
    /// shown; if a window is hidden and re-shown, it will remember the size
    /// it had prior to hiding, rather than using the default size.
    ///
    /// Windows can’t actually be 0x0 in size, they must be at least 1x1, but
    /// passing 0 for `width` and `height` is OK, resulting in a 1x1 default size.
    ///
    /// If you use this function to reestablish a previously saved window size,
    /// note that the appropriate size to save is the one returned by
    /// [`size()`][Self::size()]. Using the window allocation directly will not
    /// work in all circumstances and can lead to growing or shrinking windows.
    /// ## `width`
    /// width in pixels, or -1 to unset the default width
    /// ## `height`
    /// height in pixels, or -1 to unset the default height
    #[doc(alias = "gtk_window_set_default_size")]
    fn set_default_size(&self, width: i32, height: i32);

    /// By default, windows have a close button in the window frame. Some
    /// [window managers][gtk-X11-arch] allow GTK+ to
    /// disable this button. If you set the deletable property to [`false`]
    /// using this function, GTK+ will do its best to convince the window
    /// manager not to show a close button. Depending on the system, this
    /// function may not have any effect when called on a window that is
    /// already visible, so you should call it before calling [`WidgetExt::show()`][crate::prelude::WidgetExt::show()].
    ///
    /// On Windows, this function always works, since there’s no window manager
    /// policy involved.
    /// ## `setting`
    /// [`true`] to decorate the window as deletable
    #[doc(alias = "gtk_window_set_deletable")]
    fn set_deletable(&self, setting: bool);

    /// If `setting` is [`true`], then destroying the transient parent of `self`
    /// will also destroy `self` itself. This is useful for dialogs that
    /// shouldn’t persist beyond the lifetime of the main window they're
    /// associated with, for example.
    /// ## `setting`
    /// whether to destroy `self` with its transient parent
    #[doc(alias = "gtk_window_set_destroy_with_parent")]
    fn set_destroy_with_parent(&self, setting: bool);

    /// If `focus` is not the current focus widget, and is focusable, sets
    /// it as the focus widget for the window. If `focus` is [`None`], unsets
    /// the focus widget for this window. To set the focus to a particular
    /// widget in the toplevel, it is usually more convenient to use
    /// [`WidgetExt::grab_focus()`][crate::prelude::WidgetExt::grab_focus()] instead of this function.
    /// ## `focus`
    /// widget to be the new focus widget, or [`None`] to unset
    ///  any focus widget for the toplevel window.
    #[doc(alias = "gtk_window_set_focus")]
    fn set_focus(&self, focus: Option<&impl IsA<Widget>>);

    /// Windows may set a hint asking the desktop environment not to receive
    /// the input focus when the window is mapped. This function sets this
    /// hint.
    /// ## `setting`
    /// [`true`] to let this window receive input focus on map
    #[doc(alias = "gtk_window_set_focus_on_map")]
    fn set_focus_on_map(&self, setting: bool);

    /// Sets the `property::Window::focus-visible` property.
    /// ## `setting`
    /// the new value
    #[doc(alias = "gtk_window_set_focus_visible")]
    fn set_focus_visible(&self, setting: bool);

    /// This function sets up hints about how a window can be resized by
    /// the user. You can set a minimum and maximum size; allowed resize
    /// increments (e.g. for xterm, you can only resize by the size of a
    /// character); aspect ratios; and more. See the [`gdk::Geometry`][crate::gdk::Geometry] struct.
    /// ## `geometry_widget`
    /// widget the geometry hints used to be applied to
    ///  or [`None`]. Since 3.20 this argument is ignored and GTK behaves as if [`None`] was
    ///  set.
    /// ## `geometry`
    /// struct containing geometry information or [`None`]
    /// ## `geom_mask`
    /// mask indicating which struct fields should be paid attention to
    #[doc(alias = "gtk_window_set_geometry_hints")]
    fn set_geometry_hints(
        &self,
        geometry_widget: Option<&impl IsA<Widget>>,
        geometry: Option<&gdk::Geometry>,
        geom_mask: gdk::WindowHints,
    );

    /// Window gravity defines the meaning of coordinates passed to
    /// [`move_()`][Self::move_()]. See [`move_()`][Self::move_()] and [`gdk::Gravity`][crate::gdk::Gravity] for
    /// more details.
    ///
    /// The default window gravity is [`gdk::Gravity::NorthWest`][crate::gdk::Gravity::NorthWest] which will
    /// typically “do what you mean.”
    /// ## `gravity`
    /// window gravity
    #[doc(alias = "gtk_window_set_gravity")]
    fn set_gravity(&self, gravity: gdk::Gravity);

    /// Tells GTK+ whether to drop its extra reference to the window
    /// when `gtk_widget_destroy()` is called.
    ///
    /// This function is only exported for the benefit of language
    /// bindings which may need to keep the window alive until their
    /// wrapper object is garbage collected. There is no justification
    /// for ever calling this function in an application.
    /// ## `setting`
    /// the new value
    #[doc(alias = "gtk_window_set_has_user_ref_count")]
    fn set_has_user_ref_count(&self, setting: bool);

    /// If `setting` is [`true`], then `self` will request that it’s titlebar
    /// should be hidden when maximized.
    /// This is useful for windows that don’t convey any information other
    /// than the application name in the titlebar, to put the available
    /// screen space to better use. If the underlying window system does not
    /// support the request, the setting will not have any effect.
    ///
    /// Note that custom titlebars set with [`set_titlebar()`][Self::set_titlebar()] are
    /// not affected by this. The application is in full control of their
    /// content and visibility anyway.
    /// ## `setting`
    /// whether to hide the titlebar when `self` is maximized
    #[doc(alias = "gtk_window_set_hide_titlebar_when_maximized")]
    fn set_hide_titlebar_when_maximized(&self, setting: bool);

    /// Sets up the icon representing a [`Window`][crate::Window]. This icon is used when
    /// the window is minimized (also known as iconified). Some window
    /// managers or desktop environments may also place it in the window
    /// frame, or display it in other contexts. On others, the icon is not
    /// used at all, so your mileage may vary.
    ///
    /// The icon should be provided in whatever size it was naturally
    /// drawn; that is, don’t scale the image before passing it to
    /// GTK+. Scaling is postponed until the last minute, when the desired
    /// final size is known, to allow best quality.
    ///
    /// If you have your icon hand-drawn in multiple sizes, use
    /// [`set_icon_list()`][Self::set_icon_list()]. Then the best size will be used.
    ///
    /// This function is equivalent to calling [`set_icon_list()`][Self::set_icon_list()]
    /// with a 1-element list.
    ///
    /// See also [`Window::set_default_icon_list()`][crate::Window::set_default_icon_list()] to set the icon
    /// for all windows in your application in one go.
    /// ## `icon`
    /// icon image, or [`None`]
    #[doc(alias = "gtk_window_set_icon")]
    fn set_icon(&self, icon: Option<&gdk_pixbuf::Pixbuf>);

    /// Sets the icon for `self`.
    /// Warns on failure if `err` is [`None`].
    ///
    /// This function is equivalent to calling [`set_icon()`][Self::set_icon()]
    /// with a pixbuf created by loading the image from `filename`.
    /// ## `filename`
    /// location of icon file
    ///
    /// # Returns
    ///
    /// [`true`] if setting the icon succeeded.
    #[doc(alias = "gtk_window_set_icon_from_file")]
    fn set_icon_from_file(&self, filename: impl AsRef<std::path::Path>) -> Result<(), glib::Error>;

    #[doc(alias = "gtk_window_set_icon_list")]
    fn set_icon_list(&self, list: &[gdk_pixbuf::Pixbuf]);

    #[doc(alias = "gtk_window_set_icon_name")]
    fn set_icon_name(&self, name: Option<&str>);

    #[doc(alias = "gtk_window_set_keep_above")]
    fn set_keep_above(&self, setting: bool);

    #[doc(alias = "gtk_window_set_keep_below")]
    fn set_keep_below(&self, setting: bool);

    #[doc(alias = "gtk_window_set_mnemonic_modifier")]
    fn set_mnemonic_modifier(&self, modifier: gdk::ModifierType);

    #[doc(alias = "gtk_window_set_mnemonics_visible")]
    fn set_mnemonics_visible(&self, setting: bool);

    #[doc(alias = "gtk_window_set_modal")]
    fn set_modal(&self, modal: bool);

    #[doc(alias = "gtk_window_set_position")]
    fn set_position(&self, position: WindowPosition);

    #[doc(alias = "gtk_window_set_resizable")]
    fn set_resizable(&self, resizable: bool);

    #[doc(alias = "gtk_window_set_role")]
    fn set_role(&self, role: &str);

    #[doc(alias = "gtk_window_set_screen")]
    fn set_screen(&self, screen: &gdk::Screen);

    #[doc(alias = "gtk_window_set_skip_pager_hint")]
    fn set_skip_pager_hint(&self, setting: bool);

    #[doc(alias = "gtk_window_set_skip_taskbar_hint")]
    fn set_skip_taskbar_hint(&self, setting: bool);

    #[doc(alias = "gtk_window_set_startup_id")]
    fn set_startup_id(&self, startup_id: &str);

    #[doc(alias = "gtk_window_set_title")]
    fn set_title(&self, title: &str);

    #[doc(alias = "gtk_window_set_titlebar")]
    fn set_titlebar(&self, titlebar: Option<&impl IsA<Widget>>);

    #[doc(alias = "gtk_window_set_transient_for")]
    fn set_transient_for(&self, parent: Option<&impl IsA<Window>>);

    #[doc(alias = "gtk_window_set_type_hint")]
    fn set_type_hint(&self, hint: gdk::WindowTypeHint);

    #[doc(alias = "gtk_window_set_urgency_hint")]
    fn set_urgency_hint(&self, setting: bool);

    #[cfg_attr(feature = "v3_22", deprecated = "Since 3.22")]
    #[doc(alias = "gtk_window_set_wmclass")]
    fn set_wmclass(&self, wmclass_name: &str, wmclass_class: &str);

    #[doc(alias = "gtk_window_stick")]
    fn stick(&self);

    #[doc(alias = "gtk_window_unfullscreen")]
    fn unfullscreen(&self);

    #[doc(alias = "gtk_window_unmaximize")]
    fn unmaximize(&self);

    #[doc(alias = "gtk_window_unstick")]
    fn unstick(&self);

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

    #[doc(alias = "default-height")]
    fn set_default_height(&self, default_height: i32);

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

    #[doc(alias = "default-width")]
    fn set_default_width(&self, default_width: i32);

    #[doc(alias = "type")]
    fn type_(&self) -> WindowType;

    #[doc(alias = "window-position")]
    fn window_position(&self) -> WindowPosition;

    #[doc(alias = "window-position")]
    fn set_window_position(&self, window_position: WindowPosition);

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

    fn emit_activate_default(&self);

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

    fn emit_activate_focus(&self);

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

    fn emit_enable_debugging(&self, toggle: bool) -> bool;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    #[doc(alias = "hide-titlebar-when-maximized")]
    fn connect_hide_titlebar_when_maximized_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

impl<O: IsA<Window>> GtkWindowExt for O {
    fn activate_default(&self) -> bool {
        unsafe {
            from_glib(ffi::gtk_window_activate_default(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

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

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

    fn add_accel_group(&self, accel_group: &impl IsA<AccelGroup>) {
        unsafe {
            ffi::gtk_window_add_accel_group(
                self.as_ref().to_glib_none().0,
                accel_group.as_ref().to_glib_none().0,
            );
        }
    }

    fn add_mnemonic(&self, keyval: u32, target: &impl IsA<Widget>) {
        unsafe {
            ffi::gtk_window_add_mnemonic(
                self.as_ref().to_glib_none().0,
                keyval,
                target.as_ref().to_glib_none().0,
            );
        }
    }

    fn begin_move_drag(&self, button: i32, root_x: i32, root_y: i32, timestamp: u32) {
        unsafe {
            ffi::gtk_window_begin_move_drag(
                self.as_ref().to_glib_none().0,
                button,
                root_x,
                root_y,
                timestamp,
            );
        }
    }

    fn begin_resize_drag(
        &self,
        edge: gdk::WindowEdge,
        button: i32,
        root_x: i32,
        root_y: i32,
        timestamp: u32,
    ) {
        unsafe {
            ffi::gtk_window_begin_resize_drag(
                self.as_ref().to_glib_none().0,
                edge.into_glib(),
                button,
                root_x,
                root_y,
                timestamp,
            );
        }
    }

    fn close(&self) {
        unsafe {
            ffi::gtk_window_close(self.as_ref().to_glib_none().0);
        }
    }

    fn deiconify(&self) {
        unsafe {
            ffi::gtk_window_deiconify(self.as_ref().to_glib_none().0);
        }
    }

    fn fullscreen(&self) {
        unsafe {
            ffi::gtk_window_fullscreen(self.as_ref().to_glib_none().0);
        }
    }

    fn fullscreen_on_monitor(&self, screen: &gdk::Screen, monitor: i32) {
        unsafe {
            ffi::gtk_window_fullscreen_on_monitor(
                self.as_ref().to_glib_none().0,
                screen.to_glib_none().0,
                monitor,
            );
        }
    }

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

    fn application(&self) -> Option<Application> {
        unsafe {
            from_glib_none(ffi::gtk_window_get_application(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

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

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

    fn default_size(&self) -> (i32, i32) {
        unsafe {
            let mut width = mem::MaybeUninit::uninit();
            let mut height = mem::MaybeUninit::uninit();
            ffi::gtk_window_get_default_size(
                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 default_widget(&self) -> Option<Widget> {
        unsafe {
            from_glib_none(ffi::gtk_window_get_default_widget(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

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

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

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

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

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

    fn gravity(&self) -> gdk::Gravity {
        unsafe { from_glib(ffi::gtk_window_get_gravity(self.as_ref().to_glib_none().0)) }
    }

    fn group(&self) -> Option<WindowGroup> {
        unsafe { from_glib_none(ffi::gtk_window_get_group(self.as_ref().to_glib_none().0)) }
    }

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

    fn icon(&self) -> Option<gdk_pixbuf::Pixbuf> {
        unsafe { from_glib_none(ffi::gtk_window_get_icon(self.as_ref().to_glib_none().0)) }
    }

    fn icon_list(&self) -> Vec<gdk_pixbuf::Pixbuf> {
        unsafe {
            FromGlibPtrContainer::from_glib_container(ffi::gtk_window_get_icon_list(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    fn icon_name(&self) -> Option<glib::GString> {
        unsafe {
            from_glib_none(ffi::gtk_window_get_icon_name(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    fn mnemonic_modifier(&self) -> gdk::ModifierType {
        unsafe {
            from_glib(ffi::gtk_window_get_mnemonic_modifier(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

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

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

    fn position(&self) -> (i32, i32) {
        unsafe {
            let mut root_x = mem::MaybeUninit::uninit();
            let mut root_y = mem::MaybeUninit::uninit();
            ffi::gtk_window_get_position(
                self.as_ref().to_glib_none().0,
                root_x.as_mut_ptr(),
                root_y.as_mut_ptr(),
            );
            let root_x = root_x.assume_init();
            let root_y = root_y.assume_init();
            (root_x, root_y)
        }
    }

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

    fn role(&self) -> Option<glib::GString> {
        unsafe { from_glib_none(ffi::gtk_window_get_role(self.as_ref().to_glib_none().0)) }
    }

    fn size(&self) -> (i32, i32) {
        unsafe {
            let mut width = mem::MaybeUninit::uninit();
            let mut height = mem::MaybeUninit::uninit();
            ffi::gtk_window_get_size(
                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 skips_pager_hint(&self) -> bool {
        unsafe {
            from_glib(ffi::gtk_window_get_skip_pager_hint(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

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

    fn title(&self) -> Option<glib::GString> {
        unsafe { from_glib_none(ffi::gtk_window_get_title(self.as_ref().to_glib_none().0)) }
    }

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

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

    fn type_hint(&self) -> gdk::WindowTypeHint {
        unsafe {
            from_glib(ffi::gtk_window_get_type_hint(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

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

    fn window_type(&self) -> WindowType {
        unsafe {
            from_glib(ffi::gtk_window_get_window_type(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

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

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

    fn iconify(&self) {
        unsafe {
            ffi::gtk_window_iconify(self.as_ref().to_glib_none().0);
        }
    }

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

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

    fn maximize(&self) {
        unsafe {
            ffi::gtk_window_maximize(self.as_ref().to_glib_none().0);
        }
    }

    fn mnemonic_activate(&self, keyval: u32, modifier: gdk::ModifierType) -> bool {
        unsafe {
            from_glib(ffi::gtk_window_mnemonic_activate(
                self.as_ref().to_glib_none().0,
                keyval,
                modifier.into_glib(),
            ))
        }
    }

    fn move_(&self, x: i32, y: i32) {
        unsafe {
            ffi::gtk_window_move(self.as_ref().to_glib_none().0, x, y);
        }
    }

    fn parse_geometry(&self, geometry: &str) -> bool {
        unsafe {
            from_glib(ffi::gtk_window_parse_geometry(
                self.as_ref().to_glib_none().0,
                geometry.to_glib_none().0,
            ))
        }
    }

    fn present(&self) {
        unsafe {
            ffi::gtk_window_present(self.as_ref().to_glib_none().0);
        }
    }

    fn present_with_time(&self, timestamp: u32) {
        unsafe {
            ffi::gtk_window_present_with_time(self.as_ref().to_glib_none().0, timestamp);
        }
    }

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

    fn remove_accel_group(&self, accel_group: &impl IsA<AccelGroup>) {
        unsafe {
            ffi::gtk_window_remove_accel_group(
                self.as_ref().to_glib_none().0,
                accel_group.as_ref().to_glib_none().0,
            );
        }
    }

    fn remove_mnemonic(&self, keyval: u32, target: &impl IsA<Widget>) {
        unsafe {
            ffi::gtk_window_remove_mnemonic(
                self.as_ref().to_glib_none().0,
                keyval,
                target.as_ref().to_glib_none().0,
            );
        }
    }

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

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

    fn set_accept_focus(&self, setting: bool) {
        unsafe {
            ffi::gtk_window_set_accept_focus(self.as_ref().to_glib_none().0, setting.into_glib());
        }
    }

    fn set_application(&self, application: Option<&impl IsA<Application>>) {
        unsafe {
            ffi::gtk_window_set_application(
                self.as_ref().to_glib_none().0,
                application.map(|p| p.as_ref()).to_glib_none().0,
            );
        }
    }

    fn set_attached_to(&self, attach_widget: Option<&impl IsA<Widget>>) {
        unsafe {
            ffi::gtk_window_set_attached_to(
                self.as_ref().to_glib_none().0,
                attach_widget.map(|p| p.as_ref()).to_glib_none().0,
            );
        }
    }

    fn set_decorated(&self, setting: bool) {
        unsafe {
            ffi::gtk_window_set_decorated(self.as_ref().to_glib_none().0, setting.into_glib());
        }
    }

    fn set_default(&self, default_widget: Option<&impl IsA<Widget>>) {
        unsafe {
            ffi::gtk_window_set_default(
                self.as_ref().to_glib_none().0,
                default_widget.map(|p| p.as_ref()).to_glib_none().0,
            );
        }
    }

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

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

    fn set_deletable(&self, setting: bool) {
        unsafe {
            ffi::gtk_window_set_deletable(self.as_ref().to_glib_none().0, setting.into_glib());
        }
    }

    fn set_destroy_with_parent(&self, setting: bool) {
        unsafe {
            ffi::gtk_window_set_destroy_with_parent(
                self.as_ref().to_glib_none().0,
                setting.into_glib(),
            );
        }
    }

    fn set_focus(&self, focus: Option<&impl IsA<Widget>>) {
        unsafe {
            ffi::gtk_window_set_focus(
                self.as_ref().to_glib_none().0,
                focus.map(|p| p.as_ref()).to_glib_none().0,
            );
        }
    }

    fn set_focus_on_map(&self, setting: bool) {
        unsafe {
            ffi::gtk_window_set_focus_on_map(self.as_ref().to_glib_none().0, setting.into_glib());
        }
    }

    fn set_focus_visible(&self, setting: bool) {
        unsafe {
            ffi::gtk_window_set_focus_visible(self.as_ref().to_glib_none().0, setting.into_glib());
        }
    }

    fn set_geometry_hints(
        &self,
        geometry_widget: Option<&impl IsA<Widget>>,
        geometry: Option<&gdk::Geometry>,
        geom_mask: gdk::WindowHints,
    ) {
        unsafe {
            ffi::gtk_window_set_geometry_hints(
                self.as_ref().to_glib_none().0,
                geometry_widget.map(|p| p.as_ref()).to_glib_none().0,
                mut_override(geometry.to_glib_none().0),
                geom_mask.into_glib(),
            );
        }
    }

    fn set_gravity(&self, gravity: gdk::Gravity) {
        unsafe {
            ffi::gtk_window_set_gravity(self.as_ref().to_glib_none().0, gravity.into_glib());
        }
    }

    fn set_has_user_ref_count(&self, setting: bool) {
        unsafe {
            ffi::gtk_window_set_has_user_ref_count(
                self.as_ref().to_glib_none().0,
                setting.into_glib(),
            );
        }
    }

    fn set_hide_titlebar_when_maximized(&self, setting: bool) {
        unsafe {
            ffi::gtk_window_set_hide_titlebar_when_maximized(
                self.as_ref().to_glib_none().0,
                setting.into_glib(),
            );
        }
    }

    fn set_icon(&self, icon: Option<&gdk_pixbuf::Pixbuf>) {
        unsafe {
            ffi::gtk_window_set_icon(self.as_ref().to_glib_none().0, icon.to_glib_none().0);
        }
    }

    fn set_icon_from_file(&self, filename: impl AsRef<std::path::Path>) -> Result<(), glib::Error> {
        unsafe {
            let mut error = ptr::null_mut();
            let is_ok = ffi::gtk_window_set_icon_from_file(
                self.as_ref().to_glib_none().0,
                filename.as_ref().to_glib_none().0,
                &mut error,
            );
            assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
            if error.is_null() {
                Ok(())
            } else {
                Err(from_glib_full(error))
            }
        }
    }

    fn set_icon_list(&self, list: &[gdk_pixbuf::Pixbuf]) {
        unsafe {
            ffi::gtk_window_set_icon_list(self.as_ref().to_glib_none().0, list.to_glib_none().0);
        }
    }

    fn set_icon_name(&self, name: Option<&str>) {
        unsafe {
            ffi::gtk_window_set_icon_name(self.as_ref().to_glib_none().0, name.to_glib_none().0);
        }
    }

    fn set_keep_above(&self, setting: bool) {
        unsafe {
            ffi::gtk_window_set_keep_above(self.as_ref().to_glib_none().0, setting.into_glib());
        }
    }

    fn set_keep_below(&self, setting: bool) {
        unsafe {
            ffi::gtk_window_set_keep_below(self.as_ref().to_glib_none().0, setting.into_glib());
        }
    }

    fn set_mnemonic_modifier(&self, modifier: gdk::ModifierType) {
        unsafe {
            ffi::gtk_window_set_mnemonic_modifier(
                self.as_ref().to_glib_none().0,
                modifier.into_glib(),
            );
        }
    }

    fn set_mnemonics_visible(&self, setting: bool) {
        unsafe {
            ffi::gtk_window_set_mnemonics_visible(
                self.as_ref().to_glib_none().0,
                setting.into_glib(),
            );
        }
    }

    fn set_modal(&self, modal: bool) {
        unsafe {
            ffi::gtk_window_set_modal(self.as_ref().to_glib_none().0, modal.into_glib());
        }
    }

    fn set_position(&self, position: WindowPosition) {
        unsafe {
            ffi::gtk_window_set_position(self.as_ref().to_glib_none().0, position.into_glib());
        }
    }

    fn set_resizable(&self, resizable: bool) {
        unsafe {
            ffi::gtk_window_set_resizable(self.as_ref().to_glib_none().0, resizable.into_glib());
        }
    }

    fn set_role(&self, role: &str) {
        unsafe {
            ffi::gtk_window_set_role(self.as_ref().to_glib_none().0, role.to_glib_none().0);
        }
    }

    fn set_screen(&self, screen: &gdk::Screen) {
        unsafe {
            ffi::gtk_window_set_screen(self.as_ref().to_glib_none().0, screen.to_glib_none().0);
        }
    }

    fn set_skip_pager_hint(&self, setting: bool) {
        unsafe {
            ffi::gtk_window_set_skip_pager_hint(
                self.as_ref().to_glib_none().0,
                setting.into_glib(),
            );
        }
    }

    fn set_skip_taskbar_hint(&self, setting: bool) {
        unsafe {
            ffi::gtk_window_set_skip_taskbar_hint(
                self.as_ref().to_glib_none().0,
                setting.into_glib(),
            );
        }
    }

    fn set_startup_id(&self, startup_id: &str) {
        unsafe {
            ffi::gtk_window_set_startup_id(
                self.as_ref().to_glib_none().0,
                startup_id.to_glib_none().0,
            );
        }
    }

    fn set_title(&self, title: &str) {
        unsafe {
            ffi::gtk_window_set_title(self.as_ref().to_glib_none().0, title.to_glib_none().0);
        }
    }

    fn set_titlebar(&self, titlebar: Option<&impl IsA<Widget>>) {
        unsafe {
            ffi::gtk_window_set_titlebar(
                self.as_ref().to_glib_none().0,
                titlebar.map(|p| p.as_ref()).to_glib_none().0,
            );
        }
    }

    fn set_transient_for(&self, parent: Option<&impl IsA<Window>>) {
        unsafe {
            ffi::gtk_window_set_transient_for(
                self.as_ref().to_glib_none().0,
                parent.map(|p| p.as_ref()).to_glib_none().0,
            );
        }
    }

    fn set_type_hint(&self, hint: gdk::WindowTypeHint) {
        unsafe {
            ffi::gtk_window_set_type_hint(self.as_ref().to_glib_none().0, hint.into_glib());
        }
    }

    fn set_urgency_hint(&self, setting: bool) {
        unsafe {
            ffi::gtk_window_set_urgency_hint(self.as_ref().to_glib_none().0, setting.into_glib());
        }
    }

    fn set_wmclass(&self, wmclass_name: &str, wmclass_class: &str) {
        unsafe {
            ffi::gtk_window_set_wmclass(
                self.as_ref().to_glib_none().0,
                wmclass_name.to_glib_none().0,
                wmclass_class.to_glib_none().0,
            );
        }
    }

    fn stick(&self) {
        unsafe {
            ffi::gtk_window_stick(self.as_ref().to_glib_none().0);
        }
    }

    fn unfullscreen(&self) {
        unsafe {
            ffi::gtk_window_unfullscreen(self.as_ref().to_glib_none().0);
        }
    }

    fn unmaximize(&self) {
        unsafe {
            ffi::gtk_window_unmaximize(self.as_ref().to_glib_none().0);
        }
    }

    fn unstick(&self) {
        unsafe {
            ffi::gtk_window_unstick(self.as_ref().to_glib_none().0);
        }
    }

    fn default_height(&self) -> i32 {
        glib::ObjectExt::property(self.as_ref(), "default-height")
    }

    fn set_default_height(&self, default_height: i32) {
        glib::ObjectExt::set_property(self.as_ref(), "default-height", &default_height)
    }

    fn default_width(&self) -> i32 {
        glib::ObjectExt::property(self.as_ref(), "default-width")
    }

    fn set_default_width(&self, default_width: i32) {
        glib::ObjectExt::set_property(self.as_ref(), "default-width", &default_width)
    }

    fn type_(&self) -> WindowType {
        glib::ObjectExt::property(self.as_ref(), "type")
    }

    fn window_position(&self) -> WindowPosition {
        glib::ObjectExt::property(self.as_ref(), "window-position")
    }

    fn set_window_position(&self, window_position: WindowPosition) {
        glib::ObjectExt::set_property(self.as_ref(), "window-position", &window_position)
    }

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

    fn emit_activate_default(&self) {
        self.emit_by_name::<()>("activate-default", &[]);
    }

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

    fn emit_activate_focus(&self) {
        self.emit_by_name::<()>("activate-focus", &[]);
    }

    fn connect_enable_debugging<F: Fn(&Self, bool) -> bool + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId {
        unsafe extern "C" fn enable_debugging_trampoline<
            P: IsA<Window>,
            F: Fn(&P, bool) -> bool + 'static,
        >(
            this: *mut ffi::GtkWindow,
            toggle: glib::ffi::gboolean,
            f: glib::ffi::gpointer,
        ) -> glib::ffi::gboolean {
            let f: &F = &*(f as *const F);
            f(
                Window::from_glib_borrow(this).unsafe_cast_ref(),
                from_glib(toggle),
            )
            .into_glib()
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"enable-debugging\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    enable_debugging_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn emit_enable_debugging(&self, toggle: bool) -> bool {
        self.emit_by_name("enable-debugging", &[&toggle])
    }

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

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

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

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

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

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

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

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

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

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

    fn connect_focus_on_map_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_focus_on_map_trampoline<P: IsA<Window>, F: Fn(&P) + 'static>(
            this: *mut ffi::GtkWindow,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Window::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-map\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_focus_on_map_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_focus_visible_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_focus_visible_trampoline<
            P: IsA<Window>,
            F: Fn(&P) + 'static,
        >(
            this: *mut ffi::GtkWindow,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Window::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-visible\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_focus_visible_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

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

    fn connect_has_toplevel_focus_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_has_toplevel_focus_trampoline<
            P: IsA<Window>,
            F: Fn(&P) + 'static,
        >(
            this: *mut ffi::GtkWindow,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Window::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-toplevel-focus\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_has_toplevel_focus_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

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

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

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

    fn connect_is_active_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_is_active_trampoline<P: IsA<Window>, F: Fn(&P) + 'static>(
            this: *mut ffi::GtkWindow,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Window::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-active\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_is_active_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_is_maximized_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_is_maximized_trampoline<P: IsA<Window>, F: Fn(&P) + 'static>(
            this: *mut ffi::GtkWindow,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Window::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-maximized\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_is_maximized_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

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

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

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

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

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

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

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

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

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

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

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

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

    fn connect_window_position_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_window_position_trampoline<
            P: IsA<Window>,
            F: Fn(&P) + 'static,
        >(
            this: *mut ffi::GtkWindow,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Window::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-position\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_window_position_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }
}

impl fmt::Display for Window {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        f.write_str("Window")
    }
}