objc2_app_kit/generated/
NSWindow.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9#[cfg(feature = "objc2-quartz-core")]
10#[cfg(target_vendor = "apple")]
11use objc2_quartz_core::*;
12
13use crate::*;
14
15/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumberwithcustomsheetposition?language=objc)
16#[cfg(feature = "NSApplication")]
17pub static NSAppKitVersionNumberWithCustomSheetPosition: NSAppKitVersion = 686.0 as _;
18
19/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumberwithdeferredwindowdisplaysupport?language=objc)
20#[cfg(feature = "NSApplication")]
21pub static NSAppKitVersionNumberWithDeferredWindowDisplaySupport: NSAppKitVersion = 1019.0 as _;
22
23/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowstylemask?language=objc)
24// NS_OPTIONS
25#[repr(transparent)]
26#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
27pub struct NSWindowStyleMask(pub NSUInteger);
28bitflags::bitflags! {
29    impl NSWindowStyleMask: NSUInteger {
30        #[doc(alias = "NSWindowStyleMaskBorderless")]
31        const Borderless = 0;
32        #[doc(alias = "NSWindowStyleMaskTitled")]
33        const Titled = 1<<0;
34        #[doc(alias = "NSWindowStyleMaskClosable")]
35        const Closable = 1<<1;
36        #[doc(alias = "NSWindowStyleMaskMiniaturizable")]
37        const Miniaturizable = 1<<2;
38        #[doc(alias = "NSWindowStyleMaskResizable")]
39        const Resizable = 1<<3;
40#[deprecated = "Textured window style should no longer be used"]
41        #[doc(alias = "NSWindowStyleMaskTexturedBackground")]
42        const TexturedBackground = 1<<8;
43        #[doc(alias = "NSWindowStyleMaskUnifiedTitleAndToolbar")]
44        const UnifiedTitleAndToolbar = 1<<12;
45        #[doc(alias = "NSWindowStyleMaskFullScreen")]
46        const FullScreen = 1<<14;
47        #[doc(alias = "NSWindowStyleMaskFullSizeContentView")]
48        const FullSizeContentView = 1<<15;
49        #[doc(alias = "NSWindowStyleMaskUtilityWindow")]
50        const UtilityWindow = 1<<4;
51        #[doc(alias = "NSWindowStyleMaskDocModalWindow")]
52        const DocModalWindow = 1<<6;
53        #[doc(alias = "NSWindowStyleMaskNonactivatingPanel")]
54        const NonactivatingPanel = 1<<7;
55        #[doc(alias = "NSWindowStyleMaskHUDWindow")]
56        const HUDWindow = 1<<13;
57    }
58}
59
60unsafe impl Encode for NSWindowStyleMask {
61    const ENCODING: Encoding = NSUInteger::ENCODING;
62}
63
64unsafe impl RefEncode for NSWindowStyleMask {
65    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
66}
67
68/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsmodalresponseok?language=objc)
69#[cfg(feature = "NSApplication")]
70pub static NSModalResponseOK: NSModalResponse = 1;
71
72/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsmodalresponsecancel?language=objc)
73#[cfg(feature = "NSApplication")]
74pub static NSModalResponseCancel: NSModalResponse = 0;
75
76/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdisplaywindowrunloopordering?language=objc)
77pub const NSDisplayWindowRunLoopOrdering: c_uint = 600000;
78/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsresetcursorrectsrunloopordering?language=objc)
79pub const NSResetCursorRectsRunLoopOrdering: c_uint = 700000;
80
81/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowsharingtype?language=objc)
82// NS_ENUM
83#[repr(transparent)]
84#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
85pub struct NSWindowSharingType(pub NSUInteger);
86impl NSWindowSharingType {
87    #[doc(alias = "NSWindowSharingNone")]
88    pub const None: Self = Self(0);
89    #[doc(alias = "NSWindowSharingReadOnly")]
90    pub const ReadOnly: Self = Self(1);
91}
92
93unsafe impl Encode for NSWindowSharingType {
94    const ENCODING: Encoding = NSUInteger::ENCODING;
95}
96
97unsafe impl RefEncode for NSWindowSharingType {
98    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
99}
100
101/// You may specify at most one of
102/// `NSWindowCollectionBehaviorPrimary,``NSWindowCollectionBehaviorAuxiliary,`or
103/// `NSWindowCollectionBehaviorCanJoinAllApplications.`If unspecified, the window gets the default treatment determined by its other collection behaviors.
104///
105///
106///
107///
108///
109/// You may specify at most one of
110/// `NSWindowCollectionBehaviorManaged,``NSWindowCollectionBehaviorTransient,`or
111/// `NSWindowCollectionBehaviorStationary.`If neither is specified, the window gets the default behavior determined by its window level.
112///
113///
114///
115///
116///
117/// You may specify at most one of
118/// `NSWindowCollectionBehaviorParticipatesInCycle`or
119/// `NSWindowCollectionBehaviorIgnoresCycle.`If unspecified, the window gets the default behavior determined by its window level.
120///
121///
122///
123///
124/// You may specify at most one of
125/// `NSWindowCollectionBehaviorFullScreenPrimary,``NSWindowCollectionBehaviorFullScreenAuxiliary,`or
126/// `NSWindowCollectionBehaviorFullScreenNone.`
127///
128///
129///
130///
131/// You may specify at most one of
132/// `NSWindowCollectionBehaviorFullScreenAllowsTiling`or
133/// `NSWindowCollectionBehaviorFullScreenDisallowsTiling,`or an assertion will be raised.
134///
135/// The default behavior is to allow any window to participate in full screen tiling, as long as it meets certain requirements, such as being resizable and not a panel or sheet. Windows which are not full screen capable can still become a secondary tile in full screen. A window can explicitly allow itself to be placed into a full screen tile by including
136/// `NSWindowCollectionBehaviorFullScreenAllowsTiling.`Even if a window allows itself to be placed in a tile, it still may not be put in the tile if its
137/// `minFullScreenContentSize`is too large to fit. A window can explicitly disallow itself from being placed in a full screen tile by including
138/// `NSWindowCollectionBehaviorFullScreenDisallowsTiling.`This is useful for non-full screen capable windows to explicitly prevent themselves from being tiled. It can also be used by a full screen window to prevent any other windows from being placed in its full screen tile.
139///
140/// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowcollectionbehavior?language=objc)
141// NS_OPTIONS
142#[repr(transparent)]
143#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
144pub struct NSWindowCollectionBehavior(pub NSUInteger);
145bitflags::bitflags! {
146    impl NSWindowCollectionBehavior: NSUInteger {
147        #[doc(alias = "NSWindowCollectionBehaviorDefault")]
148        const Default = 0;
149        #[doc(alias = "NSWindowCollectionBehaviorCanJoinAllSpaces")]
150        const CanJoinAllSpaces = 1<<0;
151        #[doc(alias = "NSWindowCollectionBehaviorMoveToActiveSpace")]
152        const MoveToActiveSpace = 1<<1;
153        #[doc(alias = "NSWindowCollectionBehaviorManaged")]
154        const Managed = 1<<2;
155        #[doc(alias = "NSWindowCollectionBehaviorTransient")]
156        const Transient = 1<<3;
157        #[doc(alias = "NSWindowCollectionBehaviorStationary")]
158        const Stationary = 1<<4;
159        #[doc(alias = "NSWindowCollectionBehaviorParticipatesInCycle")]
160        const ParticipatesInCycle = 1<<5;
161        #[doc(alias = "NSWindowCollectionBehaviorIgnoresCycle")]
162        const IgnoresCycle = 1<<6;
163        #[doc(alias = "NSWindowCollectionBehaviorFullScreenPrimary")]
164        const FullScreenPrimary = 1<<7;
165        #[doc(alias = "NSWindowCollectionBehaviorFullScreenAuxiliary")]
166        const FullScreenAuxiliary = 1<<8;
167        #[doc(alias = "NSWindowCollectionBehaviorFullScreenNone")]
168        const FullScreenNone = 1<<9;
169        #[doc(alias = "NSWindowCollectionBehaviorFullScreenAllowsTiling")]
170        const FullScreenAllowsTiling = 1<<11;
171        #[doc(alias = "NSWindowCollectionBehaviorFullScreenDisallowsTiling")]
172        const FullScreenDisallowsTiling = 1<<12;
173        #[doc(alias = "NSWindowCollectionBehaviorPrimary")]
174        const Primary = 1<<16;
175        #[doc(alias = "NSWindowCollectionBehaviorAuxiliary")]
176        const Auxiliary = 1<<17;
177        #[doc(alias = "NSWindowCollectionBehaviorCanJoinAllApplications")]
178        const CanJoinAllApplications = 1<<18;
179    }
180}
181
182unsafe impl Encode for NSWindowCollectionBehavior {
183    const ENCODING: Encoding = NSUInteger::ENCODING;
184}
185
186unsafe impl RefEncode for NSWindowCollectionBehavior {
187    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
188}
189
190/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowanimationbehavior?language=objc)
191// NS_ENUM
192#[repr(transparent)]
193#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
194pub struct NSWindowAnimationBehavior(pub NSInteger);
195impl NSWindowAnimationBehavior {
196    #[doc(alias = "NSWindowAnimationBehaviorDefault")]
197    pub const Default: Self = Self(0);
198    #[doc(alias = "NSWindowAnimationBehaviorNone")]
199    pub const None: Self = Self(2);
200    #[doc(alias = "NSWindowAnimationBehaviorDocumentWindow")]
201    pub const DocumentWindow: Self = Self(3);
202    #[doc(alias = "NSWindowAnimationBehaviorUtilityWindow")]
203    pub const UtilityWindow: Self = Self(4);
204    #[doc(alias = "NSWindowAnimationBehaviorAlertPanel")]
205    pub const AlertPanel: Self = Self(5);
206}
207
208unsafe impl Encode for NSWindowAnimationBehavior {
209    const ENCODING: Encoding = NSInteger::ENCODING;
210}
211
212unsafe impl RefEncode for NSWindowAnimationBehavior {
213    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
214}
215
216/// Options used in `+windowNumbersWithOptions:`.  If no options are specified, the returned list contains window numbers for visible windows on the active space belonging to the calling application.
217///
218/// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindownumberlistoptions?language=objc)
219// NS_OPTIONS
220#[repr(transparent)]
221#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
222pub struct NSWindowNumberListOptions(pub NSUInteger);
223bitflags::bitflags! {
224    impl NSWindowNumberListOptions: NSUInteger {
225        #[doc(alias = "NSWindowNumberListAllApplications")]
226        const AllApplications = 1<<0;
227        #[doc(alias = "NSWindowNumberListAllSpaces")]
228        const AllSpaces = 1<<4;
229    }
230}
231
232unsafe impl Encode for NSWindowNumberListOptions {
233    const ENCODING: Encoding = NSUInteger::ENCODING;
234}
235
236unsafe impl RefEncode for NSWindowNumberListOptions {
237    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
238}
239
240/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowocclusionstate?language=objc)
241// NS_OPTIONS
242#[repr(transparent)]
243#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
244pub struct NSWindowOcclusionState(pub NSUInteger);
245bitflags::bitflags! {
246    impl NSWindowOcclusionState: NSUInteger {
247        #[doc(alias = "NSWindowOcclusionStateVisible")]
248        const Visible = 1<<1;
249    }
250}
251
252unsafe impl Encode for NSWindowOcclusionState {
253    const ENCODING: Encoding = NSUInteger::ENCODING;
254}
255
256unsafe impl RefEncode for NSWindowOcclusionState {
257    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
258}
259
260/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowlevel?language=objc)
261// NS_TYPED_EXTENSIBLE_ENUM
262pub type NSWindowLevel = NSInteger;
263
264/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsnormalwindowlevel?language=objc)
265pub static NSNormalWindowLevel: NSWindowLevel = 0;
266
267/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsfloatingwindowlevel?language=objc)
268pub static NSFloatingWindowLevel: NSWindowLevel = 3;
269
270/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nssubmenuwindowlevel?language=objc)
271pub static NSSubmenuWindowLevel: NSWindowLevel = 3;
272
273/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstornoffmenuwindowlevel?language=objc)
274pub static NSTornOffMenuWindowLevel: NSWindowLevel = 3;
275
276/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsmainmenuwindowlevel?language=objc)
277pub static NSMainMenuWindowLevel: NSWindowLevel = 24;
278
279/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsstatuswindowlevel?language=objc)
280pub static NSStatusWindowLevel: NSWindowLevel = 25;
281
282/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsmodalpanelwindowlevel?language=objc)
283pub static NSModalPanelWindowLevel: NSWindowLevel = 8;
284
285/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nspopupmenuwindowlevel?language=objc)
286pub static NSPopUpMenuWindowLevel: NSWindowLevel = 101;
287
288/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsscreensaverwindowlevel?language=objc)
289pub static NSScreenSaverWindowLevel: NSWindowLevel = 1000;
290
291/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsselectiondirection?language=objc)
292// NS_ENUM
293#[repr(transparent)]
294#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
295pub struct NSSelectionDirection(pub NSUInteger);
296impl NSSelectionDirection {
297    #[doc(alias = "NSDirectSelection")]
298    pub const DirectSelection: Self = Self(0);
299    #[doc(alias = "NSSelectingNext")]
300    pub const SelectingNext: Self = Self(1);
301    #[doc(alias = "NSSelectingPrevious")]
302    pub const SelectingPrevious: Self = Self(2);
303}
304
305unsafe impl Encode for NSSelectionDirection {
306    const ENCODING: Encoding = NSUInteger::ENCODING;
307}
308
309unsafe impl RefEncode for NSSelectionDirection {
310    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
311}
312
313/// Standard window buttons.
314///
315/// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowbutton?language=objc)
316// NS_ENUM
317#[repr(transparent)]
318#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
319pub struct NSWindowButton(pub NSUInteger);
320impl NSWindowButton {
321    #[doc(alias = "NSWindowCloseButton")]
322    pub const CloseButton: Self = Self(0);
323    #[doc(alias = "NSWindowMiniaturizeButton")]
324    pub const MiniaturizeButton: Self = Self(1);
325    #[doc(alias = "NSWindowZoomButton")]
326    pub const ZoomButton: Self = Self(2);
327    #[doc(alias = "NSWindowToolbarButton")]
328    pub const ToolbarButton: Self = Self(3);
329    #[doc(alias = "NSWindowDocumentIconButton")]
330    pub const DocumentIconButton: Self = Self(4);
331    #[doc(alias = "NSWindowDocumentVersionsButton")]
332    pub const DocumentVersionsButton: Self = Self(6);
333}
334
335unsafe impl Encode for NSWindowButton {
336    const ENCODING: Encoding = NSUInteger::ENCODING;
337}
338
339unsafe impl RefEncode for NSWindowButton {
340    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
341}
342
343/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowtitlevisibility?language=objc)
344// NS_ENUM
345#[repr(transparent)]
346#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
347pub struct NSWindowTitleVisibility(pub NSInteger);
348impl NSWindowTitleVisibility {
349    #[doc(alias = "NSWindowTitleVisible")]
350    pub const Visible: Self = Self(0);
351    #[doc(alias = "NSWindowTitleHidden")]
352    pub const Hidden: Self = Self(1);
353}
354
355unsafe impl Encode for NSWindowTitleVisibility {
356    const ENCODING: Encoding = NSInteger::ENCODING;
357}
358
359unsafe impl RefEncode for NSWindowTitleVisibility {
360    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
361}
362
363/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowtoolbarstyle?language=objc)
364// NS_ENUM
365#[repr(transparent)]
366#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
367pub struct NSWindowToolbarStyle(pub NSInteger);
368impl NSWindowToolbarStyle {
369    #[doc(alias = "NSWindowToolbarStyleAutomatic")]
370    pub const Automatic: Self = Self(0);
371    #[doc(alias = "NSWindowToolbarStyleExpanded")]
372    pub const Expanded: Self = Self(1);
373    #[doc(alias = "NSWindowToolbarStylePreference")]
374    pub const Preference: Self = Self(2);
375    #[doc(alias = "NSWindowToolbarStyleUnified")]
376    pub const Unified: Self = Self(3);
377    #[doc(alias = "NSWindowToolbarStyleUnifiedCompact")]
378    pub const UnifiedCompact: Self = Self(4);
379}
380
381unsafe impl Encode for NSWindowToolbarStyle {
382    const ENCODING: Encoding = NSInteger::ENCODING;
383}
384
385unsafe impl RefEncode for NSWindowToolbarStyle {
386    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
387}
388
389/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nseventdurationforever?language=objc)
390pub static NSEventDurationForever: NSTimeInterval = c_double::MAX as _;
391
392/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowusertabbingpreference?language=objc)
393// NS_ENUM
394#[repr(transparent)]
395#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
396pub struct NSWindowUserTabbingPreference(pub NSInteger);
397impl NSWindowUserTabbingPreference {
398    #[doc(alias = "NSWindowUserTabbingPreferenceManual")]
399    pub const Manual: Self = Self(0);
400    #[doc(alias = "NSWindowUserTabbingPreferenceAlways")]
401    pub const Always: Self = Self(1);
402    #[doc(alias = "NSWindowUserTabbingPreferenceInFullScreen")]
403    pub const InFullScreen: Self = Self(2);
404}
405
406unsafe impl Encode for NSWindowUserTabbingPreference {
407    const ENCODING: Encoding = NSInteger::ENCODING;
408}
409
410unsafe impl RefEncode for NSWindowUserTabbingPreference {
411    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
412}
413
414/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowtabbingmode?language=objc)
415// NS_ENUM
416#[repr(transparent)]
417#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
418pub struct NSWindowTabbingMode(pub NSInteger);
419impl NSWindowTabbingMode {
420    #[doc(alias = "NSWindowTabbingModeAutomatic")]
421    pub const Automatic: Self = Self(0);
422    #[doc(alias = "NSWindowTabbingModePreferred")]
423    pub const Preferred: Self = Self(1);
424    #[doc(alias = "NSWindowTabbingModeDisallowed")]
425    pub const Disallowed: Self = Self(2);
426}
427
428unsafe impl Encode for NSWindowTabbingMode {
429    const ENCODING: Encoding = NSInteger::ENCODING;
430}
431
432unsafe impl RefEncode for NSWindowTabbingMode {
433    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
434}
435
436/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstitlebarseparatorstyle?language=objc)
437// NS_ENUM
438#[repr(transparent)]
439#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
440pub struct NSTitlebarSeparatorStyle(pub NSInteger);
441impl NSTitlebarSeparatorStyle {
442    #[doc(alias = "NSTitlebarSeparatorStyleAutomatic")]
443    pub const Automatic: Self = Self(0);
444    #[doc(alias = "NSTitlebarSeparatorStyleNone")]
445    pub const None: Self = Self(1);
446    #[doc(alias = "NSTitlebarSeparatorStyleLine")]
447    pub const Line: Self = Self(2);
448    #[doc(alias = "NSTitlebarSeparatorStyleShadow")]
449    pub const Shadow: Self = Self(3);
450}
451
452unsafe impl Encode for NSTitlebarSeparatorStyle {
453    const ENCODING: Encoding = NSInteger::ENCODING;
454}
455
456unsafe impl RefEncode for NSTitlebarSeparatorStyle {
457    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
458}
459
460/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowframeautosavename?language=objc)
461pub type NSWindowFrameAutosaveName = NSString;
462
463/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowpersistableframedescriptor?language=objc)
464pub type NSWindowPersistableFrameDescriptor = NSString;
465
466/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowtabbingidentifier?language=objc)
467pub type NSWindowTabbingIdentifier = NSString;
468
469extern_class!(
470    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindow?language=objc)
471    #[unsafe(super(NSResponder, NSObject))]
472    #[thread_kind = MainThreadOnly]
473    #[derive(Debug, PartialEq, Eq, Hash)]
474    #[cfg(feature = "NSResponder")]
475    pub struct NSWindow;
476);
477
478#[cfg(all(feature = "NSAccessibilityProtocols", feature = "NSResponder"))]
479unsafe impl NSAccessibility for NSWindow {}
480
481#[cfg(all(feature = "NSAccessibilityProtocols", feature = "NSResponder"))]
482unsafe impl NSAccessibilityElementProtocol for NSWindow {}
483
484#[cfg(all(feature = "NSAnimation", feature = "NSResponder"))]
485unsafe impl NSAnimatablePropertyContainer for NSWindow {}
486
487#[cfg(all(feature = "NSAppearance", feature = "NSResponder"))]
488unsafe impl NSAppearanceCustomization for NSWindow {}
489
490#[cfg(feature = "NSResponder")]
491unsafe impl NSCoding for NSWindow {}
492
493#[cfg(all(feature = "NSMenu", feature = "NSResponder"))]
494unsafe impl NSMenuItemValidation for NSWindow {}
495
496#[cfg(feature = "NSResponder")]
497unsafe impl NSObjectProtocol for NSWindow {}
498
499#[cfg(all(feature = "NSResponder", feature = "NSUserInterfaceItemIdentification"))]
500unsafe impl NSUserInterfaceItemIdentification for NSWindow {}
501
502#[cfg(all(feature = "NSResponder", feature = "NSUserInterfaceValidation"))]
503unsafe impl NSUserInterfaceValidations for NSWindow {}
504
505#[cfg(feature = "NSResponder")]
506impl NSWindow {
507    extern_methods!(
508        #[unsafe(method(frameRectForContentRect:styleMask:))]
509        #[unsafe(method_family = none)]
510        pub unsafe fn frameRectForContentRect_styleMask(
511            c_rect: NSRect,
512            style: NSWindowStyleMask,
513            mtm: MainThreadMarker,
514        ) -> NSRect;
515
516        #[unsafe(method(contentRectForFrameRect:styleMask:))]
517        #[unsafe(method_family = none)]
518        pub unsafe fn contentRectForFrameRect_styleMask(
519            f_rect: NSRect,
520            style: NSWindowStyleMask,
521            mtm: MainThreadMarker,
522        ) -> NSRect;
523
524        #[cfg(feature = "objc2-core-foundation")]
525        #[unsafe(method(minFrameWidthWithTitle:styleMask:))]
526        #[unsafe(method_family = none)]
527        pub unsafe fn minFrameWidthWithTitle_styleMask(
528            title: &NSString,
529            style: NSWindowStyleMask,
530            mtm: MainThreadMarker,
531        ) -> CGFloat;
532
533        #[cfg(feature = "NSGraphics")]
534        #[unsafe(method(defaultDepthLimit))]
535        #[unsafe(method_family = none)]
536        pub unsafe fn defaultDepthLimit(mtm: MainThreadMarker) -> NSWindowDepth;
537
538        #[unsafe(method(frameRectForContentRect:))]
539        #[unsafe(method_family = none)]
540        pub unsafe fn frameRectForContentRect(&self, content_rect: NSRect) -> NSRect;
541
542        #[unsafe(method(contentRectForFrameRect:))]
543        #[unsafe(method_family = none)]
544        pub fn contentRectForFrameRect(&self, frame_rect: NSRect) -> NSRect;
545
546        #[cfg(feature = "NSGraphics")]
547        #[unsafe(method(initWithContentRect:styleMask:backing:defer:))]
548        #[unsafe(method_family = init)]
549        pub unsafe fn initWithContentRect_styleMask_backing_defer(
550            this: Allocated<Self>,
551            content_rect: NSRect,
552            style: NSWindowStyleMask,
553            backing_store_type: NSBackingStoreType,
554            flag: bool,
555        ) -> Retained<Self>;
556
557        #[cfg(all(feature = "NSGraphics", feature = "NSScreen"))]
558        #[unsafe(method(initWithContentRect:styleMask:backing:defer:screen:))]
559        #[unsafe(method_family = init)]
560        pub unsafe fn initWithContentRect_styleMask_backing_defer_screen(
561            this: Allocated<Self>,
562            content_rect: NSRect,
563            style: NSWindowStyleMask,
564            backing_store_type: NSBackingStoreType,
565            flag: bool,
566            screen: Option<&NSScreen>,
567        ) -> Retained<Self>;
568
569        #[unsafe(method(initWithCoder:))]
570        #[unsafe(method_family = init)]
571        pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
572
573        #[unsafe(method(title))]
574        #[unsafe(method_family = none)]
575        pub fn title(&self) -> Retained<NSString>;
576
577        /// Setter for [`title`][Self::title].
578        #[unsafe(method(setTitle:))]
579        #[unsafe(method_family = none)]
580        pub fn setTitle(&self, title: &NSString);
581
582        /// Secondary text that may be displayed adjacent to or below the primary title depending on the configuration of the window.
583        /// A value of empty string will remove the subtitle from the window layout.
584        #[unsafe(method(subtitle))]
585        #[unsafe(method_family = none)]
586        pub unsafe fn subtitle(&self) -> Retained<NSString>;
587
588        /// Setter for [`subtitle`][Self::subtitle].
589        #[unsafe(method(setSubtitle:))]
590        #[unsafe(method_family = none)]
591        pub unsafe fn setSubtitle(&self, subtitle: &NSString);
592
593        /// See the enum values for how this property works.
594        #[unsafe(method(titleVisibility))]
595        #[unsafe(method_family = none)]
596        pub unsafe fn titleVisibility(&self) -> NSWindowTitleVisibility;
597
598        /// Setter for [`titleVisibility`][Self::titleVisibility].
599        #[unsafe(method(setTitleVisibility:))]
600        #[unsafe(method_family = none)]
601        pub fn setTitleVisibility(&self, title_visibility: NSWindowTitleVisibility);
602
603        /// When
604        /// `YES,`the titlebar doesn't draw its background, allowing all buttons to show through, and "click through" to happen. In general, this is only useful when
605        /// `NSFullSizeContentViewWindowMask`is set.
606        #[unsafe(method(titlebarAppearsTransparent))]
607        #[unsafe(method_family = none)]
608        pub unsafe fn titlebarAppearsTransparent(&self) -> bool;
609
610        /// Setter for [`titlebarAppearsTransparent`][Self::titlebarAppearsTransparent].
611        #[unsafe(method(setTitlebarAppearsTransparent:))]
612        #[unsafe(method_family = none)]
613        pub fn setTitlebarAppearsTransparent(&self, titlebar_appears_transparent: bool);
614
615        /// Specifies how the titlebar area of the window should appear when the window displays an NSToolbar
616        #[unsafe(method(toolbarStyle))]
617        #[unsafe(method_family = none)]
618        pub unsafe fn toolbarStyle(&self) -> NSWindowToolbarStyle;
619
620        /// Setter for [`toolbarStyle`][Self::toolbarStyle].
621        #[unsafe(method(setToolbarStyle:))]
622        #[unsafe(method_family = none)]
623        pub unsafe fn setToolbarStyle(&self, toolbar_style: NSWindowToolbarStyle);
624
625        /// The
626        /// `contentLayoutRect`will return the area inside the window that is for non-obscured content. Typically, this is the same thing as the `contentView`'s frame. However, for windows with the
627        /// `NSFullSizeContentViewWindowMask`set, there needs to be a way to determine the portion that is not under the toolbar. The
628        /// `contentLayoutRect`returns the portion of the layout that is not obscured under the toolbar.
629        /// `contentLayoutRect`is in window coordinates. It is KVO compliant. */
630        #[unsafe(method(contentLayoutRect))]
631        #[unsafe(method_family = none)]
632        pub unsafe fn contentLayoutRect(&self) -> NSRect;
633
634        /// `contentLayoutGuide`is a corollary to
635        /// `contentLayoutRect.`It can be used by autolayout constraints to automatically bind to the
636        /// `contentLayoutRect.`
637        #[unsafe(method(contentLayoutGuide))]
638        #[unsafe(method_family = none)]
639        pub unsafe fn contentLayoutGuide(&self) -> Option<Retained<AnyObject>>;
640
641        #[cfg(all(
642            feature = "NSTitlebarAccessoryViewController",
643            feature = "NSViewController"
644        ))]
645        #[unsafe(method(titlebarAccessoryViewControllers))]
646        #[unsafe(method_family = none)]
647        pub unsafe fn titlebarAccessoryViewControllers(
648            &self,
649        ) -> Retained<NSArray<NSTitlebarAccessoryViewController>>;
650
651        #[cfg(all(
652            feature = "NSTitlebarAccessoryViewController",
653            feature = "NSViewController"
654        ))]
655        /// Setter for [`titlebarAccessoryViewControllers`][Self::titlebarAccessoryViewControllers].
656        #[unsafe(method(setTitlebarAccessoryViewControllers:))]
657        #[unsafe(method_family = none)]
658        pub unsafe fn setTitlebarAccessoryViewControllers(
659            &self,
660            titlebar_accessory_view_controllers: &NSArray<NSTitlebarAccessoryViewController>,
661        );
662
663        #[cfg(all(
664            feature = "NSTitlebarAccessoryViewController",
665            feature = "NSViewController"
666        ))]
667        #[unsafe(method(addTitlebarAccessoryViewController:))]
668        #[unsafe(method_family = none)]
669        pub unsafe fn addTitlebarAccessoryViewController(
670            &self,
671            child_view_controller: &NSTitlebarAccessoryViewController,
672        );
673
674        #[cfg(all(
675            feature = "NSTitlebarAccessoryViewController",
676            feature = "NSViewController"
677        ))]
678        #[unsafe(method(insertTitlebarAccessoryViewController:atIndex:))]
679        #[unsafe(method_family = none)]
680        pub unsafe fn insertTitlebarAccessoryViewController_atIndex(
681            &self,
682            child_view_controller: &NSTitlebarAccessoryViewController,
683            index: NSInteger,
684        );
685
686        #[unsafe(method(removeTitlebarAccessoryViewControllerAtIndex:))]
687        #[unsafe(method_family = none)]
688        pub unsafe fn removeTitlebarAccessoryViewControllerAtIndex(&self, index: NSInteger);
689
690        /// If url is not nil and its path is not empty, the window will show a document icon in the titlebar.
691        /// If the url represents a filename or other resource with a known icon, that icon will be used as the document icon.  Otherwise the default document icon will be used.  The icon can be customized using `-[[NSWindow standardWindowButton:NSWindowDocumentIconButton] setImage:customImage]`.  If url is not nil and its path is not empty, the window will have a pop-up menu which can be shown via command-click on the area containing the document icon and title.  By default, this menu will display the path components of the url.  The presence and contents of this menu can be controlled by the delegate method `-[window:shouldPopUpDocumentPathMenu:]`
692        /// If the url is nil or has an empty path, the window will not show a document icon and will not have a pop-up menu available via command-click.
693        #[unsafe(method(representedURL))]
694        #[unsafe(method_family = none)]
695        pub unsafe fn representedURL(&self) -> Option<Retained<NSURL>>;
696
697        /// Setter for [`representedURL`][Self::representedURL].
698        #[unsafe(method(setRepresentedURL:))]
699        #[unsafe(method_family = none)]
700        pub unsafe fn setRepresentedURL(&self, represented_url: Option<&NSURL>);
701
702        #[unsafe(method(representedFilename))]
703        #[unsafe(method_family = none)]
704        pub unsafe fn representedFilename(&self) -> Retained<NSString>;
705
706        /// Setter for [`representedFilename`][Self::representedFilename].
707        #[unsafe(method(setRepresentedFilename:))]
708        #[unsafe(method_family = none)]
709        pub unsafe fn setRepresentedFilename(&self, represented_filename: &NSString);
710
711        #[unsafe(method(setTitleWithRepresentedFilename:))]
712        #[unsafe(method_family = none)]
713        pub unsafe fn setTitleWithRepresentedFilename(&self, filename: &NSString);
714
715        #[unsafe(method(isExcludedFromWindowsMenu))]
716        #[unsafe(method_family = none)]
717        pub unsafe fn isExcludedFromWindowsMenu(&self) -> bool;
718
719        /// Setter for [`isExcludedFromWindowsMenu`][Self::isExcludedFromWindowsMenu].
720        #[unsafe(method(setExcludedFromWindowsMenu:))]
721        #[unsafe(method_family = none)]
722        pub unsafe fn setExcludedFromWindowsMenu(&self, excluded_from_windows_menu: bool);
723
724        #[cfg(feature = "NSView")]
725        #[unsafe(method(contentView))]
726        #[unsafe(method_family = none)]
727        pub fn contentView(&self) -> Option<Retained<NSView>>;
728
729        #[cfg(feature = "NSView")]
730        /// Setter for [`contentView`][Self::contentView].
731        #[unsafe(method(setContentView:))]
732        #[unsafe(method_family = none)]
733        pub fn setContentView(&self, content_view: Option<&NSView>);
734
735        #[unsafe(method(delegate))]
736        #[unsafe(method_family = none)]
737        pub unsafe fn delegate(&self) -> Option<Retained<ProtocolObject<dyn NSWindowDelegate>>>;
738
739        /// This is a [weak property][objc2::topics::weak_property].
740        /// Setter for [`delegate`][Self::delegate].
741        #[unsafe(method(setDelegate:))]
742        #[unsafe(method_family = none)]
743        pub fn setDelegate(&self, delegate: Option<&ProtocolObject<dyn NSWindowDelegate>>);
744
745        #[unsafe(method(windowNumber))]
746        #[unsafe(method_family = none)]
747        pub unsafe fn windowNumber(&self) -> NSInteger;
748
749        /// Note: The styleMask can only be set on macOS 10.6 and later. Valid
750        /// `styleMask`settings have the same restrictions as the
751        /// `styleMask`passed to `-initWithContentRect:styleMask:backing:defer:`.  Some
752        /// `styleMask`changes will cause the view hierarchy to be rebuilt, since there is a different subclass for the top level view of a borderless window than for the top level view of a titled window.
753        #[unsafe(method(styleMask))]
754        #[unsafe(method_family = none)]
755        pub fn styleMask(&self) -> NSWindowStyleMask;
756
757        /// Setter for [`styleMask`][Self::styleMask].
758        #[unsafe(method(setStyleMask:))]
759        #[unsafe(method_family = none)]
760        pub fn setStyleMask(&self, style_mask: NSWindowStyleMask);
761
762        #[cfg(all(feature = "NSText", feature = "NSView"))]
763        #[unsafe(method(fieldEditor:forObject:))]
764        #[unsafe(method_family = none)]
765        pub unsafe fn fieldEditor_forObject(
766            &self,
767            create_flag: bool,
768            object: Option<&AnyObject>,
769        ) -> Option<Retained<NSText>>;
770
771        #[unsafe(method(endEditingFor:))]
772        #[unsafe(method_family = none)]
773        pub unsafe fn endEditingFor(&self, object: Option<&AnyObject>);
774
775        #[cfg(feature = "NSScreen")]
776        #[unsafe(method(constrainFrameRect:toScreen:))]
777        #[unsafe(method_family = none)]
778        pub unsafe fn constrainFrameRect_toScreen(
779            &self,
780            frame_rect: NSRect,
781            screen: Option<&NSScreen>,
782        ) -> NSRect;
783
784        #[unsafe(method(setFrame:display:))]
785        #[unsafe(method_family = none)]
786        pub fn setFrame_display(&self, frame_rect: NSRect, flag: bool);
787
788        #[unsafe(method(setContentSize:))]
789        #[unsafe(method_family = none)]
790        pub fn setContentSize(&self, size: NSSize);
791
792        #[unsafe(method(setFrameOrigin:))]
793        #[unsafe(method_family = none)]
794        pub unsafe fn setFrameOrigin(&self, point: NSPoint);
795
796        #[unsafe(method(setFrameTopLeftPoint:))]
797        #[unsafe(method_family = none)]
798        pub fn setFrameTopLeftPoint(&self, point: NSPoint);
799
800        #[unsafe(method(cascadeTopLeftFromPoint:))]
801        #[unsafe(method_family = none)]
802        pub unsafe fn cascadeTopLeftFromPoint(&self, top_left_point: NSPoint) -> NSPoint;
803
804        /// The frame to use when cascading or sizing a new window based on the receiver's position or size. This may be different from `frame` when the receiver is positioned by the system.
805        #[unsafe(method(cascadingReferenceFrame))]
806        #[unsafe(method_family = none)]
807        pub unsafe fn cascadingReferenceFrame(&self) -> NSRect;
808
809        #[unsafe(method(frame))]
810        #[unsafe(method_family = none)]
811        pub fn frame(&self) -> NSRect;
812
813        /// Subclasses can override
814        /// `animationResizeTime:`to control the total time for the frame change.
815        /// `newFrame`is the rect passed into
816        /// `setFrame:display:animate:`
817        #[unsafe(method(animationResizeTime:))]
818        #[unsafe(method_family = none)]
819        pub unsafe fn animationResizeTime(&self, new_frame: NSRect) -> NSTimeInterval;
820
821        /// `setFrame:display:animate:`is equivalent to
822        /// `setFrame:display:`if the
823        /// `animateFlag`is NO.
824        /// If the
825        /// `animationFlag`is YES, this method will perform a smooth resize of the window, where the total time for the resize is specified by
826        /// `-animationResizeTime:`
827        #[unsafe(method(setFrame:display:animate:))]
828        #[unsafe(method_family = none)]
829        pub unsafe fn setFrame_display_animate(
830            &self,
831            frame_rect: NSRect,
832            display_flag: bool,
833            animate_flag: bool,
834        );
835
836        #[unsafe(method(inLiveResize))]
837        #[unsafe(method_family = none)]
838        pub unsafe fn inLiveResize(&self) -> bool;
839
840        #[unsafe(method(resizeIncrements))]
841        #[unsafe(method_family = none)]
842        pub unsafe fn resizeIncrements(&self) -> NSSize;
843
844        /// Setter for [`resizeIncrements`][Self::resizeIncrements].
845        #[unsafe(method(setResizeIncrements:))]
846        #[unsafe(method_family = none)]
847        pub fn setResizeIncrements(&self, resize_increments: NSSize);
848
849        #[unsafe(method(aspectRatio))]
850        #[unsafe(method_family = none)]
851        pub unsafe fn aspectRatio(&self) -> NSSize;
852
853        /// Setter for [`aspectRatio`][Self::aspectRatio].
854        #[unsafe(method(setAspectRatio:))]
855        #[unsafe(method_family = none)]
856        pub unsafe fn setAspectRatio(&self, aspect_ratio: NSSize);
857
858        #[unsafe(method(contentResizeIncrements))]
859        #[unsafe(method_family = none)]
860        pub fn contentResizeIncrements(&self) -> NSSize;
861
862        /// Setter for [`contentResizeIncrements`][Self::contentResizeIncrements].
863        #[unsafe(method(setContentResizeIncrements:))]
864        #[unsafe(method_family = none)]
865        pub fn setContentResizeIncrements(&self, content_resize_increments: NSSize);
866
867        #[unsafe(method(contentAspectRatio))]
868        #[unsafe(method_family = none)]
869        pub unsafe fn contentAspectRatio(&self) -> NSSize;
870
871        /// Setter for [`contentAspectRatio`][Self::contentAspectRatio].
872        #[unsafe(method(setContentAspectRatio:))]
873        #[unsafe(method_family = none)]
874        pub unsafe fn setContentAspectRatio(&self, content_aspect_ratio: NSSize);
875
876        #[unsafe(method(viewsNeedDisplay))]
877        #[unsafe(method_family = none)]
878        pub unsafe fn viewsNeedDisplay(&self) -> bool;
879
880        /// Setter for [`viewsNeedDisplay`][Self::viewsNeedDisplay].
881        #[unsafe(method(setViewsNeedDisplay:))]
882        #[unsafe(method_family = none)]
883        pub unsafe fn setViewsNeedDisplay(&self, views_need_display: bool);
884
885        #[unsafe(method(displayIfNeeded))]
886        #[unsafe(method_family = none)]
887        pub unsafe fn displayIfNeeded(&self);
888
889        #[unsafe(method(display))]
890        #[unsafe(method_family = none)]
891        pub unsafe fn display(&self);
892
893        #[unsafe(method(preservesContentDuringLiveResize))]
894        #[unsafe(method_family = none)]
895        pub unsafe fn preservesContentDuringLiveResize(&self) -> bool;
896
897        /// Setter for [`preservesContentDuringLiveResize`][Self::preservesContentDuringLiveResize].
898        #[unsafe(method(setPreservesContentDuringLiveResize:))]
899        #[unsafe(method_family = none)]
900        pub unsafe fn setPreservesContentDuringLiveResize(
901            &self,
902            preserves_content_during_live_resize: bool,
903        );
904
905        #[unsafe(method(update))]
906        #[unsafe(method_family = none)]
907        pub unsafe fn update(&self);
908
909        #[unsafe(method(makeFirstResponder:))]
910        #[unsafe(method_family = none)]
911        pub fn makeFirstResponder(&self, responder: Option<&NSResponder>) -> bool;
912
913        #[unsafe(method(firstResponder))]
914        #[unsafe(method_family = none)]
915        pub fn firstResponder(&self) -> Option<Retained<NSResponder>>;
916
917        #[cfg(feature = "NSEvent")]
918        #[unsafe(method(resizeFlags))]
919        #[unsafe(method_family = none)]
920        pub unsafe fn resizeFlags(&self) -> NSEventModifierFlags;
921
922        #[unsafe(method(close))]
923        #[unsafe(method_family = none)]
924        pub fn close(&self);
925
926        #[unsafe(method(isReleasedWhenClosed))]
927        #[unsafe(method_family = none)]
928        pub unsafe fn isReleasedWhenClosed(&self) -> bool;
929
930        /// Setter for [`isReleasedWhenClosed`][Self::isReleasedWhenClosed].
931        #[unsafe(method(setReleasedWhenClosed:))]
932        #[unsafe(method_family = none)]
933        pub unsafe fn setReleasedWhenClosed(&self, released_when_closed: bool);
934
935        #[unsafe(method(miniaturize:))]
936        #[unsafe(method_family = none)]
937        pub fn miniaturize(&self, sender: Option<&AnyObject>);
938
939        #[unsafe(method(deminiaturize:))]
940        #[unsafe(method_family = none)]
941        pub unsafe fn deminiaturize(&self, sender: Option<&AnyObject>);
942
943        #[unsafe(method(isZoomed))]
944        #[unsafe(method_family = none)]
945        pub fn isZoomed(&self) -> bool;
946
947        #[unsafe(method(zoom:))]
948        #[unsafe(method_family = none)]
949        pub fn zoom(&self, sender: Option<&AnyObject>);
950
951        #[unsafe(method(isMiniaturized))]
952        #[unsafe(method_family = none)]
953        pub fn isMiniaturized(&self) -> bool;
954
955        #[unsafe(method(tryToPerform:with:))]
956        #[unsafe(method_family = none)]
957        pub unsafe fn tryToPerform_with(&self, action: Sel, object: Option<&AnyObject>) -> bool;
958
959        #[cfg(feature = "NSPasteboard")]
960        #[unsafe(method(validRequestorForSendType:returnType:))]
961        #[unsafe(method_family = none)]
962        pub unsafe fn validRequestorForSendType_returnType(
963            &self,
964            send_type: Option<&NSPasteboardType>,
965            return_type: Option<&NSPasteboardType>,
966        ) -> Option<Retained<AnyObject>>;
967
968        #[cfg(feature = "NSColor")]
969        #[unsafe(method(backgroundColor))]
970        #[unsafe(method_family = none)]
971        pub unsafe fn backgroundColor(&self) -> Retained<NSColor>;
972
973        #[cfg(feature = "NSColor")]
974        /// Setter for [`backgroundColor`][Self::backgroundColor].
975        #[unsafe(method(setBackgroundColor:))]
976        #[unsafe(method_family = none)]
977        pub fn setBackgroundColor(&self, background_color: Option<&NSColor>);
978
979        #[cfg(feature = "objc2-core-foundation")]
980        #[unsafe(method(setContentBorderThickness:forEdge:))]
981        #[unsafe(method_family = none)]
982        pub unsafe fn setContentBorderThickness_forEdge(
983            &self,
984            thickness: CGFloat,
985            edge: NSRectEdge,
986        );
987
988        #[cfg(feature = "objc2-core-foundation")]
989        #[unsafe(method(contentBorderThicknessForEdge:))]
990        #[unsafe(method_family = none)]
991        pub unsafe fn contentBorderThicknessForEdge(&self, edge: NSRectEdge) -> CGFloat;
992
993        #[unsafe(method(setAutorecalculatesContentBorderThickness:forEdge:))]
994        #[unsafe(method_family = none)]
995        pub unsafe fn setAutorecalculatesContentBorderThickness_forEdge(
996            &self,
997            flag: bool,
998            edge: NSRectEdge,
999        );
1000
1001        #[unsafe(method(autorecalculatesContentBorderThicknessForEdge:))]
1002        #[unsafe(method_family = none)]
1003        pub unsafe fn autorecalculatesContentBorderThicknessForEdge(
1004            &self,
1005            edge: NSRectEdge,
1006        ) -> bool;
1007
1008        #[unsafe(method(isMovable))]
1009        #[unsafe(method_family = none)]
1010        pub unsafe fn isMovable(&self) -> bool;
1011
1012        /// Setter for [`isMovable`][Self::isMovable].
1013        #[unsafe(method(setMovable:))]
1014        #[unsafe(method_family = none)]
1015        pub fn setMovable(&self, movable: bool);
1016
1017        #[unsafe(method(isMovableByWindowBackground))]
1018        #[unsafe(method_family = none)]
1019        pub unsafe fn isMovableByWindowBackground(&self) -> bool;
1020
1021        /// Setter for [`isMovableByWindowBackground`][Self::isMovableByWindowBackground].
1022        #[unsafe(method(setMovableByWindowBackground:))]
1023        #[unsafe(method_family = none)]
1024        pub fn setMovableByWindowBackground(&self, movable_by_window_background: bool);
1025
1026        #[unsafe(method(hidesOnDeactivate))]
1027        #[unsafe(method_family = none)]
1028        pub unsafe fn hidesOnDeactivate(&self) -> bool;
1029
1030        /// Setter for [`hidesOnDeactivate`][Self::hidesOnDeactivate].
1031        #[unsafe(method(setHidesOnDeactivate:))]
1032        #[unsafe(method_family = none)]
1033        pub unsafe fn setHidesOnDeactivate(&self, hides_on_deactivate: bool);
1034
1035        /// Indicates whether a window can be hidden during `-[NSApplication hide:]`.  Default is
1036        /// `YES.`
1037        #[unsafe(method(canHide))]
1038        #[unsafe(method_family = none)]
1039        pub unsafe fn canHide(&self) -> bool;
1040
1041        /// Setter for [`canHide`][Self::canHide].
1042        #[unsafe(method(setCanHide:))]
1043        #[unsafe(method_family = none)]
1044        pub unsafe fn setCanHide(&self, can_hide: bool);
1045
1046        #[unsafe(method(center))]
1047        #[unsafe(method_family = none)]
1048        pub fn center(&self);
1049
1050        #[unsafe(method(makeKeyAndOrderFront:))]
1051        #[unsafe(method_family = none)]
1052        pub fn makeKeyAndOrderFront(&self, sender: Option<&AnyObject>);
1053
1054        #[unsafe(method(orderFront:))]
1055        #[unsafe(method_family = none)]
1056        pub fn orderFront(&self, sender: Option<&AnyObject>);
1057
1058        #[unsafe(method(orderBack:))]
1059        #[unsafe(method_family = none)]
1060        pub unsafe fn orderBack(&self, sender: Option<&AnyObject>);
1061
1062        #[unsafe(method(orderOut:))]
1063        #[unsafe(method_family = none)]
1064        pub fn orderOut(&self, sender: Option<&AnyObject>);
1065
1066        #[cfg(feature = "NSGraphics")]
1067        #[unsafe(method(orderWindow:relativeTo:))]
1068        #[unsafe(method_family = none)]
1069        pub unsafe fn orderWindow_relativeTo(
1070            &self,
1071            place: NSWindowOrderingMode,
1072            other_win: NSInteger,
1073        );
1074
1075        #[unsafe(method(orderFrontRegardless))]
1076        #[unsafe(method_family = none)]
1077        pub unsafe fn orderFrontRegardless(&self);
1078
1079        #[cfg(feature = "NSImage")]
1080        #[unsafe(method(miniwindowImage))]
1081        #[unsafe(method_family = none)]
1082        pub unsafe fn miniwindowImage(&self) -> Option<Retained<NSImage>>;
1083
1084        #[cfg(feature = "NSImage")]
1085        /// Setter for [`miniwindowImage`][Self::miniwindowImage].
1086        #[unsafe(method(setMiniwindowImage:))]
1087        #[unsafe(method_family = none)]
1088        pub unsafe fn setMiniwindowImage(&self, miniwindow_image: Option<&NSImage>);
1089
1090        #[unsafe(method(miniwindowTitle))]
1091        #[unsafe(method_family = none)]
1092        pub unsafe fn miniwindowTitle(&self) -> Retained<NSString>;
1093
1094        /// Setter for [`miniwindowTitle`][Self::miniwindowTitle].
1095        #[unsafe(method(setMiniwindowTitle:))]
1096        #[unsafe(method_family = none)]
1097        pub unsafe fn setMiniwindowTitle(&self, miniwindow_title: Option<&NSString>);
1098
1099        #[cfg(feature = "NSDockTile")]
1100        #[unsafe(method(dockTile))]
1101        #[unsafe(method_family = none)]
1102        pub unsafe fn dockTile(&self) -> Retained<NSDockTile>;
1103
1104        #[unsafe(method(isDocumentEdited))]
1105        #[unsafe(method_family = none)]
1106        pub fn isDocumentEdited(&self) -> bool;
1107
1108        /// Setter for [`isDocumentEdited`][Self::isDocumentEdited].
1109        #[unsafe(method(setDocumentEdited:))]
1110        #[unsafe(method_family = none)]
1111        pub fn setDocumentEdited(&self, document_edited: bool);
1112
1113        #[unsafe(method(isVisible))]
1114        #[unsafe(method_family = none)]
1115        pub fn isVisible(&self) -> bool;
1116
1117        #[unsafe(method(isKeyWindow))]
1118        #[unsafe(method_family = none)]
1119        pub fn isKeyWindow(&self) -> bool;
1120
1121        #[unsafe(method(isMainWindow))]
1122        #[unsafe(method_family = none)]
1123        pub unsafe fn isMainWindow(&self) -> bool;
1124
1125        #[unsafe(method(canBecomeKeyWindow))]
1126        #[unsafe(method_family = none)]
1127        pub unsafe fn canBecomeKeyWindow(&self) -> bool;
1128
1129        #[unsafe(method(canBecomeMainWindow))]
1130        #[unsafe(method_family = none)]
1131        pub unsafe fn canBecomeMainWindow(&self) -> bool;
1132
1133        /// Makes the window key and main if eligible, updating NSApplication's `-keyWindow` and `-mainWindow` properties.
1134        #[unsafe(method(makeKeyWindow))]
1135        #[unsafe(method_family = none)]
1136        pub unsafe fn makeKeyWindow(&self);
1137
1138        /// Makes the window main if eligible. Updates NSApplication's `-mainWindow` property.
1139        #[unsafe(method(makeMainWindow))]
1140        #[unsafe(method_family = none)]
1141        pub unsafe fn makeMainWindow(&self);
1142
1143        /// Informs the window that it has become the key window. This method exists as an override point. Do not invoke directly. Instead, invoke `-makeKeyWindow`.
1144        #[unsafe(method(becomeKeyWindow))]
1145        #[unsafe(method_family = none)]
1146        pub unsafe fn becomeKeyWindow(&self);
1147
1148        /// Informs the window that it has stopped being the key window. This method exists as an override point. Do not invoke directly. Windows automatically receive this message when deactivating or when another window has become key.
1149        #[unsafe(method(resignKeyWindow))]
1150        #[unsafe(method_family = none)]
1151        pub unsafe fn resignKeyWindow(&self);
1152
1153        /// Informs the window that it has become the main window. This method exists as an override point. Do not invoke directly. Instead, invoke `-makeMainWindow`.
1154        #[unsafe(method(becomeMainWindow))]
1155        #[unsafe(method_family = none)]
1156        pub unsafe fn becomeMainWindow(&self);
1157
1158        /// Informs the window that it has stopped being the main window. This method exists as an override point. Do not invoke directly. Windows automatically receive this message when deactivating or when another window has become main.
1159        #[unsafe(method(resignMainWindow))]
1160        #[unsafe(method_family = none)]
1161        pub unsafe fn resignMainWindow(&self);
1162
1163        #[unsafe(method(worksWhenModal))]
1164        #[unsafe(method_family = none)]
1165        pub unsafe fn worksWhenModal(&self) -> bool;
1166
1167        /// Normally, application termination is prohibited when a modal window or sheet is open, without consulting the application delegate.  Some windows like the open panel or toolbar customization sheet should not prevent application termination.  `-setPreventsApplicationTerminationWhenModal:NO` on a modal window or sheet will override the default behavior and allow application termination to proceed, either through the sudden termination path if enabled, or on to the next step of consulting the application delegate.  By default, `-preventsApplicationTerminationWhenModal` returns
1168        /// `YES`
1169        #[unsafe(method(preventsApplicationTerminationWhenModal))]
1170        #[unsafe(method_family = none)]
1171        pub unsafe fn preventsApplicationTerminationWhenModal(&self) -> bool;
1172
1173        /// Setter for [`preventsApplicationTerminationWhenModal`][Self::preventsApplicationTerminationWhenModal].
1174        #[unsafe(method(setPreventsApplicationTerminationWhenModal:))]
1175        #[unsafe(method_family = none)]
1176        pub unsafe fn setPreventsApplicationTerminationWhenModal(
1177            &self,
1178            prevents_application_termination_when_modal: bool,
1179        );
1180
1181        #[unsafe(method(convertRectToScreen:))]
1182        #[unsafe(method_family = none)]
1183        pub fn convertRectToScreen(&self, rect: NSRect) -> NSRect;
1184
1185        #[unsafe(method(convertRectFromScreen:))]
1186        #[unsafe(method_family = none)]
1187        pub unsafe fn convertRectFromScreen(&self, rect: NSRect) -> NSRect;
1188
1189        #[unsafe(method(convertPointToScreen:))]
1190        #[unsafe(method_family = none)]
1191        pub unsafe fn convertPointToScreen(&self, point: NSPoint) -> NSPoint;
1192
1193        #[unsafe(method(convertPointFromScreen:))]
1194        #[unsafe(method_family = none)]
1195        pub fn convertPointFromScreen(&self, point: NSPoint) -> NSPoint;
1196
1197        #[unsafe(method(convertRectToBacking:))]
1198        #[unsafe(method_family = none)]
1199        pub unsafe fn convertRectToBacking(&self, rect: NSRect) -> NSRect;
1200
1201        #[unsafe(method(convertRectFromBacking:))]
1202        #[unsafe(method_family = none)]
1203        pub unsafe fn convertRectFromBacking(&self, rect: NSRect) -> NSRect;
1204
1205        #[unsafe(method(convertPointToBacking:))]
1206        #[unsafe(method_family = none)]
1207        pub unsafe fn convertPointToBacking(&self, point: NSPoint) -> NSPoint;
1208
1209        #[unsafe(method(convertPointFromBacking:))]
1210        #[unsafe(method_family = none)]
1211        pub unsafe fn convertPointFromBacking(&self, point: NSPoint) -> NSPoint;
1212
1213        /// Use `NSIntegralRectWithOptions()` to produce a backing store pixel aligned rectangle from the given input rectangle in window coordinates.
1214        #[unsafe(method(backingAlignedRect:options:))]
1215        #[unsafe(method_family = none)]
1216        pub unsafe fn backingAlignedRect_options(
1217            &self,
1218            rect: NSRect,
1219            options: NSAlignmentOptions,
1220        ) -> NSRect;
1221
1222        #[cfg(feature = "objc2-core-foundation")]
1223        /// Returns the scale factor representing the number of backing store pixels corresponding to each linear unit in window space on this
1224        /// `NSWindow.`This method is provided for rare cases when the explicit scale factor is needed. Please use `-convert*ToBacking:` methods whenever possible.
1225        #[unsafe(method(backingScaleFactor))]
1226        #[unsafe(method_family = none)]
1227        pub fn backingScaleFactor(&self) -> CGFloat;
1228
1229        #[unsafe(method(performClose:))]
1230        #[unsafe(method_family = none)]
1231        pub unsafe fn performClose(&self, sender: Option<&AnyObject>);
1232
1233        #[unsafe(method(performMiniaturize:))]
1234        #[unsafe(method_family = none)]
1235        pub unsafe fn performMiniaturize(&self, sender: Option<&AnyObject>);
1236
1237        #[unsafe(method(performZoom:))]
1238        #[unsafe(method_family = none)]
1239        pub unsafe fn performZoom(&self, sender: Option<&AnyObject>);
1240
1241        #[unsafe(method(dataWithEPSInsideRect:))]
1242        #[unsafe(method_family = none)]
1243        pub unsafe fn dataWithEPSInsideRect(&self, rect: NSRect) -> Retained<NSData>;
1244
1245        #[unsafe(method(dataWithPDFInsideRect:))]
1246        #[unsafe(method_family = none)]
1247        pub unsafe fn dataWithPDFInsideRect(&self, rect: NSRect) -> Retained<NSData>;
1248
1249        #[unsafe(method(print:))]
1250        #[unsafe(method_family = none)]
1251        pub unsafe fn print(&self, sender: Option<&AnyObject>);
1252
1253        /// Default is
1254        /// `NO.`Set to
1255        /// `YES`to allow a window to display tooltips even when the application is in the background.  Note that, enabling tooltips in an inactive application will cause the app to do work any time the mouse passes over the window.  This can degrade system performance.
1256        /// Returns
1257        /// `YES`if this window displays tooltips even when the application is in the background.  To configure this setting you should call `-setAllowsToolTipsWhenApplicationIsInactive:` instead of overriding `-allowsToolTipsWhenApplicationIsInactive`.
1258        #[unsafe(method(allowsToolTipsWhenApplicationIsInactive))]
1259        #[unsafe(method_family = none)]
1260        pub unsafe fn allowsToolTipsWhenApplicationIsInactive(&self) -> bool;
1261
1262        /// Setter for [`allowsToolTipsWhenApplicationIsInactive`][Self::allowsToolTipsWhenApplicationIsInactive].
1263        #[unsafe(method(setAllowsToolTipsWhenApplicationIsInactive:))]
1264        #[unsafe(method_family = none)]
1265        pub unsafe fn setAllowsToolTipsWhenApplicationIsInactive(
1266            &self,
1267            allows_tool_tips_when_application_is_inactive: bool,
1268        );
1269
1270        #[cfg(feature = "NSGraphics")]
1271        #[unsafe(method(backingType))]
1272        #[unsafe(method_family = none)]
1273        pub unsafe fn backingType(&self) -> NSBackingStoreType;
1274
1275        #[cfg(feature = "NSGraphics")]
1276        /// Setter for [`backingType`][Self::backingType].
1277        #[unsafe(method(setBackingType:))]
1278        #[unsafe(method_family = none)]
1279        pub unsafe fn setBackingType(&self, backing_type: NSBackingStoreType);
1280
1281        #[unsafe(method(level))]
1282        #[unsafe(method_family = none)]
1283        pub unsafe fn level(&self) -> NSWindowLevel;
1284
1285        /// Setter for [`level`][Self::level].
1286        #[unsafe(method(setLevel:))]
1287        #[unsafe(method_family = none)]
1288        pub fn setLevel(&self, level: NSWindowLevel);
1289
1290        #[cfg(feature = "NSGraphics")]
1291        #[unsafe(method(depthLimit))]
1292        #[unsafe(method_family = none)]
1293        pub unsafe fn depthLimit(&self) -> NSWindowDepth;
1294
1295        #[cfg(feature = "NSGraphics")]
1296        /// Setter for [`depthLimit`][Self::depthLimit].
1297        #[unsafe(method(setDepthLimit:))]
1298        #[unsafe(method_family = none)]
1299        pub unsafe fn setDepthLimit(&self, depth_limit: NSWindowDepth);
1300
1301        #[unsafe(method(setDynamicDepthLimit:))]
1302        #[unsafe(method_family = none)]
1303        pub unsafe fn setDynamicDepthLimit(&self, flag: bool);
1304
1305        #[unsafe(method(hasDynamicDepthLimit))]
1306        #[unsafe(method_family = none)]
1307        pub unsafe fn hasDynamicDepthLimit(&self) -> bool;
1308
1309        #[cfg(feature = "NSScreen")]
1310        /// The screen property returns the best screen for the window. If the window only intersects one screen, it returns that screen. If it intersects more than one screen, then it resolves the tie through based on what space it is mostly on. It may return nil if there are no available screens, or it is completely off screen.
1311        #[unsafe(method(screen))]
1312        #[unsafe(method_family = none)]
1313        pub fn screen(&self) -> Option<Retained<NSScreen>>;
1314
1315        #[cfg(feature = "NSScreen")]
1316        #[unsafe(method(deepestScreen))]
1317        #[unsafe(method_family = none)]
1318        pub unsafe fn deepestScreen(&self) -> Option<Retained<NSScreen>>;
1319
1320        #[unsafe(method(hasShadow))]
1321        #[unsafe(method_family = none)]
1322        pub fn hasShadow(&self) -> bool;
1323
1324        /// Setter for [`hasShadow`][Self::hasShadow].
1325        #[unsafe(method(setHasShadow:))]
1326        #[unsafe(method_family = none)]
1327        pub fn setHasShadow(&self, has_shadow: bool);
1328
1329        #[unsafe(method(invalidateShadow))]
1330        #[unsafe(method_family = none)]
1331        pub unsafe fn invalidateShadow(&self);
1332
1333        #[cfg(feature = "objc2-core-foundation")]
1334        #[unsafe(method(alphaValue))]
1335        #[unsafe(method_family = none)]
1336        pub unsafe fn alphaValue(&self) -> CGFloat;
1337
1338        #[cfg(feature = "objc2-core-foundation")]
1339        /// Setter for [`alphaValue`][Self::alphaValue].
1340        #[unsafe(method(setAlphaValue:))]
1341        #[unsafe(method_family = none)]
1342        pub unsafe fn setAlphaValue(&self, alpha_value: CGFloat);
1343
1344        #[unsafe(method(isOpaque))]
1345        #[unsafe(method_family = none)]
1346        pub unsafe fn isOpaque(&self) -> bool;
1347
1348        /// Setter for [`isOpaque`][Self::isOpaque].
1349        #[unsafe(method(setOpaque:))]
1350        #[unsafe(method_family = none)]
1351        pub fn setOpaque(&self, opaque: bool);
1352
1353        /// `-setSharingType:` specifies whether the window content can be read from another process.  The default sharing type is
1354        /// `NSWindowSharingReadOnly,`which means other processes can read the window content (eg. for window capture) but cannot modify it.  If you set your window sharing type to
1355        /// `NSWindowSharingNone,`so that the content cannot be captured, your window will also not be able to participate in a number of system services, so this setting should be used with caution.
1356        #[unsafe(method(sharingType))]
1357        #[unsafe(method_family = none)]
1358        pub unsafe fn sharingType(&self) -> NSWindowSharingType;
1359
1360        /// Setter for [`sharingType`][Self::sharingType].
1361        #[unsafe(method(setSharingType:))]
1362        #[unsafe(method_family = none)]
1363        pub fn setSharingType(&self, sharing_type: NSWindowSharingType);
1364
1365        /// Controls whether threading of view drawing should be enabled for this window.  Defaults to
1366        /// `YES.`When this is set to
1367        /// `YES,`AppKit's view system is allowed to perform `-drawRect:` activity for the window's views on threads other than the main thread, for views that have `canDrawConcurrently == YES`.  When this is set to
1368        /// `NO,`the window's views will be drawn serially as on 10.5 and earlier, even though some of the views may have `canDrawConcurrently == YES`.
1369        #[unsafe(method(allowsConcurrentViewDrawing))]
1370        #[unsafe(method_family = none)]
1371        pub unsafe fn allowsConcurrentViewDrawing(&self) -> bool;
1372
1373        /// Setter for [`allowsConcurrentViewDrawing`][Self::allowsConcurrentViewDrawing].
1374        #[unsafe(method(setAllowsConcurrentViewDrawing:))]
1375        #[unsafe(method_family = none)]
1376        pub unsafe fn setAllowsConcurrentViewDrawing(&self, allows_concurrent_view_drawing: bool);
1377
1378        #[unsafe(method(displaysWhenScreenProfileChanges))]
1379        #[unsafe(method_family = none)]
1380        pub unsafe fn displaysWhenScreenProfileChanges(&self) -> bool;
1381
1382        /// Setter for [`displaysWhenScreenProfileChanges`][Self::displaysWhenScreenProfileChanges].
1383        #[unsafe(method(setDisplaysWhenScreenProfileChanges:))]
1384        #[unsafe(method_family = none)]
1385        pub unsafe fn setDisplaysWhenScreenProfileChanges(
1386            &self,
1387            displays_when_screen_profile_changes: bool,
1388        );
1389
1390        /// This API controls whether the receiver is permitted onscreen before the user has logged in.  This property is off by default.  Alert panels and windows presented by input managers are examples of windows which should have this property set.
1391        #[unsafe(method(canBecomeVisibleWithoutLogin))]
1392        #[unsafe(method_family = none)]
1393        pub unsafe fn canBecomeVisibleWithoutLogin(&self) -> bool;
1394
1395        /// Setter for [`canBecomeVisibleWithoutLogin`][Self::canBecomeVisibleWithoutLogin].
1396        #[unsafe(method(setCanBecomeVisibleWithoutLogin:))]
1397        #[unsafe(method_family = none)]
1398        pub unsafe fn setCanBecomeVisibleWithoutLogin(
1399            &self,
1400            can_become_visible_without_login: bool,
1401        );
1402
1403        #[unsafe(method(collectionBehavior))]
1404        #[unsafe(method_family = none)]
1405        pub unsafe fn collectionBehavior(&self) -> NSWindowCollectionBehavior;
1406
1407        /// Setter for [`collectionBehavior`][Self::collectionBehavior].
1408        #[unsafe(method(setCollectionBehavior:))]
1409        #[unsafe(method_family = none)]
1410        pub unsafe fn setCollectionBehavior(&self, collection_behavior: NSWindowCollectionBehavior);
1411
1412        /// Provides for per-window control over automatic orderFront/orderOut animation behaviors added in 10.7.  Can be set to
1413        /// `NSWindowAnimationBehaviorNone`to disable Appkit's automatic animations for a given window, or to one of the other non-Default
1414        /// `NSWindowAnimationBehavior`values to override AppKit's automatic inference of appropriate animation behavior based on the window's apparent type.
1415        #[unsafe(method(animationBehavior))]
1416        #[unsafe(method_family = none)]
1417        pub unsafe fn animationBehavior(&self) -> NSWindowAnimationBehavior;
1418
1419        /// Setter for [`animationBehavior`][Self::animationBehavior].
1420        #[unsafe(method(setAnimationBehavior:))]
1421        #[unsafe(method_family = none)]
1422        pub unsafe fn setAnimationBehavior(&self, animation_behavior: NSWindowAnimationBehavior);
1423
1424        /// Returns
1425        /// `YES`if this window is associated with the active space.  For visible windows, this API indicates whether the window is currently visible on the active space.  For offscreen windows, it indicates whether ordering the window onscreen would make it bring it onto the active space
1426        #[unsafe(method(isOnActiveSpace))]
1427        #[unsafe(method_family = none)]
1428        pub unsafe fn isOnActiveSpace(&self) -> bool;
1429
1430        /// `-toggleFullScreen:` enters or exits for full screen. A window must have
1431        /// `NSWindowCollectionBehaviorFullScreenAuxiliary`or
1432        /// `NSWindowCollectionBehaviorFullScreenPrimary`included in the
1433        /// `collectionBehavior`property; if it does not, this method may simply do nothing.
1434        #[unsafe(method(toggleFullScreen:))]
1435        #[unsafe(method_family = none)]
1436        pub fn toggleFullScreen(&self, sender: Option<&AnyObject>);
1437
1438        #[unsafe(method(stringWithSavedFrame))]
1439        #[unsafe(method_family = none)]
1440        pub unsafe fn stringWithSavedFrame(&self) -> Retained<NSWindowPersistableFrameDescriptor>;
1441
1442        #[unsafe(method(setFrameFromString:))]
1443        #[unsafe(method_family = none)]
1444        pub unsafe fn setFrameFromString(&self, string: &NSWindowPersistableFrameDescriptor);
1445
1446        #[unsafe(method(saveFrameUsingName:))]
1447        #[unsafe(method_family = none)]
1448        pub unsafe fn saveFrameUsingName(&self, name: &NSWindowFrameAutosaveName);
1449
1450        #[unsafe(method(setFrameUsingName:force:))]
1451        #[unsafe(method_family = none)]
1452        pub unsafe fn setFrameUsingName_force(
1453            &self,
1454            name: &NSWindowFrameAutosaveName,
1455            force: bool,
1456        ) -> bool;
1457
1458        #[unsafe(method(setFrameUsingName:))]
1459        #[unsafe(method_family = none)]
1460        pub unsafe fn setFrameUsingName(&self, name: &NSWindowFrameAutosaveName) -> bool;
1461
1462        #[unsafe(method(setFrameAutosaveName:))]
1463        #[unsafe(method_family = none)]
1464        pub unsafe fn setFrameAutosaveName(&self, name: &NSWindowFrameAutosaveName) -> bool;
1465
1466        #[unsafe(method(frameAutosaveName))]
1467        #[unsafe(method_family = none)]
1468        pub unsafe fn frameAutosaveName(&self) -> Retained<NSWindowFrameAutosaveName>;
1469
1470        #[unsafe(method(removeFrameUsingName:))]
1471        #[unsafe(method_family = none)]
1472        pub unsafe fn removeFrameUsingName(name: &NSWindowFrameAutosaveName, mtm: MainThreadMarker);
1473
1474        #[unsafe(method(minSize))]
1475        #[unsafe(method_family = none)]
1476        pub unsafe fn minSize(&self) -> NSSize;
1477
1478        /// Setter for [`minSize`][Self::minSize].
1479        #[unsafe(method(setMinSize:))]
1480        #[unsafe(method_family = none)]
1481        pub fn setMinSize(&self, min_size: NSSize);
1482
1483        #[unsafe(method(maxSize))]
1484        #[unsafe(method_family = none)]
1485        pub unsafe fn maxSize(&self) -> NSSize;
1486
1487        /// Setter for [`maxSize`][Self::maxSize].
1488        #[unsafe(method(setMaxSize:))]
1489        #[unsafe(method_family = none)]
1490        pub fn setMaxSize(&self, max_size: NSSize);
1491
1492        #[unsafe(method(contentMinSize))]
1493        #[unsafe(method_family = none)]
1494        pub unsafe fn contentMinSize(&self) -> NSSize;
1495
1496        /// Setter for [`contentMinSize`][Self::contentMinSize].
1497        #[unsafe(method(setContentMinSize:))]
1498        #[unsafe(method_family = none)]
1499        pub unsafe fn setContentMinSize(&self, content_min_size: NSSize);
1500
1501        #[unsafe(method(contentMaxSize))]
1502        #[unsafe(method_family = none)]
1503        pub unsafe fn contentMaxSize(&self) -> NSSize;
1504
1505        /// Setter for [`contentMaxSize`][Self::contentMaxSize].
1506        #[unsafe(method(setContentMaxSize:))]
1507        #[unsafe(method_family = none)]
1508        pub unsafe fn setContentMaxSize(&self, content_max_size: NSSize);
1509
1510        #[unsafe(method(minFullScreenContentSize))]
1511        #[unsafe(method_family = none)]
1512        pub unsafe fn minFullScreenContentSize(&self) -> NSSize;
1513
1514        /// Setter for [`minFullScreenContentSize`][Self::minFullScreenContentSize].
1515        #[unsafe(method(setMinFullScreenContentSize:))]
1516        #[unsafe(method_family = none)]
1517        pub unsafe fn setMinFullScreenContentSize(&self, min_full_screen_content_size: NSSize);
1518
1519        #[unsafe(method(maxFullScreenContentSize))]
1520        #[unsafe(method_family = none)]
1521        pub unsafe fn maxFullScreenContentSize(&self) -> NSSize;
1522
1523        /// Setter for [`maxFullScreenContentSize`][Self::maxFullScreenContentSize].
1524        #[unsafe(method(setMaxFullScreenContentSize:))]
1525        #[unsafe(method_family = none)]
1526        pub unsafe fn setMaxFullScreenContentSize(&self, max_full_screen_content_size: NSSize);
1527
1528        #[cfg(feature = "NSGraphics")]
1529        #[unsafe(method(deviceDescription))]
1530        #[unsafe(method_family = none)]
1531        pub unsafe fn deviceDescription(
1532            &self,
1533        ) -> Retained<NSDictionary<NSDeviceDescriptionKey, AnyObject>>;
1534
1535        #[cfg(feature = "NSWindowController")]
1536        #[unsafe(method(windowController))]
1537        #[unsafe(method_family = none)]
1538        pub unsafe fn windowController(&self) -> Option<Retained<NSWindowController>>;
1539
1540        #[cfg(feature = "NSWindowController")]
1541        /// This is a [weak property][objc2::topics::weak_property].
1542        /// Setter for [`windowController`][Self::windowController].
1543        #[unsafe(method(setWindowController:))]
1544        #[unsafe(method_family = none)]
1545        pub unsafe fn setWindowController(&self, window_controller: Option<&NSWindowController>);
1546
1547        #[cfg(all(feature = "NSApplication", feature = "block2"))]
1548        #[unsafe(method(beginSheet:completionHandler:))]
1549        #[unsafe(method_family = none)]
1550        pub unsafe fn beginSheet_completionHandler(
1551            &self,
1552            sheet_window: &NSWindow,
1553            handler: Option<&block2::Block<dyn Fn(NSModalResponse)>>,
1554        );
1555
1556        #[cfg(all(feature = "NSApplication", feature = "block2"))]
1557        #[unsafe(method(beginCriticalSheet:completionHandler:))]
1558        #[unsafe(method_family = none)]
1559        pub unsafe fn beginCriticalSheet_completionHandler(
1560            &self,
1561            sheet_window: &NSWindow,
1562            handler: Option<&block2::Block<dyn Fn(NSModalResponse)>>,
1563        );
1564
1565        #[unsafe(method(endSheet:))]
1566        #[unsafe(method_family = none)]
1567        pub unsafe fn endSheet(&self, sheet_window: &NSWindow);
1568
1569        #[cfg(feature = "NSApplication")]
1570        #[unsafe(method(endSheet:returnCode:))]
1571        #[unsafe(method_family = none)]
1572        pub unsafe fn endSheet_returnCode(
1573            &self,
1574            sheet_window: &NSWindow,
1575            return_code: NSModalResponse,
1576        );
1577
1578        /// An ordered array of the sheets on the window. This consists of the presented sheets in top-to-bottom order, followed by queued sheets in the order they were queued. This does not include nested/sub-sheets.
1579        #[unsafe(method(sheets))]
1580        #[unsafe(method_family = none)]
1581        pub unsafe fn sheets(&self) -> Retained<NSArray<NSWindow>>;
1582
1583        /// Returns the top-most sheet if there is one or more sheets, or nil if there is no sheet.
1584        #[unsafe(method(attachedSheet))]
1585        #[unsafe(method_family = none)]
1586        pub unsafe fn attachedSheet(&self) -> Option<Retained<NSWindow>>;
1587
1588        #[unsafe(method(isSheet))]
1589        #[unsafe(method_family = none)]
1590        pub unsafe fn isSheet(&self) -> bool;
1591
1592        /// Returns the window that the sheet is directly attached to. This is based on the logical attachment of the sheet, not visual attachment.
1593        /// This relationship exists starting when the sheet is begun (using
1594        /// `NSApplication's``-beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo: or NSWindow's -beginSheet:completionHandler:`), and ending once it is ordered out.
1595        /// Returns nil if the window is not a sheet or has no sheet parent.
1596        #[unsafe(method(sheetParent))]
1597        #[unsafe(method_family = none)]
1598        pub unsafe fn sheetParent(&self) -> Option<Retained<NSWindow>>;
1599
1600        #[cfg(all(feature = "NSButton", feature = "NSControl", feature = "NSView"))]
1601        #[unsafe(method(standardWindowButton:forStyleMask:))]
1602        #[unsafe(method_family = none)]
1603        pub unsafe fn standardWindowButton_forStyleMask(
1604            b: NSWindowButton,
1605            style_mask: NSWindowStyleMask,
1606            mtm: MainThreadMarker,
1607        ) -> Option<Retained<NSButton>>;
1608
1609        #[cfg(all(feature = "NSButton", feature = "NSControl", feature = "NSView"))]
1610        #[unsafe(method(standardWindowButton:))]
1611        #[unsafe(method_family = none)]
1612        pub fn standardWindowButton(&self, b: NSWindowButton) -> Option<Retained<NSButton>>;
1613
1614        #[cfg(feature = "NSGraphics")]
1615        #[unsafe(method(addChildWindow:ordered:))]
1616        #[unsafe(method_family = none)]
1617        pub unsafe fn addChildWindow_ordered(
1618            &self,
1619            child_win: &NSWindow,
1620            place: NSWindowOrderingMode,
1621        );
1622
1623        #[unsafe(method(removeChildWindow:))]
1624        #[unsafe(method_family = none)]
1625        pub unsafe fn removeChildWindow(&self, child_win: &NSWindow);
1626
1627        #[unsafe(method(childWindows))]
1628        #[unsafe(method_family = none)]
1629        pub unsafe fn childWindows(&self) -> Option<Retained<NSArray<NSWindow>>>;
1630
1631        #[unsafe(method(parentWindow))]
1632        #[unsafe(method_family = none)]
1633        pub unsafe fn parentWindow(&self) -> Option<Retained<NSWindow>>;
1634
1635        /// This is a [weak property][objc2::topics::weak_property].
1636        /// Setter for [`parentWindow`][Self::parentWindow].
1637        #[unsafe(method(setParentWindow:))]
1638        #[unsafe(method_family = none)]
1639        pub unsafe fn setParentWindow(&self, parent_window: Option<&NSWindow>);
1640
1641        #[cfg(feature = "NSAppearance")]
1642        /// If set, the receiver will inherit the appearance of that object, as well as use KVO to observe its effectiveAppearance for changes. Typically this is used for child windows that are shown from a parent window or specific view. Defaults to NSApp.
1643        #[unsafe(method(appearanceSource))]
1644        #[unsafe(method_family = none)]
1645        pub unsafe fn appearanceSource(&self) -> Option<Retained<NSObject>>;
1646
1647        #[cfg(feature = "NSAppearance")]
1648        /// This is a [weak property][objc2::topics::weak_property].
1649        /// Setter for [`appearanceSource`][Self::appearanceSource].
1650        #[unsafe(method(setAppearanceSource:))]
1651        #[unsafe(method_family = none)]
1652        pub unsafe fn setAppearanceSource(&self, appearance_source: Option<&NSObject>);
1653
1654        #[cfg(feature = "NSColorSpace")]
1655        #[unsafe(method(colorSpace))]
1656        #[unsafe(method_family = none)]
1657        pub unsafe fn colorSpace(&self) -> Option<Retained<NSColorSpace>>;
1658
1659        #[cfg(feature = "NSColorSpace")]
1660        /// Setter for [`colorSpace`][Self::colorSpace].
1661        #[unsafe(method(setColorSpace:))]
1662        #[unsafe(method_family = none)]
1663        pub unsafe fn setColorSpace(&self, color_space: Option<&NSColorSpace>);
1664
1665        #[cfg(feature = "NSGraphics")]
1666        /// `-canRepresentDisplayGamut:` returns
1667        /// `YES`if the colorSpace of the receiving window, and the
1668        /// `colorSpace`of the screen containing that window, are capable of representing the given display gamut
1669        #[unsafe(method(canRepresentDisplayGamut:))]
1670        #[unsafe(method_family = none)]
1671        pub unsafe fn canRepresentDisplayGamut(&self, display_gamut: NSDisplayGamut) -> bool;
1672
1673        /// `+windowNumbersWithOptions:` returns an autoreleased array of
1674        /// `NSNumbers`containing windowNumbers for all visible windows satisfying options.  If no options are specified, only visible windows belonging to the calling application and on the active space are included.  If options include
1675        /// `NSWindowNumberListAllApplications,`visible windows belonging to all applications are included.  If options include
1676        /// `NSWindowNumberListAllSpaces,`visible windows on all spaces are included.  Windows on the active space are returned in z-order.
1677        /// Examples:
1678        /// To get an array of windowNumbers visible on the current space and belonging to the calling application:
1679        /// `windowNumbers = [NSWindow windowNumbersWithOptions:0];`
1680        /// To get an array of windowNumbers visible on any space and belonging to any application:
1681        /// `windowNumbers = [NSWindow windowNumbersWithOptions:NSWindowNumberListAllApplications|NSWindowNumberListAllSpaces];`
1682        /// To get an array of windowNumbers visible on any space and belonging to the calling application:
1683        /// `windowNumbers = [NSWindow windowNumbersWithOptions:NSWindowNumberListAllSpaces];`
1684        #[unsafe(method(windowNumbersWithOptions:))]
1685        #[unsafe(method_family = none)]
1686        pub unsafe fn windowNumbersWithOptions(
1687            options: NSWindowNumberListOptions,
1688            mtm: MainThreadMarker,
1689        ) -> Option<Retained<NSArray<NSNumber>>>;
1690
1691        /// `+windowNumberAtPoint:belowWindowWithWindowNumber:` returns the number of the frontmost window that would be hit by a mouseDown at the screen location "point".  "windowNum" can be specified to exclude a given window along with all windows above it, and may belong to any application.  If no windows are to be excluded, specify 0 for "windowNum".  The windowNumber returned may correspond to a window in another application.
1692        #[unsafe(method(windowNumberAtPoint:belowWindowWithWindowNumber:))]
1693        #[unsafe(method_family = none)]
1694        pub unsafe fn windowNumberAtPoint_belowWindowWithWindowNumber(
1695            point: NSPoint,
1696            window_number: NSInteger,
1697            mtm: MainThreadMarker,
1698        ) -> NSInteger;
1699
1700        #[unsafe(method(occlusionState))]
1701        #[unsafe(method_family = none)]
1702        pub fn occlusionState(&self) -> NSWindowOcclusionState;
1703
1704        /// Specifies the style of separator displayed between the window's titlebar and content.
1705        ///
1706        /// The default value is NSTitlebarSeparatorStyleAutomatic. Changing this value will override any preference made by `NSSplitViewItem`.
1707        #[unsafe(method(titlebarSeparatorStyle))]
1708        #[unsafe(method_family = none)]
1709        pub unsafe fn titlebarSeparatorStyle(&self) -> NSTitlebarSeparatorStyle;
1710
1711        /// Setter for [`titlebarSeparatorStyle`][Self::titlebarSeparatorStyle].
1712        #[unsafe(method(setTitlebarSeparatorStyle:))]
1713        #[unsafe(method_family = none)]
1714        pub unsafe fn setTitlebarSeparatorStyle(
1715            &self,
1716            titlebar_separator_style: NSTitlebarSeparatorStyle,
1717        );
1718
1719        #[cfg(feature = "NSViewController")]
1720        /// The main content view controller for the window. This provides the contentView of the window. Assigning this value will remove the existing contentView and will make the contentViewController.view the main contentView for the window. The default value is nil. The contentViewController only controls the contentView, and not the title of the window. The window title can easily be bound to the contentViewController with the following: [window bind:NSTitleBinding toObject:contentViewController withKeyPath:
1721        /// "
1722        /// title" options:nil]. Setting the contentViewController will cause the window to resize based on the current size of the contentViewController. Autolayout should be used to restrict the size of the window. The value of the contentViewController is encoded in the NIB. Directly assigning a contentView will clear out the contentViewController.
1723        #[unsafe(method(contentViewController))]
1724        #[unsafe(method_family = none)]
1725        pub unsafe fn contentViewController(&self) -> Option<Retained<NSViewController>>;
1726
1727        #[cfg(feature = "NSViewController")]
1728        /// Setter for [`contentViewController`][Self::contentViewController].
1729        #[unsafe(method(setContentViewController:))]
1730        #[unsafe(method_family = none)]
1731        pub unsafe fn setContentViewController(
1732            &self,
1733            content_view_controller: Option<&NSViewController>,
1734        );
1735
1736        #[cfg(feature = "NSViewController")]
1737        /// Convenience method for creating an autoreleased titled window with the given contentViewController. A basic NSWindow with the following attributes is made: titled, closable, resizable, miniaturizable. The window's title is automatically bound to the contentViewController's title. The size of the window can easily be controlled by utilizing autolayout and applying size constraints to the view (or its subviews). The window has isReleasedWhenClosed set to NO, and it must be explicitly retained to keep the window instance alive. To have it automatically be freed when it is closed, do the following: [window retain] and [window setReleasedWhenClosed:YES].
1738        #[unsafe(method(windowWithContentViewController:))]
1739        #[unsafe(method_family = none)]
1740        pub unsafe fn windowWithContentViewController(
1741            content_view_controller: &NSViewController,
1742        ) -> Retained<Self>;
1743
1744        #[cfg(feature = "NSEvent")]
1745        /// Call to start a drag (moving the window) in the Window Server process. In general, this can be done after a mouseDown event has come in and been examined by an application or view. The view may determine it wants to allow that portion of the window to start a window drag, and can hand off the work to the Window Server process by calling this method. This allows the window to participate in space switching, and other system features. Pass the original mouseDown event to the method. The method will return right away, and a mouseUp may not get sent.
1746        #[unsafe(method(performWindowDragWithEvent:))]
1747        #[unsafe(method_family = none)]
1748        pub fn performWindowDragWithEvent(&self, event: &NSEvent);
1749
1750        #[cfg(feature = "NSView")]
1751        #[unsafe(method(initialFirstResponder))]
1752        #[unsafe(method_family = none)]
1753        pub unsafe fn initialFirstResponder(&self) -> Option<Retained<NSView>>;
1754
1755        #[cfg(feature = "NSView")]
1756        /// This is a [weak property][objc2::topics::weak_property].
1757        /// Setter for [`initialFirstResponder`][Self::initialFirstResponder].
1758        #[unsafe(method(setInitialFirstResponder:))]
1759        #[unsafe(method_family = none)]
1760        pub fn setInitialFirstResponder(&self, initial_first_responder: Option<&NSView>);
1761
1762        #[unsafe(method(selectNextKeyView:))]
1763        #[unsafe(method_family = none)]
1764        pub fn selectNextKeyView(&self, sender: Option<&AnyObject>);
1765
1766        #[unsafe(method(selectPreviousKeyView:))]
1767        #[unsafe(method_family = none)]
1768        pub fn selectPreviousKeyView(&self, sender: Option<&AnyObject>);
1769
1770        #[cfg(feature = "NSView")]
1771        #[unsafe(method(selectKeyViewFollowingView:))]
1772        #[unsafe(method_family = none)]
1773        pub unsafe fn selectKeyViewFollowingView(&self, view: &NSView);
1774
1775        #[cfg(feature = "NSView")]
1776        #[unsafe(method(selectKeyViewPrecedingView:))]
1777        #[unsafe(method_family = none)]
1778        pub unsafe fn selectKeyViewPrecedingView(&self, view: &NSView);
1779
1780        #[unsafe(method(keyViewSelectionDirection))]
1781        #[unsafe(method_family = none)]
1782        pub unsafe fn keyViewSelectionDirection(&self) -> NSSelectionDirection;
1783
1784        #[cfg(all(feature = "NSActionCell", feature = "NSButtonCell", feature = "NSCell"))]
1785        #[unsafe(method(defaultButtonCell))]
1786        #[unsafe(method_family = none)]
1787        pub unsafe fn defaultButtonCell(&self) -> Option<Retained<NSButtonCell>>;
1788
1789        #[cfg(all(feature = "NSActionCell", feature = "NSButtonCell", feature = "NSCell"))]
1790        /// Setter for [`defaultButtonCell`][Self::defaultButtonCell].
1791        #[unsafe(method(setDefaultButtonCell:))]
1792        #[unsafe(method_family = none)]
1793        pub unsafe fn setDefaultButtonCell(&self, default_button_cell: Option<&NSButtonCell>);
1794
1795        #[unsafe(method(disableKeyEquivalentForDefaultButtonCell))]
1796        #[unsafe(method_family = none)]
1797        pub unsafe fn disableKeyEquivalentForDefaultButtonCell(&self);
1798
1799        #[unsafe(method(enableKeyEquivalentForDefaultButtonCell))]
1800        #[unsafe(method_family = none)]
1801        pub unsafe fn enableKeyEquivalentForDefaultButtonCell(&self);
1802
1803        #[unsafe(method(autorecalculatesKeyViewLoop))]
1804        #[unsafe(method_family = none)]
1805        pub unsafe fn autorecalculatesKeyViewLoop(&self) -> bool;
1806
1807        /// Setter for [`autorecalculatesKeyViewLoop`][Self::autorecalculatesKeyViewLoop].
1808        #[unsafe(method(setAutorecalculatesKeyViewLoop:))]
1809        #[unsafe(method_family = none)]
1810        pub unsafe fn setAutorecalculatesKeyViewLoop(&self, autorecalculates_key_view_loop: bool);
1811
1812        #[unsafe(method(recalculateKeyViewLoop))]
1813        #[unsafe(method_family = none)]
1814        pub unsafe fn recalculateKeyViewLoop(&self);
1815
1816        #[cfg(feature = "NSToolbar")]
1817        #[unsafe(method(toolbar))]
1818        #[unsafe(method_family = none)]
1819        pub unsafe fn toolbar(&self) -> Option<Retained<NSToolbar>>;
1820
1821        #[cfg(feature = "NSToolbar")]
1822        /// Setter for [`toolbar`][Self::toolbar].
1823        #[unsafe(method(setToolbar:))]
1824        #[unsafe(method_family = none)]
1825        pub unsafe fn setToolbar(&self, toolbar: Option<&NSToolbar>);
1826
1827        #[unsafe(method(toggleToolbarShown:))]
1828        #[unsafe(method_family = none)]
1829        pub unsafe fn toggleToolbarShown(&self, sender: Option<&AnyObject>);
1830
1831        #[unsafe(method(runToolbarCustomizationPalette:))]
1832        #[unsafe(method_family = none)]
1833        pub unsafe fn runToolbarCustomizationPalette(&self, sender: Option<&AnyObject>);
1834
1835        #[deprecated = "This property has no effect"]
1836        #[unsafe(method(showsToolbarButton))]
1837        #[unsafe(method_family = none)]
1838        pub unsafe fn showsToolbarButton(&self) -> bool;
1839
1840        /// Setter for [`showsToolbarButton`][Self::showsToolbarButton].
1841        #[deprecated = "This property has no effect"]
1842        #[unsafe(method(setShowsToolbarButton:))]
1843        #[unsafe(method_family = none)]
1844        pub unsafe fn setShowsToolbarButton(&self, shows_toolbar_button: bool);
1845
1846        /// Allows automatic window tabbing when the value is
1847        /// `YES.`By default, this will be set to
1848        /// `YES,`but applications can explicitly opt out of all automatic tabbing by setting it to NO, and can still adopted explicit window tabbing, if desired.
1849        #[unsafe(method(allowsAutomaticWindowTabbing))]
1850        #[unsafe(method_family = none)]
1851        pub fn allowsAutomaticWindowTabbing(mtm: MainThreadMarker) -> bool;
1852
1853        /// Setter for [`allowsAutomaticWindowTabbing`][Self::allowsAutomaticWindowTabbing].
1854        #[unsafe(method(setAllowsAutomaticWindowTabbing:))]
1855        #[unsafe(method_family = none)]
1856        pub fn setAllowsAutomaticWindowTabbing(
1857            allows_automatic_window_tabbing: bool,
1858            mtm: MainThreadMarker,
1859        );
1860
1861        /// Returns the user's tabbing preference as set in System Preferences. This value should be queried anytime a new window is made to see if the user wants to automatically show it in tabs.
1862        #[unsafe(method(userTabbingPreference))]
1863        #[unsafe(method_family = none)]
1864        pub unsafe fn userTabbingPreference(mtm: MainThreadMarker)
1865            -> NSWindowUserTabbingPreference;
1866
1867        /// Get and set the tabbing mode for this window. This should be set before a window is shown. The default value is
1868        /// `NSWindowTabbingModeAutomatic.`When the value is
1869        /// `NSWindowTabbingModeAutomatic,`the system will look at the
1870        /// `userTabbingPreference`and automatically tab windows together based on the tabbingIdentifier, when it is appropriate to do so.
1871        #[unsafe(method(tabbingMode))]
1872        #[unsafe(method_family = none)]
1873        pub unsafe fn tabbingMode(&self) -> NSWindowTabbingMode;
1874
1875        /// Setter for [`tabbingMode`][Self::tabbingMode].
1876        #[unsafe(method(setTabbingMode:))]
1877        #[unsafe(method_family = none)]
1878        pub fn setTabbingMode(&self, tabbing_mode: NSWindowTabbingMode);
1879
1880        /// Windows with the same
1881        /// `tabbingIdentifier`will have the ability to be tabbed together when a window is being shown. This allows aggregation of similar windows. By default, the
1882        /// `tabbingIdentifier`will be generated based on inherent window properties, such as the window class name, the delegate class name, the window controller class name, and some additional state. Windows can be explicitly made to group together by using the same
1883        /// `tabbingIdentifier.`
1884        #[unsafe(method(tabbingIdentifier))]
1885        #[unsafe(method_family = none)]
1886        pub fn tabbingIdentifier(&self) -> Retained<NSWindowTabbingIdentifier>;
1887
1888        /// Setter for [`tabbingIdentifier`][Self::tabbingIdentifier].
1889        #[unsafe(method(setTabbingIdentifier:))]
1890        #[unsafe(method_family = none)]
1891        pub fn setTabbingIdentifier(&self, tabbing_identifier: &NSWindowTabbingIdentifier);
1892
1893        /// Actions that can be called to perform various tabbed window behaviors. UI that is hooked up to these items can be automatically validated by calling `NSWindow`'s
1894        /// `validateUserInterfaceItem.`
1895        #[unsafe(method(selectNextTab:))]
1896        #[unsafe(method_family = none)]
1897        pub fn selectNextTab(&self, sender: Option<&AnyObject>);
1898
1899        #[unsafe(method(selectPreviousTab:))]
1900        #[unsafe(method_family = none)]
1901        pub unsafe fn selectPreviousTab(&self, sender: Option<&AnyObject>);
1902
1903        #[unsafe(method(moveTabToNewWindow:))]
1904        #[unsafe(method_family = none)]
1905        pub unsafe fn moveTabToNewWindow(&self, sender: Option<&AnyObject>);
1906
1907        #[unsafe(method(mergeAllWindows:))]
1908        #[unsafe(method_family = none)]
1909        pub unsafe fn mergeAllWindows(&self, sender: Option<&AnyObject>);
1910
1911        #[unsafe(method(toggleTabBar:))]
1912        #[unsafe(method_family = none)]
1913        pub unsafe fn toggleTabBar(&self, sender: Option<&AnyObject>);
1914
1915        /// Toggle the Tab Picker / Tab Overview UI which is invoked via "Show All Tabs". Performs the toggle in an animated fashion. Use `tabGroup.isOverviewVisible` to find out if it is visible or not at a given time.
1916        #[unsafe(method(toggleTabOverview:))]
1917        #[unsafe(method_family = none)]
1918        pub unsafe fn toggleTabOverview(&self, sender: Option<&AnyObject>);
1919
1920        /// This is now a cover for `self.tabGroup.windows`, but will return nil if the window is not showing a tab bar.
1921        #[unsafe(method(tabbedWindows))]
1922        #[unsafe(method_family = none)]
1923        pub unsafe fn tabbedWindows(&self) -> Option<Retained<NSArray<NSWindow>>>;
1924
1925        #[cfg(feature = "NSGraphics")]
1926        /// This is now a cover for `-[self.tabGroup addWindow:]`, which allows more precise placement.
1927        #[unsafe(method(addTabbedWindow:ordered:))]
1928        #[unsafe(method_family = none)]
1929        pub unsafe fn addTabbedWindow_ordered(
1930            &self,
1931            window: &NSWindow,
1932            ordered: NSWindowOrderingMode,
1933        );
1934
1935        #[cfg(feature = "NSWindowTab")]
1936        /// Access the properties for this window when it is a tabbed window environment. See the
1937        /// `NSWindowTab`header and comments for more information.
1938        #[unsafe(method(tab))]
1939        #[unsafe(method_family = none)]
1940        pub unsafe fn tab(&self) -> Retained<NSWindowTab>;
1941
1942        #[cfg(feature = "NSWindowTabGroup")]
1943        /// Represents a tab group of windows. This
1944        /// `tabGroup`is lazily created on demand.
1945        #[unsafe(method(tabGroup))]
1946        #[unsafe(method_family = none)]
1947        pub fn tabGroup(&self) -> Option<Retained<NSWindowTabGroup>>;
1948
1949        #[cfg(feature = "block2")]
1950        /// Attempt to move window sharing (i.e. within a SharePlay session) from the receiver to another window. In response to this request, the user may choose to transfer sharing to the new window, or simply stop sharing the content.
1951        ///
1952        /// Parameter `window`: A window that is replacing the reciever in representing the user's current activity.
1953        ///
1954        /// Parameter `completionHandler`: A completion block that is called after the request finishes.
1955        /// `error`In the event of a failed transfer request, a non-nil error contains details about the failure.
1956        #[unsafe(method(transferWindowSharingToWindow:completionHandler:))]
1957        #[unsafe(method_family = none)]
1958        pub unsafe fn transferWindowSharingToWindow_completionHandler(
1959            &self,
1960            window: &NSWindow,
1961            completion_handler: &block2::Block<dyn Fn(*mut NSError)>,
1962        );
1963
1964        /// Indicates whether the receiver is the subject of an active SharePlay sharing session.
1965        #[unsafe(method(hasActiveWindowSharingSession))]
1966        #[unsafe(method_family = none)]
1967        pub unsafe fn hasActiveWindowSharingSession(&self) -> bool;
1968
1969        #[cfg(feature = "block2")]
1970        /// Request sharing of window.  If there is an available ScreenCaptureKit sharing session, an alert will be presented asking the user to confirm the share
1971        ///
1972        /// Parameter `window`: The window to share
1973        ///
1974        /// Parameter `completionHandler`: A completion block that is called after the request finishes.
1975        /// `error`The error will be non-nil if the request does not result in a window being shared.  The error will be NSUserCancelledError if there is no ScreenCaptureKit session, or if the user rejects the offer to share.  If sharing fails for some other reason, the error will provide the details.
1976        #[unsafe(method(requestSharingOfWindow:completionHandler:))]
1977        #[unsafe(method_family = none)]
1978        pub unsafe fn requestSharingOfWindow_completionHandler(
1979            &self,
1980            window: &NSWindow,
1981            completion_handler: &block2::Block<dyn Fn(*mut NSError)>,
1982        );
1983
1984        #[cfg(all(feature = "NSImage", feature = "block2"))]
1985        /// Request sharing of window to be provided later.  If there is an available ScreenCaptureKit sharing session, an alert will be presented asking the user to confirm the share.  The delegate will be asked to provide the window to share via windowForSharingRequestFromWindow:
1986        ///
1987        /// Parameter `image`: An image showing a preview of the window to share
1988        ///
1989        /// Parameter `title`: The title to show in a confirmation dialog
1990        ///
1991        /// Parameter `completionHandler`: A completion block that is called after the request finishes.
1992        /// `error`The error will be non-nil if the request does not result in a window being shared.  The error will be NSUserCancelledError if there is no ScreenCaptureKit session, or if the user rejects the offer to share.  If sharing fails for some other reason, the error will provide the details.
1993        #[unsafe(method(requestSharingOfWindowUsingPreview:title:completionHandler:))]
1994        #[unsafe(method_family = none)]
1995        pub unsafe fn requestSharingOfWindowUsingPreview_title_completionHandler(
1996            &self,
1997            image: &NSImage,
1998            title: &NSString,
1999            completion_handler: &block2::Block<dyn Fn(*mut NSError)>,
2000        );
2001
2002        #[cfg(feature = "NSUserInterfaceLayout")]
2003        /// Retrieve the layout direction of the window titlebar: this includes the standard window buttons (close/minimize/maximize buttons) and the title for this window. In general, this will return "right to left" (RTL) if the primary system language is RTL. The layout direction may be RTL even in applications that do not have a RTL language localization. This value should be utilized if an application uses titlebarAppearsTransparent and places controls underneath the titlebar.
2004        #[unsafe(method(windowTitlebarLayoutDirection))]
2005        #[unsafe(method_family = none)]
2006        pub unsafe fn windowTitlebarLayoutDirection(&self) -> NSUserInterfaceLayoutDirection;
2007    );
2008}
2009
2010/// Methods declared on superclass `NSResponder`.
2011#[cfg(feature = "NSResponder")]
2012impl NSWindow {
2013    extern_methods!(
2014        #[unsafe(method(init))]
2015        #[unsafe(method_family = init)]
2016        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
2017    );
2018}
2019
2020/// Methods declared on superclass `NSObject`.
2021#[cfg(feature = "NSResponder")]
2022impl NSWindow {
2023    extern_methods!(
2024        #[unsafe(method(new))]
2025        #[unsafe(method_family = new)]
2026        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
2027    );
2028}
2029
2030/// NSEvent.
2031#[cfg(feature = "NSResponder")]
2032impl NSWindow {
2033    extern_methods!(
2034        #[cfg(all(feature = "NSEvent", feature = "block2"))]
2035        /// Tracks events matching the supplied mask with the supplied tracking handler until the tracking handler explicitly terminates tracking. Each event is removed from the event queue then passed to the tracking handler. If a matching event does not exist in the event queue, then the main thread blocks in the specified runloop mode until an event of the requested type is received or the timeout expires. If the timeout expires, the tracking handler is called with a nil event. A negative timeout is interpreted as 0. Use
2036        /// `NSEventDurationForever`to never timeout. Tracking continues until `*stop` is set to
2037        /// `YES.`Calls to `-nextEventMatchingMask:…` are allowed inside the trackingHandler block. This method returns once tracking is terminated.
2038        #[unsafe(method(trackEventsMatchingMask:timeout:mode:handler:))]
2039        #[unsafe(method_family = none)]
2040        pub unsafe fn trackEventsMatchingMask_timeout_mode_handler(
2041            &self,
2042            mask: NSEventMask,
2043            timeout: NSTimeInterval,
2044            mode: &NSRunLoopMode,
2045            tracking_handler: &block2::Block<dyn Fn(*mut NSEvent, NonNull<Bool>) + '_>,
2046        );
2047
2048        #[cfg(feature = "NSEvent")]
2049        #[unsafe(method(nextEventMatchingMask:))]
2050        #[unsafe(method_family = none)]
2051        pub unsafe fn nextEventMatchingMask(&self, mask: NSEventMask) -> Option<Retained<NSEvent>>;
2052
2053        #[cfg(feature = "NSEvent")]
2054        #[unsafe(method(nextEventMatchingMask:untilDate:inMode:dequeue:))]
2055        #[unsafe(method_family = none)]
2056        pub unsafe fn nextEventMatchingMask_untilDate_inMode_dequeue(
2057            &self,
2058            mask: NSEventMask,
2059            expiration: Option<&NSDate>,
2060            mode: &NSRunLoopMode,
2061            deq_flag: bool,
2062        ) -> Option<Retained<NSEvent>>;
2063
2064        #[cfg(feature = "NSEvent")]
2065        #[unsafe(method(discardEventsMatchingMask:beforeEvent:))]
2066        #[unsafe(method_family = none)]
2067        pub unsafe fn discardEventsMatchingMask_beforeEvent(
2068            &self,
2069            mask: NSEventMask,
2070            last_event: Option<&NSEvent>,
2071        );
2072
2073        #[cfg(feature = "NSEvent")]
2074        #[unsafe(method(postEvent:atStart:))]
2075        #[unsafe(method_family = none)]
2076        pub unsafe fn postEvent_atStart(&self, event: &NSEvent, flag: bool);
2077
2078        #[cfg(feature = "NSEvent")]
2079        #[unsafe(method(sendEvent:))]
2080        #[unsafe(method_family = none)]
2081        pub fn sendEvent(&self, event: &NSEvent);
2082
2083        #[cfg(feature = "NSEvent")]
2084        #[unsafe(method(currentEvent))]
2085        #[unsafe(method_family = none)]
2086        pub unsafe fn currentEvent(&self) -> Option<Retained<NSEvent>>;
2087
2088        #[unsafe(method(acceptsMouseMovedEvents))]
2089        #[unsafe(method_family = none)]
2090        pub unsafe fn acceptsMouseMovedEvents(&self) -> bool;
2091
2092        /// Setter for [`acceptsMouseMovedEvents`][Self::acceptsMouseMovedEvents].
2093        #[unsafe(method(setAcceptsMouseMovedEvents:))]
2094        #[unsafe(method_family = none)]
2095        pub fn setAcceptsMouseMovedEvents(&self, accepts_mouse_moved_events: bool);
2096
2097        #[unsafe(method(ignoresMouseEvents))]
2098        #[unsafe(method_family = none)]
2099        pub unsafe fn ignoresMouseEvents(&self) -> bool;
2100
2101        /// Setter for [`ignoresMouseEvents`][Self::ignoresMouseEvents].
2102        #[unsafe(method(setIgnoresMouseEvents:))]
2103        #[unsafe(method_family = none)]
2104        pub fn setIgnoresMouseEvents(&self, ignores_mouse_events: bool);
2105
2106        #[unsafe(method(mouseLocationOutsideOfEventStream))]
2107        #[unsafe(method_family = none)]
2108        pub unsafe fn mouseLocationOutsideOfEventStream(&self) -> NSPoint;
2109    );
2110}
2111
2112/// NSCursorRect.
2113#[cfg(feature = "NSResponder")]
2114impl NSWindow {
2115    extern_methods!(
2116        #[unsafe(method(disableCursorRects))]
2117        #[unsafe(method_family = none)]
2118        pub unsafe fn disableCursorRects(&self);
2119
2120        #[unsafe(method(enableCursorRects))]
2121        #[unsafe(method_family = none)]
2122        pub unsafe fn enableCursorRects(&self);
2123
2124        #[unsafe(method(discardCursorRects))]
2125        #[unsafe(method_family = none)]
2126        pub unsafe fn discardCursorRects(&self);
2127
2128        #[unsafe(method(areCursorRectsEnabled))]
2129        #[unsafe(method_family = none)]
2130        pub unsafe fn areCursorRectsEnabled(&self) -> bool;
2131
2132        #[cfg(feature = "NSView")]
2133        #[unsafe(method(invalidateCursorRectsForView:))]
2134        #[unsafe(method_family = none)]
2135        pub fn invalidateCursorRectsForView(&self, view: &NSView);
2136
2137        #[unsafe(method(resetCursorRects))]
2138        #[unsafe(method_family = none)]
2139        pub unsafe fn resetCursorRects(&self);
2140    );
2141}
2142
2143/// NSDrag.
2144#[cfg(feature = "NSResponder")]
2145impl NSWindow {
2146    extern_methods!(
2147        #[cfg(all(
2148            feature = "NSDragging",
2149            feature = "NSDraggingItem",
2150            feature = "NSDraggingSession",
2151            feature = "NSEvent"
2152        ))]
2153        #[unsafe(method(beginDraggingSessionWithItems:event:source:))]
2154        #[unsafe(method_family = none)]
2155        pub unsafe fn beginDraggingSessionWithItems_event_source(
2156            &self,
2157            items: &NSArray<NSDraggingItem>,
2158            event: &NSEvent,
2159            source: &ProtocolObject<dyn NSDraggingSource>,
2160        ) -> Retained<NSDraggingSession>;
2161
2162        #[cfg(all(feature = "NSEvent", feature = "NSImage", feature = "NSPasteboard"))]
2163        #[deprecated = "Use -[NSWindow beginDraggingSessionWithItems:event:source:] instead."]
2164        #[unsafe(method(dragImage:at:offset:event:pasteboard:source:slideBack:))]
2165        #[unsafe(method_family = none)]
2166        pub unsafe fn dragImage_at_offset_event_pasteboard_source_slideBack(
2167            &self,
2168            image: &NSImage,
2169            base_location: NSPoint,
2170            initial_offset: NSSize,
2171            event: &NSEvent,
2172            pboard: &NSPasteboard,
2173            source_obj: &AnyObject,
2174            slide_flag: bool,
2175        );
2176
2177        #[cfg(feature = "NSPasteboard")]
2178        #[unsafe(method(registerForDraggedTypes:))]
2179        #[unsafe(method_family = none)]
2180        pub fn registerForDraggedTypes(&self, new_types: &NSArray<NSPasteboardType>);
2181
2182        #[unsafe(method(unregisterDraggedTypes))]
2183        #[unsafe(method_family = none)]
2184        pub unsafe fn unregisterDraggedTypes(&self);
2185    );
2186}
2187
2188/// NSDisplayLink.
2189#[cfg(feature = "NSResponder")]
2190impl NSWindow {
2191    extern_methods!(
2192        #[cfg(feature = "objc2-quartz-core")]
2193        #[cfg(target_vendor = "apple")]
2194        #[unsafe(method(displayLinkWithTarget:selector:))]
2195        #[unsafe(method_family = none)]
2196        pub unsafe fn displayLinkWithTarget_selector(
2197            &self,
2198            target: &AnyObject,
2199            selector: Sel,
2200        ) -> Retained<CADisplayLink>;
2201    );
2202}
2203
2204extern_protocol!(
2205    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowdelegate?language=objc)
2206    pub unsafe trait NSWindowDelegate: NSObjectProtocol + MainThreadOnly {
2207        #[cfg(feature = "NSResponder")]
2208        #[optional]
2209        #[unsafe(method(windowShouldClose:))]
2210        #[unsafe(method_family = none)]
2211        unsafe fn windowShouldClose(&self, sender: &NSWindow) -> bool;
2212
2213        #[cfg(feature = "NSResponder")]
2214        #[optional]
2215        #[unsafe(method(windowWillReturnFieldEditor:toObject:))]
2216        #[unsafe(method_family = none)]
2217        unsafe fn windowWillReturnFieldEditor_toObject(
2218            &self,
2219            sender: &NSWindow,
2220            client: Option<&AnyObject>,
2221        ) -> Option<Retained<AnyObject>>;
2222
2223        #[cfg(feature = "NSResponder")]
2224        #[optional]
2225        #[unsafe(method(windowWillResize:toSize:))]
2226        #[unsafe(method_family = none)]
2227        unsafe fn windowWillResize_toSize(&self, sender: &NSWindow, frame_size: NSSize) -> NSSize;
2228
2229        #[cfg(feature = "NSResponder")]
2230        #[optional]
2231        #[unsafe(method(windowWillUseStandardFrame:defaultFrame:))]
2232        #[unsafe(method_family = none)]
2233        unsafe fn windowWillUseStandardFrame_defaultFrame(
2234            &self,
2235            window: &NSWindow,
2236            new_frame: NSRect,
2237        ) -> NSRect;
2238
2239        #[cfg(feature = "NSResponder")]
2240        #[optional]
2241        #[unsafe(method(windowShouldZoom:toFrame:))]
2242        #[unsafe(method_family = none)]
2243        unsafe fn windowShouldZoom_toFrame(&self, window: &NSWindow, new_frame: NSRect) -> bool;
2244
2245        #[cfg(feature = "NSResponder")]
2246        #[optional]
2247        #[unsafe(method(windowWillReturnUndoManager:))]
2248        #[unsafe(method_family = none)]
2249        unsafe fn windowWillReturnUndoManager(
2250            &self,
2251            window: &NSWindow,
2252        ) -> Option<Retained<NSUndoManager>>;
2253
2254        #[cfg(feature = "NSResponder")]
2255        /// Tells the delegate that the window is about to show a sheet, and gives the delegate a chance to customize the location of the sheet.
2256        #[optional]
2257        #[unsafe(method(window:willPositionSheet:usingRect:))]
2258        #[unsafe(method_family = none)]
2259        unsafe fn window_willPositionSheet_usingRect(
2260            &self,
2261            window: &NSWindow,
2262            sheet: &NSWindow,
2263            rect: NSRect,
2264        ) -> NSRect;
2265
2266        #[cfg(all(feature = "NSMenu", feature = "NSResponder"))]
2267        /// If a window has a
2268        /// `representedURL,`the window will by default show a path popup menu for a command-click on a rectangle containing the window document icon button and the window title.  The window delegate may implement `-window:shouldPopupDocumentPathMenu:` to override `NSWindow`'s default behavior for path popup menu.  A return of
2269        /// `NO`will prevent the menu from being shown.  A return of
2270        /// `YES`will cause the window to show the menu passed to this method, which by default will contain a menuItem for each path component of the
2271        /// `representedURL.`If the
2272        /// `representedURL`has no path components, the menu will have no menu items.  Before returning
2273        /// `YES,`the window delegate may customize the menu by changing the menuItems.  menuItems may be added or deleted, and each menuItem title, action, or target may be modified.
2274        #[optional]
2275        #[unsafe(method(window:shouldPopUpDocumentPathMenu:))]
2276        #[unsafe(method_family = none)]
2277        unsafe fn window_shouldPopUpDocumentPathMenu(
2278            &self,
2279            window: &NSWindow,
2280            menu: &NSMenu,
2281        ) -> bool;
2282
2283        #[cfg(all(feature = "NSEvent", feature = "NSPasteboard", feature = "NSResponder"))]
2284        /// The window delegate may implement `-window:shouldDragDocumentWithEvent:from:withPasteboard:` to override
2285        /// `NSWindow`document icon's default drag behavior.  The delegate can prohibit the drag by returning
2286        /// `NO.`Before returning
2287        /// `NO,`the delegate may implement its own dragging behavior using `-[NSWindow dragImage:at:offset:event:pasteboard:source:slideBack:]`.  Alternatively, the delegate can enable a drag by returning
2288        /// `YES,`for example to override NSWindow's default behavior of prohibiting the drag of an edited document.  Lastly, the delegate can customize the pasteboard contents before returning
2289        /// `YES.`
2290        #[optional]
2291        #[unsafe(method(window:shouldDragDocumentWithEvent:from:withPasteboard:))]
2292        #[unsafe(method_family = none)]
2293        unsafe fn window_shouldDragDocumentWithEvent_from_withPasteboard(
2294            &self,
2295            window: &NSWindow,
2296            event: &NSEvent,
2297            drag_image_location: NSPoint,
2298            pasteboard: &NSPasteboard,
2299        ) -> bool;
2300
2301        #[cfg(feature = "NSResponder")]
2302        #[optional]
2303        #[unsafe(method(window:willUseFullScreenContentSize:))]
2304        #[unsafe(method_family = none)]
2305        unsafe fn window_willUseFullScreenContentSize(
2306            &self,
2307            window: &NSWindow,
2308            proposed_size: NSSize,
2309        ) -> NSSize;
2310
2311        #[cfg(all(feature = "NSApplication", feature = "NSResponder"))]
2312        #[optional]
2313        #[unsafe(method(window:willUseFullScreenPresentationOptions:))]
2314        #[unsafe(method_family = none)]
2315        unsafe fn window_willUseFullScreenPresentationOptions(
2316            &self,
2317            window: &NSWindow,
2318            proposed_options: NSApplicationPresentationOptions,
2319        ) -> NSApplicationPresentationOptions;
2320
2321        #[cfg(feature = "NSResponder")]
2322        /// The default animation between a window and its fullscreen representation is a crossfade.  With knowledge of the layout of a window before and after it enters fullscreen, an application can do a much better job on the animation.  The following API allows a window delegate to customize the animation by providing a custom window or windows containing layers or other effects.  In order to manage windows on spaces, we need the window delegate to provide a list of windows involved in the animation.  If an application does not do a custom animation, this method can be unimplemented or can return nil.  `-window:startCustomAnimationToEnterFullScreenWithDuration:` will be called only if `-customWindowsToEnterFullScreenForWindow:` returns non-nil.
2323        #[optional]
2324        #[unsafe(method(customWindowsToEnterFullScreenForWindow:))]
2325        #[unsafe(method_family = none)]
2326        unsafe fn customWindowsToEnterFullScreenForWindow(
2327            &self,
2328            window: &NSWindow,
2329        ) -> Option<Retained<NSArray<NSWindow>>>;
2330
2331        #[cfg(feature = "NSResponder")]
2332        /// The system has started its animation into fullscreen, including transitioning to a new space.  Start the window fullscreen animation immediately, and perform the animation with the given duration to  be in sync with the system animation.  This method is called only if `-customWindowToEnterFullScreenForWindow:` returned non-nil.
2333        #[optional]
2334        #[unsafe(method(window:startCustomAnimationToEnterFullScreenWithDuration:))]
2335        #[unsafe(method_family = none)]
2336        unsafe fn window_startCustomAnimationToEnterFullScreenWithDuration(
2337            &self,
2338            window: &NSWindow,
2339            duration: NSTimeInterval,
2340        );
2341
2342        #[cfg(feature = "NSResponder")]
2343        /// In some cases, the transition to enter fullscreen will fail, due to being in the midst of handling some other animation or user gesture.  We will attempt to minimize these cases, but believe there is a need for failure handling.  This method indicates that there was an error, and the application should clean up any work it may have done to prepare to enter fullscreen.  This message will be sent whether or not the delegate indicated a custom animation by returning non-nil from `-customWindowsToEnterFullScreenForWindow:`.
2344        #[optional]
2345        #[unsafe(method(windowDidFailToEnterFullScreen:))]
2346        #[unsafe(method_family = none)]
2347        unsafe fn windowDidFailToEnterFullScreen(&self, window: &NSWindow);
2348
2349        #[cfg(feature = "NSResponder")]
2350        /// The window is about to exit fullscreen mode.  The following API allows a window delegate to customize the animation when the window is about to exit fullscreen.  In order to manage windows on spaces, we need the window delegate to provide a list of windows involved in the animation.  If an application does not do a custom animation, this method can be unimplemented or can return nil. `-window:startCustomAnimationToExitFullScreenWithDuration:` will be called only if `-customWindowsToExitFullScreenForWindow:` returns non-nil.
2351        #[optional]
2352        #[unsafe(method(customWindowsToExitFullScreenForWindow:))]
2353        #[unsafe(method_family = none)]
2354        unsafe fn customWindowsToExitFullScreenForWindow(
2355            &self,
2356            window: &NSWindow,
2357        ) -> Option<Retained<NSArray<NSWindow>>>;
2358
2359        #[cfg(feature = "NSResponder")]
2360        /// The system has started its animation out of fullscreen, including transitioning back to the desktop space.  Start the window animation immediately, and perform the animation with the given duration to  be in sync with the system animation.  This method is called only if `-customWindowsToExitFullScreenForWindow:` returned non-nil.
2361        #[optional]
2362        #[unsafe(method(window:startCustomAnimationToExitFullScreenWithDuration:))]
2363        #[unsafe(method_family = none)]
2364        unsafe fn window_startCustomAnimationToExitFullScreenWithDuration(
2365            &self,
2366            window: &NSWindow,
2367            duration: NSTimeInterval,
2368        );
2369
2370        #[cfg(all(feature = "NSResponder", feature = "NSScreen"))]
2371        /// `-customWindowsToEnterFullScreenForWindow:onScreen:` will be called in place of `-customWindowsToEnterFullScreenForWindow:` if both are implemented.
2372        #[optional]
2373        #[unsafe(method(customWindowsToEnterFullScreenForWindow:onScreen:))]
2374        #[unsafe(method_family = none)]
2375        unsafe fn customWindowsToEnterFullScreenForWindow_onScreen(
2376            &self,
2377            window: &NSWindow,
2378            screen: &NSScreen,
2379        ) -> Option<Retained<NSArray<NSWindow>>>;
2380
2381        #[cfg(all(feature = "NSResponder", feature = "NSScreen"))]
2382        /// `-window:startCustomAnimationToEnterFullScreenOnScreen:withDuration:` will be called in place of `-window:startCustomAnimationToEnterFullScreenWithDuration:` if both are implemented.
2383        #[optional]
2384        #[unsafe(method(window:startCustomAnimationToEnterFullScreenOnScreen:withDuration:))]
2385        #[unsafe(method_family = none)]
2386        unsafe fn window_startCustomAnimationToEnterFullScreenOnScreen_withDuration(
2387            &self,
2388            window: &NSWindow,
2389            screen: &NSScreen,
2390            duration: NSTimeInterval,
2391        );
2392
2393        #[cfg(feature = "NSResponder")]
2394        /// In some cases, the transition to exit fullscreen will fail, due to being in the midst of handling some other animation or user gesture.  We will attempt to minimize these cases, but believe there is a need for failure handling.  This method indicates that there was an error, and the application should clean up any work it may have done to prepare to exit fullscreen.  This message will be sent whether or not the delegate indicated a custom animation by returning non-nil from `-customWindowsToExitFullScreenForWindow:`.
2395        #[optional]
2396        #[unsafe(method(windowDidFailToExitFullScreen:))]
2397        #[unsafe(method_family = none)]
2398        unsafe fn windowDidFailToExitFullScreen(&self, window: &NSWindow);
2399
2400        #[cfg(feature = "NSResponder")]
2401        /// Windows entering the version browser will be resized to the size returned by this method. If either dimension of the returned size is larger than the
2402        /// `maxPreferredFrameSize,`the window will also be scaled down to ensure it fits properly in the version browser. Returned sizes larger than
2403        /// `maxAllowedSize`will be constrained to that size. If this method is not implemented, the version browser will use `-window:willUseStandardFrame:` to determine the resulting window frame size.
2404        #[optional]
2405        #[unsafe(method(window:willResizeForVersionBrowserWithMaxPreferredSize:maxAllowedSize:))]
2406        #[unsafe(method_family = none)]
2407        unsafe fn window_willResizeForVersionBrowserWithMaxPreferredSize_maxAllowedSize(
2408            &self,
2409            window: &NSWindow,
2410            max_preferred_frame_size: NSSize,
2411            max_allowed_frame_size: NSSize,
2412        ) -> NSSize;
2413
2414        #[cfg(feature = "NSResponder")]
2415        /// Method called by `-[NSWindow encodeRestorableStateWithCoder:]` to give the delegate a chance to encode any additional state into the NSCoder.  This state is available in the NSCoder passed to `-restoreWindowWithIdentifier:state:handler:`. See the header `NSWindowRestoration.h` for more information.
2416        #[optional]
2417        #[unsafe(method(window:willEncodeRestorableState:))]
2418        #[unsafe(method_family = none)]
2419        unsafe fn window_willEncodeRestorableState(&self, window: &NSWindow, state: &NSCoder);
2420
2421        #[cfg(feature = "NSResponder")]
2422        /// Method called by `-[NSWindow restoreStateWithCoder:]` to give the delegate a chance to restore its own state, which it may decode from the
2423        /// `NSCoder.`See the header `NSWindowRestoration.h` for more information.
2424        #[optional]
2425        #[unsafe(method(window:didDecodeRestorableState:))]
2426        #[unsafe(method_family = none)]
2427        unsafe fn window_didDecodeRestorableState(&self, window: &NSWindow, state: &NSCoder);
2428
2429        #[cfg(all(feature = "NSPreviewRepresentingActivityItem", feature = "NSResponder"))]
2430        /// Preview representable activity items, used for sharing and collaboration.
2431        #[optional]
2432        #[unsafe(method(previewRepresentableActivityItemsForWindow:))]
2433        #[unsafe(method_family = none)]
2434        unsafe fn previewRepresentableActivityItemsForWindow(
2435            &self,
2436            window: &NSWindow,
2437        ) -> Option<Retained<NSArray<ProtocolObject<dyn NSPreviewRepresentableActivityItem>>>>;
2438
2439        #[cfg(feature = "NSResponder")]
2440        /// Method called to get the window to share once sharing is confirmed, after a request is initiated by requestSharingOfWindowUsingPreview:title:completionHandler:. Implement this on the delegate of the requesting window
2441        #[optional]
2442        #[unsafe(method(windowForSharingRequestFromWindow:))]
2443        #[unsafe(method_family = none)]
2444        unsafe fn windowForSharingRequestFromWindow(
2445            &self,
2446            window: &NSWindow,
2447        ) -> Option<Retained<NSWindow>>;
2448
2449        #[optional]
2450        #[unsafe(method(windowDidResize:))]
2451        #[unsafe(method_family = none)]
2452        unsafe fn windowDidResize(&self, notification: &NSNotification);
2453
2454        #[optional]
2455        #[unsafe(method(windowDidExpose:))]
2456        #[unsafe(method_family = none)]
2457        unsafe fn windowDidExpose(&self, notification: &NSNotification);
2458
2459        #[optional]
2460        #[unsafe(method(windowWillMove:))]
2461        #[unsafe(method_family = none)]
2462        unsafe fn windowWillMove(&self, notification: &NSNotification);
2463
2464        #[optional]
2465        #[unsafe(method(windowDidMove:))]
2466        #[unsafe(method_family = none)]
2467        unsafe fn windowDidMove(&self, notification: &NSNotification);
2468
2469        #[optional]
2470        #[unsafe(method(windowDidBecomeKey:))]
2471        #[unsafe(method_family = none)]
2472        unsafe fn windowDidBecomeKey(&self, notification: &NSNotification);
2473
2474        #[optional]
2475        #[unsafe(method(windowDidResignKey:))]
2476        #[unsafe(method_family = none)]
2477        unsafe fn windowDidResignKey(&self, notification: &NSNotification);
2478
2479        #[optional]
2480        #[unsafe(method(windowDidBecomeMain:))]
2481        #[unsafe(method_family = none)]
2482        unsafe fn windowDidBecomeMain(&self, notification: &NSNotification);
2483
2484        #[optional]
2485        #[unsafe(method(windowDidResignMain:))]
2486        #[unsafe(method_family = none)]
2487        unsafe fn windowDidResignMain(&self, notification: &NSNotification);
2488
2489        #[optional]
2490        #[unsafe(method(windowWillClose:))]
2491        #[unsafe(method_family = none)]
2492        unsafe fn windowWillClose(&self, notification: &NSNotification);
2493
2494        #[optional]
2495        #[unsafe(method(windowWillMiniaturize:))]
2496        #[unsafe(method_family = none)]
2497        unsafe fn windowWillMiniaturize(&self, notification: &NSNotification);
2498
2499        #[optional]
2500        #[unsafe(method(windowDidMiniaturize:))]
2501        #[unsafe(method_family = none)]
2502        unsafe fn windowDidMiniaturize(&self, notification: &NSNotification);
2503
2504        #[optional]
2505        #[unsafe(method(windowDidDeminiaturize:))]
2506        #[unsafe(method_family = none)]
2507        unsafe fn windowDidDeminiaturize(&self, notification: &NSNotification);
2508
2509        #[optional]
2510        #[unsafe(method(windowDidUpdate:))]
2511        #[unsafe(method_family = none)]
2512        unsafe fn windowDidUpdate(&self, notification: &NSNotification);
2513
2514        #[optional]
2515        #[unsafe(method(windowDidChangeScreen:))]
2516        #[unsafe(method_family = none)]
2517        unsafe fn windowDidChangeScreen(&self, notification: &NSNotification);
2518
2519        #[optional]
2520        #[unsafe(method(windowDidChangeScreenProfile:))]
2521        #[unsafe(method_family = none)]
2522        unsafe fn windowDidChangeScreenProfile(&self, notification: &NSNotification);
2523
2524        #[optional]
2525        #[unsafe(method(windowDidChangeBackingProperties:))]
2526        #[unsafe(method_family = none)]
2527        unsafe fn windowDidChangeBackingProperties(&self, notification: &NSNotification);
2528
2529        #[optional]
2530        #[unsafe(method(windowWillBeginSheet:))]
2531        #[unsafe(method_family = none)]
2532        unsafe fn windowWillBeginSheet(&self, notification: &NSNotification);
2533
2534        #[optional]
2535        #[unsafe(method(windowDidEndSheet:))]
2536        #[unsafe(method_family = none)]
2537        unsafe fn windowDidEndSheet(&self, notification: &NSNotification);
2538
2539        #[optional]
2540        #[unsafe(method(windowWillStartLiveResize:))]
2541        #[unsafe(method_family = none)]
2542        unsafe fn windowWillStartLiveResize(&self, notification: &NSNotification);
2543
2544        #[optional]
2545        #[unsafe(method(windowDidEndLiveResize:))]
2546        #[unsafe(method_family = none)]
2547        unsafe fn windowDidEndLiveResize(&self, notification: &NSNotification);
2548
2549        #[optional]
2550        #[unsafe(method(windowWillEnterFullScreen:))]
2551        #[unsafe(method_family = none)]
2552        unsafe fn windowWillEnterFullScreen(&self, notification: &NSNotification);
2553
2554        #[optional]
2555        #[unsafe(method(windowDidEnterFullScreen:))]
2556        #[unsafe(method_family = none)]
2557        unsafe fn windowDidEnterFullScreen(&self, notification: &NSNotification);
2558
2559        #[optional]
2560        #[unsafe(method(windowWillExitFullScreen:))]
2561        #[unsafe(method_family = none)]
2562        unsafe fn windowWillExitFullScreen(&self, notification: &NSNotification);
2563
2564        #[optional]
2565        #[unsafe(method(windowDidExitFullScreen:))]
2566        #[unsafe(method_family = none)]
2567        unsafe fn windowDidExitFullScreen(&self, notification: &NSNotification);
2568
2569        #[optional]
2570        #[unsafe(method(windowWillEnterVersionBrowser:))]
2571        #[unsafe(method_family = none)]
2572        unsafe fn windowWillEnterVersionBrowser(&self, notification: &NSNotification);
2573
2574        #[optional]
2575        #[unsafe(method(windowDidEnterVersionBrowser:))]
2576        #[unsafe(method_family = none)]
2577        unsafe fn windowDidEnterVersionBrowser(&self, notification: &NSNotification);
2578
2579        #[optional]
2580        #[unsafe(method(windowWillExitVersionBrowser:))]
2581        #[unsafe(method_family = none)]
2582        unsafe fn windowWillExitVersionBrowser(&self, notification: &NSNotification);
2583
2584        #[optional]
2585        #[unsafe(method(windowDidExitVersionBrowser:))]
2586        #[unsafe(method_family = none)]
2587        unsafe fn windowDidExitVersionBrowser(&self, notification: &NSNotification);
2588
2589        #[optional]
2590        #[unsafe(method(windowDidChangeOcclusionState:))]
2591        #[unsafe(method_family = none)]
2592        unsafe fn windowDidChangeOcclusionState(&self, notification: &NSNotification);
2593    }
2594);
2595
2596extern "C" {
2597    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowdidbecomekeynotification?language=objc)
2598    pub static NSWindowDidBecomeKeyNotification: &'static NSNotificationName;
2599}
2600
2601extern "C" {
2602    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowdidbecomemainnotification?language=objc)
2603    pub static NSWindowDidBecomeMainNotification: &'static NSNotificationName;
2604}
2605
2606extern "C" {
2607    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowdidchangescreennotification?language=objc)
2608    pub static NSWindowDidChangeScreenNotification: &'static NSNotificationName;
2609}
2610
2611extern "C" {
2612    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowdiddeminiaturizenotification?language=objc)
2613    pub static NSWindowDidDeminiaturizeNotification: &'static NSNotificationName;
2614}
2615
2616extern "C" {
2617    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowdidexposenotification?language=objc)
2618    pub static NSWindowDidExposeNotification: &'static NSNotificationName;
2619}
2620
2621extern "C" {
2622    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowdidminiaturizenotification?language=objc)
2623    pub static NSWindowDidMiniaturizeNotification: &'static NSNotificationName;
2624}
2625
2626extern "C" {
2627    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowdidmovenotification?language=objc)
2628    pub static NSWindowDidMoveNotification: &'static NSNotificationName;
2629}
2630
2631extern "C" {
2632    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowdidresignkeynotification?language=objc)
2633    pub static NSWindowDidResignKeyNotification: &'static NSNotificationName;
2634}
2635
2636extern "C" {
2637    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowdidresignmainnotification?language=objc)
2638    pub static NSWindowDidResignMainNotification: &'static NSNotificationName;
2639}
2640
2641extern "C" {
2642    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowdidresizenotification?language=objc)
2643    pub static NSWindowDidResizeNotification: &'static NSNotificationName;
2644}
2645
2646extern "C" {
2647    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowdidupdatenotification?language=objc)
2648    pub static NSWindowDidUpdateNotification: &'static NSNotificationName;
2649}
2650
2651extern "C" {
2652    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowwillclosenotification?language=objc)
2653    pub static NSWindowWillCloseNotification: &'static NSNotificationName;
2654}
2655
2656extern "C" {
2657    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowwillminiaturizenotification?language=objc)
2658    pub static NSWindowWillMiniaturizeNotification: &'static NSNotificationName;
2659}
2660
2661extern "C" {
2662    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowwillmovenotification?language=objc)
2663    pub static NSWindowWillMoveNotification: &'static NSNotificationName;
2664}
2665
2666extern "C" {
2667    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowwillbeginsheetnotification?language=objc)
2668    pub static NSWindowWillBeginSheetNotification: &'static NSNotificationName;
2669}
2670
2671extern "C" {
2672    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowdidendsheetnotification?language=objc)
2673    pub static NSWindowDidEndSheetNotification: &'static NSNotificationName;
2674}
2675
2676extern "C" {
2677    /// `NSWindowDidChangeBackingPropertiesNotification`is posted on 10.7.3 and later, when a window's
2678    /// `backingScaleFactor`and/or its
2679    /// `colorSpace`changes.  When running on a system version where this new notification is available, applications should use it instead of
2680    /// `NSWindowDidChangeScreenProfileNotification`to watch for changes to either of these backing store properties.  Many applications won't have any need to watch for this notification, but those that perform sophisticated color handling or manually manage their own caches of window-resolution-and/or/colorspace-appropriate bitmapped images will find this notification useful, as a prompt to invalidate their caches or schedule other reassessment for the new resolution and/or color space as needed.  The notification's userInfo dictionary specifies the window's previous
2681    /// `backingScaleFactor`and
2682    /// `colorSpace.`You can compare these with the window's new
2683    /// `backingScaleFactor`and
2684    /// `colorSpace`at the time of the notification, to determine which of these two properties (potentially both) changed.
2685    ///
2686    /// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowdidchangebackingpropertiesnotification?language=objc)
2687    pub static NSWindowDidChangeBackingPropertiesNotification: &'static NSNotificationName;
2688}
2689
2690extern "C" {
2691    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsbackingpropertyoldscalefactorkey?language=objc)
2692    pub static NSBackingPropertyOldScaleFactorKey: &'static NSString;
2693}
2694
2695extern "C" {
2696    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsbackingpropertyoldcolorspacekey?language=objc)
2697    pub static NSBackingPropertyOldColorSpaceKey: &'static NSString;
2698}
2699
2700extern "C" {
2701    /// `NSWindowDidChangeScreenProfileNotification`is posted when a window's display's color profile changes, or when the window moves to a display that has a different color profile.  When running on 10.7.3 or later, this notification is still posted for compatibility, but modern applications should instead watch for
2702    /// `NSWindowDidChangeBackingPropertiesNotification,`which is posted for both color space and resolution changes, and facilitates handling both in a single update and redisplay pass.
2703    ///
2704    /// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowdidchangescreenprofilenotification?language=objc)
2705    pub static NSWindowDidChangeScreenProfileNotification: &'static NSNotificationName;
2706}
2707
2708extern "C" {
2709    /// `NSWindowWillStartLiveResizeNotification`is sent when the user starts a live resize operation via a mouseDown in the resize corner.  The notification will be sent before the window size is changed.  Note that this notification is sent once for a sequence of window resize operations
2710    ///
2711    /// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowwillstartliveresizenotification?language=objc)
2712    pub static NSWindowWillStartLiveResizeNotification: &'static NSNotificationName;
2713}
2714
2715extern "C" {
2716    /// `NSWindowDidEndLiveResizeNotification`is sent after the user ends a live resize operation via a mouseUp in the resize corner.  The notification will be sent after the final window size change.    Note that this notification is sent once for a sequence of window resize operations
2717    ///
2718    /// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowdidendliveresizenotification?language=objc)
2719    pub static NSWindowDidEndLiveResizeNotification: &'static NSNotificationName;
2720}
2721
2722extern "C" {
2723    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowwillenterfullscreennotification?language=objc)
2724    pub static NSWindowWillEnterFullScreenNotification: &'static NSNotificationName;
2725}
2726
2727extern "C" {
2728    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowdidenterfullscreennotification?language=objc)
2729    pub static NSWindowDidEnterFullScreenNotification: &'static NSNotificationName;
2730}
2731
2732extern "C" {
2733    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowwillexitfullscreennotification?language=objc)
2734    pub static NSWindowWillExitFullScreenNotification: &'static NSNotificationName;
2735}
2736
2737extern "C" {
2738    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowdidexitfullscreennotification?language=objc)
2739    pub static NSWindowDidExitFullScreenNotification: &'static NSNotificationName;
2740}
2741
2742extern "C" {
2743    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowwillenterversionbrowsernotification?language=objc)
2744    pub static NSWindowWillEnterVersionBrowserNotification: &'static NSNotificationName;
2745}
2746
2747extern "C" {
2748    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowdidenterversionbrowsernotification?language=objc)
2749    pub static NSWindowDidEnterVersionBrowserNotification: &'static NSNotificationName;
2750}
2751
2752extern "C" {
2753    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowwillexitversionbrowsernotification?language=objc)
2754    pub static NSWindowWillExitVersionBrowserNotification: &'static NSNotificationName;
2755}
2756
2757extern "C" {
2758    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowdidexitversionbrowsernotification?language=objc)
2759    pub static NSWindowDidExitVersionBrowserNotification: &'static NSNotificationName;
2760}
2761
2762extern "C" {
2763    /// Upon receiving this notification, you can query the
2764    /// `NSWindow`for its current occlusion state. Note that this only notifies about changes in the state of the occlusion, not when the occlusion region changes. You can use this notification to increase responsiveness and save power, by halting any expensive calculations that the user can not see.
2765    ///
2766    /// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowdidchangeocclusionstatenotification?language=objc)
2767    pub static NSWindowDidChangeOcclusionStateNotification: &'static NSNotificationName;
2768}
2769
2770/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowbackinglocation?language=objc)
2771// NS_ENUM
2772#[deprecated]
2773#[repr(transparent)]
2774#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
2775pub struct NSWindowBackingLocation(pub NSUInteger);
2776impl NSWindowBackingLocation {
2777    #[doc(alias = "NSWindowBackingLocationDefault")]
2778    pub const Default: Self = Self(0);
2779    #[doc(alias = "NSWindowBackingLocationVideoMemory")]
2780    pub const VideoMemory: Self = Self(1);
2781    #[doc(alias = "NSWindowBackingLocationMainMemory")]
2782    pub const MainMemory: Self = Self(2);
2783}
2784
2785unsafe impl Encode for NSWindowBackingLocation {
2786    const ENCODING: Encoding = NSUInteger::ENCODING;
2787}
2788
2789unsafe impl RefEncode for NSWindowBackingLocation {
2790    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
2791}
2792
2793/// NSDeprecated.
2794#[cfg(feature = "NSResponder")]
2795impl NSWindow {
2796    extern_methods!(
2797        #[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"]
2798        #[unsafe(method(cacheImageInRect:))]
2799        #[unsafe(method_family = none)]
2800        pub unsafe fn cacheImageInRect(&self, rect: NSRect);
2801
2802        #[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"]
2803        #[unsafe(method(restoreCachedImage))]
2804        #[unsafe(method_family = none)]
2805        pub unsafe fn restoreCachedImage(&self);
2806
2807        #[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"]
2808        #[unsafe(method(discardCachedImage))]
2809        #[unsafe(method_family = none)]
2810        pub unsafe fn discardCachedImage(&self);
2811
2812        #[cfg(feature = "NSMenu")]
2813        #[deprecated = "This method does not do anything and should not be called."]
2814        #[unsafe(method(menuChanged:))]
2815        #[unsafe(method_family = none)]
2816        pub unsafe fn menuChanged(menu: &NSMenu);
2817
2818        #[deprecated = "This method is unused and should not be called."]
2819        #[unsafe(method(gState))]
2820        #[unsafe(method_family = none)]
2821        pub unsafe fn gState(&self) -> NSInteger;
2822
2823        #[deprecated = "Use -convertRectToScreen: or -convertPointToScreen: instead"]
2824        #[unsafe(method(convertBaseToScreen:))]
2825        #[unsafe(method_family = none)]
2826        pub unsafe fn convertBaseToScreen(&self, point: NSPoint) -> NSPoint;
2827
2828        #[deprecated = "Use -convertRectFromScreen or -convertPointFromScreen: instead"]
2829        #[unsafe(method(convertScreenToBase:))]
2830        #[unsafe(method_family = none)]
2831        pub unsafe fn convertScreenToBase(&self, point: NSPoint) -> NSPoint;
2832
2833        #[cfg(feature = "objc2-core-foundation")]
2834        #[deprecated = "Use -convertRectToBacking: and -backingScaleFactor instead"]
2835        #[unsafe(method(userSpaceScaleFactor))]
2836        #[unsafe(method_family = none)]
2837        pub unsafe fn userSpaceScaleFactor(&self) -> CGFloat;
2838
2839        #[deprecated = "This method does not do anything and should not be called."]
2840        #[unsafe(method(useOptimizedDrawing:))]
2841        #[unsafe(method_family = none)]
2842        pub unsafe fn useOptimizedDrawing(&self, flag: bool);
2843
2844        #[deprecated = "This method does not do anything and should not be called."]
2845        #[unsafe(method(canStoreColor))]
2846        #[unsafe(method_family = none)]
2847        pub unsafe fn canStoreColor(&self) -> bool;
2848
2849        #[deprecated = "Use +[NSAnimationContext runAnimationGroup:completionHandler:] to perform atomic updates across runloop invocations."]
2850        #[unsafe(method(disableFlushWindow))]
2851        #[unsafe(method_family = none)]
2852        pub unsafe fn disableFlushWindow(&self);
2853
2854        #[deprecated = "Use +[NSAnimationContext runAnimationGroup:completionHandler:] to perform atomic updates across runloop invocations."]
2855        #[unsafe(method(enableFlushWindow))]
2856        #[unsafe(method_family = none)]
2857        pub unsafe fn enableFlushWindow(&self);
2858
2859        #[deprecated = "Use +[NSAnimationContext runAnimationGroup:completionHandler:] to perform atomic updates across runloop invocations."]
2860        #[unsafe(method(isFlushWindowDisabled))]
2861        #[unsafe(method_family = none)]
2862        pub unsafe fn isFlushWindowDisabled(&self) -> bool;
2863
2864        #[deprecated = "Allow AppKit's automatic deferred display mechanism to take care of flushing any graphics contexts as needed."]
2865        #[unsafe(method(flushWindow))]
2866        #[unsafe(method_family = none)]
2867        pub unsafe fn flushWindow(&self);
2868
2869        #[deprecated = "Allow AppKit's automatic deferred display mechanism to take care of flushing any graphics contexts as needed."]
2870        #[unsafe(method(flushWindowIfNeeded))]
2871        #[unsafe(method_family = none)]
2872        pub unsafe fn flushWindowIfNeeded(&self);
2873
2874        #[deprecated = "Use +[NSAnimationContext runAnimationGroup:completionHandler:] to temporarily prevent AppKit's automatic deferred display mechanism from drawing."]
2875        #[unsafe(method(isAutodisplay))]
2876        #[unsafe(method_family = none)]
2877        pub unsafe fn isAutodisplay(&self) -> bool;
2878
2879        /// Setter for [`isAutodisplay`][Self::isAutodisplay].
2880        #[deprecated = "Use +[NSAnimationContext runAnimationGroup:completionHandler:] to temporarily prevent AppKit's automatic deferred display mechanism from drawing."]
2881        #[unsafe(method(setAutodisplay:))]
2882        #[unsafe(method_family = none)]
2883        pub unsafe fn setAutodisplay(&self, autodisplay: bool);
2884
2885        #[cfg(feature = "NSGraphicsContext")]
2886        #[deprecated = "Add instances of NSView to display content in a window."]
2887        #[unsafe(method(graphicsContext))]
2888        #[unsafe(method_family = none)]
2889        pub unsafe fn graphicsContext(&self) -> Option<Retained<NSGraphicsContext>>;
2890
2891        #[deprecated = "This property does not do anything and should not be used"]
2892        #[unsafe(method(isOneShot))]
2893        #[unsafe(method_family = none)]
2894        pub unsafe fn isOneShot(&self) -> bool;
2895
2896        /// Setter for [`isOneShot`][Self::isOneShot].
2897        #[deprecated = "This property does not do anything and should not be used"]
2898        #[unsafe(method(setOneShot:))]
2899        #[unsafe(method_family = none)]
2900        pub unsafe fn setOneShot(&self, one_shot: bool);
2901
2902        #[deprecated = "This property does not do anything and should not be used"]
2903        #[unsafe(method(preferredBackingLocation))]
2904        #[unsafe(method_family = none)]
2905        pub unsafe fn preferredBackingLocation(&self) -> NSWindowBackingLocation;
2906
2907        /// Setter for [`preferredBackingLocation`][Self::preferredBackingLocation].
2908        #[deprecated = "This property does not do anything and should not be used"]
2909        #[unsafe(method(setPreferredBackingLocation:))]
2910        #[unsafe(method_family = none)]
2911        pub unsafe fn setPreferredBackingLocation(
2912            &self,
2913            preferred_backing_location: NSWindowBackingLocation,
2914        );
2915
2916        #[deprecated = "This property does not do anything and should not be used"]
2917        #[unsafe(method(backingLocation))]
2918        #[unsafe(method_family = none)]
2919        pub unsafe fn backingLocation(&self) -> NSWindowBackingLocation;
2920
2921        #[deprecated = "This property does not do anything and should not be used."]
2922        #[unsafe(method(showsResizeIndicator))]
2923        #[unsafe(method_family = none)]
2924        pub unsafe fn showsResizeIndicator(&self) -> bool;
2925
2926        /// Setter for [`showsResizeIndicator`][Self::showsResizeIndicator].
2927        #[deprecated = "This property does not do anything and should not be used."]
2928        #[unsafe(method(setShowsResizeIndicator:))]
2929        #[unsafe(method_family = none)]
2930        pub unsafe fn setShowsResizeIndicator(&self, shows_resize_indicator: bool);
2931
2932        #[deprecated = "This method should not be used."]
2933        #[unsafe(method(initWithWindowRef:))]
2934        #[unsafe(method_family = init)]
2935        pub unsafe fn initWithWindowRef(
2936            this: Allocated<Self>,
2937            window_ref: NonNull<c_void>,
2938        ) -> Option<Retained<NSWindow>>;
2939
2940        #[deprecated = "This method should not be used."]
2941        #[unsafe(method(windowRef))]
2942        #[unsafe(method_family = none)]
2943        pub unsafe fn windowRef(&self) -> NonNull<c_void>;
2944
2945        #[deprecated = "This method does not do anything and should not be called."]
2946        #[unsafe(method(disableScreenUpdatesUntilFlush))]
2947        #[unsafe(method_family = none)]
2948        pub unsafe fn disableScreenUpdatesUntilFlush(&self);
2949    );
2950}
2951
2952/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsborderlesswindowmask?language=objc)
2953pub static NSBorderlessWindowMask: NSWindowStyleMask =
2954    NSWindowStyleMask(NSWindowStyleMask::Borderless.0);
2955
2956/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstitledwindowmask?language=objc)
2957pub static NSTitledWindowMask: NSWindowStyleMask = NSWindowStyleMask(NSWindowStyleMask::Titled.0);
2958
2959/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsclosablewindowmask?language=objc)
2960pub static NSClosableWindowMask: NSWindowStyleMask =
2961    NSWindowStyleMask(NSWindowStyleMask::Closable.0);
2962
2963/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsminiaturizablewindowmask?language=objc)
2964pub static NSMiniaturizableWindowMask: NSWindowStyleMask =
2965    NSWindowStyleMask(NSWindowStyleMask::Miniaturizable.0);
2966
2967/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsresizablewindowmask?language=objc)
2968pub static NSResizableWindowMask: NSWindowStyleMask =
2969    NSWindowStyleMask(NSWindowStyleMask::Resizable.0);
2970
2971/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstexturedbackgroundwindowmask?language=objc)
2972pub static NSTexturedBackgroundWindowMask: NSWindowStyleMask =
2973    NSWindowStyleMask(NSWindowStyleMask::TexturedBackground.0);
2974
2975/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsunifiedtitleandtoolbarwindowmask?language=objc)
2976pub static NSUnifiedTitleAndToolbarWindowMask: NSWindowStyleMask =
2977    NSWindowStyleMask(NSWindowStyleMask::UnifiedTitleAndToolbar.0);
2978
2979/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsfullscreenwindowmask?language=objc)
2980pub static NSFullScreenWindowMask: NSWindowStyleMask =
2981    NSWindowStyleMask(NSWindowStyleMask::FullScreen.0);
2982
2983/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsfullsizecontentviewwindowmask?language=objc)
2984pub static NSFullSizeContentViewWindowMask: NSWindowStyleMask =
2985    NSWindowStyleMask(NSWindowStyleMask::FullSizeContentView.0);
2986
2987/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsutilitywindowmask?language=objc)
2988pub static NSUtilityWindowMask: NSWindowStyleMask =
2989    NSWindowStyleMask(NSWindowStyleMask::UtilityWindow.0);
2990
2991/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdocmodalwindowmask?language=objc)
2992pub static NSDocModalWindowMask: NSWindowStyleMask =
2993    NSWindowStyleMask(NSWindowStyleMask::DocModalWindow.0);
2994
2995/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsnonactivatingpanelmask?language=objc)
2996pub static NSNonactivatingPanelMask: NSWindowStyleMask =
2997    NSWindowStyleMask(NSWindowStyleMask::NonactivatingPanel.0);
2998
2999/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nshudwindowmask?language=objc)
3000pub static NSHUDWindowMask: NSWindowStyleMask = NSWindowStyleMask(NSWindowStyleMask::HUDWindow.0);
3001
3002/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsunscaledwindowmask?language=objc)
3003pub static NSUnscaledWindowMask: NSWindowStyleMask = NSWindowStyleMask(1 << 11);
3004
3005/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowfullscreenbutton?language=objc)
3006pub static NSWindowFullScreenButton: NSWindowButton = NSWindowButton(7);
3007
3008/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdockwindowlevel?language=objc)
3009pub static NSDockWindowLevel: NSWindowLevel = 20;
3010
3011/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowsharingreadwrite?language=objc)
3012pub static NSWindowSharingReadWrite: NSWindowSharingType = NSWindowSharingType(2);