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
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
#[cfg(feature = "block2")]
use block2::*;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

#[cfg(feature = "NSApplication")]
pub static NSAppKitVersionNumberWithCustomSheetPosition: NSAppKitVersion = 686.0 as _;

#[cfg(feature = "NSApplication")]
pub static NSAppKitVersionNumberWithDeferredWindowDisplaySupport: NSAppKitVersion = 1019.0 as _;

// NS_OPTIONS
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSWindowStyleMask(pub NSUInteger);
impl NSWindowStyleMask {
    #[doc(alias = "NSWindowStyleMaskBorderless")]
    pub const Borderless: Self = Self(0);
    #[doc(alias = "NSWindowStyleMaskTitled")]
    pub const Titled: Self = Self(1 << 0);
    #[doc(alias = "NSWindowStyleMaskClosable")]
    pub const Closable: Self = Self(1 << 1);
    #[doc(alias = "NSWindowStyleMaskMiniaturizable")]
    pub const Miniaturizable: Self = Self(1 << 2);
    #[doc(alias = "NSWindowStyleMaskResizable")]
    pub const Resizable: Self = Self(1 << 3);
    #[deprecated = "Textured window style should no longer be used"]
    #[doc(alias = "NSWindowStyleMaskTexturedBackground")]
    pub const TexturedBackground: Self = Self(1 << 8);
    #[doc(alias = "NSWindowStyleMaskUnifiedTitleAndToolbar")]
    pub const UnifiedTitleAndToolbar: Self = Self(1 << 12);
    #[doc(alias = "NSWindowStyleMaskFullScreen")]
    pub const FullScreen: Self = Self(1 << 14);
    #[doc(alias = "NSWindowStyleMaskFullSizeContentView")]
    pub const FullSizeContentView: Self = Self(1 << 15);
    #[doc(alias = "NSWindowStyleMaskUtilityWindow")]
    pub const UtilityWindow: Self = Self(1 << 4);
    #[doc(alias = "NSWindowStyleMaskDocModalWindow")]
    pub const DocModalWindow: Self = Self(1 << 6);
    #[doc(alias = "NSWindowStyleMaskNonactivatingPanel")]
    pub const NonactivatingPanel: Self = Self(1 << 7);
    #[doc(alias = "NSWindowStyleMaskHUDWindow")]
    pub const HUDWindow: Self = Self(1 << 13);
}

unsafe impl Encode for NSWindowStyleMask {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

unsafe impl RefEncode for NSWindowStyleMask {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

#[cfg(feature = "NSApplication")]
pub static NSModalResponseOK: NSModalResponse = 1;

#[cfg(feature = "NSApplication")]
pub static NSModalResponseCancel: NSModalResponse = 0;

pub const NSDisplayWindowRunLoopOrdering: c_uint = 600000;
pub const NSResetCursorRectsRunLoopOrdering: c_uint = 700000;

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSWindowSharingType(pub NSUInteger);
impl NSWindowSharingType {
    pub const NSWindowSharingNone: Self = Self(0);
    pub const NSWindowSharingReadOnly: Self = Self(1);
    pub const NSWindowSharingReadWrite: Self = Self(2);
}

unsafe impl Encode for NSWindowSharingType {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

unsafe impl RefEncode for NSWindowSharingType {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

// NS_OPTIONS
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSWindowCollectionBehavior(pub NSUInteger);
impl NSWindowCollectionBehavior {
    #[doc(alias = "NSWindowCollectionBehaviorDefault")]
    pub const Default: Self = Self(0);
    #[doc(alias = "NSWindowCollectionBehaviorCanJoinAllSpaces")]
    pub const CanJoinAllSpaces: Self = Self(1 << 0);
    #[doc(alias = "NSWindowCollectionBehaviorMoveToActiveSpace")]
    pub const MoveToActiveSpace: Self = Self(1 << 1);
    #[doc(alias = "NSWindowCollectionBehaviorManaged")]
    pub const Managed: Self = Self(1 << 2);
    #[doc(alias = "NSWindowCollectionBehaviorTransient")]
    pub const Transient: Self = Self(1 << 3);
    #[doc(alias = "NSWindowCollectionBehaviorStationary")]
    pub const Stationary: Self = Self(1 << 4);
    #[doc(alias = "NSWindowCollectionBehaviorParticipatesInCycle")]
    pub const ParticipatesInCycle: Self = Self(1 << 5);
    #[doc(alias = "NSWindowCollectionBehaviorIgnoresCycle")]
    pub const IgnoresCycle: Self = Self(1 << 6);
    #[doc(alias = "NSWindowCollectionBehaviorFullScreenPrimary")]
    pub const FullScreenPrimary: Self = Self(1 << 7);
    #[doc(alias = "NSWindowCollectionBehaviorFullScreenAuxiliary")]
    pub const FullScreenAuxiliary: Self = Self(1 << 8);
    #[doc(alias = "NSWindowCollectionBehaviorFullScreenNone")]
    pub const FullScreenNone: Self = Self(1 << 9);
    #[doc(alias = "NSWindowCollectionBehaviorFullScreenAllowsTiling")]
    pub const FullScreenAllowsTiling: Self = Self(1 << 11);
    #[doc(alias = "NSWindowCollectionBehaviorFullScreenDisallowsTiling")]
    pub const FullScreenDisallowsTiling: Self = Self(1 << 12);
    #[doc(alias = "NSWindowCollectionBehaviorPrimary")]
    pub const Primary: Self = Self(1 << 16);
    #[doc(alias = "NSWindowCollectionBehaviorAuxiliary")]
    pub const Auxiliary: Self = Self(1 << 17);
    #[doc(alias = "NSWindowCollectionBehaviorCanJoinAllApplications")]
    pub const CanJoinAllApplications: Self = Self(1 << 18);
}

unsafe impl Encode for NSWindowCollectionBehavior {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

unsafe impl RefEncode for NSWindowCollectionBehavior {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSWindowAnimationBehavior(pub NSInteger);
impl NSWindowAnimationBehavior {
    #[doc(alias = "NSWindowAnimationBehaviorDefault")]
    pub const Default: Self = Self(0);
    #[doc(alias = "NSWindowAnimationBehaviorNone")]
    pub const None: Self = Self(2);
    #[doc(alias = "NSWindowAnimationBehaviorDocumentWindow")]
    pub const DocumentWindow: Self = Self(3);
    #[doc(alias = "NSWindowAnimationBehaviorUtilityWindow")]
    pub const UtilityWindow: Self = Self(4);
    #[doc(alias = "NSWindowAnimationBehaviorAlertPanel")]
    pub const AlertPanel: Self = Self(5);
}

unsafe impl Encode for NSWindowAnimationBehavior {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for NSWindowAnimationBehavior {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

// NS_OPTIONS
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSWindowNumberListOptions(pub NSUInteger);
impl NSWindowNumberListOptions {
    pub const NSWindowNumberListAllApplications: Self = Self(1 << 0);
    pub const NSWindowNumberListAllSpaces: Self = Self(1 << 4);
}

unsafe impl Encode for NSWindowNumberListOptions {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

unsafe impl RefEncode for NSWindowNumberListOptions {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

// NS_OPTIONS
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSWindowOcclusionState(pub NSUInteger);
impl NSWindowOcclusionState {
    #[doc(alias = "NSWindowOcclusionStateVisible")]
    pub const Visible: Self = Self(1 << 1);
}

unsafe impl Encode for NSWindowOcclusionState {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

unsafe impl RefEncode for NSWindowOcclusionState {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

// NS_TYPED_EXTENSIBLE_ENUM
pub type NSWindowLevel = NSInteger;

pub static NSNormalWindowLevel: NSWindowLevel = 0;

pub static NSFloatingWindowLevel: NSWindowLevel = 3;

pub static NSSubmenuWindowLevel: NSWindowLevel = 3;

pub static NSTornOffMenuWindowLevel: NSWindowLevel = 3;

pub static NSMainMenuWindowLevel: NSWindowLevel = 24;

pub static NSStatusWindowLevel: NSWindowLevel = 25;

pub static NSModalPanelWindowLevel: NSWindowLevel = 8;

pub static NSPopUpMenuWindowLevel: NSWindowLevel = 101;

pub static NSScreenSaverWindowLevel: NSWindowLevel = 1000;

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSSelectionDirection(pub NSUInteger);
impl NSSelectionDirection {
    pub const NSDirectSelection: Self = Self(0);
    pub const NSSelectingNext: Self = Self(1);
    pub const NSSelectingPrevious: Self = Self(2);
}

unsafe impl Encode for NSSelectionDirection {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

unsafe impl RefEncode for NSSelectionDirection {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSWindowButton(pub NSUInteger);
impl NSWindowButton {
    pub const NSWindowCloseButton: Self = Self(0);
    pub const NSWindowMiniaturizeButton: Self = Self(1);
    pub const NSWindowZoomButton: Self = Self(2);
    pub const NSWindowToolbarButton: Self = Self(3);
    pub const NSWindowDocumentIconButton: Self = Self(4);
    pub const NSWindowDocumentVersionsButton: Self = Self(6);
}

unsafe impl Encode for NSWindowButton {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

unsafe impl RefEncode for NSWindowButton {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSWindowTitleVisibility(pub NSInteger);
impl NSWindowTitleVisibility {
    pub const NSWindowTitleVisible: Self = Self(0);
    pub const NSWindowTitleHidden: Self = Self(1);
}

unsafe impl Encode for NSWindowTitleVisibility {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for NSWindowTitleVisibility {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSWindowToolbarStyle(pub NSInteger);
impl NSWindowToolbarStyle {
    #[doc(alias = "NSWindowToolbarStyleAutomatic")]
    pub const Automatic: Self = Self(0);
    #[doc(alias = "NSWindowToolbarStyleExpanded")]
    pub const Expanded: Self = Self(1);
    #[doc(alias = "NSWindowToolbarStylePreference")]
    pub const Preference: Self = Self(2);
    #[doc(alias = "NSWindowToolbarStyleUnified")]
    pub const Unified: Self = Self(3);
    #[doc(alias = "NSWindowToolbarStyleUnifiedCompact")]
    pub const UnifiedCompact: Self = Self(4);
}

unsafe impl Encode for NSWindowToolbarStyle {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for NSWindowToolbarStyle {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

pub static NSEventDurationForever: NSTimeInterval = c_double::MAX as _;

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSWindowUserTabbingPreference(pub NSInteger);
impl NSWindowUserTabbingPreference {
    #[doc(alias = "NSWindowUserTabbingPreferenceManual")]
    pub const Manual: Self = Self(0);
    #[doc(alias = "NSWindowUserTabbingPreferenceAlways")]
    pub const Always: Self = Self(1);
    #[doc(alias = "NSWindowUserTabbingPreferenceInFullScreen")]
    pub const InFullScreen: Self = Self(2);
}

unsafe impl Encode for NSWindowUserTabbingPreference {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for NSWindowUserTabbingPreference {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSWindowTabbingMode(pub NSInteger);
impl NSWindowTabbingMode {
    #[doc(alias = "NSWindowTabbingModeAutomatic")]
    pub const Automatic: Self = Self(0);
    #[doc(alias = "NSWindowTabbingModePreferred")]
    pub const Preferred: Self = Self(1);
    #[doc(alias = "NSWindowTabbingModeDisallowed")]
    pub const Disallowed: Self = Self(2);
}

unsafe impl Encode for NSWindowTabbingMode {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for NSWindowTabbingMode {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSTitlebarSeparatorStyle(pub NSInteger);
impl NSTitlebarSeparatorStyle {
    #[doc(alias = "NSTitlebarSeparatorStyleAutomatic")]
    pub const Automatic: Self = Self(0);
    #[doc(alias = "NSTitlebarSeparatorStyleNone")]
    pub const None: Self = Self(1);
    #[doc(alias = "NSTitlebarSeparatorStyleLine")]
    pub const Line: Self = Self(2);
    #[doc(alias = "NSTitlebarSeparatorStyleShadow")]
    pub const Shadow: Self = Self(3);
}

unsafe impl Encode for NSTitlebarSeparatorStyle {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for NSTitlebarSeparatorStyle {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

pub type NSWindowFrameAutosaveName = NSString;

pub type NSWindowPersistableFrameDescriptor = NSString;

pub type NSWindowTabbingIdentifier = NSString;

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "NSResponder")]
    pub struct NSWindow;

    #[cfg(feature = "NSResponder")]
    unsafe impl ClassType for NSWindow {
        #[inherits(NSObject)]
        type Super = NSResponder;
        type Mutability = MainThreadOnly;
    }
);

#[cfg(all(feature = "NSAccessibilityProtocols", feature = "NSResponder"))]
unsafe impl NSAccessibility for NSWindow {}

#[cfg(all(feature = "NSAccessibilityProtocols", feature = "NSResponder"))]
unsafe impl NSAccessibilityElementProtocol for NSWindow {}

#[cfg(all(feature = "NSAnimation", feature = "NSResponder"))]
unsafe impl NSAnimatablePropertyContainer for NSWindow {}

#[cfg(all(feature = "NSAppearance", feature = "NSResponder"))]
unsafe impl NSAppearanceCustomization for NSWindow {}

#[cfg(feature = "NSResponder")]
unsafe impl NSCoding for NSWindow {}

#[cfg(all(feature = "NSMenu", feature = "NSResponder"))]
unsafe impl NSMenuItemValidation for NSWindow {}

#[cfg(feature = "NSResponder")]
unsafe impl NSObjectProtocol for NSWindow {}

#[cfg(all(feature = "NSResponder", feature = "NSUserInterfaceItemIdentification"))]
unsafe impl NSUserInterfaceItemIdentification for NSWindow {}

#[cfg(all(feature = "NSResponder", feature = "NSUserInterfaceValidation"))]
unsafe impl NSUserInterfaceValidations for NSWindow {}

extern_methods!(
    #[cfg(feature = "NSResponder")]
    unsafe impl NSWindow {
        #[method(frameRectForContentRect:styleMask:)]
        pub unsafe fn frameRectForContentRect_styleMask(
            c_rect: NSRect,
            style: NSWindowStyleMask,
            mtm: MainThreadMarker,
        ) -> NSRect;

        #[method(contentRectForFrameRect:styleMask:)]
        pub unsafe fn contentRectForFrameRect_styleMask(
            f_rect: NSRect,
            style: NSWindowStyleMask,
            mtm: MainThreadMarker,
        ) -> NSRect;

        #[method(minFrameWidthWithTitle:styleMask:)]
        pub unsafe fn minFrameWidthWithTitle_styleMask(
            title: &NSString,
            style: NSWindowStyleMask,
            mtm: MainThreadMarker,
        ) -> CGFloat;

        #[cfg(feature = "NSGraphics")]
        #[method(defaultDepthLimit)]
        pub unsafe fn defaultDepthLimit(mtm: MainThreadMarker) -> NSWindowDepth;

        #[method(frameRectForContentRect:)]
        pub unsafe fn frameRectForContentRect(&self, content_rect: NSRect) -> NSRect;

        #[method(contentRectForFrameRect:)]
        pub fn contentRectForFrameRect(&self, frame_rect: NSRect) -> NSRect;

        #[cfg(feature = "NSGraphics")]
        #[method_id(@__retain_semantics Init initWithContentRect:styleMask:backing:defer:)]
        pub unsafe fn initWithContentRect_styleMask_backing_defer(
            this: Allocated<Self>,
            content_rect: NSRect,
            style: NSWindowStyleMask,
            backing_store_type: NSBackingStoreType,
            flag: bool,
        ) -> Id<Self>;

        #[cfg(all(feature = "NSGraphics", feature = "NSScreen"))]
        #[method_id(@__retain_semantics Init initWithContentRect:styleMask:backing:defer:screen:)]
        pub unsafe fn initWithContentRect_styleMask_backing_defer_screen(
            this: Allocated<Self>,
            content_rect: NSRect,
            style: NSWindowStyleMask,
            backing_store_type: NSBackingStoreType,
            flag: bool,
            screen: Option<&NSScreen>,
        ) -> Id<Self>;

        #[method_id(@__retain_semantics Init initWithCoder:)]
        pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Id<Self>;

        #[method_id(@__retain_semantics Other title)]
        pub fn title(&self) -> Id<NSString>;

        #[method(setTitle:)]
        pub fn setTitle(&self, title: &NSString);

        #[method_id(@__retain_semantics Other subtitle)]
        pub unsafe fn subtitle(&self) -> Id<NSString>;

        #[method(setSubtitle:)]
        pub unsafe fn setSubtitle(&self, subtitle: &NSString);

        #[method(titleVisibility)]
        pub unsafe fn titleVisibility(&self) -> NSWindowTitleVisibility;

        #[method(setTitleVisibility:)]
        pub fn setTitleVisibility(&self, title_visibility: NSWindowTitleVisibility);

        #[method(titlebarAppearsTransparent)]
        pub unsafe fn titlebarAppearsTransparent(&self) -> bool;

        #[method(setTitlebarAppearsTransparent:)]
        pub fn setTitlebarAppearsTransparent(&self, titlebar_appears_transparent: bool);

        #[method(toolbarStyle)]
        pub unsafe fn toolbarStyle(&self) -> NSWindowToolbarStyle;

        #[method(setToolbarStyle:)]
        pub unsafe fn setToolbarStyle(&self, toolbar_style: NSWindowToolbarStyle);

        #[method(contentLayoutRect)]
        pub unsafe fn contentLayoutRect(&self) -> NSRect;

        #[method_id(@__retain_semantics Other contentLayoutGuide)]
        pub unsafe fn contentLayoutGuide(&self) -> Option<Id<AnyObject>>;

        #[cfg(all(
            feature = "NSTitlebarAccessoryViewController",
            feature = "NSViewController"
        ))]
        #[method_id(@__retain_semantics Other titlebarAccessoryViewControllers)]
        pub unsafe fn titlebarAccessoryViewControllers(
            &self,
        ) -> Id<NSArray<NSTitlebarAccessoryViewController>>;

        #[cfg(all(
            feature = "NSTitlebarAccessoryViewController",
            feature = "NSViewController"
        ))]
        #[method(setTitlebarAccessoryViewControllers:)]
        pub unsafe fn setTitlebarAccessoryViewControllers(
            &self,
            titlebar_accessory_view_controllers: &NSArray<NSTitlebarAccessoryViewController>,
        );

        #[cfg(all(
            feature = "NSTitlebarAccessoryViewController",
            feature = "NSViewController"
        ))]
        #[method(addTitlebarAccessoryViewController:)]
        pub unsafe fn addTitlebarAccessoryViewController(
            &self,
            child_view_controller: &NSTitlebarAccessoryViewController,
        );

        #[cfg(all(
            feature = "NSTitlebarAccessoryViewController",
            feature = "NSViewController"
        ))]
        #[method(insertTitlebarAccessoryViewController:atIndex:)]
        pub unsafe fn insertTitlebarAccessoryViewController_atIndex(
            &self,
            child_view_controller: &NSTitlebarAccessoryViewController,
            index: NSInteger,
        );

        #[method(removeTitlebarAccessoryViewControllerAtIndex:)]
        pub unsafe fn removeTitlebarAccessoryViewControllerAtIndex(&self, index: NSInteger);

        #[method_id(@__retain_semantics Other representedURL)]
        pub unsafe fn representedURL(&self) -> Option<Id<NSURL>>;

        #[method(setRepresentedURL:)]
        pub unsafe fn setRepresentedURL(&self, represented_url: Option<&NSURL>);

        #[method_id(@__retain_semantics Other representedFilename)]
        pub unsafe fn representedFilename(&self) -> Id<NSString>;

        #[method(setRepresentedFilename:)]
        pub unsafe fn setRepresentedFilename(&self, represented_filename: &NSString);

        #[method(setTitleWithRepresentedFilename:)]
        pub unsafe fn setTitleWithRepresentedFilename(&self, filename: &NSString);

        #[method(isExcludedFromWindowsMenu)]
        pub unsafe fn isExcludedFromWindowsMenu(&self) -> bool;

        #[method(setExcludedFromWindowsMenu:)]
        pub unsafe fn setExcludedFromWindowsMenu(&self, excluded_from_windows_menu: bool);

        #[cfg(feature = "NSView")]
        #[method_id(@__retain_semantics Other contentView)]
        pub fn contentView(&self) -> Option<Id<NSView>>;

        #[cfg(feature = "NSView")]
        #[method(setContentView:)]
        pub fn setContentView(&self, content_view: Option<&NSView>);

        #[method_id(@__retain_semantics Other delegate)]
        pub unsafe fn delegate(&self) -> Option<Id<ProtocolObject<dyn NSWindowDelegate>>>;

        #[method(setDelegate:)]
        pub fn setDelegate(&self, delegate: Option<&ProtocolObject<dyn NSWindowDelegate>>);

        #[method(windowNumber)]
        pub unsafe fn windowNumber(&self) -> NSInteger;

        #[method(styleMask)]
        pub fn styleMask(&self) -> NSWindowStyleMask;

        #[method(setStyleMask:)]
        pub fn setStyleMask(&self, style_mask: NSWindowStyleMask);

        #[cfg(all(feature = "NSText", feature = "NSView"))]
        #[method_id(@__retain_semantics Other fieldEditor:forObject:)]
        pub unsafe fn fieldEditor_forObject(
            &self,
            create_flag: bool,
            object: Option<&AnyObject>,
        ) -> Option<Id<NSText>>;

        #[method(endEditingFor:)]
        pub unsafe fn endEditingFor(&self, object: Option<&AnyObject>);

        #[cfg(feature = "NSScreen")]
        #[method(constrainFrameRect:toScreen:)]
        pub unsafe fn constrainFrameRect_toScreen(
            &self,
            frame_rect: NSRect,
            screen: Option<&NSScreen>,
        ) -> NSRect;

        #[method(setFrame:display:)]
        pub fn setFrame_display(&self, frame_rect: NSRect, flag: bool);

        #[method(setContentSize:)]
        pub fn setContentSize(&self, size: NSSize);

        #[method(setFrameOrigin:)]
        pub unsafe fn setFrameOrigin(&self, point: NSPoint);

        #[method(setFrameTopLeftPoint:)]
        pub fn setFrameTopLeftPoint(&self, point: NSPoint);

        #[method(cascadeTopLeftFromPoint:)]
        pub unsafe fn cascadeTopLeftFromPoint(&self, top_left_point: NSPoint) -> NSPoint;

        #[method(frame)]
        pub fn frame(&self) -> NSRect;

        #[method(animationResizeTime:)]
        pub unsafe fn animationResizeTime(&self, new_frame: NSRect) -> NSTimeInterval;

        #[method(setFrame:display:animate:)]
        pub unsafe fn setFrame_display_animate(
            &self,
            frame_rect: NSRect,
            display_flag: bool,
            animate_flag: bool,
        );

        #[method(inLiveResize)]
        pub unsafe fn inLiveResize(&self) -> bool;

        #[method(resizeIncrements)]
        pub unsafe fn resizeIncrements(&self) -> NSSize;

        #[method(setResizeIncrements:)]
        pub fn setResizeIncrements(&self, resize_increments: NSSize);

        #[method(aspectRatio)]
        pub unsafe fn aspectRatio(&self) -> NSSize;

        #[method(setAspectRatio:)]
        pub unsafe fn setAspectRatio(&self, aspect_ratio: NSSize);

        #[method(contentResizeIncrements)]
        pub fn contentResizeIncrements(&self) -> NSSize;

        #[method(setContentResizeIncrements:)]
        pub fn setContentResizeIncrements(&self, content_resize_increments: NSSize);

        #[method(contentAspectRatio)]
        pub unsafe fn contentAspectRatio(&self) -> NSSize;

        #[method(setContentAspectRatio:)]
        pub unsafe fn setContentAspectRatio(&self, content_aspect_ratio: NSSize);

        #[method(viewsNeedDisplay)]
        pub unsafe fn viewsNeedDisplay(&self) -> bool;

        #[method(setViewsNeedDisplay:)]
        pub unsafe fn setViewsNeedDisplay(&self, views_need_display: bool);

        #[method(displayIfNeeded)]
        pub unsafe fn displayIfNeeded(&self);

        #[method(display)]
        pub unsafe fn display(&self);

        #[method(preservesContentDuringLiveResize)]
        pub unsafe fn preservesContentDuringLiveResize(&self) -> bool;

        #[method(setPreservesContentDuringLiveResize:)]
        pub unsafe fn setPreservesContentDuringLiveResize(
            &self,
            preserves_content_during_live_resize: bool,
        );

        #[method(update)]
        pub unsafe fn update(&self);

        #[method(makeFirstResponder:)]
        pub fn makeFirstResponder(&self, responder: Option<&NSResponder>) -> bool;

        #[method_id(@__retain_semantics Other firstResponder)]
        pub fn firstResponder(&self) -> Option<Id<NSResponder>>;

        #[cfg(feature = "NSEvent")]
        #[method(resizeFlags)]
        pub unsafe fn resizeFlags(&self) -> NSEventModifierFlags;

        #[method(close)]
        pub fn close(&self);

        #[method(isReleasedWhenClosed)]
        pub unsafe fn isReleasedWhenClosed(&self) -> bool;

        #[method(setReleasedWhenClosed:)]
        pub unsafe fn setReleasedWhenClosed(&self, released_when_closed: bool);

        #[method(miniaturize:)]
        pub fn miniaturize(&self, sender: Option<&AnyObject>);

        #[method(deminiaturize:)]
        pub unsafe fn deminiaturize(&self, sender: Option<&AnyObject>);

        #[method(isZoomed)]
        pub fn isZoomed(&self) -> bool;

        #[method(zoom:)]
        pub fn zoom(&self, sender: Option<&AnyObject>);

        #[method(isMiniaturized)]
        pub fn isMiniaturized(&self) -> bool;

        #[method(tryToPerform:with:)]
        pub unsafe fn tryToPerform_with(&self, action: Sel, object: Option<&AnyObject>) -> bool;

        #[cfg(feature = "NSPasteboard")]
        #[method_id(@__retain_semantics Other validRequestorForSendType:returnType:)]
        pub unsafe fn validRequestorForSendType_returnType(
            &self,
            send_type: Option<&NSPasteboardType>,
            return_type: Option<&NSPasteboardType>,
        ) -> Option<Id<AnyObject>>;

        #[cfg(feature = "NSColor")]
        #[method_id(@__retain_semantics Other backgroundColor)]
        pub unsafe fn backgroundColor(&self) -> Id<NSColor>;

        #[cfg(feature = "NSColor")]
        #[method(setBackgroundColor:)]
        pub fn setBackgroundColor(&self, background_color: Option<&NSColor>);

        #[method(setContentBorderThickness:forEdge:)]
        pub unsafe fn setContentBorderThickness_forEdge(
            &self,
            thickness: CGFloat,
            edge: NSRectEdge,
        );

        #[method(contentBorderThicknessForEdge:)]
        pub unsafe fn contentBorderThicknessForEdge(&self, edge: NSRectEdge) -> CGFloat;

        #[method(setAutorecalculatesContentBorderThickness:forEdge:)]
        pub unsafe fn setAutorecalculatesContentBorderThickness_forEdge(
            &self,
            flag: bool,
            edge: NSRectEdge,
        );

        #[method(autorecalculatesContentBorderThicknessForEdge:)]
        pub unsafe fn autorecalculatesContentBorderThicknessForEdge(
            &self,
            edge: NSRectEdge,
        ) -> bool;

        #[method(isMovable)]
        pub unsafe fn isMovable(&self) -> bool;

        #[method(setMovable:)]
        pub fn setMovable(&self, movable: bool);

        #[method(isMovableByWindowBackground)]
        pub unsafe fn isMovableByWindowBackground(&self) -> bool;

        #[method(setMovableByWindowBackground:)]
        pub fn setMovableByWindowBackground(&self, movable_by_window_background: bool);

        #[method(hidesOnDeactivate)]
        pub unsafe fn hidesOnDeactivate(&self) -> bool;

        #[method(setHidesOnDeactivate:)]
        pub unsafe fn setHidesOnDeactivate(&self, hides_on_deactivate: bool);

        #[method(canHide)]
        pub unsafe fn canHide(&self) -> bool;

        #[method(setCanHide:)]
        pub unsafe fn setCanHide(&self, can_hide: bool);

        #[method(center)]
        pub fn center(&self);

        #[method(makeKeyAndOrderFront:)]
        pub fn makeKeyAndOrderFront(&self, sender: Option<&AnyObject>);

        #[method(orderFront:)]
        pub fn orderFront(&self, sender: Option<&AnyObject>);

        #[method(orderBack:)]
        pub unsafe fn orderBack(&self, sender: Option<&AnyObject>);

        #[method(orderOut:)]
        pub fn orderOut(&self, sender: Option<&AnyObject>);

        #[cfg(feature = "NSGraphics")]
        #[method(orderWindow:relativeTo:)]
        pub unsafe fn orderWindow_relativeTo(
            &self,
            place: NSWindowOrderingMode,
            other_win: NSInteger,
        );

        #[method(orderFrontRegardless)]
        pub unsafe fn orderFrontRegardless(&self);

        #[cfg(feature = "NSImage")]
        #[method_id(@__retain_semantics Other miniwindowImage)]
        pub unsafe fn miniwindowImage(&self) -> Option<Id<NSImage>>;

        #[cfg(feature = "NSImage")]
        #[method(setMiniwindowImage:)]
        pub unsafe fn setMiniwindowImage(&self, miniwindow_image: Option<&NSImage>);

        #[method_id(@__retain_semantics Other miniwindowTitle)]
        pub unsafe fn miniwindowTitle(&self) -> Id<NSString>;

        #[method(setMiniwindowTitle:)]
        pub unsafe fn setMiniwindowTitle(&self, miniwindow_title: Option<&NSString>);

        #[cfg(feature = "NSDockTile")]
        #[method_id(@__retain_semantics Other dockTile)]
        pub unsafe fn dockTile(&self) -> Id<NSDockTile>;

        #[method(isDocumentEdited)]
        pub fn isDocumentEdited(&self) -> bool;

        #[method(setDocumentEdited:)]
        pub fn setDocumentEdited(&self, document_edited: bool);

        #[method(isVisible)]
        pub fn isVisible(&self) -> bool;

        #[method(isKeyWindow)]
        pub fn isKeyWindow(&self) -> bool;

        #[method(isMainWindow)]
        pub unsafe fn isMainWindow(&self) -> bool;

        #[method(canBecomeKeyWindow)]
        pub unsafe fn canBecomeKeyWindow(&self) -> bool;

        #[method(canBecomeMainWindow)]
        pub unsafe fn canBecomeMainWindow(&self) -> bool;

        #[method(makeKeyWindow)]
        pub unsafe fn makeKeyWindow(&self);

        #[method(makeMainWindow)]
        pub unsafe fn makeMainWindow(&self);

        #[method(becomeKeyWindow)]
        pub unsafe fn becomeKeyWindow(&self);

        #[method(resignKeyWindow)]
        pub unsafe fn resignKeyWindow(&self);

        #[method(becomeMainWindow)]
        pub unsafe fn becomeMainWindow(&self);

        #[method(resignMainWindow)]
        pub unsafe fn resignMainWindow(&self);

        #[method(worksWhenModal)]
        pub unsafe fn worksWhenModal(&self) -> bool;

        #[method(preventsApplicationTerminationWhenModal)]
        pub unsafe fn preventsApplicationTerminationWhenModal(&self) -> bool;

        #[method(setPreventsApplicationTerminationWhenModal:)]
        pub unsafe fn setPreventsApplicationTerminationWhenModal(
            &self,
            prevents_application_termination_when_modal: bool,
        );

        #[method(convertRectToScreen:)]
        pub fn convertRectToScreen(&self, rect: NSRect) -> NSRect;

        #[method(convertRectFromScreen:)]
        pub unsafe fn convertRectFromScreen(&self, rect: NSRect) -> NSRect;

        #[method(convertPointToScreen:)]
        pub unsafe fn convertPointToScreen(&self, point: NSPoint) -> NSPoint;

        #[method(convertPointFromScreen:)]
        pub fn convertPointFromScreen(&self, point: NSPoint) -> NSPoint;

        #[method(convertRectToBacking:)]
        pub unsafe fn convertRectToBacking(&self, rect: NSRect) -> NSRect;

        #[method(convertRectFromBacking:)]
        pub unsafe fn convertRectFromBacking(&self, rect: NSRect) -> NSRect;

        #[method(convertPointToBacking:)]
        pub unsafe fn convertPointToBacking(&self, point: NSPoint) -> NSPoint;

        #[method(convertPointFromBacking:)]
        pub unsafe fn convertPointFromBacking(&self, point: NSPoint) -> NSPoint;

        #[method(backingAlignedRect:options:)]
        pub unsafe fn backingAlignedRect_options(
            &self,
            rect: NSRect,
            options: NSAlignmentOptions,
        ) -> NSRect;

        #[method(backingScaleFactor)]
        pub fn backingScaleFactor(&self) -> CGFloat;

        #[method(performClose:)]
        pub unsafe fn performClose(&self, sender: Option<&AnyObject>);

        #[method(performMiniaturize:)]
        pub unsafe fn performMiniaturize(&self, sender: Option<&AnyObject>);

        #[method(performZoom:)]
        pub unsafe fn performZoom(&self, sender: Option<&AnyObject>);

        #[method_id(@__retain_semantics Other dataWithEPSInsideRect:)]
        pub unsafe fn dataWithEPSInsideRect(&self, rect: NSRect) -> Id<NSData>;

        #[method_id(@__retain_semantics Other dataWithPDFInsideRect:)]
        pub unsafe fn dataWithPDFInsideRect(&self, rect: NSRect) -> Id<NSData>;

        #[method(print:)]
        pub unsafe fn print(&self, sender: Option<&AnyObject>);

        #[method(allowsToolTipsWhenApplicationIsInactive)]
        pub unsafe fn allowsToolTipsWhenApplicationIsInactive(&self) -> bool;

        #[method(setAllowsToolTipsWhenApplicationIsInactive:)]
        pub unsafe fn setAllowsToolTipsWhenApplicationIsInactive(
            &self,
            allows_tool_tips_when_application_is_inactive: bool,
        );

        #[cfg(feature = "NSGraphics")]
        #[method(backingType)]
        pub unsafe fn backingType(&self) -> NSBackingStoreType;

        #[cfg(feature = "NSGraphics")]
        #[method(setBackingType:)]
        pub unsafe fn setBackingType(&self, backing_type: NSBackingStoreType);

        #[method(level)]
        pub unsafe fn level(&self) -> NSWindowLevel;

        #[method(setLevel:)]
        pub fn setLevel(&self, level: NSWindowLevel);

        #[cfg(feature = "NSGraphics")]
        #[method(depthLimit)]
        pub unsafe fn depthLimit(&self) -> NSWindowDepth;

        #[cfg(feature = "NSGraphics")]
        #[method(setDepthLimit:)]
        pub unsafe fn setDepthLimit(&self, depth_limit: NSWindowDepth);

        #[method(setDynamicDepthLimit:)]
        pub unsafe fn setDynamicDepthLimit(&self, flag: bool);

        #[method(hasDynamicDepthLimit)]
        pub unsafe fn hasDynamicDepthLimit(&self) -> bool;

        #[cfg(feature = "NSScreen")]
        #[method_id(@__retain_semantics Other screen)]
        pub fn screen(&self) -> Option<Id<NSScreen>>;

        #[cfg(feature = "NSScreen")]
        #[method_id(@__retain_semantics Other deepestScreen)]
        pub unsafe fn deepestScreen(&self) -> Option<Id<NSScreen>>;

        #[method(hasShadow)]
        pub fn hasShadow(&self) -> bool;

        #[method(setHasShadow:)]
        pub fn setHasShadow(&self, has_shadow: bool);

        #[method(invalidateShadow)]
        pub unsafe fn invalidateShadow(&self);

        #[method(alphaValue)]
        pub unsafe fn alphaValue(&self) -> CGFloat;

        #[method(setAlphaValue:)]
        pub unsafe fn setAlphaValue(&self, alpha_value: CGFloat);

        #[method(isOpaque)]
        pub unsafe fn isOpaque(&self) -> bool;

        #[method(setOpaque:)]
        pub fn setOpaque(&self, opaque: bool);

        #[method(sharingType)]
        pub unsafe fn sharingType(&self) -> NSWindowSharingType;

        #[method(setSharingType:)]
        pub fn setSharingType(&self, sharing_type: NSWindowSharingType);

        #[method(allowsConcurrentViewDrawing)]
        pub unsafe fn allowsConcurrentViewDrawing(&self) -> bool;

        #[method(setAllowsConcurrentViewDrawing:)]
        pub unsafe fn setAllowsConcurrentViewDrawing(&self, allows_concurrent_view_drawing: bool);

        #[method(displaysWhenScreenProfileChanges)]
        pub unsafe fn displaysWhenScreenProfileChanges(&self) -> bool;

        #[method(setDisplaysWhenScreenProfileChanges:)]
        pub unsafe fn setDisplaysWhenScreenProfileChanges(
            &self,
            displays_when_screen_profile_changes: bool,
        );

        #[method(disableScreenUpdatesUntilFlush)]
        pub unsafe fn disableScreenUpdatesUntilFlush(&self);

        #[method(canBecomeVisibleWithoutLogin)]
        pub unsafe fn canBecomeVisibleWithoutLogin(&self) -> bool;

        #[method(setCanBecomeVisibleWithoutLogin:)]
        pub unsafe fn setCanBecomeVisibleWithoutLogin(
            &self,
            can_become_visible_without_login: bool,
        );

        #[method(collectionBehavior)]
        pub unsafe fn collectionBehavior(&self) -> NSWindowCollectionBehavior;

        #[method(setCollectionBehavior:)]
        pub unsafe fn setCollectionBehavior(&self, collection_behavior: NSWindowCollectionBehavior);

        #[method(animationBehavior)]
        pub unsafe fn animationBehavior(&self) -> NSWindowAnimationBehavior;

        #[method(setAnimationBehavior:)]
        pub unsafe fn setAnimationBehavior(&self, animation_behavior: NSWindowAnimationBehavior);

        #[method(isOnActiveSpace)]
        pub unsafe fn isOnActiveSpace(&self) -> bool;

        #[method(toggleFullScreen:)]
        pub fn toggleFullScreen(&self, sender: Option<&AnyObject>);

        #[method_id(@__retain_semantics Other stringWithSavedFrame)]
        pub unsafe fn stringWithSavedFrame(&self) -> Id<NSWindowPersistableFrameDescriptor>;

        #[method(setFrameFromString:)]
        pub unsafe fn setFrameFromString(&self, string: &NSWindowPersistableFrameDescriptor);

        #[method(saveFrameUsingName:)]
        pub unsafe fn saveFrameUsingName(&self, name: &NSWindowFrameAutosaveName);

        #[method(setFrameUsingName:force:)]
        pub unsafe fn setFrameUsingName_force(
            &self,
            name: &NSWindowFrameAutosaveName,
            force: bool,
        ) -> bool;

        #[method(setFrameUsingName:)]
        pub unsafe fn setFrameUsingName(&self, name: &NSWindowFrameAutosaveName) -> bool;

        #[method(setFrameAutosaveName:)]
        pub unsafe fn setFrameAutosaveName(&self, name: &NSWindowFrameAutosaveName) -> bool;

        #[method_id(@__retain_semantics Other frameAutosaveName)]
        pub unsafe fn frameAutosaveName(&self) -> Id<NSWindowFrameAutosaveName>;

        #[method(removeFrameUsingName:)]
        pub unsafe fn removeFrameUsingName(name: &NSWindowFrameAutosaveName, mtm: MainThreadMarker);

        #[method(minSize)]
        pub unsafe fn minSize(&self) -> NSSize;

        #[method(setMinSize:)]
        pub fn setMinSize(&self, min_size: NSSize);

        #[method(maxSize)]
        pub unsafe fn maxSize(&self) -> NSSize;

        #[method(setMaxSize:)]
        pub fn setMaxSize(&self, max_size: NSSize);

        #[method(contentMinSize)]
        pub unsafe fn contentMinSize(&self) -> NSSize;

        #[method(setContentMinSize:)]
        pub unsafe fn setContentMinSize(&self, content_min_size: NSSize);

        #[method(contentMaxSize)]
        pub unsafe fn contentMaxSize(&self) -> NSSize;

        #[method(setContentMaxSize:)]
        pub unsafe fn setContentMaxSize(&self, content_max_size: NSSize);

        #[method(minFullScreenContentSize)]
        pub unsafe fn minFullScreenContentSize(&self) -> NSSize;

        #[method(setMinFullScreenContentSize:)]
        pub unsafe fn setMinFullScreenContentSize(&self, min_full_screen_content_size: NSSize);

        #[method(maxFullScreenContentSize)]
        pub unsafe fn maxFullScreenContentSize(&self) -> NSSize;

        #[method(setMaxFullScreenContentSize:)]
        pub unsafe fn setMaxFullScreenContentSize(&self, max_full_screen_content_size: NSSize);

        #[cfg(feature = "NSGraphics")]
        #[method_id(@__retain_semantics Other deviceDescription)]
        pub unsafe fn deviceDescription(
            &self,
        ) -> Id<NSDictionary<NSDeviceDescriptionKey, AnyObject>>;

        #[cfg(feature = "NSWindowController")]
        #[method_id(@__retain_semantics Other windowController)]
        pub unsafe fn windowController(&self) -> Option<Id<NSWindowController>>;

        #[cfg(feature = "NSWindowController")]
        #[method(setWindowController:)]
        pub unsafe fn setWindowController(&self, window_controller: Option<&NSWindowController>);

        #[cfg(all(feature = "NSApplication", feature = "block2"))]
        #[method(beginSheet:completionHandler:)]
        pub unsafe fn beginSheet_completionHandler(
            &self,
            sheet_window: &NSWindow,
            handler: Option<&Block<dyn Fn(NSModalResponse)>>,
        );

        #[cfg(all(feature = "NSApplication", feature = "block2"))]
        #[method(beginCriticalSheet:completionHandler:)]
        pub unsafe fn beginCriticalSheet_completionHandler(
            &self,
            sheet_window: &NSWindow,
            handler: Option<&Block<dyn Fn(NSModalResponse)>>,
        );

        #[method(endSheet:)]
        pub unsafe fn endSheet(&self, sheet_window: &NSWindow);

        #[cfg(feature = "NSApplication")]
        #[method(endSheet:returnCode:)]
        pub unsafe fn endSheet_returnCode(
            &self,
            sheet_window: &NSWindow,
            return_code: NSModalResponse,
        );

        #[method_id(@__retain_semantics Other sheets)]
        pub unsafe fn sheets(&self) -> Id<NSArray<NSWindow>>;

        #[method_id(@__retain_semantics Other attachedSheet)]
        pub unsafe fn attachedSheet(&self) -> Option<Id<NSWindow>>;

        #[method(isSheet)]
        pub unsafe fn isSheet(&self) -> bool;

        #[method_id(@__retain_semantics Other sheetParent)]
        pub unsafe fn sheetParent(&self) -> Option<Id<NSWindow>>;

        #[cfg(all(feature = "NSButton", feature = "NSControl", feature = "NSView"))]
        #[method_id(@__retain_semantics Other standardWindowButton:forStyleMask:)]
        pub unsafe fn standardWindowButton_forStyleMask(
            b: NSWindowButton,
            style_mask: NSWindowStyleMask,
            mtm: MainThreadMarker,
        ) -> Option<Id<NSButton>>;

        #[cfg(all(feature = "NSButton", feature = "NSControl", feature = "NSView"))]
        #[method_id(@__retain_semantics Other standardWindowButton:)]
        pub fn standardWindowButton(&self, b: NSWindowButton) -> Option<Id<NSButton>>;

        #[cfg(feature = "NSGraphics")]
        #[method(addChildWindow:ordered:)]
        pub unsafe fn addChildWindow_ordered(
            &self,
            child_win: &NSWindow,
            place: NSWindowOrderingMode,
        );

        #[method(removeChildWindow:)]
        pub unsafe fn removeChildWindow(&self, child_win: &NSWindow);

        #[method_id(@__retain_semantics Other childWindows)]
        pub unsafe fn childWindows(&self) -> Option<Id<NSArray<NSWindow>>>;

        #[method_id(@__retain_semantics Other parentWindow)]
        pub unsafe fn parentWindow(&self) -> Option<Id<NSWindow>>;

        #[method(setParentWindow:)]
        pub unsafe fn setParentWindow(&self, parent_window: Option<&NSWindow>);

        #[cfg(feature = "NSAppearance")]
        #[method_id(@__retain_semantics Other appearanceSource)]
        pub unsafe fn appearanceSource(&self) -> Option<Id<NSObject>>;

        #[cfg(feature = "NSAppearance")]
        #[method(setAppearanceSource:)]
        pub unsafe fn setAppearanceSource(&self, appearance_source: Option<&NSObject>);

        #[cfg(feature = "NSColorSpace")]
        #[method_id(@__retain_semantics Other colorSpace)]
        pub unsafe fn colorSpace(&self) -> Option<Id<NSColorSpace>>;

        #[cfg(feature = "NSColorSpace")]
        #[method(setColorSpace:)]
        pub unsafe fn setColorSpace(&self, color_space: Option<&NSColorSpace>);

        #[cfg(feature = "NSGraphics")]
        #[method(canRepresentDisplayGamut:)]
        pub unsafe fn canRepresentDisplayGamut(&self, display_gamut: NSDisplayGamut) -> bool;

        #[method_id(@__retain_semantics Other windowNumbersWithOptions:)]
        pub unsafe fn windowNumbersWithOptions(
            options: NSWindowNumberListOptions,
            mtm: MainThreadMarker,
        ) -> Option<Id<NSArray<NSNumber>>>;

        #[method(windowNumberAtPoint:belowWindowWithWindowNumber:)]
        pub unsafe fn windowNumberAtPoint_belowWindowWithWindowNumber(
            point: NSPoint,
            window_number: NSInteger,
            mtm: MainThreadMarker,
        ) -> NSInteger;

        #[method(occlusionState)]
        pub fn occlusionState(&self) -> NSWindowOcclusionState;

        #[method(titlebarSeparatorStyle)]
        pub unsafe fn titlebarSeparatorStyle(&self) -> NSTitlebarSeparatorStyle;

        #[method(setTitlebarSeparatorStyle:)]
        pub unsafe fn setTitlebarSeparatorStyle(
            &self,
            titlebar_separator_style: NSTitlebarSeparatorStyle,
        );

        #[cfg(feature = "NSViewController")]
        #[method_id(@__retain_semantics Other contentViewController)]
        pub unsafe fn contentViewController(&self) -> Option<Id<NSViewController>>;

        #[cfg(feature = "NSViewController")]
        #[method(setContentViewController:)]
        pub unsafe fn setContentViewController(
            &self,
            content_view_controller: Option<&NSViewController>,
        );

        #[cfg(feature = "NSViewController")]
        #[method_id(@__retain_semantics Other windowWithContentViewController:)]
        pub unsafe fn windowWithContentViewController(
            content_view_controller: &NSViewController,
        ) -> Id<Self>;

        #[cfg(feature = "NSEvent")]
        #[method(performWindowDragWithEvent:)]
        pub fn performWindowDragWithEvent(&self, event: &NSEvent);

        #[cfg(feature = "NSView")]
        #[method_id(@__retain_semantics Other initialFirstResponder)]
        pub unsafe fn initialFirstResponder(&self) -> Option<Id<NSView>>;

        #[cfg(feature = "NSView")]
        #[method(setInitialFirstResponder:)]
        pub fn setInitialFirstResponder(&self, initial_first_responder: Option<&NSView>);

        #[method(selectNextKeyView:)]
        pub fn selectNextKeyView(&self, sender: Option<&AnyObject>);

        #[method(selectPreviousKeyView:)]
        pub fn selectPreviousKeyView(&self, sender: Option<&AnyObject>);

        #[cfg(feature = "NSView")]
        #[method(selectKeyViewFollowingView:)]
        pub unsafe fn selectKeyViewFollowingView(&self, view: &NSView);

        #[cfg(feature = "NSView")]
        #[method(selectKeyViewPrecedingView:)]
        pub unsafe fn selectKeyViewPrecedingView(&self, view: &NSView);

        #[method(keyViewSelectionDirection)]
        pub unsafe fn keyViewSelectionDirection(&self) -> NSSelectionDirection;

        #[cfg(all(feature = "NSActionCell", feature = "NSButtonCell", feature = "NSCell"))]
        #[method_id(@__retain_semantics Other defaultButtonCell)]
        pub unsafe fn defaultButtonCell(&self) -> Option<Id<NSButtonCell>>;

        #[cfg(all(feature = "NSActionCell", feature = "NSButtonCell", feature = "NSCell"))]
        #[method(setDefaultButtonCell:)]
        pub unsafe fn setDefaultButtonCell(&self, default_button_cell: Option<&NSButtonCell>);

        #[method(disableKeyEquivalentForDefaultButtonCell)]
        pub unsafe fn disableKeyEquivalentForDefaultButtonCell(&self);

        #[method(enableKeyEquivalentForDefaultButtonCell)]
        pub unsafe fn enableKeyEquivalentForDefaultButtonCell(&self);

        #[method(autorecalculatesKeyViewLoop)]
        pub unsafe fn autorecalculatesKeyViewLoop(&self) -> bool;

        #[method(setAutorecalculatesKeyViewLoop:)]
        pub unsafe fn setAutorecalculatesKeyViewLoop(&self, autorecalculates_key_view_loop: bool);

        #[method(recalculateKeyViewLoop)]
        pub unsafe fn recalculateKeyViewLoop(&self);

        #[cfg(feature = "NSToolbar")]
        #[method_id(@__retain_semantics Other toolbar)]
        pub unsafe fn toolbar(&self) -> Option<Id<NSToolbar>>;

        #[cfg(feature = "NSToolbar")]
        #[method(setToolbar:)]
        pub unsafe fn setToolbar(&self, toolbar: Option<&NSToolbar>);

        #[method(toggleToolbarShown:)]
        pub unsafe fn toggleToolbarShown(&self, sender: Option<&AnyObject>);

        #[method(runToolbarCustomizationPalette:)]
        pub unsafe fn runToolbarCustomizationPalette(&self, sender: Option<&AnyObject>);

        #[deprecated = "This property has no effect"]
        #[method(showsToolbarButton)]
        pub unsafe fn showsToolbarButton(&self) -> bool;

        #[deprecated = "This property has no effect"]
        #[method(setShowsToolbarButton:)]
        pub unsafe fn setShowsToolbarButton(&self, shows_toolbar_button: bool);

        #[method(allowsAutomaticWindowTabbing)]
        pub fn allowsAutomaticWindowTabbing(mtm: MainThreadMarker) -> bool;

        #[method(setAllowsAutomaticWindowTabbing:)]
        pub fn setAllowsAutomaticWindowTabbing(
            allows_automatic_window_tabbing: bool,
            mtm: MainThreadMarker,
        );

        #[method(userTabbingPreference)]
        pub unsafe fn userTabbingPreference(mtm: MainThreadMarker)
            -> NSWindowUserTabbingPreference;

        #[method(tabbingMode)]
        pub unsafe fn tabbingMode(&self) -> NSWindowTabbingMode;

        #[method(setTabbingMode:)]
        pub fn setTabbingMode(&self, tabbing_mode: NSWindowTabbingMode);

        #[method_id(@__retain_semantics Other tabbingIdentifier)]
        pub fn tabbingIdentifier(&self) -> Id<NSWindowTabbingIdentifier>;

        #[method(setTabbingIdentifier:)]
        pub fn setTabbingIdentifier(&self, tabbing_identifier: &NSWindowTabbingIdentifier);

        #[method(selectNextTab:)]
        pub fn selectNextTab(&self, sender: Option<&AnyObject>);

        #[method(selectPreviousTab:)]
        pub unsafe fn selectPreviousTab(&self, sender: Option<&AnyObject>);

        #[method(moveTabToNewWindow:)]
        pub unsafe fn moveTabToNewWindow(&self, sender: Option<&AnyObject>);

        #[method(mergeAllWindows:)]
        pub unsafe fn mergeAllWindows(&self, sender: Option<&AnyObject>);

        #[method(toggleTabBar:)]
        pub unsafe fn toggleTabBar(&self, sender: Option<&AnyObject>);

        #[method(toggleTabOverview:)]
        pub unsafe fn toggleTabOverview(&self, sender: Option<&AnyObject>);

        #[method_id(@__retain_semantics Other tabbedWindows)]
        pub unsafe fn tabbedWindows(&self) -> Option<Id<NSArray<NSWindow>>>;

        #[cfg(feature = "NSGraphics")]
        #[method(addTabbedWindow:ordered:)]
        pub unsafe fn addTabbedWindow_ordered(
            &self,
            window: &NSWindow,
            ordered: NSWindowOrderingMode,
        );

        #[cfg(feature = "NSWindowTab")]
        #[method_id(@__retain_semantics Other tab)]
        pub unsafe fn tab(&self) -> Id<NSWindowTab>;

        #[cfg(feature = "NSWindowTabGroup")]
        #[method_id(@__retain_semantics Other tabGroup)]
        pub fn tabGroup(&self) -> Option<Id<NSWindowTabGroup>>;

        #[cfg(feature = "block2")]
        #[method(transferWindowSharingToWindow:completionHandler:)]
        pub unsafe fn transferWindowSharingToWindow_completionHandler(
            &self,
            window: &NSWindow,
            completion_handler: &Block<dyn Fn(*mut NSError)>,
        );

        #[method(hasActiveWindowSharingSession)]
        pub unsafe fn hasActiveWindowSharingSession(&self) -> bool;

        #[cfg(feature = "NSUserInterfaceLayout")]
        #[method(windowTitlebarLayoutDirection)]
        pub unsafe fn windowTitlebarLayoutDirection(&self) -> NSUserInterfaceLayoutDirection;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSResponder`
    #[cfg(feature = "NSResponder")]
    unsafe impl NSWindow {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    #[cfg(feature = "NSResponder")]
    unsafe impl NSWindow {
        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new(mtm: MainThreadMarker) -> Id<Self>;
    }
);

extern_methods!(
    /// NSEvent
    #[cfg(feature = "NSResponder")]
    unsafe impl NSWindow {
        #[cfg(all(feature = "NSEvent", feature = "block2"))]
        #[method(trackEventsMatchingMask:timeout:mode:handler:)]
        pub unsafe fn trackEventsMatchingMask_timeout_mode_handler(
            &self,
            mask: NSEventMask,
            timeout: NSTimeInterval,
            mode: &NSRunLoopMode,
            tracking_handler: &Block<dyn Fn(*mut NSEvent, NonNull<Bool>) + '_>,
        );

        #[cfg(feature = "NSEvent")]
        #[method_id(@__retain_semantics Other nextEventMatchingMask:)]
        pub unsafe fn nextEventMatchingMask(&self, mask: NSEventMask) -> Option<Id<NSEvent>>;

        #[cfg(feature = "NSEvent")]
        #[method_id(@__retain_semantics Other nextEventMatchingMask:untilDate:inMode:dequeue:)]
        pub unsafe fn nextEventMatchingMask_untilDate_inMode_dequeue(
            &self,
            mask: NSEventMask,
            expiration: Option<&NSDate>,
            mode: &NSRunLoopMode,
            deq_flag: bool,
        ) -> Option<Id<NSEvent>>;

        #[cfg(feature = "NSEvent")]
        #[method(discardEventsMatchingMask:beforeEvent:)]
        pub unsafe fn discardEventsMatchingMask_beforeEvent(
            &self,
            mask: NSEventMask,
            last_event: Option<&NSEvent>,
        );

        #[cfg(feature = "NSEvent")]
        #[method(postEvent:atStart:)]
        pub unsafe fn postEvent_atStart(&self, event: &NSEvent, flag: bool);

        #[cfg(feature = "NSEvent")]
        #[method(sendEvent:)]
        pub fn sendEvent(&self, event: &NSEvent);

        #[cfg(feature = "NSEvent")]
        #[method_id(@__retain_semantics Other currentEvent)]
        pub unsafe fn currentEvent(&self) -> Option<Id<NSEvent>>;

        #[method(acceptsMouseMovedEvents)]
        pub unsafe fn acceptsMouseMovedEvents(&self) -> bool;

        #[method(setAcceptsMouseMovedEvents:)]
        pub fn setAcceptsMouseMovedEvents(&self, accepts_mouse_moved_events: bool);

        #[method(ignoresMouseEvents)]
        pub unsafe fn ignoresMouseEvents(&self) -> bool;

        #[method(setIgnoresMouseEvents:)]
        pub fn setIgnoresMouseEvents(&self, ignores_mouse_events: bool);

        #[method(mouseLocationOutsideOfEventStream)]
        pub unsafe fn mouseLocationOutsideOfEventStream(&self) -> NSPoint;
    }
);

extern_methods!(
    /// NSCursorRect
    #[cfg(feature = "NSResponder")]
    unsafe impl NSWindow {
        #[method(disableCursorRects)]
        pub unsafe fn disableCursorRects(&self);

        #[method(enableCursorRects)]
        pub unsafe fn enableCursorRects(&self);

        #[method(discardCursorRects)]
        pub unsafe fn discardCursorRects(&self);

        #[method(areCursorRectsEnabled)]
        pub unsafe fn areCursorRectsEnabled(&self) -> bool;

        #[cfg(feature = "NSView")]
        #[method(invalidateCursorRectsForView:)]
        pub fn invalidateCursorRectsForView(&self, view: &NSView);

        #[method(resetCursorRects)]
        pub unsafe fn resetCursorRects(&self);
    }
);

extern_methods!(
    /// NSDrag
    #[cfg(feature = "NSResponder")]
    unsafe impl NSWindow {
        #[cfg(all(feature = "NSEvent", feature = "NSImage", feature = "NSPasteboard"))]
        #[method(dragImage:at:offset:event:pasteboard:source:slideBack:)]
        pub unsafe fn dragImage_at_offset_event_pasteboard_source_slideBack(
            &self,
            image: &NSImage,
            base_location: NSPoint,
            initial_offset: NSSize,
            event: &NSEvent,
            pboard: &NSPasteboard,
            source_obj: &AnyObject,
            slide_flag: bool,
        );

        #[cfg(feature = "NSPasteboard")]
        #[method(registerForDraggedTypes:)]
        pub fn registerForDraggedTypes(&self, new_types: &NSArray<NSPasteboardType>);

        #[method(unregisterDraggedTypes)]
        pub unsafe fn unregisterDraggedTypes(&self);
    }
);

extern_methods!(
    /// NSCarbonExtensions
    #[cfg(feature = "NSResponder")]
    unsafe impl NSWindow {
        #[method_id(@__retain_semantics Init initWithWindowRef:)]
        pub unsafe fn initWithWindowRef(
            this: Allocated<Self>,
            window_ref: NonNull<c_void>,
        ) -> Option<Id<NSWindow>>;

        #[method(windowRef)]
        pub unsafe fn windowRef(&self) -> NonNull<c_void>;
    }
);

extern_methods!(
    /// NSDisplayLink
    #[cfg(feature = "NSResponder")]
    unsafe impl NSWindow {}
);

extern_protocol!(
    pub unsafe trait NSWindowDelegate: NSObjectProtocol + IsMainThreadOnly {
        #[cfg(feature = "NSResponder")]
        #[optional]
        #[method(windowShouldClose:)]
        unsafe fn windowShouldClose(&self, sender: &NSWindow) -> bool;

        #[cfg(feature = "NSResponder")]
        #[optional]
        #[method_id(@__retain_semantics Other windowWillReturnFieldEditor:toObject:)]
        unsafe fn windowWillReturnFieldEditor_toObject(
            &self,
            sender: &NSWindow,
            client: Option<&AnyObject>,
        ) -> Option<Id<AnyObject>>;

        #[cfg(feature = "NSResponder")]
        #[optional]
        #[method(windowWillResize:toSize:)]
        unsafe fn windowWillResize_toSize(&self, sender: &NSWindow, frame_size: NSSize) -> NSSize;

        #[cfg(feature = "NSResponder")]
        #[optional]
        #[method(windowWillUseStandardFrame:defaultFrame:)]
        unsafe fn windowWillUseStandardFrame_defaultFrame(
            &self,
            window: &NSWindow,
            new_frame: NSRect,
        ) -> NSRect;

        #[cfg(feature = "NSResponder")]
        #[optional]
        #[method(windowShouldZoom:toFrame:)]
        unsafe fn windowShouldZoom_toFrame(&self, window: &NSWindow, new_frame: NSRect) -> bool;

        #[cfg(feature = "NSResponder")]
        #[optional]
        #[method_id(@__retain_semantics Other windowWillReturnUndoManager:)]
        unsafe fn windowWillReturnUndoManager(
            &self,
            window: &NSWindow,
        ) -> Option<Id<NSUndoManager>>;

        #[cfg(feature = "NSResponder")]
        #[optional]
        #[method(window:willPositionSheet:usingRect:)]
        unsafe fn window_willPositionSheet_usingRect(
            &self,
            window: &NSWindow,
            sheet: &NSWindow,
            rect: NSRect,
        ) -> NSRect;

        #[cfg(all(feature = "NSMenu", feature = "NSResponder"))]
        #[optional]
        #[method(window:shouldPopUpDocumentPathMenu:)]
        unsafe fn window_shouldPopUpDocumentPathMenu(
            &self,
            window: &NSWindow,
            menu: &NSMenu,
        ) -> bool;

        #[cfg(all(feature = "NSEvent", feature = "NSPasteboard", feature = "NSResponder"))]
        #[optional]
        #[method(window:shouldDragDocumentWithEvent:from:withPasteboard:)]
        unsafe fn window_shouldDragDocumentWithEvent_from_withPasteboard(
            &self,
            window: &NSWindow,
            event: &NSEvent,
            drag_image_location: NSPoint,
            pasteboard: &NSPasteboard,
        ) -> bool;

        #[cfg(feature = "NSResponder")]
        #[optional]
        #[method(window:willUseFullScreenContentSize:)]
        unsafe fn window_willUseFullScreenContentSize(
            &self,
            window: &NSWindow,
            proposed_size: NSSize,
        ) -> NSSize;

        #[cfg(all(feature = "NSApplication", feature = "NSResponder"))]
        #[optional]
        #[method(window:willUseFullScreenPresentationOptions:)]
        unsafe fn window_willUseFullScreenPresentationOptions(
            &self,
            window: &NSWindow,
            proposed_options: NSApplicationPresentationOptions,
        ) -> NSApplicationPresentationOptions;

        #[cfg(feature = "NSResponder")]
        #[optional]
        #[method_id(@__retain_semantics Other customWindowsToEnterFullScreenForWindow:)]
        unsafe fn customWindowsToEnterFullScreenForWindow(
            &self,
            window: &NSWindow,
        ) -> Option<Id<NSArray<NSWindow>>>;

        #[cfg(feature = "NSResponder")]
        #[optional]
        #[method(window:startCustomAnimationToEnterFullScreenWithDuration:)]
        unsafe fn window_startCustomAnimationToEnterFullScreenWithDuration(
            &self,
            window: &NSWindow,
            duration: NSTimeInterval,
        );

        #[cfg(feature = "NSResponder")]
        #[optional]
        #[method(windowDidFailToEnterFullScreen:)]
        unsafe fn windowDidFailToEnterFullScreen(&self, window: &NSWindow);

        #[cfg(feature = "NSResponder")]
        #[optional]
        #[method_id(@__retain_semantics Other customWindowsToExitFullScreenForWindow:)]
        unsafe fn customWindowsToExitFullScreenForWindow(
            &self,
            window: &NSWindow,
        ) -> Option<Id<NSArray<NSWindow>>>;

        #[cfg(feature = "NSResponder")]
        #[optional]
        #[method(window:startCustomAnimationToExitFullScreenWithDuration:)]
        unsafe fn window_startCustomAnimationToExitFullScreenWithDuration(
            &self,
            window: &NSWindow,
            duration: NSTimeInterval,
        );

        #[cfg(all(feature = "NSResponder", feature = "NSScreen"))]
        #[optional]
        #[method_id(@__retain_semantics Other customWindowsToEnterFullScreenForWindow:onScreen:)]
        unsafe fn customWindowsToEnterFullScreenForWindow_onScreen(
            &self,
            window: &NSWindow,
            screen: &NSScreen,
        ) -> Option<Id<NSArray<NSWindow>>>;

        #[cfg(all(feature = "NSResponder", feature = "NSScreen"))]
        #[optional]
        #[method(window:startCustomAnimationToEnterFullScreenOnScreen:withDuration:)]
        unsafe fn window_startCustomAnimationToEnterFullScreenOnScreen_withDuration(
            &self,
            window: &NSWindow,
            screen: &NSScreen,
            duration: NSTimeInterval,
        );

        #[cfg(feature = "NSResponder")]
        #[optional]
        #[method(windowDidFailToExitFullScreen:)]
        unsafe fn windowDidFailToExitFullScreen(&self, window: &NSWindow);

        #[cfg(feature = "NSResponder")]
        #[optional]
        #[method(window:willResizeForVersionBrowserWithMaxPreferredSize:maxAllowedSize:)]
        unsafe fn window_willResizeForVersionBrowserWithMaxPreferredSize_maxAllowedSize(
            &self,
            window: &NSWindow,
            max_preferred_frame_size: NSSize,
            max_allowed_frame_size: NSSize,
        ) -> NSSize;

        #[cfg(feature = "NSResponder")]
        #[optional]
        #[method(window:willEncodeRestorableState:)]
        unsafe fn window_willEncodeRestorableState(&self, window: &NSWindow, state: &NSCoder);

        #[cfg(feature = "NSResponder")]
        #[optional]
        #[method(window:didDecodeRestorableState:)]
        unsafe fn window_didDecodeRestorableState(&self, window: &NSWindow, state: &NSCoder);

        #[cfg(all(feature = "NSPreviewRepresentingActivityItem", feature = "NSResponder"))]
        #[optional]
        #[method_id(@__retain_semantics Other previewRepresentableActivityItemsForWindow:)]
        unsafe fn previewRepresentableActivityItemsForWindow(
            &self,
            window: &NSWindow,
        ) -> Option<Id<NSArray<ProtocolObject<dyn NSPreviewRepresentableActivityItem>>>>;

        #[optional]
        #[method(windowDidResize:)]
        unsafe fn windowDidResize(&self, notification: &NSNotification);

        #[optional]
        #[method(windowDidExpose:)]
        unsafe fn windowDidExpose(&self, notification: &NSNotification);

        #[optional]
        #[method(windowWillMove:)]
        unsafe fn windowWillMove(&self, notification: &NSNotification);

        #[optional]
        #[method(windowDidMove:)]
        unsafe fn windowDidMove(&self, notification: &NSNotification);

        #[optional]
        #[method(windowDidBecomeKey:)]
        unsafe fn windowDidBecomeKey(&self, notification: &NSNotification);

        #[optional]
        #[method(windowDidResignKey:)]
        unsafe fn windowDidResignKey(&self, notification: &NSNotification);

        #[optional]
        #[method(windowDidBecomeMain:)]
        unsafe fn windowDidBecomeMain(&self, notification: &NSNotification);

        #[optional]
        #[method(windowDidResignMain:)]
        unsafe fn windowDidResignMain(&self, notification: &NSNotification);

        #[optional]
        #[method(windowWillClose:)]
        unsafe fn windowWillClose(&self, notification: &NSNotification);

        #[optional]
        #[method(windowWillMiniaturize:)]
        unsafe fn windowWillMiniaturize(&self, notification: &NSNotification);

        #[optional]
        #[method(windowDidMiniaturize:)]
        unsafe fn windowDidMiniaturize(&self, notification: &NSNotification);

        #[optional]
        #[method(windowDidDeminiaturize:)]
        unsafe fn windowDidDeminiaturize(&self, notification: &NSNotification);

        #[optional]
        #[method(windowDidUpdate:)]
        unsafe fn windowDidUpdate(&self, notification: &NSNotification);

        #[optional]
        #[method(windowDidChangeScreen:)]
        unsafe fn windowDidChangeScreen(&self, notification: &NSNotification);

        #[optional]
        #[method(windowDidChangeScreenProfile:)]
        unsafe fn windowDidChangeScreenProfile(&self, notification: &NSNotification);

        #[optional]
        #[method(windowDidChangeBackingProperties:)]
        unsafe fn windowDidChangeBackingProperties(&self, notification: &NSNotification);

        #[optional]
        #[method(windowWillBeginSheet:)]
        unsafe fn windowWillBeginSheet(&self, notification: &NSNotification);

        #[optional]
        #[method(windowDidEndSheet:)]
        unsafe fn windowDidEndSheet(&self, notification: &NSNotification);

        #[optional]
        #[method(windowWillStartLiveResize:)]
        unsafe fn windowWillStartLiveResize(&self, notification: &NSNotification);

        #[optional]
        #[method(windowDidEndLiveResize:)]
        unsafe fn windowDidEndLiveResize(&self, notification: &NSNotification);

        #[optional]
        #[method(windowWillEnterFullScreen:)]
        unsafe fn windowWillEnterFullScreen(&self, notification: &NSNotification);

        #[optional]
        #[method(windowDidEnterFullScreen:)]
        unsafe fn windowDidEnterFullScreen(&self, notification: &NSNotification);

        #[optional]
        #[method(windowWillExitFullScreen:)]
        unsafe fn windowWillExitFullScreen(&self, notification: &NSNotification);

        #[optional]
        #[method(windowDidExitFullScreen:)]
        unsafe fn windowDidExitFullScreen(&self, notification: &NSNotification);

        #[optional]
        #[method(windowWillEnterVersionBrowser:)]
        unsafe fn windowWillEnterVersionBrowser(&self, notification: &NSNotification);

        #[optional]
        #[method(windowDidEnterVersionBrowser:)]
        unsafe fn windowDidEnterVersionBrowser(&self, notification: &NSNotification);

        #[optional]
        #[method(windowWillExitVersionBrowser:)]
        unsafe fn windowWillExitVersionBrowser(&self, notification: &NSNotification);

        #[optional]
        #[method(windowDidExitVersionBrowser:)]
        unsafe fn windowDidExitVersionBrowser(&self, notification: &NSNotification);

        #[optional]
        #[method(windowDidChangeOcclusionState:)]
        unsafe fn windowDidChangeOcclusionState(&self, notification: &NSNotification);
    }

    unsafe impl ProtocolType for dyn NSWindowDelegate {}
);

extern "C" {
    pub static NSWindowDidBecomeKeyNotification: &'static NSNotificationName;
}

extern "C" {
    pub static NSWindowDidBecomeMainNotification: &'static NSNotificationName;
}

extern "C" {
    pub static NSWindowDidChangeScreenNotification: &'static NSNotificationName;
}

extern "C" {
    pub static NSWindowDidDeminiaturizeNotification: &'static NSNotificationName;
}

extern "C" {
    pub static NSWindowDidExposeNotification: &'static NSNotificationName;
}

extern "C" {
    pub static NSWindowDidMiniaturizeNotification: &'static NSNotificationName;
}

extern "C" {
    pub static NSWindowDidMoveNotification: &'static NSNotificationName;
}

extern "C" {
    pub static NSWindowDidResignKeyNotification: &'static NSNotificationName;
}

extern "C" {
    pub static NSWindowDidResignMainNotification: &'static NSNotificationName;
}

extern "C" {
    pub static NSWindowDidResizeNotification: &'static NSNotificationName;
}

extern "C" {
    pub static NSWindowDidUpdateNotification: &'static NSNotificationName;
}

extern "C" {
    pub static NSWindowWillCloseNotification: &'static NSNotificationName;
}

extern "C" {
    pub static NSWindowWillMiniaturizeNotification: &'static NSNotificationName;
}

extern "C" {
    pub static NSWindowWillMoveNotification: &'static NSNotificationName;
}

extern "C" {
    pub static NSWindowWillBeginSheetNotification: &'static NSNotificationName;
}

extern "C" {
    pub static NSWindowDidEndSheetNotification: &'static NSNotificationName;
}

extern "C" {
    pub static NSWindowDidChangeBackingPropertiesNotification: &'static NSNotificationName;
}

extern "C" {
    pub static NSBackingPropertyOldScaleFactorKey: &'static NSString;
}

extern "C" {
    pub static NSBackingPropertyOldColorSpaceKey: &'static NSString;
}

extern "C" {
    pub static NSWindowDidChangeScreenProfileNotification: &'static NSNotificationName;
}

extern "C" {
    pub static NSWindowWillStartLiveResizeNotification: &'static NSNotificationName;
}

extern "C" {
    pub static NSWindowDidEndLiveResizeNotification: &'static NSNotificationName;
}

extern "C" {
    pub static NSWindowWillEnterFullScreenNotification: &'static NSNotificationName;
}

extern "C" {
    pub static NSWindowDidEnterFullScreenNotification: &'static NSNotificationName;
}

extern "C" {
    pub static NSWindowWillExitFullScreenNotification: &'static NSNotificationName;
}

extern "C" {
    pub static NSWindowDidExitFullScreenNotification: &'static NSNotificationName;
}

extern "C" {
    pub static NSWindowWillEnterVersionBrowserNotification: &'static NSNotificationName;
}

extern "C" {
    pub static NSWindowDidEnterVersionBrowserNotification: &'static NSNotificationName;
}

extern "C" {
    pub static NSWindowWillExitVersionBrowserNotification: &'static NSNotificationName;
}

extern "C" {
    pub static NSWindowDidExitVersionBrowserNotification: &'static NSNotificationName;
}

extern "C" {
    pub static NSWindowDidChangeOcclusionStateNotification: &'static NSNotificationName;
}

// NS_ENUM
#[deprecated]
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSWindowBackingLocation(pub NSUInteger);
impl NSWindowBackingLocation {
    #[doc(alias = "NSWindowBackingLocationDefault")]
    pub const Default: Self = Self(0);
    #[doc(alias = "NSWindowBackingLocationVideoMemory")]
    pub const VideoMemory: Self = Self(1);
    #[doc(alias = "NSWindowBackingLocationMainMemory")]
    pub const MainMemory: Self = Self(2);
}

unsafe impl Encode for NSWindowBackingLocation {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

unsafe impl RefEncode for NSWindowBackingLocation {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

extern_methods!(
    /// NSDeprecated
    #[cfg(feature = "NSResponder")]
    unsafe impl NSWindow {
        #[deprecated = "This method shouldn’t be used as it doesn’t work in all drawing situations; instead, a subview should be used that implements the desired drawing behavior"]
        #[method(cacheImageInRect:)]
        pub unsafe fn cacheImageInRect(&self, rect: NSRect);

        #[deprecated = "This method shouldn’t be used as it doesn’t work in all drawing situations; instead, a subview should be used that implements the desired drawing behavior"]
        #[method(restoreCachedImage)]
        pub unsafe fn restoreCachedImage(&self);

        #[deprecated = "This method shouldn’t be used as it doesn’t work in all drawing situations; instead, a subview should be used that implements the desired drawing behavior"]
        #[method(discardCachedImage)]
        pub unsafe fn discardCachedImage(&self);

        #[cfg(feature = "NSMenu")]
        #[deprecated = "This method does not do anything and should not be called."]
        #[method(menuChanged:)]
        pub unsafe fn menuChanged(menu: &NSMenu);

        #[deprecated = "This method is unused and should not be called."]
        #[method(gState)]
        pub unsafe fn gState(&self) -> NSInteger;

        #[deprecated = "Use -convertRectToScreen: or -convertPointToScreen: instead"]
        #[method(convertBaseToScreen:)]
        pub unsafe fn convertBaseToScreen(&self, point: NSPoint) -> NSPoint;

        #[deprecated = "Use -convertRectFromScreen or -convertPointFromScreen: instead"]
        #[method(convertScreenToBase:)]
        pub unsafe fn convertScreenToBase(&self, point: NSPoint) -> NSPoint;

        #[deprecated = "Use -convertRectToBacking: and -backingScaleFactor instead"]
        #[method(userSpaceScaleFactor)]
        pub unsafe fn userSpaceScaleFactor(&self) -> CGFloat;

        #[deprecated = "This method does not do anything and should not be called."]
        #[method(useOptimizedDrawing:)]
        pub unsafe fn useOptimizedDrawing(&self, flag: bool);

        #[deprecated = "This method does not do anything and should not be called."]
        #[method(canStoreColor)]
        pub unsafe fn canStoreColor(&self) -> bool;

        #[deprecated = "Use +[NSAnimationContext runAnimationGroup:completionHandler:] to perform atomic updates across runloop invocations."]
        #[method(disableFlushWindow)]
        pub unsafe fn disableFlushWindow(&self);

        #[deprecated = "Use +[NSAnimationContext runAnimationGroup:completionHandler:] to perform atomic updates across runloop invocations."]
        #[method(enableFlushWindow)]
        pub unsafe fn enableFlushWindow(&self);

        #[deprecated = "Use +[NSAnimationContext runAnimationGroup:completionHandler:] to perform atomic updates across runloop invocations."]
        #[method(isFlushWindowDisabled)]
        pub unsafe fn isFlushWindowDisabled(&self) -> bool;

        #[deprecated = "Allow AppKit's automatic deferred display mechanism to take care of flushing any graphics contexts as needed."]
        #[method(flushWindow)]
        pub unsafe fn flushWindow(&self);

        #[deprecated = "Allow AppKit's automatic deferred display mechanism to take care of flushing any graphics contexts as needed."]
        #[method(flushWindowIfNeeded)]
        pub unsafe fn flushWindowIfNeeded(&self);

        #[deprecated = "Use +[NSAnimationContext runAnimationGroup:completionHandler:] to temporarily prevent AppKit's automatic deferred display mechanism from drawing."]
        #[method(isAutodisplay)]
        pub unsafe fn isAutodisplay(&self) -> bool;

        #[deprecated = "Use +[NSAnimationContext runAnimationGroup:completionHandler:] to temporarily prevent AppKit's automatic deferred display mechanism from drawing."]
        #[method(setAutodisplay:)]
        pub unsafe fn setAutodisplay(&self, autodisplay: bool);

        #[cfg(feature = "NSGraphicsContext")]
        #[deprecated = "Add instances of NSView to display content in a window."]
        #[method_id(@__retain_semantics Other graphicsContext)]
        pub unsafe fn graphicsContext(&self) -> Option<Id<NSGraphicsContext>>;

        #[deprecated = "This property does not do anything and should not be used"]
        #[method(isOneShot)]
        pub unsafe fn isOneShot(&self) -> bool;

        #[deprecated = "This property does not do anything and should not be used"]
        #[method(setOneShot:)]
        pub unsafe fn setOneShot(&self, one_shot: bool);

        #[deprecated = "This property does not do anything and should not be used"]
        #[method(preferredBackingLocation)]
        pub unsafe fn preferredBackingLocation(&self) -> NSWindowBackingLocation;

        #[deprecated = "This property does not do anything and should not be used"]
        #[method(setPreferredBackingLocation:)]
        pub unsafe fn setPreferredBackingLocation(
            &self,
            preferred_backing_location: NSWindowBackingLocation,
        );

        #[deprecated = "This property does not do anything and should not be used"]
        #[method(backingLocation)]
        pub unsafe fn backingLocation(&self) -> NSWindowBackingLocation;

        #[method(showsResizeIndicator)]
        pub unsafe fn showsResizeIndicator(&self) -> bool;

        #[method(setShowsResizeIndicator:)]
        pub unsafe fn setShowsResizeIndicator(&self, shows_resize_indicator: bool);
    }
);

pub static NSBorderlessWindowMask: NSWindowStyleMask =
    NSWindowStyleMask(NSWindowStyleMask::Borderless.0);

pub static NSTitledWindowMask: NSWindowStyleMask = NSWindowStyleMask(NSWindowStyleMask::Titled.0);

pub static NSClosableWindowMask: NSWindowStyleMask =
    NSWindowStyleMask(NSWindowStyleMask::Closable.0);

pub static NSMiniaturizableWindowMask: NSWindowStyleMask =
    NSWindowStyleMask(NSWindowStyleMask::Miniaturizable.0);

pub static NSResizableWindowMask: NSWindowStyleMask =
    NSWindowStyleMask(NSWindowStyleMask::Resizable.0);

pub static NSTexturedBackgroundWindowMask: NSWindowStyleMask =
    NSWindowStyleMask(NSWindowStyleMask::TexturedBackground.0);

pub static NSUnifiedTitleAndToolbarWindowMask: NSWindowStyleMask =
    NSWindowStyleMask(NSWindowStyleMask::UnifiedTitleAndToolbar.0);

pub static NSFullScreenWindowMask: NSWindowStyleMask =
    NSWindowStyleMask(NSWindowStyleMask::FullScreen.0);

pub static NSFullSizeContentViewWindowMask: NSWindowStyleMask =
    NSWindowStyleMask(NSWindowStyleMask::FullSizeContentView.0);

pub static NSUtilityWindowMask: NSWindowStyleMask =
    NSWindowStyleMask(NSWindowStyleMask::UtilityWindow.0);

pub static NSDocModalWindowMask: NSWindowStyleMask =
    NSWindowStyleMask(NSWindowStyleMask::DocModalWindow.0);

pub static NSNonactivatingPanelMask: NSWindowStyleMask =
    NSWindowStyleMask(NSWindowStyleMask::NonactivatingPanel.0);

pub static NSHUDWindowMask: NSWindowStyleMask = NSWindowStyleMask(NSWindowStyleMask::HUDWindow.0);

pub static NSUnscaledWindowMask: NSWindowStyleMask = NSWindowStyleMask(1 << 11);

pub static NSWindowFullScreenButton: NSWindowButton = NSWindowButton(7);

pub static NSDockWindowLevel: NSWindowLevel = 20;