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        #[doc(alias = "NSWindowStyleMaskTexturedBackground")]
41#[deprecated = "Textured window style should no longer be used"]
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"))]
479extern_conformance!(
480    unsafe impl NSAccessibility for NSWindow {}
481);
482
483#[cfg(all(feature = "NSAccessibilityProtocols", feature = "NSResponder"))]
484extern_conformance!(
485    unsafe impl NSAccessibilityElementProtocol for NSWindow {}
486);
487
488#[cfg(all(feature = "NSAnimation", feature = "NSResponder"))]
489extern_conformance!(
490    unsafe impl NSAnimatablePropertyContainer for NSWindow {}
491);
492
493#[cfg(all(feature = "NSAppearance", feature = "NSResponder"))]
494extern_conformance!(
495    unsafe impl NSAppearanceCustomization for NSWindow {}
496);
497
498#[cfg(feature = "NSResponder")]
499extern_conformance!(
500    unsafe impl NSCoding for NSWindow {}
501);
502
503#[cfg(all(feature = "NSMenu", feature = "NSResponder"))]
504extern_conformance!(
505    unsafe impl NSMenuItemValidation for NSWindow {}
506);
507
508#[cfg(feature = "NSResponder")]
509extern_conformance!(
510    unsafe impl NSObjectProtocol for NSWindow {}
511);
512
513#[cfg(all(feature = "NSResponder", feature = "NSUserInterfaceItemIdentification"))]
514extern_conformance!(
515    unsafe impl NSUserInterfaceItemIdentification for NSWindow {}
516);
517
518#[cfg(all(feature = "NSResponder", feature = "NSUserInterfaceValidation"))]
519extern_conformance!(
520    unsafe impl NSUserInterfaceValidations for NSWindow {}
521);
522
523#[cfg(feature = "NSResponder")]
524impl NSWindow {
525    extern_methods!(
526        #[unsafe(method(frameRectForContentRect:styleMask:))]
527        #[unsafe(method_family = none)]
528        pub unsafe fn frameRectForContentRect_styleMask(
529            c_rect: NSRect,
530            style: NSWindowStyleMask,
531            mtm: MainThreadMarker,
532        ) -> NSRect;
533
534        #[unsafe(method(contentRectForFrameRect:styleMask:))]
535        #[unsafe(method_family = none)]
536        pub unsafe fn contentRectForFrameRect_styleMask(
537            f_rect: NSRect,
538            style: NSWindowStyleMask,
539            mtm: MainThreadMarker,
540        ) -> NSRect;
541
542        #[cfg(feature = "objc2-core-foundation")]
543        #[unsafe(method(minFrameWidthWithTitle:styleMask:))]
544        #[unsafe(method_family = none)]
545        pub unsafe fn minFrameWidthWithTitle_styleMask(
546            title: &NSString,
547            style: NSWindowStyleMask,
548            mtm: MainThreadMarker,
549        ) -> CGFloat;
550
551        #[cfg(feature = "NSGraphics")]
552        #[unsafe(method(defaultDepthLimit))]
553        #[unsafe(method_family = none)]
554        pub unsafe fn defaultDepthLimit(mtm: MainThreadMarker) -> NSWindowDepth;
555
556        #[unsafe(method(frameRectForContentRect:))]
557        #[unsafe(method_family = none)]
558        pub unsafe fn frameRectForContentRect(&self, content_rect: NSRect) -> NSRect;
559
560        #[unsafe(method(contentRectForFrameRect:))]
561        #[unsafe(method_family = none)]
562        pub fn contentRectForFrameRect(&self, frame_rect: NSRect) -> NSRect;
563
564        #[cfg(feature = "NSGraphics")]
565        #[unsafe(method(initWithContentRect:styleMask:backing:defer:))]
566        #[unsafe(method_family = init)]
567        pub unsafe fn initWithContentRect_styleMask_backing_defer(
568            this: Allocated<Self>,
569            content_rect: NSRect,
570            style: NSWindowStyleMask,
571            backing_store_type: NSBackingStoreType,
572            flag: bool,
573        ) -> Retained<Self>;
574
575        #[cfg(all(feature = "NSGraphics", feature = "NSScreen"))]
576        #[unsafe(method(initWithContentRect:styleMask:backing:defer:screen:))]
577        #[unsafe(method_family = init)]
578        pub unsafe fn initWithContentRect_styleMask_backing_defer_screen(
579            this: Allocated<Self>,
580            content_rect: NSRect,
581            style: NSWindowStyleMask,
582            backing_store_type: NSBackingStoreType,
583            flag: bool,
584            screen: Option<&NSScreen>,
585        ) -> Retained<Self>;
586
587        #[unsafe(method(initWithCoder:))]
588        #[unsafe(method_family = init)]
589        pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
590
591        #[unsafe(method(title))]
592        #[unsafe(method_family = none)]
593        pub fn title(&self) -> Retained<NSString>;
594
595        /// Setter for [`title`][Self::title].
596        #[unsafe(method(setTitle:))]
597        #[unsafe(method_family = none)]
598        pub fn setTitle(&self, title: &NSString);
599
600        /// Secondary text that may be displayed adjacent to or below the primary title depending on the configuration of the window.
601        /// A value of empty string will remove the subtitle from the window layout.
602        #[unsafe(method(subtitle))]
603        #[unsafe(method_family = none)]
604        pub unsafe fn subtitle(&self) -> Retained<NSString>;
605
606        /// Setter for [`subtitle`][Self::subtitle].
607        #[unsafe(method(setSubtitle:))]
608        #[unsafe(method_family = none)]
609        pub unsafe fn setSubtitle(&self, subtitle: &NSString);
610
611        /// See the enum values for how this property works.
612        #[unsafe(method(titleVisibility))]
613        #[unsafe(method_family = none)]
614        pub unsafe fn titleVisibility(&self) -> NSWindowTitleVisibility;
615
616        /// Setter for [`titleVisibility`][Self::titleVisibility].
617        #[unsafe(method(setTitleVisibility:))]
618        #[unsafe(method_family = none)]
619        pub fn setTitleVisibility(&self, title_visibility: NSWindowTitleVisibility);
620
621        /// When
622        /// `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
623        /// `NSFullSizeContentViewWindowMask`is set.
624        #[unsafe(method(titlebarAppearsTransparent))]
625        #[unsafe(method_family = none)]
626        pub unsafe fn titlebarAppearsTransparent(&self) -> bool;
627
628        /// Setter for [`titlebarAppearsTransparent`][Self::titlebarAppearsTransparent].
629        #[unsafe(method(setTitlebarAppearsTransparent:))]
630        #[unsafe(method_family = none)]
631        pub fn setTitlebarAppearsTransparent(&self, titlebar_appears_transparent: bool);
632
633        /// Specifies how the titlebar area of the window should appear when the window displays an NSToolbar
634        #[unsafe(method(toolbarStyle))]
635        #[unsafe(method_family = none)]
636        pub unsafe fn toolbarStyle(&self) -> NSWindowToolbarStyle;
637
638        /// Setter for [`toolbarStyle`][Self::toolbarStyle].
639        #[unsafe(method(setToolbarStyle:))]
640        #[unsafe(method_family = none)]
641        pub unsafe fn setToolbarStyle(&self, toolbar_style: NSWindowToolbarStyle);
642
643        /// The
644        /// `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
645        /// `NSFullSizeContentViewWindowMask`set, there needs to be a way to determine the portion that is not under the toolbar. The
646        /// `contentLayoutRect`returns the portion of the layout that is not obscured under the toolbar.
647        /// `contentLayoutRect`is in window coordinates. It is KVO compliant. */
648        #[unsafe(method(contentLayoutRect))]
649        #[unsafe(method_family = none)]
650        pub unsafe fn contentLayoutRect(&self) -> NSRect;
651
652        /// `contentLayoutGuide`is a corollary to
653        /// `contentLayoutRect.`It can be used by autolayout constraints to automatically bind to the
654        /// `contentLayoutRect.`
655        #[unsafe(method(contentLayoutGuide))]
656        #[unsafe(method_family = none)]
657        pub unsafe fn contentLayoutGuide(&self) -> Option<Retained<AnyObject>>;
658
659        #[cfg(all(
660            feature = "NSTitlebarAccessoryViewController",
661            feature = "NSViewController"
662        ))]
663        #[unsafe(method(titlebarAccessoryViewControllers))]
664        #[unsafe(method_family = none)]
665        pub unsafe fn titlebarAccessoryViewControllers(
666            &self,
667        ) -> Retained<NSArray<NSTitlebarAccessoryViewController>>;
668
669        #[cfg(all(
670            feature = "NSTitlebarAccessoryViewController",
671            feature = "NSViewController"
672        ))]
673        /// Setter for [`titlebarAccessoryViewControllers`][Self::titlebarAccessoryViewControllers].
674        #[unsafe(method(setTitlebarAccessoryViewControllers:))]
675        #[unsafe(method_family = none)]
676        pub unsafe fn setTitlebarAccessoryViewControllers(
677            &self,
678            titlebar_accessory_view_controllers: &NSArray<NSTitlebarAccessoryViewController>,
679        );
680
681        #[cfg(all(
682            feature = "NSTitlebarAccessoryViewController",
683            feature = "NSViewController"
684        ))]
685        #[unsafe(method(addTitlebarAccessoryViewController:))]
686        #[unsafe(method_family = none)]
687        pub unsafe fn addTitlebarAccessoryViewController(
688            &self,
689            child_view_controller: &NSTitlebarAccessoryViewController,
690        );
691
692        #[cfg(all(
693            feature = "NSTitlebarAccessoryViewController",
694            feature = "NSViewController"
695        ))]
696        #[unsafe(method(insertTitlebarAccessoryViewController:atIndex:))]
697        #[unsafe(method_family = none)]
698        pub unsafe fn insertTitlebarAccessoryViewController_atIndex(
699            &self,
700            child_view_controller: &NSTitlebarAccessoryViewController,
701            index: NSInteger,
702        );
703
704        #[unsafe(method(removeTitlebarAccessoryViewControllerAtIndex:))]
705        #[unsafe(method_family = none)]
706        pub unsafe fn removeTitlebarAccessoryViewControllerAtIndex(&self, index: NSInteger);
707
708        /// If url is not nil and its path is not empty, the window will show a document icon in the titlebar.
709        /// 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:]`
710        /// 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.
711        #[unsafe(method(representedURL))]
712        #[unsafe(method_family = none)]
713        pub unsafe fn representedURL(&self) -> Option<Retained<NSURL>>;
714
715        /// Setter for [`representedURL`][Self::representedURL].
716        #[unsafe(method(setRepresentedURL:))]
717        #[unsafe(method_family = none)]
718        pub unsafe fn setRepresentedURL(&self, represented_url: Option<&NSURL>);
719
720        #[unsafe(method(representedFilename))]
721        #[unsafe(method_family = none)]
722        pub unsafe fn representedFilename(&self) -> Retained<NSString>;
723
724        /// Setter for [`representedFilename`][Self::representedFilename].
725        #[unsafe(method(setRepresentedFilename:))]
726        #[unsafe(method_family = none)]
727        pub unsafe fn setRepresentedFilename(&self, represented_filename: &NSString);
728
729        #[unsafe(method(setTitleWithRepresentedFilename:))]
730        #[unsafe(method_family = none)]
731        pub unsafe fn setTitleWithRepresentedFilename(&self, filename: &NSString);
732
733        #[unsafe(method(isExcludedFromWindowsMenu))]
734        #[unsafe(method_family = none)]
735        pub unsafe fn isExcludedFromWindowsMenu(&self) -> bool;
736
737        /// Setter for [`isExcludedFromWindowsMenu`][Self::isExcludedFromWindowsMenu].
738        #[unsafe(method(setExcludedFromWindowsMenu:))]
739        #[unsafe(method_family = none)]
740        pub unsafe fn setExcludedFromWindowsMenu(&self, excluded_from_windows_menu: bool);
741
742        #[cfg(feature = "NSView")]
743        #[unsafe(method(contentView))]
744        #[unsafe(method_family = none)]
745        pub fn contentView(&self) -> Option<Retained<NSView>>;
746
747        #[cfg(feature = "NSView")]
748        /// Setter for [`contentView`][Self::contentView].
749        #[unsafe(method(setContentView:))]
750        #[unsafe(method_family = none)]
751        pub fn setContentView(&self, content_view: Option<&NSView>);
752
753        #[unsafe(method(delegate))]
754        #[unsafe(method_family = none)]
755        pub unsafe fn delegate(&self) -> Option<Retained<ProtocolObject<dyn NSWindowDelegate>>>;
756
757        /// This is a [weak property][objc2::topics::weak_property].
758        /// Setter for [`delegate`][Self::delegate].
759        #[unsafe(method(setDelegate:))]
760        #[unsafe(method_family = none)]
761        pub fn setDelegate(&self, delegate: Option<&ProtocolObject<dyn NSWindowDelegate>>);
762
763        #[unsafe(method(windowNumber))]
764        #[unsafe(method_family = none)]
765        pub unsafe fn windowNumber(&self) -> NSInteger;
766
767        /// Note: The styleMask can only be set on macOS 10.6 and later. Valid
768        /// `styleMask`settings have the same restrictions as the
769        /// `styleMask`passed to `-initWithContentRect:styleMask:backing:defer:`.  Some
770        /// `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.
771        #[unsafe(method(styleMask))]
772        #[unsafe(method_family = none)]
773        pub fn styleMask(&self) -> NSWindowStyleMask;
774
775        /// Setter for [`styleMask`][Self::styleMask].
776        #[unsafe(method(setStyleMask:))]
777        #[unsafe(method_family = none)]
778        pub fn setStyleMask(&self, style_mask: NSWindowStyleMask);
779
780        #[cfg(all(feature = "NSText", feature = "NSView"))]
781        #[unsafe(method(fieldEditor:forObject:))]
782        #[unsafe(method_family = none)]
783        pub unsafe fn fieldEditor_forObject(
784            &self,
785            create_flag: bool,
786            object: Option<&AnyObject>,
787        ) -> Option<Retained<NSText>>;
788
789        #[unsafe(method(endEditingFor:))]
790        #[unsafe(method_family = none)]
791        pub unsafe fn endEditingFor(&self, object: Option<&AnyObject>);
792
793        #[cfg(feature = "NSScreen")]
794        #[unsafe(method(constrainFrameRect:toScreen:))]
795        #[unsafe(method_family = none)]
796        pub unsafe fn constrainFrameRect_toScreen(
797            &self,
798            frame_rect: NSRect,
799            screen: Option<&NSScreen>,
800        ) -> NSRect;
801
802        #[unsafe(method(setFrame:display:))]
803        #[unsafe(method_family = none)]
804        pub fn setFrame_display(&self, frame_rect: NSRect, flag: bool);
805
806        #[unsafe(method(setContentSize:))]
807        #[unsafe(method_family = none)]
808        pub fn setContentSize(&self, size: NSSize);
809
810        #[unsafe(method(setFrameOrigin:))]
811        #[unsafe(method_family = none)]
812        pub unsafe fn setFrameOrigin(&self, point: NSPoint);
813
814        #[unsafe(method(setFrameTopLeftPoint:))]
815        #[unsafe(method_family = none)]
816        pub fn setFrameTopLeftPoint(&self, point: NSPoint);
817
818        #[unsafe(method(cascadeTopLeftFromPoint:))]
819        #[unsafe(method_family = none)]
820        pub unsafe fn cascadeTopLeftFromPoint(&self, top_left_point: NSPoint) -> NSPoint;
821
822        /// 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.
823        #[unsafe(method(cascadingReferenceFrame))]
824        #[unsafe(method_family = none)]
825        pub unsafe fn cascadingReferenceFrame(&self) -> NSRect;
826
827        #[unsafe(method(frame))]
828        #[unsafe(method_family = none)]
829        pub fn frame(&self) -> NSRect;
830
831        /// Subclasses can override
832        /// `animationResizeTime:`to control the total time for the frame change.
833        /// `newFrame`is the rect passed into
834        /// `setFrame:display:animate:`
835        #[unsafe(method(animationResizeTime:))]
836        #[unsafe(method_family = none)]
837        pub unsafe fn animationResizeTime(&self, new_frame: NSRect) -> NSTimeInterval;
838
839        /// `setFrame:display:animate:`is equivalent to
840        /// `setFrame:display:`if the
841        /// `animateFlag`is NO.
842        /// If the
843        /// `animationFlag`is YES, this method will perform a smooth resize of the window, where the total time for the resize is specified by
844        /// `-animationResizeTime:`
845        #[unsafe(method(setFrame:display:animate:))]
846        #[unsafe(method_family = none)]
847        pub unsafe fn setFrame_display_animate(
848            &self,
849            frame_rect: NSRect,
850            display_flag: bool,
851            animate_flag: bool,
852        );
853
854        #[unsafe(method(inLiveResize))]
855        #[unsafe(method_family = none)]
856        pub unsafe fn inLiveResize(&self) -> bool;
857
858        #[unsafe(method(resizeIncrements))]
859        #[unsafe(method_family = none)]
860        pub unsafe fn resizeIncrements(&self) -> NSSize;
861
862        /// Setter for [`resizeIncrements`][Self::resizeIncrements].
863        #[unsafe(method(setResizeIncrements:))]
864        #[unsafe(method_family = none)]
865        pub fn setResizeIncrements(&self, resize_increments: NSSize);
866
867        #[unsafe(method(aspectRatio))]
868        #[unsafe(method_family = none)]
869        pub unsafe fn aspectRatio(&self) -> NSSize;
870
871        /// Setter for [`aspectRatio`][Self::aspectRatio].
872        #[unsafe(method(setAspectRatio:))]
873        #[unsafe(method_family = none)]
874        pub unsafe fn setAspectRatio(&self, aspect_ratio: NSSize);
875
876        #[unsafe(method(contentResizeIncrements))]
877        #[unsafe(method_family = none)]
878        pub fn contentResizeIncrements(&self) -> NSSize;
879
880        /// Setter for [`contentResizeIncrements`][Self::contentResizeIncrements].
881        #[unsafe(method(setContentResizeIncrements:))]
882        #[unsafe(method_family = none)]
883        pub fn setContentResizeIncrements(&self, content_resize_increments: NSSize);
884
885        #[unsafe(method(contentAspectRatio))]
886        #[unsafe(method_family = none)]
887        pub unsafe fn contentAspectRatio(&self) -> NSSize;
888
889        /// Setter for [`contentAspectRatio`][Self::contentAspectRatio].
890        #[unsafe(method(setContentAspectRatio:))]
891        #[unsafe(method_family = none)]
892        pub unsafe fn setContentAspectRatio(&self, content_aspect_ratio: NSSize);
893
894        #[unsafe(method(viewsNeedDisplay))]
895        #[unsafe(method_family = none)]
896        pub unsafe fn viewsNeedDisplay(&self) -> bool;
897
898        /// Setter for [`viewsNeedDisplay`][Self::viewsNeedDisplay].
899        #[unsafe(method(setViewsNeedDisplay:))]
900        #[unsafe(method_family = none)]
901        pub unsafe fn setViewsNeedDisplay(&self, views_need_display: bool);
902
903        #[unsafe(method(displayIfNeeded))]
904        #[unsafe(method_family = none)]
905        pub unsafe fn displayIfNeeded(&self);
906
907        #[unsafe(method(display))]
908        #[unsafe(method_family = none)]
909        pub unsafe fn display(&self);
910
911        #[unsafe(method(preservesContentDuringLiveResize))]
912        #[unsafe(method_family = none)]
913        pub unsafe fn preservesContentDuringLiveResize(&self) -> bool;
914
915        /// Setter for [`preservesContentDuringLiveResize`][Self::preservesContentDuringLiveResize].
916        #[unsafe(method(setPreservesContentDuringLiveResize:))]
917        #[unsafe(method_family = none)]
918        pub unsafe fn setPreservesContentDuringLiveResize(
919            &self,
920            preserves_content_during_live_resize: bool,
921        );
922
923        #[unsafe(method(update))]
924        #[unsafe(method_family = none)]
925        pub unsafe fn update(&self);
926
927        #[unsafe(method(makeFirstResponder:))]
928        #[unsafe(method_family = none)]
929        pub fn makeFirstResponder(&self, responder: Option<&NSResponder>) -> bool;
930
931        #[unsafe(method(firstResponder))]
932        #[unsafe(method_family = none)]
933        pub fn firstResponder(&self) -> Option<Retained<NSResponder>>;
934
935        #[cfg(feature = "NSEvent")]
936        #[unsafe(method(resizeFlags))]
937        #[unsafe(method_family = none)]
938        pub unsafe fn resizeFlags(&self) -> NSEventModifierFlags;
939
940        #[unsafe(method(close))]
941        #[unsafe(method_family = none)]
942        pub fn close(&self);
943
944        #[unsafe(method(isReleasedWhenClosed))]
945        #[unsafe(method_family = none)]
946        pub unsafe fn isReleasedWhenClosed(&self) -> bool;
947
948        /// Setter for [`isReleasedWhenClosed`][Self::isReleasedWhenClosed].
949        #[unsafe(method(setReleasedWhenClosed:))]
950        #[unsafe(method_family = none)]
951        pub unsafe fn setReleasedWhenClosed(&self, released_when_closed: bool);
952
953        #[unsafe(method(miniaturize:))]
954        #[unsafe(method_family = none)]
955        pub fn miniaturize(&self, sender: Option<&AnyObject>);
956
957        #[unsafe(method(deminiaturize:))]
958        #[unsafe(method_family = none)]
959        pub unsafe fn deminiaturize(&self, sender: Option<&AnyObject>);
960
961        #[unsafe(method(isZoomed))]
962        #[unsafe(method_family = none)]
963        pub fn isZoomed(&self) -> bool;
964
965        #[unsafe(method(zoom:))]
966        #[unsafe(method_family = none)]
967        pub fn zoom(&self, sender: Option<&AnyObject>);
968
969        #[unsafe(method(isMiniaturized))]
970        #[unsafe(method_family = none)]
971        pub fn isMiniaturized(&self) -> bool;
972
973        #[unsafe(method(tryToPerform:with:))]
974        #[unsafe(method_family = none)]
975        pub unsafe fn tryToPerform_with(&self, action: Sel, object: Option<&AnyObject>) -> bool;
976
977        #[cfg(feature = "NSPasteboard")]
978        #[unsafe(method(validRequestorForSendType:returnType:))]
979        #[unsafe(method_family = none)]
980        pub unsafe fn validRequestorForSendType_returnType(
981            &self,
982            send_type: Option<&NSPasteboardType>,
983            return_type: Option<&NSPasteboardType>,
984        ) -> Option<Retained<AnyObject>>;
985
986        #[cfg(feature = "NSColor")]
987        #[unsafe(method(backgroundColor))]
988        #[unsafe(method_family = none)]
989        pub unsafe fn backgroundColor(&self) -> Retained<NSColor>;
990
991        #[cfg(feature = "NSColor")]
992        /// Setter for [`backgroundColor`][Self::backgroundColor].
993        #[unsafe(method(setBackgroundColor:))]
994        #[unsafe(method_family = none)]
995        pub fn setBackgroundColor(&self, background_color: Option<&NSColor>);
996
997        #[cfg(feature = "objc2-core-foundation")]
998        #[unsafe(method(setContentBorderThickness:forEdge:))]
999        #[unsafe(method_family = none)]
1000        pub unsafe fn setContentBorderThickness_forEdge(
1001            &self,
1002            thickness: CGFloat,
1003            edge: NSRectEdge,
1004        );
1005
1006        #[cfg(feature = "objc2-core-foundation")]
1007        #[unsafe(method(contentBorderThicknessForEdge:))]
1008        #[unsafe(method_family = none)]
1009        pub unsafe fn contentBorderThicknessForEdge(&self, edge: NSRectEdge) -> CGFloat;
1010
1011        #[unsafe(method(setAutorecalculatesContentBorderThickness:forEdge:))]
1012        #[unsafe(method_family = none)]
1013        pub unsafe fn setAutorecalculatesContentBorderThickness_forEdge(
1014            &self,
1015            flag: bool,
1016            edge: NSRectEdge,
1017        );
1018
1019        #[unsafe(method(autorecalculatesContentBorderThicknessForEdge:))]
1020        #[unsafe(method_family = none)]
1021        pub unsafe fn autorecalculatesContentBorderThicknessForEdge(
1022            &self,
1023            edge: NSRectEdge,
1024        ) -> bool;
1025
1026        #[unsafe(method(isMovable))]
1027        #[unsafe(method_family = none)]
1028        pub unsafe fn isMovable(&self) -> bool;
1029
1030        /// Setter for [`isMovable`][Self::isMovable].
1031        #[unsafe(method(setMovable:))]
1032        #[unsafe(method_family = none)]
1033        pub fn setMovable(&self, movable: bool);
1034
1035        #[unsafe(method(isMovableByWindowBackground))]
1036        #[unsafe(method_family = none)]
1037        pub unsafe fn isMovableByWindowBackground(&self) -> bool;
1038
1039        /// Setter for [`isMovableByWindowBackground`][Self::isMovableByWindowBackground].
1040        #[unsafe(method(setMovableByWindowBackground:))]
1041        #[unsafe(method_family = none)]
1042        pub fn setMovableByWindowBackground(&self, movable_by_window_background: bool);
1043
1044        #[unsafe(method(hidesOnDeactivate))]
1045        #[unsafe(method_family = none)]
1046        pub unsafe fn hidesOnDeactivate(&self) -> bool;
1047
1048        /// Setter for [`hidesOnDeactivate`][Self::hidesOnDeactivate].
1049        #[unsafe(method(setHidesOnDeactivate:))]
1050        #[unsafe(method_family = none)]
1051        pub unsafe fn setHidesOnDeactivate(&self, hides_on_deactivate: bool);
1052
1053        /// Indicates whether a window can be hidden during `-[NSApplication hide:]`.  Default is
1054        /// `YES.`
1055        #[unsafe(method(canHide))]
1056        #[unsafe(method_family = none)]
1057        pub unsafe fn canHide(&self) -> bool;
1058
1059        /// Setter for [`canHide`][Self::canHide].
1060        #[unsafe(method(setCanHide:))]
1061        #[unsafe(method_family = none)]
1062        pub unsafe fn setCanHide(&self, can_hide: bool);
1063
1064        #[unsafe(method(center))]
1065        #[unsafe(method_family = none)]
1066        pub fn center(&self);
1067
1068        #[unsafe(method(makeKeyAndOrderFront:))]
1069        #[unsafe(method_family = none)]
1070        pub fn makeKeyAndOrderFront(&self, sender: Option<&AnyObject>);
1071
1072        #[unsafe(method(orderFront:))]
1073        #[unsafe(method_family = none)]
1074        pub fn orderFront(&self, sender: Option<&AnyObject>);
1075
1076        #[unsafe(method(orderBack:))]
1077        #[unsafe(method_family = none)]
1078        pub unsafe fn orderBack(&self, sender: Option<&AnyObject>);
1079
1080        #[unsafe(method(orderOut:))]
1081        #[unsafe(method_family = none)]
1082        pub fn orderOut(&self, sender: Option<&AnyObject>);
1083
1084        #[cfg(feature = "NSGraphics")]
1085        #[unsafe(method(orderWindow:relativeTo:))]
1086        #[unsafe(method_family = none)]
1087        pub unsafe fn orderWindow_relativeTo(
1088            &self,
1089            place: NSWindowOrderingMode,
1090            other_win: NSInteger,
1091        );
1092
1093        #[unsafe(method(orderFrontRegardless))]
1094        #[unsafe(method_family = none)]
1095        pub unsafe fn orderFrontRegardless(&self);
1096
1097        #[cfg(feature = "NSImage")]
1098        #[unsafe(method(miniwindowImage))]
1099        #[unsafe(method_family = none)]
1100        pub unsafe fn miniwindowImage(&self) -> Option<Retained<NSImage>>;
1101
1102        #[cfg(feature = "NSImage")]
1103        /// Setter for [`miniwindowImage`][Self::miniwindowImage].
1104        #[unsafe(method(setMiniwindowImage:))]
1105        #[unsafe(method_family = none)]
1106        pub unsafe fn setMiniwindowImage(&self, miniwindow_image: Option<&NSImage>);
1107
1108        #[unsafe(method(miniwindowTitle))]
1109        #[unsafe(method_family = none)]
1110        pub unsafe fn miniwindowTitle(&self) -> Retained<NSString>;
1111
1112        /// Setter for [`miniwindowTitle`][Self::miniwindowTitle].
1113        #[unsafe(method(setMiniwindowTitle:))]
1114        #[unsafe(method_family = none)]
1115        pub unsafe fn setMiniwindowTitle(&self, miniwindow_title: Option<&NSString>);
1116
1117        #[cfg(feature = "NSDockTile")]
1118        #[unsafe(method(dockTile))]
1119        #[unsafe(method_family = none)]
1120        pub unsafe fn dockTile(&self) -> Retained<NSDockTile>;
1121
1122        #[unsafe(method(isDocumentEdited))]
1123        #[unsafe(method_family = none)]
1124        pub fn isDocumentEdited(&self) -> bool;
1125
1126        /// Setter for [`isDocumentEdited`][Self::isDocumentEdited].
1127        #[unsafe(method(setDocumentEdited:))]
1128        #[unsafe(method_family = none)]
1129        pub fn setDocumentEdited(&self, document_edited: bool);
1130
1131        #[unsafe(method(isVisible))]
1132        #[unsafe(method_family = none)]
1133        pub fn isVisible(&self) -> bool;
1134
1135        #[unsafe(method(isKeyWindow))]
1136        #[unsafe(method_family = none)]
1137        pub fn isKeyWindow(&self) -> bool;
1138
1139        #[unsafe(method(isMainWindow))]
1140        #[unsafe(method_family = none)]
1141        pub unsafe fn isMainWindow(&self) -> bool;
1142
1143        #[unsafe(method(canBecomeKeyWindow))]
1144        #[unsafe(method_family = none)]
1145        pub unsafe fn canBecomeKeyWindow(&self) -> bool;
1146
1147        #[unsafe(method(canBecomeMainWindow))]
1148        #[unsafe(method_family = none)]
1149        pub unsafe fn canBecomeMainWindow(&self) -> bool;
1150
1151        /// Makes the window key and main if eligible, updating NSApplication's `-keyWindow` and `-mainWindow` properties.
1152        #[unsafe(method(makeKeyWindow))]
1153        #[unsafe(method_family = none)]
1154        pub unsafe fn makeKeyWindow(&self);
1155
1156        /// Makes the window main if eligible. Updates NSApplication's `-mainWindow` property.
1157        #[unsafe(method(makeMainWindow))]
1158        #[unsafe(method_family = none)]
1159        pub unsafe fn makeMainWindow(&self);
1160
1161        /// Informs the window that it has become the key window. This method exists as an override point. Do not invoke directly. Instead, invoke `-makeKeyWindow`.
1162        #[unsafe(method(becomeKeyWindow))]
1163        #[unsafe(method_family = none)]
1164        pub unsafe fn becomeKeyWindow(&self);
1165
1166        /// 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.
1167        #[unsafe(method(resignKeyWindow))]
1168        #[unsafe(method_family = none)]
1169        pub unsafe fn resignKeyWindow(&self);
1170
1171        /// Informs the window that it has become the main window. This method exists as an override point. Do not invoke directly. Instead, invoke `-makeMainWindow`.
1172        #[unsafe(method(becomeMainWindow))]
1173        #[unsafe(method_family = none)]
1174        pub unsafe fn becomeMainWindow(&self);
1175
1176        /// 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.
1177        #[unsafe(method(resignMainWindow))]
1178        #[unsafe(method_family = none)]
1179        pub unsafe fn resignMainWindow(&self);
1180
1181        #[unsafe(method(worksWhenModal))]
1182        #[unsafe(method_family = none)]
1183        pub unsafe fn worksWhenModal(&self) -> bool;
1184
1185        /// A Boolean value that indicates whether or not to prevent application termination when the receiving window is presented modally.
1186        /// The value of this property is `YES` if the window should prevent application termination when modal; otherwise, `NO`.
1187        /// The default value is `YES`. However, note that some window subclasses and some windows created indirectly (like those created by UI frameworks like AppKit and SwiftUI), may have different default values. For example, the Open panel and toolbar customization sheets should not prevent application termination, so those windows have `preventsApplicationTerminationWhenModal` set to `NO`. Some `NSAlert`s, like those that are simply informational, have windows that do not prevent application termination by default. Setting this property overrides the default behavior.
1188        #[unsafe(method(preventsApplicationTerminationWhenModal))]
1189        #[unsafe(method_family = none)]
1190        pub unsafe fn preventsApplicationTerminationWhenModal(&self) -> bool;
1191
1192        /// Setter for [`preventsApplicationTerminationWhenModal`][Self::preventsApplicationTerminationWhenModal].
1193        #[unsafe(method(setPreventsApplicationTerminationWhenModal:))]
1194        #[unsafe(method_family = none)]
1195        pub unsafe fn setPreventsApplicationTerminationWhenModal(
1196            &self,
1197            prevents_application_termination_when_modal: bool,
1198        );
1199
1200        #[unsafe(method(convertRectToScreen:))]
1201        #[unsafe(method_family = none)]
1202        pub fn convertRectToScreen(&self, rect: NSRect) -> NSRect;
1203
1204        #[unsafe(method(convertRectFromScreen:))]
1205        #[unsafe(method_family = none)]
1206        pub unsafe fn convertRectFromScreen(&self, rect: NSRect) -> NSRect;
1207
1208        #[unsafe(method(convertPointToScreen:))]
1209        #[unsafe(method_family = none)]
1210        pub unsafe fn convertPointToScreen(&self, point: NSPoint) -> NSPoint;
1211
1212        #[unsafe(method(convertPointFromScreen:))]
1213        #[unsafe(method_family = none)]
1214        pub fn convertPointFromScreen(&self, point: NSPoint) -> NSPoint;
1215
1216        #[unsafe(method(convertRectToBacking:))]
1217        #[unsafe(method_family = none)]
1218        pub unsafe fn convertRectToBacking(&self, rect: NSRect) -> NSRect;
1219
1220        #[unsafe(method(convertRectFromBacking:))]
1221        #[unsafe(method_family = none)]
1222        pub unsafe fn convertRectFromBacking(&self, rect: NSRect) -> NSRect;
1223
1224        #[unsafe(method(convertPointToBacking:))]
1225        #[unsafe(method_family = none)]
1226        pub unsafe fn convertPointToBacking(&self, point: NSPoint) -> NSPoint;
1227
1228        #[unsafe(method(convertPointFromBacking:))]
1229        #[unsafe(method_family = none)]
1230        pub unsafe fn convertPointFromBacking(&self, point: NSPoint) -> NSPoint;
1231
1232        /// Use `NSIntegralRectWithOptions()` to produce a backing store pixel aligned rectangle from the given input rectangle in window coordinates.
1233        #[unsafe(method(backingAlignedRect:options:))]
1234        #[unsafe(method_family = none)]
1235        pub unsafe fn backingAlignedRect_options(
1236            &self,
1237            rect: NSRect,
1238            options: NSAlignmentOptions,
1239        ) -> NSRect;
1240
1241        #[cfg(feature = "objc2-core-foundation")]
1242        /// Returns the scale factor representing the number of backing store pixels corresponding to each linear unit in window space on this
1243        /// `NSWindow.`This method is provided for rare cases when the explicit scale factor is needed. Please use `-convert*ToBacking:` methods whenever possible.
1244        #[unsafe(method(backingScaleFactor))]
1245        #[unsafe(method_family = none)]
1246        pub fn backingScaleFactor(&self) -> CGFloat;
1247
1248        #[unsafe(method(performClose:))]
1249        #[unsafe(method_family = none)]
1250        pub unsafe fn performClose(&self, sender: Option<&AnyObject>);
1251
1252        #[unsafe(method(performMiniaturize:))]
1253        #[unsafe(method_family = none)]
1254        pub unsafe fn performMiniaturize(&self, sender: Option<&AnyObject>);
1255
1256        #[unsafe(method(performZoom:))]
1257        #[unsafe(method_family = none)]
1258        pub unsafe fn performZoom(&self, sender: Option<&AnyObject>);
1259
1260        #[unsafe(method(dataWithEPSInsideRect:))]
1261        #[unsafe(method_family = none)]
1262        pub unsafe fn dataWithEPSInsideRect(&self, rect: NSRect) -> Retained<NSData>;
1263
1264        #[unsafe(method(dataWithPDFInsideRect:))]
1265        #[unsafe(method_family = none)]
1266        pub unsafe fn dataWithPDFInsideRect(&self, rect: NSRect) -> Retained<NSData>;
1267
1268        #[unsafe(method(print:))]
1269        #[unsafe(method_family = none)]
1270        pub unsafe fn print(&self, sender: Option<&AnyObject>);
1271
1272        /// Default is
1273        /// `NO.`Set to
1274        /// `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.
1275        /// Returns
1276        /// `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`.
1277        #[unsafe(method(allowsToolTipsWhenApplicationIsInactive))]
1278        #[unsafe(method_family = none)]
1279        pub unsafe fn allowsToolTipsWhenApplicationIsInactive(&self) -> bool;
1280
1281        /// Setter for [`allowsToolTipsWhenApplicationIsInactive`][Self::allowsToolTipsWhenApplicationIsInactive].
1282        #[unsafe(method(setAllowsToolTipsWhenApplicationIsInactive:))]
1283        #[unsafe(method_family = none)]
1284        pub unsafe fn setAllowsToolTipsWhenApplicationIsInactive(
1285            &self,
1286            allows_tool_tips_when_application_is_inactive: bool,
1287        );
1288
1289        #[cfg(feature = "NSGraphics")]
1290        #[unsafe(method(backingType))]
1291        #[unsafe(method_family = none)]
1292        pub unsafe fn backingType(&self) -> NSBackingStoreType;
1293
1294        #[cfg(feature = "NSGraphics")]
1295        /// Setter for [`backingType`][Self::backingType].
1296        #[unsafe(method(setBackingType:))]
1297        #[unsafe(method_family = none)]
1298        pub unsafe fn setBackingType(&self, backing_type: NSBackingStoreType);
1299
1300        #[unsafe(method(level))]
1301        #[unsafe(method_family = none)]
1302        pub unsafe fn level(&self) -> NSWindowLevel;
1303
1304        /// Setter for [`level`][Self::level].
1305        #[unsafe(method(setLevel:))]
1306        #[unsafe(method_family = none)]
1307        pub fn setLevel(&self, level: NSWindowLevel);
1308
1309        #[cfg(feature = "NSGraphics")]
1310        #[unsafe(method(depthLimit))]
1311        #[unsafe(method_family = none)]
1312        pub unsafe fn depthLimit(&self) -> NSWindowDepth;
1313
1314        #[cfg(feature = "NSGraphics")]
1315        /// Setter for [`depthLimit`][Self::depthLimit].
1316        #[unsafe(method(setDepthLimit:))]
1317        #[unsafe(method_family = none)]
1318        pub unsafe fn setDepthLimit(&self, depth_limit: NSWindowDepth);
1319
1320        #[unsafe(method(setDynamicDepthLimit:))]
1321        #[unsafe(method_family = none)]
1322        pub unsafe fn setDynamicDepthLimit(&self, flag: bool);
1323
1324        #[unsafe(method(hasDynamicDepthLimit))]
1325        #[unsafe(method_family = none)]
1326        pub unsafe fn hasDynamicDepthLimit(&self) -> bool;
1327
1328        #[cfg(feature = "NSScreen")]
1329        /// 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.
1330        #[unsafe(method(screen))]
1331        #[unsafe(method_family = none)]
1332        pub fn screen(&self) -> Option<Retained<NSScreen>>;
1333
1334        #[cfg(feature = "NSScreen")]
1335        #[unsafe(method(deepestScreen))]
1336        #[unsafe(method_family = none)]
1337        pub unsafe fn deepestScreen(&self) -> Option<Retained<NSScreen>>;
1338
1339        #[unsafe(method(hasShadow))]
1340        #[unsafe(method_family = none)]
1341        pub fn hasShadow(&self) -> bool;
1342
1343        /// Setter for [`hasShadow`][Self::hasShadow].
1344        #[unsafe(method(setHasShadow:))]
1345        #[unsafe(method_family = none)]
1346        pub fn setHasShadow(&self, has_shadow: bool);
1347
1348        #[unsafe(method(invalidateShadow))]
1349        #[unsafe(method_family = none)]
1350        pub unsafe fn invalidateShadow(&self);
1351
1352        #[cfg(feature = "objc2-core-foundation")]
1353        #[unsafe(method(alphaValue))]
1354        #[unsafe(method_family = none)]
1355        pub unsafe fn alphaValue(&self) -> CGFloat;
1356
1357        #[cfg(feature = "objc2-core-foundation")]
1358        /// Setter for [`alphaValue`][Self::alphaValue].
1359        #[unsafe(method(setAlphaValue:))]
1360        #[unsafe(method_family = none)]
1361        pub unsafe fn setAlphaValue(&self, alpha_value: CGFloat);
1362
1363        #[unsafe(method(isOpaque))]
1364        #[unsafe(method_family = none)]
1365        pub unsafe fn isOpaque(&self) -> bool;
1366
1367        /// Setter for [`isOpaque`][Self::isOpaque].
1368        #[unsafe(method(setOpaque:))]
1369        #[unsafe(method_family = none)]
1370        pub fn setOpaque(&self, opaque: bool);
1371
1372        /// `-setSharingType:` specifies whether the window content can be read from another process.  The default sharing type is
1373        /// `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
1374        /// `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.
1375        #[unsafe(method(sharingType))]
1376        #[unsafe(method_family = none)]
1377        pub unsafe fn sharingType(&self) -> NSWindowSharingType;
1378
1379        /// Setter for [`sharingType`][Self::sharingType].
1380        #[unsafe(method(setSharingType:))]
1381        #[unsafe(method_family = none)]
1382        pub fn setSharingType(&self, sharing_type: NSWindowSharingType);
1383
1384        /// Controls whether threading of view drawing should be enabled for this window.  Defaults to
1385        /// `YES.`When this is set to
1386        /// `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
1387        /// `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`.
1388        #[unsafe(method(allowsConcurrentViewDrawing))]
1389        #[unsafe(method_family = none)]
1390        pub unsafe fn allowsConcurrentViewDrawing(&self) -> bool;
1391
1392        /// Setter for [`allowsConcurrentViewDrawing`][Self::allowsConcurrentViewDrawing].
1393        #[unsafe(method(setAllowsConcurrentViewDrawing:))]
1394        #[unsafe(method_family = none)]
1395        pub unsafe fn setAllowsConcurrentViewDrawing(&self, allows_concurrent_view_drawing: bool);
1396
1397        #[unsafe(method(displaysWhenScreenProfileChanges))]
1398        #[unsafe(method_family = none)]
1399        pub unsafe fn displaysWhenScreenProfileChanges(&self) -> bool;
1400
1401        /// Setter for [`displaysWhenScreenProfileChanges`][Self::displaysWhenScreenProfileChanges].
1402        #[unsafe(method(setDisplaysWhenScreenProfileChanges:))]
1403        #[unsafe(method_family = none)]
1404        pub unsafe fn setDisplaysWhenScreenProfileChanges(
1405            &self,
1406            displays_when_screen_profile_changes: bool,
1407        );
1408
1409        /// 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.
1410        #[unsafe(method(canBecomeVisibleWithoutLogin))]
1411        #[unsafe(method_family = none)]
1412        pub unsafe fn canBecomeVisibleWithoutLogin(&self) -> bool;
1413
1414        /// Setter for [`canBecomeVisibleWithoutLogin`][Self::canBecomeVisibleWithoutLogin].
1415        #[unsafe(method(setCanBecomeVisibleWithoutLogin:))]
1416        #[unsafe(method_family = none)]
1417        pub unsafe fn setCanBecomeVisibleWithoutLogin(
1418            &self,
1419            can_become_visible_without_login: bool,
1420        );
1421
1422        #[unsafe(method(collectionBehavior))]
1423        #[unsafe(method_family = none)]
1424        pub unsafe fn collectionBehavior(&self) -> NSWindowCollectionBehavior;
1425
1426        /// Setter for [`collectionBehavior`][Self::collectionBehavior].
1427        #[unsafe(method(setCollectionBehavior:))]
1428        #[unsafe(method_family = none)]
1429        pub unsafe fn setCollectionBehavior(&self, collection_behavior: NSWindowCollectionBehavior);
1430
1431        /// Provides for per-window control over automatic orderFront/orderOut animation behaviors added in 10.7.  Can be set to
1432        /// `NSWindowAnimationBehaviorNone`to disable Appkit's automatic animations for a given window, or to one of the other non-Default
1433        /// `NSWindowAnimationBehavior`values to override AppKit's automatic inference of appropriate animation behavior based on the window's apparent type.
1434        #[unsafe(method(animationBehavior))]
1435        #[unsafe(method_family = none)]
1436        pub unsafe fn animationBehavior(&self) -> NSWindowAnimationBehavior;
1437
1438        /// Setter for [`animationBehavior`][Self::animationBehavior].
1439        #[unsafe(method(setAnimationBehavior:))]
1440        #[unsafe(method_family = none)]
1441        pub unsafe fn setAnimationBehavior(&self, animation_behavior: NSWindowAnimationBehavior);
1442
1443        /// Returns
1444        /// `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
1445        #[unsafe(method(isOnActiveSpace))]
1446        #[unsafe(method_family = none)]
1447        pub unsafe fn isOnActiveSpace(&self) -> bool;
1448
1449        /// `-toggleFullScreen:` enters or exits for full screen. A window must have
1450        /// `NSWindowCollectionBehaviorFullScreenAuxiliary`or
1451        /// `NSWindowCollectionBehaviorFullScreenPrimary`included in the
1452        /// `collectionBehavior`property; if it does not, this method may simply do nothing.
1453        #[unsafe(method(toggleFullScreen:))]
1454        #[unsafe(method_family = none)]
1455        pub fn toggleFullScreen(&self, sender: Option<&AnyObject>);
1456
1457        #[unsafe(method(stringWithSavedFrame))]
1458        #[unsafe(method_family = none)]
1459        pub unsafe fn stringWithSavedFrame(&self) -> Retained<NSWindowPersistableFrameDescriptor>;
1460
1461        #[unsafe(method(setFrameFromString:))]
1462        #[unsafe(method_family = none)]
1463        pub unsafe fn setFrameFromString(&self, string: &NSWindowPersistableFrameDescriptor);
1464
1465        #[unsafe(method(saveFrameUsingName:))]
1466        #[unsafe(method_family = none)]
1467        pub unsafe fn saveFrameUsingName(&self, name: &NSWindowFrameAutosaveName);
1468
1469        #[unsafe(method(setFrameUsingName:force:))]
1470        #[unsafe(method_family = none)]
1471        pub unsafe fn setFrameUsingName_force(
1472            &self,
1473            name: &NSWindowFrameAutosaveName,
1474            force: bool,
1475        ) -> bool;
1476
1477        #[unsafe(method(setFrameUsingName:))]
1478        #[unsafe(method_family = none)]
1479        pub unsafe fn setFrameUsingName(&self, name: &NSWindowFrameAutosaveName) -> bool;
1480
1481        #[unsafe(method(setFrameAutosaveName:))]
1482        #[unsafe(method_family = none)]
1483        pub unsafe fn setFrameAutosaveName(&self, name: &NSWindowFrameAutosaveName) -> bool;
1484
1485        #[unsafe(method(frameAutosaveName))]
1486        #[unsafe(method_family = none)]
1487        pub unsafe fn frameAutosaveName(&self) -> Retained<NSWindowFrameAutosaveName>;
1488
1489        #[unsafe(method(removeFrameUsingName:))]
1490        #[unsafe(method_family = none)]
1491        pub unsafe fn removeFrameUsingName(name: &NSWindowFrameAutosaveName, mtm: MainThreadMarker);
1492
1493        #[unsafe(method(minSize))]
1494        #[unsafe(method_family = none)]
1495        pub unsafe fn minSize(&self) -> NSSize;
1496
1497        /// Setter for [`minSize`][Self::minSize].
1498        #[unsafe(method(setMinSize:))]
1499        #[unsafe(method_family = none)]
1500        pub fn setMinSize(&self, min_size: NSSize);
1501
1502        #[unsafe(method(maxSize))]
1503        #[unsafe(method_family = none)]
1504        pub unsafe fn maxSize(&self) -> NSSize;
1505
1506        /// Setter for [`maxSize`][Self::maxSize].
1507        #[unsafe(method(setMaxSize:))]
1508        #[unsafe(method_family = none)]
1509        pub fn setMaxSize(&self, max_size: NSSize);
1510
1511        #[unsafe(method(contentMinSize))]
1512        #[unsafe(method_family = none)]
1513        pub unsafe fn contentMinSize(&self) -> NSSize;
1514
1515        /// Setter for [`contentMinSize`][Self::contentMinSize].
1516        #[unsafe(method(setContentMinSize:))]
1517        #[unsafe(method_family = none)]
1518        pub unsafe fn setContentMinSize(&self, content_min_size: NSSize);
1519
1520        #[unsafe(method(contentMaxSize))]
1521        #[unsafe(method_family = none)]
1522        pub unsafe fn contentMaxSize(&self) -> NSSize;
1523
1524        /// Setter for [`contentMaxSize`][Self::contentMaxSize].
1525        #[unsafe(method(setContentMaxSize:))]
1526        #[unsafe(method_family = none)]
1527        pub unsafe fn setContentMaxSize(&self, content_max_size: NSSize);
1528
1529        #[unsafe(method(minFullScreenContentSize))]
1530        #[unsafe(method_family = none)]
1531        pub unsafe fn minFullScreenContentSize(&self) -> NSSize;
1532
1533        /// Setter for [`minFullScreenContentSize`][Self::minFullScreenContentSize].
1534        #[unsafe(method(setMinFullScreenContentSize:))]
1535        #[unsafe(method_family = none)]
1536        pub unsafe fn setMinFullScreenContentSize(&self, min_full_screen_content_size: NSSize);
1537
1538        #[unsafe(method(maxFullScreenContentSize))]
1539        #[unsafe(method_family = none)]
1540        pub unsafe fn maxFullScreenContentSize(&self) -> NSSize;
1541
1542        /// Setter for [`maxFullScreenContentSize`][Self::maxFullScreenContentSize].
1543        #[unsafe(method(setMaxFullScreenContentSize:))]
1544        #[unsafe(method_family = none)]
1545        pub unsafe fn setMaxFullScreenContentSize(&self, max_full_screen_content_size: NSSize);
1546
1547        #[cfg(feature = "NSGraphics")]
1548        #[unsafe(method(deviceDescription))]
1549        #[unsafe(method_family = none)]
1550        pub unsafe fn deviceDescription(
1551            &self,
1552        ) -> Retained<NSDictionary<NSDeviceDescriptionKey, AnyObject>>;
1553
1554        #[cfg(feature = "NSWindowController")]
1555        #[unsafe(method(windowController))]
1556        #[unsafe(method_family = none)]
1557        pub unsafe fn windowController(&self) -> Option<Retained<NSWindowController>>;
1558
1559        #[cfg(feature = "NSWindowController")]
1560        /// This is a [weak property][objc2::topics::weak_property].
1561        /// Setter for [`windowController`][Self::windowController].
1562        #[unsafe(method(setWindowController:))]
1563        #[unsafe(method_family = none)]
1564        pub unsafe fn setWindowController(&self, window_controller: Option<&NSWindowController>);
1565
1566        #[cfg(all(feature = "NSApplication", feature = "block2"))]
1567        #[unsafe(method(beginSheet:completionHandler:))]
1568        #[unsafe(method_family = none)]
1569        pub unsafe fn beginSheet_completionHandler(
1570            &self,
1571            sheet_window: &NSWindow,
1572            handler: Option<&block2::DynBlock<dyn Fn(NSModalResponse)>>,
1573        );
1574
1575        #[cfg(all(feature = "NSApplication", feature = "block2"))]
1576        #[unsafe(method(beginCriticalSheet:completionHandler:))]
1577        #[unsafe(method_family = none)]
1578        pub unsafe fn beginCriticalSheet_completionHandler(
1579            &self,
1580            sheet_window: &NSWindow,
1581            handler: Option<&block2::DynBlock<dyn Fn(NSModalResponse)>>,
1582        );
1583
1584        #[unsafe(method(endSheet:))]
1585        #[unsafe(method_family = none)]
1586        pub unsafe fn endSheet(&self, sheet_window: &NSWindow);
1587
1588        #[cfg(feature = "NSApplication")]
1589        #[unsafe(method(endSheet:returnCode:))]
1590        #[unsafe(method_family = none)]
1591        pub unsafe fn endSheet_returnCode(
1592            &self,
1593            sheet_window: &NSWindow,
1594            return_code: NSModalResponse,
1595        );
1596
1597        /// 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.
1598        #[unsafe(method(sheets))]
1599        #[unsafe(method_family = none)]
1600        pub unsafe fn sheets(&self) -> Retained<NSArray<NSWindow>>;
1601
1602        /// Returns the top-most sheet if there is one or more sheets, or nil if there is no sheet.
1603        #[unsafe(method(attachedSheet))]
1604        #[unsafe(method_family = none)]
1605        pub unsafe fn attachedSheet(&self) -> Option<Retained<NSWindow>>;
1606
1607        #[unsafe(method(isSheet))]
1608        #[unsafe(method_family = none)]
1609        pub unsafe fn isSheet(&self) -> bool;
1610
1611        /// Returns the window that the sheet is directly attached to. This is based on the logical attachment of the sheet, not visual attachment.
1612        /// This relationship exists starting when the sheet is begun (using
1613        /// `NSApplication's``-beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo: or NSWindow's -beginSheet:completionHandler:`), and ending once it is ordered out.
1614        /// Returns nil if the window is not a sheet or has no sheet parent.
1615        #[unsafe(method(sheetParent))]
1616        #[unsafe(method_family = none)]
1617        pub unsafe fn sheetParent(&self) -> Option<Retained<NSWindow>>;
1618
1619        #[cfg(all(feature = "NSButton", feature = "NSControl", feature = "NSView"))]
1620        #[unsafe(method(standardWindowButton:forStyleMask:))]
1621        #[unsafe(method_family = none)]
1622        pub unsafe fn standardWindowButton_forStyleMask(
1623            b: NSWindowButton,
1624            style_mask: NSWindowStyleMask,
1625            mtm: MainThreadMarker,
1626        ) -> Option<Retained<NSButton>>;
1627
1628        #[cfg(all(feature = "NSButton", feature = "NSControl", feature = "NSView"))]
1629        #[unsafe(method(standardWindowButton:))]
1630        #[unsafe(method_family = none)]
1631        pub fn standardWindowButton(&self, b: NSWindowButton) -> Option<Retained<NSButton>>;
1632
1633        #[cfg(feature = "NSGraphics")]
1634        #[unsafe(method(addChildWindow:ordered:))]
1635        #[unsafe(method_family = none)]
1636        pub unsafe fn addChildWindow_ordered(
1637            &self,
1638            child_win: &NSWindow,
1639            place: NSWindowOrderingMode,
1640        );
1641
1642        #[unsafe(method(removeChildWindow:))]
1643        #[unsafe(method_family = none)]
1644        pub unsafe fn removeChildWindow(&self, child_win: &NSWindow);
1645
1646        #[unsafe(method(childWindows))]
1647        #[unsafe(method_family = none)]
1648        pub unsafe fn childWindows(&self) -> Option<Retained<NSArray<NSWindow>>>;
1649
1650        #[unsafe(method(parentWindow))]
1651        #[unsafe(method_family = none)]
1652        pub unsafe fn parentWindow(&self) -> Option<Retained<NSWindow>>;
1653
1654        /// This is a [weak property][objc2::topics::weak_property].
1655        /// Setter for [`parentWindow`][Self::parentWindow].
1656        #[unsafe(method(setParentWindow:))]
1657        #[unsafe(method_family = none)]
1658        pub unsafe fn setParentWindow(&self, parent_window: Option<&NSWindow>);
1659
1660        #[cfg(feature = "NSAppearance")]
1661        /// 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.
1662        #[unsafe(method(appearanceSource))]
1663        #[unsafe(method_family = none)]
1664        pub unsafe fn appearanceSource(&self) -> Option<Retained<NSObject>>;
1665
1666        #[cfg(feature = "NSAppearance")]
1667        /// This is a [weak property][objc2::topics::weak_property].
1668        /// Setter for [`appearanceSource`][Self::appearanceSource].
1669        #[unsafe(method(setAppearanceSource:))]
1670        #[unsafe(method_family = none)]
1671        pub unsafe fn setAppearanceSource(&self, appearance_source: Option<&NSObject>);
1672
1673        #[cfg(feature = "NSColorSpace")]
1674        #[unsafe(method(colorSpace))]
1675        #[unsafe(method_family = none)]
1676        pub unsafe fn colorSpace(&self) -> Option<Retained<NSColorSpace>>;
1677
1678        #[cfg(feature = "NSColorSpace")]
1679        /// Setter for [`colorSpace`][Self::colorSpace].
1680        #[unsafe(method(setColorSpace:))]
1681        #[unsafe(method_family = none)]
1682        pub unsafe fn setColorSpace(&self, color_space: Option<&NSColorSpace>);
1683
1684        #[cfg(feature = "NSGraphics")]
1685        /// `-canRepresentDisplayGamut:` returns
1686        /// `YES`if the colorSpace of the receiving window, and the
1687        /// `colorSpace`of the screen containing that window, are capable of representing the given display gamut
1688        #[unsafe(method(canRepresentDisplayGamut:))]
1689        #[unsafe(method_family = none)]
1690        pub unsafe fn canRepresentDisplayGamut(&self, display_gamut: NSDisplayGamut) -> bool;
1691
1692        /// `+windowNumbersWithOptions:` returns an autoreleased array of
1693        /// `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
1694        /// `NSWindowNumberListAllApplications,`visible windows belonging to all applications are included.  If options include
1695        /// `NSWindowNumberListAllSpaces,`visible windows on all spaces are included.  Windows on the active space are returned in z-order.
1696        /// Examples:
1697        /// To get an array of windowNumbers visible on the current space and belonging to the calling application:
1698        /// `windowNumbers = [NSWindow windowNumbersWithOptions:0];`
1699        /// To get an array of windowNumbers visible on any space and belonging to any application:
1700        /// `windowNumbers = [NSWindow windowNumbersWithOptions:NSWindowNumberListAllApplications|NSWindowNumberListAllSpaces];`
1701        /// To get an array of windowNumbers visible on any space and belonging to the calling application:
1702        /// `windowNumbers = [NSWindow windowNumbersWithOptions:NSWindowNumberListAllSpaces];`
1703        #[unsafe(method(windowNumbersWithOptions:))]
1704        #[unsafe(method_family = none)]
1705        pub unsafe fn windowNumbersWithOptions(
1706            options: NSWindowNumberListOptions,
1707            mtm: MainThreadMarker,
1708        ) -> Option<Retained<NSArray<NSNumber>>>;
1709
1710        /// `+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.
1711        #[unsafe(method(windowNumberAtPoint:belowWindowWithWindowNumber:))]
1712        #[unsafe(method_family = none)]
1713        pub unsafe fn windowNumberAtPoint_belowWindowWithWindowNumber(
1714            point: NSPoint,
1715            window_number: NSInteger,
1716            mtm: MainThreadMarker,
1717        ) -> NSInteger;
1718
1719        #[unsafe(method(occlusionState))]
1720        #[unsafe(method_family = none)]
1721        pub fn occlusionState(&self) -> NSWindowOcclusionState;
1722
1723        /// Specifies the style of separator displayed between the window's titlebar and content.
1724        ///
1725        /// The default value is NSTitlebarSeparatorStyleAutomatic. Changing this value will override any preference made by `NSSplitViewItem`.
1726        #[unsafe(method(titlebarSeparatorStyle))]
1727        #[unsafe(method_family = none)]
1728        pub unsafe fn titlebarSeparatorStyle(&self) -> NSTitlebarSeparatorStyle;
1729
1730        /// Setter for [`titlebarSeparatorStyle`][Self::titlebarSeparatorStyle].
1731        #[unsafe(method(setTitlebarSeparatorStyle:))]
1732        #[unsafe(method_family = none)]
1733        pub unsafe fn setTitlebarSeparatorStyle(
1734            &self,
1735            titlebar_separator_style: NSTitlebarSeparatorStyle,
1736        );
1737
1738        #[cfg(feature = "NSViewController")]
1739        /// 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:
1740        /// "
1741        /// 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.
1742        #[unsafe(method(contentViewController))]
1743        #[unsafe(method_family = none)]
1744        pub unsafe fn contentViewController(&self) -> Option<Retained<NSViewController>>;
1745
1746        #[cfg(feature = "NSViewController")]
1747        /// Setter for [`contentViewController`][Self::contentViewController].
1748        #[unsafe(method(setContentViewController:))]
1749        #[unsafe(method_family = none)]
1750        pub unsafe fn setContentViewController(
1751            &self,
1752            content_view_controller: Option<&NSViewController>,
1753        );
1754
1755        #[cfg(feature = "NSViewController")]
1756        /// 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].
1757        #[unsafe(method(windowWithContentViewController:))]
1758        #[unsafe(method_family = none)]
1759        pub unsafe fn windowWithContentViewController(
1760            content_view_controller: &NSViewController,
1761        ) -> Retained<Self>;
1762
1763        #[cfg(feature = "NSEvent")]
1764        /// 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.
1765        #[unsafe(method(performWindowDragWithEvent:))]
1766        #[unsafe(method_family = none)]
1767        pub fn performWindowDragWithEvent(&self, event: &NSEvent);
1768
1769        #[cfg(feature = "NSView")]
1770        #[unsafe(method(initialFirstResponder))]
1771        #[unsafe(method_family = none)]
1772        pub unsafe fn initialFirstResponder(&self) -> Option<Retained<NSView>>;
1773
1774        #[cfg(feature = "NSView")]
1775        /// This is a [weak property][objc2::topics::weak_property].
1776        /// Setter for [`initialFirstResponder`][Self::initialFirstResponder].
1777        #[unsafe(method(setInitialFirstResponder:))]
1778        #[unsafe(method_family = none)]
1779        pub fn setInitialFirstResponder(&self, initial_first_responder: Option<&NSView>);
1780
1781        #[unsafe(method(selectNextKeyView:))]
1782        #[unsafe(method_family = none)]
1783        pub fn selectNextKeyView(&self, sender: Option<&AnyObject>);
1784
1785        #[unsafe(method(selectPreviousKeyView:))]
1786        #[unsafe(method_family = none)]
1787        pub fn selectPreviousKeyView(&self, sender: Option<&AnyObject>);
1788
1789        #[cfg(feature = "NSView")]
1790        #[unsafe(method(selectKeyViewFollowingView:))]
1791        #[unsafe(method_family = none)]
1792        pub unsafe fn selectKeyViewFollowingView(&self, view: &NSView);
1793
1794        #[cfg(feature = "NSView")]
1795        #[unsafe(method(selectKeyViewPrecedingView:))]
1796        #[unsafe(method_family = none)]
1797        pub unsafe fn selectKeyViewPrecedingView(&self, view: &NSView);
1798
1799        #[unsafe(method(keyViewSelectionDirection))]
1800        #[unsafe(method_family = none)]
1801        pub unsafe fn keyViewSelectionDirection(&self) -> NSSelectionDirection;
1802
1803        #[cfg(all(feature = "NSActionCell", feature = "NSButtonCell", feature = "NSCell"))]
1804        #[unsafe(method(defaultButtonCell))]
1805        #[unsafe(method_family = none)]
1806        pub unsafe fn defaultButtonCell(&self) -> Option<Retained<NSButtonCell>>;
1807
1808        #[cfg(all(feature = "NSActionCell", feature = "NSButtonCell", feature = "NSCell"))]
1809        /// Setter for [`defaultButtonCell`][Self::defaultButtonCell].
1810        #[unsafe(method(setDefaultButtonCell:))]
1811        #[unsafe(method_family = none)]
1812        pub unsafe fn setDefaultButtonCell(&self, default_button_cell: Option<&NSButtonCell>);
1813
1814        #[unsafe(method(disableKeyEquivalentForDefaultButtonCell))]
1815        #[unsafe(method_family = none)]
1816        pub unsafe fn disableKeyEquivalentForDefaultButtonCell(&self);
1817
1818        #[unsafe(method(enableKeyEquivalentForDefaultButtonCell))]
1819        #[unsafe(method_family = none)]
1820        pub unsafe fn enableKeyEquivalentForDefaultButtonCell(&self);
1821
1822        #[unsafe(method(autorecalculatesKeyViewLoop))]
1823        #[unsafe(method_family = none)]
1824        pub unsafe fn autorecalculatesKeyViewLoop(&self) -> bool;
1825
1826        /// Setter for [`autorecalculatesKeyViewLoop`][Self::autorecalculatesKeyViewLoop].
1827        #[unsafe(method(setAutorecalculatesKeyViewLoop:))]
1828        #[unsafe(method_family = none)]
1829        pub unsafe fn setAutorecalculatesKeyViewLoop(&self, autorecalculates_key_view_loop: bool);
1830
1831        #[unsafe(method(recalculateKeyViewLoop))]
1832        #[unsafe(method_family = none)]
1833        pub unsafe fn recalculateKeyViewLoop(&self);
1834
1835        #[cfg(feature = "NSToolbar")]
1836        #[unsafe(method(toolbar))]
1837        #[unsafe(method_family = none)]
1838        pub unsafe fn toolbar(&self) -> Option<Retained<NSToolbar>>;
1839
1840        #[cfg(feature = "NSToolbar")]
1841        /// Setter for [`toolbar`][Self::toolbar].
1842        #[unsafe(method(setToolbar:))]
1843        #[unsafe(method_family = none)]
1844        pub unsafe fn setToolbar(&self, toolbar: Option<&NSToolbar>);
1845
1846        #[unsafe(method(toggleToolbarShown:))]
1847        #[unsafe(method_family = none)]
1848        pub unsafe fn toggleToolbarShown(&self, sender: Option<&AnyObject>);
1849
1850        #[unsafe(method(runToolbarCustomizationPalette:))]
1851        #[unsafe(method_family = none)]
1852        pub unsafe fn runToolbarCustomizationPalette(&self, sender: Option<&AnyObject>);
1853
1854        #[deprecated = "This property has no effect"]
1855        #[unsafe(method(showsToolbarButton))]
1856        #[unsafe(method_family = none)]
1857        pub unsafe fn showsToolbarButton(&self) -> bool;
1858
1859        /// Setter for [`showsToolbarButton`][Self::showsToolbarButton].
1860        #[deprecated = "This property has no effect"]
1861        #[unsafe(method(setShowsToolbarButton:))]
1862        #[unsafe(method_family = none)]
1863        pub unsafe fn setShowsToolbarButton(&self, shows_toolbar_button: bool);
1864
1865        /// Allows automatic window tabbing when the value is
1866        /// `YES.`By default, this will be set to
1867        /// `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.
1868        #[unsafe(method(allowsAutomaticWindowTabbing))]
1869        #[unsafe(method_family = none)]
1870        pub fn allowsAutomaticWindowTabbing(mtm: MainThreadMarker) -> bool;
1871
1872        /// Setter for [`allowsAutomaticWindowTabbing`][Self::allowsAutomaticWindowTabbing].
1873        #[unsafe(method(setAllowsAutomaticWindowTabbing:))]
1874        #[unsafe(method_family = none)]
1875        pub fn setAllowsAutomaticWindowTabbing(
1876            allows_automatic_window_tabbing: bool,
1877            mtm: MainThreadMarker,
1878        );
1879
1880        /// 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.
1881        #[unsafe(method(userTabbingPreference))]
1882        #[unsafe(method_family = none)]
1883        pub unsafe fn userTabbingPreference(mtm: MainThreadMarker)
1884            -> NSWindowUserTabbingPreference;
1885
1886        /// Get and set the tabbing mode for this window. This should be set before a window is shown. The default value is
1887        /// `NSWindowTabbingModeAutomatic.`When the value is
1888        /// `NSWindowTabbingModeAutomatic,`the system will look at the
1889        /// `userTabbingPreference`and automatically tab windows together based on the tabbingIdentifier, when it is appropriate to do so.
1890        #[unsafe(method(tabbingMode))]
1891        #[unsafe(method_family = none)]
1892        pub unsafe fn tabbingMode(&self) -> NSWindowTabbingMode;
1893
1894        /// Setter for [`tabbingMode`][Self::tabbingMode].
1895        #[unsafe(method(setTabbingMode:))]
1896        #[unsafe(method_family = none)]
1897        pub fn setTabbingMode(&self, tabbing_mode: NSWindowTabbingMode);
1898
1899        /// Windows with the same
1900        /// `tabbingIdentifier`will have the ability to be tabbed together when a window is being shown. This allows aggregation of similar windows. By default, the
1901        /// `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
1902        /// `tabbingIdentifier.`
1903        #[unsafe(method(tabbingIdentifier))]
1904        #[unsafe(method_family = none)]
1905        pub fn tabbingIdentifier(&self) -> Retained<NSWindowTabbingIdentifier>;
1906
1907        /// Setter for [`tabbingIdentifier`][Self::tabbingIdentifier].
1908        #[unsafe(method(setTabbingIdentifier:))]
1909        #[unsafe(method_family = none)]
1910        pub fn setTabbingIdentifier(&self, tabbing_identifier: &NSWindowTabbingIdentifier);
1911
1912        /// 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
1913        /// `validateUserInterfaceItem.`
1914        #[unsafe(method(selectNextTab:))]
1915        #[unsafe(method_family = none)]
1916        pub fn selectNextTab(&self, sender: Option<&AnyObject>);
1917
1918        #[unsafe(method(selectPreviousTab:))]
1919        #[unsafe(method_family = none)]
1920        pub unsafe fn selectPreviousTab(&self, sender: Option<&AnyObject>);
1921
1922        #[unsafe(method(moveTabToNewWindow:))]
1923        #[unsafe(method_family = none)]
1924        pub unsafe fn moveTabToNewWindow(&self, sender: Option<&AnyObject>);
1925
1926        #[unsafe(method(mergeAllWindows:))]
1927        #[unsafe(method_family = none)]
1928        pub unsafe fn mergeAllWindows(&self, sender: Option<&AnyObject>);
1929
1930        #[unsafe(method(toggleTabBar:))]
1931        #[unsafe(method_family = none)]
1932        pub unsafe fn toggleTabBar(&self, sender: Option<&AnyObject>);
1933
1934        /// 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.
1935        #[unsafe(method(toggleTabOverview:))]
1936        #[unsafe(method_family = none)]
1937        pub unsafe fn toggleTabOverview(&self, sender: Option<&AnyObject>);
1938
1939        /// This is now a cover for `self.tabGroup.windows`, but will return nil if the window is not showing a tab bar.
1940        #[unsafe(method(tabbedWindows))]
1941        #[unsafe(method_family = none)]
1942        pub unsafe fn tabbedWindows(&self) -> Option<Retained<NSArray<NSWindow>>>;
1943
1944        #[cfg(feature = "NSGraphics")]
1945        /// This is now a cover for `-[self.tabGroup addWindow:]`, which allows more precise placement.
1946        #[unsafe(method(addTabbedWindow:ordered:))]
1947        #[unsafe(method_family = none)]
1948        pub unsafe fn addTabbedWindow_ordered(
1949            &self,
1950            window: &NSWindow,
1951            ordered: NSWindowOrderingMode,
1952        );
1953
1954        #[cfg(feature = "NSWindowTab")]
1955        /// Access the properties for this window when it is a tabbed window environment. See the
1956        /// `NSWindowTab`header and comments for more information.
1957        #[unsafe(method(tab))]
1958        #[unsafe(method_family = none)]
1959        pub unsafe fn tab(&self) -> Retained<NSWindowTab>;
1960
1961        #[cfg(feature = "NSWindowTabGroup")]
1962        /// Represents a tab group of windows. This
1963        /// `tabGroup`is lazily created on demand.
1964        #[unsafe(method(tabGroup))]
1965        #[unsafe(method_family = none)]
1966        pub fn tabGroup(&self) -> Option<Retained<NSWindowTabGroup>>;
1967
1968        #[cfg(feature = "block2")]
1969        /// 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.
1970        ///
1971        /// Parameter `window`: A window that is replacing the reciever in representing the user's current activity.
1972        ///
1973        /// Parameter `completionHandler`: A completion block that is called after the request finishes.
1974        /// `error`In the event of a failed transfer request, a non-nil error contains details about the failure.
1975        #[unsafe(method(transferWindowSharingToWindow:completionHandler:))]
1976        #[unsafe(method_family = none)]
1977        pub unsafe fn transferWindowSharingToWindow_completionHandler(
1978            &self,
1979            window: &NSWindow,
1980            completion_handler: &block2::DynBlock<dyn Fn(*mut NSError)>,
1981        );
1982
1983        /// Indicates whether the receiver is the subject of an active SharePlay sharing session.
1984        #[unsafe(method(hasActiveWindowSharingSession))]
1985        #[unsafe(method_family = none)]
1986        pub unsafe fn hasActiveWindowSharingSession(&self) -> bool;
1987
1988        #[cfg(feature = "block2")]
1989        /// Request sharing of window.  If there is an available ScreenCaptureKit sharing session, an alert will be presented asking the user to confirm the share
1990        ///
1991        /// Parameter `window`: The window to share
1992        ///
1993        /// Parameter `completionHandler`: A completion block that is called after the request finishes.
1994        /// `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.
1995        #[unsafe(method(requestSharingOfWindow:completionHandler:))]
1996        #[unsafe(method_family = none)]
1997        pub unsafe fn requestSharingOfWindow_completionHandler(
1998            &self,
1999            window: &NSWindow,
2000            completion_handler: &block2::DynBlock<dyn Fn(*mut NSError)>,
2001        );
2002
2003        #[cfg(all(feature = "NSImage", feature = "block2"))]
2004        /// 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:
2005        ///
2006        /// Parameter `image`: An image showing a preview of the window to share
2007        ///
2008        /// Parameter `title`: The title to show in a confirmation dialog
2009        ///
2010        /// Parameter `completionHandler`: A completion block that is called after the request finishes.
2011        /// `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.
2012        #[unsafe(method(requestSharingOfWindowUsingPreview:title:completionHandler:))]
2013        #[unsafe(method_family = none)]
2014        pub unsafe fn requestSharingOfWindowUsingPreview_title_completionHandler(
2015            &self,
2016            image: &NSImage,
2017            title: &NSString,
2018            completion_handler: &block2::DynBlock<dyn Fn(*mut NSError)>,
2019        );
2020
2021        #[cfg(feature = "NSUserInterfaceLayout")]
2022        /// 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.
2023        #[unsafe(method(windowTitlebarLayoutDirection))]
2024        #[unsafe(method_family = none)]
2025        pub unsafe fn windowTitlebarLayoutDirection(&self) -> NSUserInterfaceLayoutDirection;
2026    );
2027}
2028
2029/// Methods declared on superclass `NSResponder`.
2030#[cfg(feature = "NSResponder")]
2031impl NSWindow {
2032    extern_methods!(
2033        #[unsafe(method(init))]
2034        #[unsafe(method_family = init)]
2035        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
2036    );
2037}
2038
2039/// Methods declared on superclass `NSObject`.
2040#[cfg(feature = "NSResponder")]
2041impl NSWindow {
2042    extern_methods!(
2043        #[unsafe(method(new))]
2044        #[unsafe(method_family = new)]
2045        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
2046    );
2047}
2048
2049/// NSEvent.
2050#[cfg(feature = "NSResponder")]
2051impl NSWindow {
2052    extern_methods!(
2053        #[cfg(all(feature = "NSEvent", feature = "block2"))]
2054        /// 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
2055        /// `NSEventDurationForever`to never timeout. Tracking continues until `*stop` is set to
2056        /// `YES.`Calls to `-nextEventMatchingMask:…` are allowed inside the trackingHandler block. This method returns once tracking is terminated.
2057        #[unsafe(method(trackEventsMatchingMask:timeout:mode:handler:))]
2058        #[unsafe(method_family = none)]
2059        pub unsafe fn trackEventsMatchingMask_timeout_mode_handler(
2060            &self,
2061            mask: NSEventMask,
2062            timeout: NSTimeInterval,
2063            mode: &NSRunLoopMode,
2064            tracking_handler: &block2::DynBlock<dyn Fn(*mut NSEvent, NonNull<Bool>) + '_>,
2065        );
2066
2067        #[cfg(feature = "NSEvent")]
2068        #[unsafe(method(nextEventMatchingMask:))]
2069        #[unsafe(method_family = none)]
2070        pub unsafe fn nextEventMatchingMask(&self, mask: NSEventMask) -> Option<Retained<NSEvent>>;
2071
2072        #[cfg(feature = "NSEvent")]
2073        #[unsafe(method(nextEventMatchingMask:untilDate:inMode:dequeue:))]
2074        #[unsafe(method_family = none)]
2075        pub unsafe fn nextEventMatchingMask_untilDate_inMode_dequeue(
2076            &self,
2077            mask: NSEventMask,
2078            expiration: Option<&NSDate>,
2079            mode: &NSRunLoopMode,
2080            deq_flag: bool,
2081        ) -> Option<Retained<NSEvent>>;
2082
2083        #[cfg(feature = "NSEvent")]
2084        #[unsafe(method(discardEventsMatchingMask:beforeEvent:))]
2085        #[unsafe(method_family = none)]
2086        pub unsafe fn discardEventsMatchingMask_beforeEvent(
2087            &self,
2088            mask: NSEventMask,
2089            last_event: Option<&NSEvent>,
2090        );
2091
2092        #[cfg(feature = "NSEvent")]
2093        #[unsafe(method(postEvent:atStart:))]
2094        #[unsafe(method_family = none)]
2095        pub unsafe fn postEvent_atStart(&self, event: &NSEvent, flag: bool);
2096
2097        #[cfg(feature = "NSEvent")]
2098        #[unsafe(method(sendEvent:))]
2099        #[unsafe(method_family = none)]
2100        pub fn sendEvent(&self, event: &NSEvent);
2101
2102        #[cfg(feature = "NSEvent")]
2103        #[unsafe(method(currentEvent))]
2104        #[unsafe(method_family = none)]
2105        pub unsafe fn currentEvent(&self) -> Option<Retained<NSEvent>>;
2106
2107        #[unsafe(method(acceptsMouseMovedEvents))]
2108        #[unsafe(method_family = none)]
2109        pub unsafe fn acceptsMouseMovedEvents(&self) -> bool;
2110
2111        /// Setter for [`acceptsMouseMovedEvents`][Self::acceptsMouseMovedEvents].
2112        #[unsafe(method(setAcceptsMouseMovedEvents:))]
2113        #[unsafe(method_family = none)]
2114        pub fn setAcceptsMouseMovedEvents(&self, accepts_mouse_moved_events: bool);
2115
2116        #[unsafe(method(ignoresMouseEvents))]
2117        #[unsafe(method_family = none)]
2118        pub unsafe fn ignoresMouseEvents(&self) -> bool;
2119
2120        /// Setter for [`ignoresMouseEvents`][Self::ignoresMouseEvents].
2121        #[unsafe(method(setIgnoresMouseEvents:))]
2122        #[unsafe(method_family = none)]
2123        pub fn setIgnoresMouseEvents(&self, ignores_mouse_events: bool);
2124
2125        #[unsafe(method(mouseLocationOutsideOfEventStream))]
2126        #[unsafe(method_family = none)]
2127        pub unsafe fn mouseLocationOutsideOfEventStream(&self) -> NSPoint;
2128    );
2129}
2130
2131/// NSCursorRect.
2132#[cfg(feature = "NSResponder")]
2133impl NSWindow {
2134    extern_methods!(
2135        #[unsafe(method(disableCursorRects))]
2136        #[unsafe(method_family = none)]
2137        pub unsafe fn disableCursorRects(&self);
2138
2139        #[unsafe(method(enableCursorRects))]
2140        #[unsafe(method_family = none)]
2141        pub unsafe fn enableCursorRects(&self);
2142
2143        #[unsafe(method(discardCursorRects))]
2144        #[unsafe(method_family = none)]
2145        pub unsafe fn discardCursorRects(&self);
2146
2147        #[unsafe(method(areCursorRectsEnabled))]
2148        #[unsafe(method_family = none)]
2149        pub unsafe fn areCursorRectsEnabled(&self) -> bool;
2150
2151        #[cfg(feature = "NSView")]
2152        #[unsafe(method(invalidateCursorRectsForView:))]
2153        #[unsafe(method_family = none)]
2154        pub fn invalidateCursorRectsForView(&self, view: &NSView);
2155
2156        #[unsafe(method(resetCursorRects))]
2157        #[unsafe(method_family = none)]
2158        pub unsafe fn resetCursorRects(&self);
2159    );
2160}
2161
2162/// NSDrag.
2163#[cfg(feature = "NSResponder")]
2164impl NSWindow {
2165    extern_methods!(
2166        #[cfg(all(
2167            feature = "NSDragging",
2168            feature = "NSDraggingItem",
2169            feature = "NSDraggingSession",
2170            feature = "NSEvent"
2171        ))]
2172        #[unsafe(method(beginDraggingSessionWithItems:event:source:))]
2173        #[unsafe(method_family = none)]
2174        pub unsafe fn beginDraggingSessionWithItems_event_source(
2175            &self,
2176            items: &NSArray<NSDraggingItem>,
2177            event: &NSEvent,
2178            source: &ProtocolObject<dyn NSDraggingSource>,
2179        ) -> Retained<NSDraggingSession>;
2180
2181        #[cfg(all(feature = "NSEvent", feature = "NSImage", feature = "NSPasteboard"))]
2182        #[deprecated = "Use -[NSWindow beginDraggingSessionWithItems:event:source:] instead."]
2183        #[unsafe(method(dragImage:at:offset:event:pasteboard:source:slideBack:))]
2184        #[unsafe(method_family = none)]
2185        pub unsafe fn dragImage_at_offset_event_pasteboard_source_slideBack(
2186            &self,
2187            image: &NSImage,
2188            base_location: NSPoint,
2189            initial_offset: NSSize,
2190            event: &NSEvent,
2191            pboard: &NSPasteboard,
2192            source_obj: &AnyObject,
2193            slide_flag: bool,
2194        );
2195
2196        #[cfg(feature = "NSPasteboard")]
2197        #[unsafe(method(registerForDraggedTypes:))]
2198        #[unsafe(method_family = none)]
2199        pub fn registerForDraggedTypes(&self, new_types: &NSArray<NSPasteboardType>);
2200
2201        #[unsafe(method(unregisterDraggedTypes))]
2202        #[unsafe(method_family = none)]
2203        pub unsafe fn unregisterDraggedTypes(&self);
2204    );
2205}
2206
2207/// NSDisplayLink.
2208#[cfg(feature = "NSResponder")]
2209impl NSWindow {
2210    extern_methods!(
2211        #[cfg(feature = "objc2-quartz-core")]
2212        #[cfg(target_vendor = "apple")]
2213        #[unsafe(method(displayLinkWithTarget:selector:))]
2214        #[unsafe(method_family = none)]
2215        pub unsafe fn displayLinkWithTarget_selector(
2216            &self,
2217            target: &AnyObject,
2218            selector: Sel,
2219        ) -> Retained<CADisplayLink>;
2220    );
2221}
2222
2223extern_protocol!(
2224    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowdelegate?language=objc)
2225    pub unsafe trait NSWindowDelegate: NSObjectProtocol + MainThreadOnly {
2226        #[cfg(feature = "NSResponder")]
2227        #[optional]
2228        #[unsafe(method(windowShouldClose:))]
2229        #[unsafe(method_family = none)]
2230        unsafe fn windowShouldClose(&self, sender: &NSWindow) -> bool;
2231
2232        #[cfg(feature = "NSResponder")]
2233        #[optional]
2234        #[unsafe(method(windowWillReturnFieldEditor:toObject:))]
2235        #[unsafe(method_family = none)]
2236        unsafe fn windowWillReturnFieldEditor_toObject(
2237            &self,
2238            sender: &NSWindow,
2239            client: Option<&AnyObject>,
2240        ) -> Option<Retained<AnyObject>>;
2241
2242        #[cfg(feature = "NSResponder")]
2243        #[optional]
2244        #[unsafe(method(windowWillResize:toSize:))]
2245        #[unsafe(method_family = none)]
2246        unsafe fn windowWillResize_toSize(&self, sender: &NSWindow, frame_size: NSSize) -> NSSize;
2247
2248        #[cfg(feature = "NSResponder")]
2249        #[optional]
2250        #[unsafe(method(windowWillUseStandardFrame:defaultFrame:))]
2251        #[unsafe(method_family = none)]
2252        unsafe fn windowWillUseStandardFrame_defaultFrame(
2253            &self,
2254            window: &NSWindow,
2255            new_frame: NSRect,
2256        ) -> NSRect;
2257
2258        #[cfg(feature = "NSResponder")]
2259        #[optional]
2260        #[unsafe(method(windowShouldZoom:toFrame:))]
2261        #[unsafe(method_family = none)]
2262        unsafe fn windowShouldZoom_toFrame(&self, window: &NSWindow, new_frame: NSRect) -> bool;
2263
2264        #[cfg(feature = "NSResponder")]
2265        #[optional]
2266        #[unsafe(method(windowWillReturnUndoManager:))]
2267        #[unsafe(method_family = none)]
2268        unsafe fn windowWillReturnUndoManager(
2269            &self,
2270            window: &NSWindow,
2271        ) -> Option<Retained<NSUndoManager>>;
2272
2273        #[cfg(feature = "NSResponder")]
2274        /// 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.
2275        #[optional]
2276        #[unsafe(method(window:willPositionSheet:usingRect:))]
2277        #[unsafe(method_family = none)]
2278        unsafe fn window_willPositionSheet_usingRect(
2279            &self,
2280            window: &NSWindow,
2281            sheet: &NSWindow,
2282            rect: NSRect,
2283        ) -> NSRect;
2284
2285        #[cfg(all(feature = "NSMenu", feature = "NSResponder"))]
2286        /// If a window has a
2287        /// `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
2288        /// `NO`will prevent the menu from being shown.  A return of
2289        /// `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
2290        /// `representedURL.`If the
2291        /// `representedURL`has no path components, the menu will have no menu items.  Before returning
2292        /// `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.
2293        #[optional]
2294        #[unsafe(method(window:shouldPopUpDocumentPathMenu:))]
2295        #[unsafe(method_family = none)]
2296        unsafe fn window_shouldPopUpDocumentPathMenu(
2297            &self,
2298            window: &NSWindow,
2299            menu: &NSMenu,
2300        ) -> bool;
2301
2302        #[cfg(all(feature = "NSEvent", feature = "NSPasteboard", feature = "NSResponder"))]
2303        /// The window delegate may implement `-window:shouldDragDocumentWithEvent:from:withPasteboard:` to override
2304        /// `NSWindow`document icon's default drag behavior.  The delegate can prohibit the drag by returning
2305        /// `NO.`Before returning
2306        /// `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
2307        /// `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
2308        /// `YES.`
2309        #[optional]
2310        #[unsafe(method(window:shouldDragDocumentWithEvent:from:withPasteboard:))]
2311        #[unsafe(method_family = none)]
2312        unsafe fn window_shouldDragDocumentWithEvent_from_withPasteboard(
2313            &self,
2314            window: &NSWindow,
2315            event: &NSEvent,
2316            drag_image_location: NSPoint,
2317            pasteboard: &NSPasteboard,
2318        ) -> bool;
2319
2320        #[cfg(feature = "NSResponder")]
2321        #[optional]
2322        #[unsafe(method(window:willUseFullScreenContentSize:))]
2323        #[unsafe(method_family = none)]
2324        unsafe fn window_willUseFullScreenContentSize(
2325            &self,
2326            window: &NSWindow,
2327            proposed_size: NSSize,
2328        ) -> NSSize;
2329
2330        #[cfg(all(feature = "NSApplication", feature = "NSResponder"))]
2331        #[optional]
2332        #[unsafe(method(window:willUseFullScreenPresentationOptions:))]
2333        #[unsafe(method_family = none)]
2334        unsafe fn window_willUseFullScreenPresentationOptions(
2335            &self,
2336            window: &NSWindow,
2337            proposed_options: NSApplicationPresentationOptions,
2338        ) -> NSApplicationPresentationOptions;
2339
2340        #[cfg(feature = "NSResponder")]
2341        /// 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.
2342        #[optional]
2343        #[unsafe(method(customWindowsToEnterFullScreenForWindow:))]
2344        #[unsafe(method_family = none)]
2345        unsafe fn customWindowsToEnterFullScreenForWindow(
2346            &self,
2347            window: &NSWindow,
2348        ) -> Option<Retained<NSArray<NSWindow>>>;
2349
2350        #[cfg(feature = "NSResponder")]
2351        /// 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.
2352        #[optional]
2353        #[unsafe(method(window:startCustomAnimationToEnterFullScreenWithDuration:))]
2354        #[unsafe(method_family = none)]
2355        unsafe fn window_startCustomAnimationToEnterFullScreenWithDuration(
2356            &self,
2357            window: &NSWindow,
2358            duration: NSTimeInterval,
2359        );
2360
2361        #[cfg(feature = "NSResponder")]
2362        /// 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:`.
2363        #[optional]
2364        #[unsafe(method(windowDidFailToEnterFullScreen:))]
2365        #[unsafe(method_family = none)]
2366        unsafe fn windowDidFailToEnterFullScreen(&self, window: &NSWindow);
2367
2368        #[cfg(feature = "NSResponder")]
2369        /// 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.
2370        #[optional]
2371        #[unsafe(method(customWindowsToExitFullScreenForWindow:))]
2372        #[unsafe(method_family = none)]
2373        unsafe fn customWindowsToExitFullScreenForWindow(
2374            &self,
2375            window: &NSWindow,
2376        ) -> Option<Retained<NSArray<NSWindow>>>;
2377
2378        #[cfg(feature = "NSResponder")]
2379        /// 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.
2380        #[optional]
2381        #[unsafe(method(window:startCustomAnimationToExitFullScreenWithDuration:))]
2382        #[unsafe(method_family = none)]
2383        unsafe fn window_startCustomAnimationToExitFullScreenWithDuration(
2384            &self,
2385            window: &NSWindow,
2386            duration: NSTimeInterval,
2387        );
2388
2389        #[cfg(all(feature = "NSResponder", feature = "NSScreen"))]
2390        /// `-customWindowsToEnterFullScreenForWindow:onScreen:` will be called in place of `-customWindowsToEnterFullScreenForWindow:` if both are implemented.
2391        #[optional]
2392        #[unsafe(method(customWindowsToEnterFullScreenForWindow:onScreen:))]
2393        #[unsafe(method_family = none)]
2394        unsafe fn customWindowsToEnterFullScreenForWindow_onScreen(
2395            &self,
2396            window: &NSWindow,
2397            screen: &NSScreen,
2398        ) -> Option<Retained<NSArray<NSWindow>>>;
2399
2400        #[cfg(all(feature = "NSResponder", feature = "NSScreen"))]
2401        /// `-window:startCustomAnimationToEnterFullScreenOnScreen:withDuration:` will be called in place of `-window:startCustomAnimationToEnterFullScreenWithDuration:` if both are implemented.
2402        #[optional]
2403        #[unsafe(method(window:startCustomAnimationToEnterFullScreenOnScreen:withDuration:))]
2404        #[unsafe(method_family = none)]
2405        unsafe fn window_startCustomAnimationToEnterFullScreenOnScreen_withDuration(
2406            &self,
2407            window: &NSWindow,
2408            screen: &NSScreen,
2409            duration: NSTimeInterval,
2410        );
2411
2412        #[cfg(feature = "NSResponder")]
2413        /// 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:`.
2414        #[optional]
2415        #[unsafe(method(windowDidFailToExitFullScreen:))]
2416        #[unsafe(method_family = none)]
2417        unsafe fn windowDidFailToExitFullScreen(&self, window: &NSWindow);
2418
2419        #[cfg(feature = "NSResponder")]
2420        /// 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
2421        /// `maxPreferredFrameSize,`the window will also be scaled down to ensure it fits properly in the version browser. Returned sizes larger than
2422        /// `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.
2423        #[optional]
2424        #[unsafe(method(window:willResizeForVersionBrowserWithMaxPreferredSize:maxAllowedSize:))]
2425        #[unsafe(method_family = none)]
2426        unsafe fn window_willResizeForVersionBrowserWithMaxPreferredSize_maxAllowedSize(
2427            &self,
2428            window: &NSWindow,
2429            max_preferred_frame_size: NSSize,
2430            max_allowed_frame_size: NSSize,
2431        ) -> NSSize;
2432
2433        #[cfg(feature = "NSResponder")]
2434        /// 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.
2435        #[optional]
2436        #[unsafe(method(window:willEncodeRestorableState:))]
2437        #[unsafe(method_family = none)]
2438        unsafe fn window_willEncodeRestorableState(&self, window: &NSWindow, state: &NSCoder);
2439
2440        #[cfg(feature = "NSResponder")]
2441        /// Method called by `-[NSWindow restoreStateWithCoder:]` to give the delegate a chance to restore its own state, which it may decode from the
2442        /// `NSCoder.`See the header `NSWindowRestoration.h` for more information.
2443        #[optional]
2444        #[unsafe(method(window:didDecodeRestorableState:))]
2445        #[unsafe(method_family = none)]
2446        unsafe fn window_didDecodeRestorableState(&self, window: &NSWindow, state: &NSCoder);
2447
2448        #[cfg(all(feature = "NSPreviewRepresentingActivityItem", feature = "NSResponder"))]
2449        /// Preview representable activity items, used for sharing and collaboration.
2450        #[optional]
2451        #[unsafe(method(previewRepresentableActivityItemsForWindow:))]
2452        #[unsafe(method_family = none)]
2453        unsafe fn previewRepresentableActivityItemsForWindow(
2454            &self,
2455            window: &NSWindow,
2456        ) -> Option<Retained<NSArray<ProtocolObject<dyn NSPreviewRepresentableActivityItem>>>>;
2457
2458        #[cfg(feature = "NSResponder")]
2459        /// 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
2460        #[optional]
2461        #[unsafe(method(windowForSharingRequestFromWindow:))]
2462        #[unsafe(method_family = none)]
2463        unsafe fn windowForSharingRequestFromWindow(
2464            &self,
2465            window: &NSWindow,
2466        ) -> Option<Retained<NSWindow>>;
2467
2468        #[optional]
2469        #[unsafe(method(windowDidResize:))]
2470        #[unsafe(method_family = none)]
2471        unsafe fn windowDidResize(&self, notification: &NSNotification);
2472
2473        #[optional]
2474        #[unsafe(method(windowDidExpose:))]
2475        #[unsafe(method_family = none)]
2476        unsafe fn windowDidExpose(&self, notification: &NSNotification);
2477
2478        #[optional]
2479        #[unsafe(method(windowWillMove:))]
2480        #[unsafe(method_family = none)]
2481        unsafe fn windowWillMove(&self, notification: &NSNotification);
2482
2483        #[optional]
2484        #[unsafe(method(windowDidMove:))]
2485        #[unsafe(method_family = none)]
2486        unsafe fn windowDidMove(&self, notification: &NSNotification);
2487
2488        #[optional]
2489        #[unsafe(method(windowDidBecomeKey:))]
2490        #[unsafe(method_family = none)]
2491        unsafe fn windowDidBecomeKey(&self, notification: &NSNotification);
2492
2493        #[optional]
2494        #[unsafe(method(windowDidResignKey:))]
2495        #[unsafe(method_family = none)]
2496        unsafe fn windowDidResignKey(&self, notification: &NSNotification);
2497
2498        #[optional]
2499        #[unsafe(method(windowDidBecomeMain:))]
2500        #[unsafe(method_family = none)]
2501        unsafe fn windowDidBecomeMain(&self, notification: &NSNotification);
2502
2503        #[optional]
2504        #[unsafe(method(windowDidResignMain:))]
2505        #[unsafe(method_family = none)]
2506        unsafe fn windowDidResignMain(&self, notification: &NSNotification);
2507
2508        #[optional]
2509        #[unsafe(method(windowWillClose:))]
2510        #[unsafe(method_family = none)]
2511        unsafe fn windowWillClose(&self, notification: &NSNotification);
2512
2513        #[optional]
2514        #[unsafe(method(windowWillMiniaturize:))]
2515        #[unsafe(method_family = none)]
2516        unsafe fn windowWillMiniaturize(&self, notification: &NSNotification);
2517
2518        #[optional]
2519        #[unsafe(method(windowDidMiniaturize:))]
2520        #[unsafe(method_family = none)]
2521        unsafe fn windowDidMiniaturize(&self, notification: &NSNotification);
2522
2523        #[optional]
2524        #[unsafe(method(windowDidDeminiaturize:))]
2525        #[unsafe(method_family = none)]
2526        unsafe fn windowDidDeminiaturize(&self, notification: &NSNotification);
2527
2528        #[optional]
2529        #[unsafe(method(windowDidUpdate:))]
2530        #[unsafe(method_family = none)]
2531        unsafe fn windowDidUpdate(&self, notification: &NSNotification);
2532
2533        #[optional]
2534        #[unsafe(method(windowDidChangeScreen:))]
2535        #[unsafe(method_family = none)]
2536        unsafe fn windowDidChangeScreen(&self, notification: &NSNotification);
2537
2538        #[optional]
2539        #[unsafe(method(windowDidChangeScreenProfile:))]
2540        #[unsafe(method_family = none)]
2541        unsafe fn windowDidChangeScreenProfile(&self, notification: &NSNotification);
2542
2543        #[optional]
2544        #[unsafe(method(windowDidChangeBackingProperties:))]
2545        #[unsafe(method_family = none)]
2546        unsafe fn windowDidChangeBackingProperties(&self, notification: &NSNotification);
2547
2548        #[optional]
2549        #[unsafe(method(windowWillBeginSheet:))]
2550        #[unsafe(method_family = none)]
2551        unsafe fn windowWillBeginSheet(&self, notification: &NSNotification);
2552
2553        #[optional]
2554        #[unsafe(method(windowDidEndSheet:))]
2555        #[unsafe(method_family = none)]
2556        unsafe fn windowDidEndSheet(&self, notification: &NSNotification);
2557
2558        #[optional]
2559        #[unsafe(method(windowWillStartLiveResize:))]
2560        #[unsafe(method_family = none)]
2561        unsafe fn windowWillStartLiveResize(&self, notification: &NSNotification);
2562
2563        #[optional]
2564        #[unsafe(method(windowDidEndLiveResize:))]
2565        #[unsafe(method_family = none)]
2566        unsafe fn windowDidEndLiveResize(&self, notification: &NSNotification);
2567
2568        #[optional]
2569        #[unsafe(method(windowWillEnterFullScreen:))]
2570        #[unsafe(method_family = none)]
2571        unsafe fn windowWillEnterFullScreen(&self, notification: &NSNotification);
2572
2573        #[optional]
2574        #[unsafe(method(windowDidEnterFullScreen:))]
2575        #[unsafe(method_family = none)]
2576        unsafe fn windowDidEnterFullScreen(&self, notification: &NSNotification);
2577
2578        #[optional]
2579        #[unsafe(method(windowWillExitFullScreen:))]
2580        #[unsafe(method_family = none)]
2581        unsafe fn windowWillExitFullScreen(&self, notification: &NSNotification);
2582
2583        #[optional]
2584        #[unsafe(method(windowDidExitFullScreen:))]
2585        #[unsafe(method_family = none)]
2586        unsafe fn windowDidExitFullScreen(&self, notification: &NSNotification);
2587
2588        #[optional]
2589        #[unsafe(method(windowWillEnterVersionBrowser:))]
2590        #[unsafe(method_family = none)]
2591        unsafe fn windowWillEnterVersionBrowser(&self, notification: &NSNotification);
2592
2593        #[optional]
2594        #[unsafe(method(windowDidEnterVersionBrowser:))]
2595        #[unsafe(method_family = none)]
2596        unsafe fn windowDidEnterVersionBrowser(&self, notification: &NSNotification);
2597
2598        #[optional]
2599        #[unsafe(method(windowWillExitVersionBrowser:))]
2600        #[unsafe(method_family = none)]
2601        unsafe fn windowWillExitVersionBrowser(&self, notification: &NSNotification);
2602
2603        #[optional]
2604        #[unsafe(method(windowDidExitVersionBrowser:))]
2605        #[unsafe(method_family = none)]
2606        unsafe fn windowDidExitVersionBrowser(&self, notification: &NSNotification);
2607
2608        #[optional]
2609        #[unsafe(method(windowDidChangeOcclusionState:))]
2610        #[unsafe(method_family = none)]
2611        unsafe fn windowDidChangeOcclusionState(&self, notification: &NSNotification);
2612    }
2613);
2614
2615extern "C" {
2616    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowdidbecomekeynotification?language=objc)
2617    pub static NSWindowDidBecomeKeyNotification: &'static NSNotificationName;
2618}
2619
2620extern "C" {
2621    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowdidbecomemainnotification?language=objc)
2622    pub static NSWindowDidBecomeMainNotification: &'static NSNotificationName;
2623}
2624
2625extern "C" {
2626    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowdidchangescreennotification?language=objc)
2627    pub static NSWindowDidChangeScreenNotification: &'static NSNotificationName;
2628}
2629
2630extern "C" {
2631    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowdiddeminiaturizenotification?language=objc)
2632    pub static NSWindowDidDeminiaturizeNotification: &'static NSNotificationName;
2633}
2634
2635extern "C" {
2636    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowdidexposenotification?language=objc)
2637    pub static NSWindowDidExposeNotification: &'static NSNotificationName;
2638}
2639
2640extern "C" {
2641    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowdidminiaturizenotification?language=objc)
2642    pub static NSWindowDidMiniaturizeNotification: &'static NSNotificationName;
2643}
2644
2645extern "C" {
2646    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowdidmovenotification?language=objc)
2647    pub static NSWindowDidMoveNotification: &'static NSNotificationName;
2648}
2649
2650extern "C" {
2651    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowdidresignkeynotification?language=objc)
2652    pub static NSWindowDidResignKeyNotification: &'static NSNotificationName;
2653}
2654
2655extern "C" {
2656    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowdidresignmainnotification?language=objc)
2657    pub static NSWindowDidResignMainNotification: &'static NSNotificationName;
2658}
2659
2660extern "C" {
2661    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowdidresizenotification?language=objc)
2662    pub static NSWindowDidResizeNotification: &'static NSNotificationName;
2663}
2664
2665extern "C" {
2666    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowdidupdatenotification?language=objc)
2667    pub static NSWindowDidUpdateNotification: &'static NSNotificationName;
2668}
2669
2670extern "C" {
2671    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowwillclosenotification?language=objc)
2672    pub static NSWindowWillCloseNotification: &'static NSNotificationName;
2673}
2674
2675extern "C" {
2676    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowwillminiaturizenotification?language=objc)
2677    pub static NSWindowWillMiniaturizeNotification: &'static NSNotificationName;
2678}
2679
2680extern "C" {
2681    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowwillmovenotification?language=objc)
2682    pub static NSWindowWillMoveNotification: &'static NSNotificationName;
2683}
2684
2685extern "C" {
2686    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowwillbeginsheetnotification?language=objc)
2687    pub static NSWindowWillBeginSheetNotification: &'static NSNotificationName;
2688}
2689
2690extern "C" {
2691    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowdidendsheetnotification?language=objc)
2692    pub static NSWindowDidEndSheetNotification: &'static NSNotificationName;
2693}
2694
2695extern "C" {
2696    /// `NSWindowDidChangeBackingPropertiesNotification`is posted on 10.7.3 and later, when a window's
2697    /// `backingScaleFactor`and/or its
2698    /// `colorSpace`changes.  When running on a system version where this new notification is available, applications should use it instead of
2699    /// `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
2700    /// `backingScaleFactor`and
2701    /// `colorSpace.`You can compare these with the window's new
2702    /// `backingScaleFactor`and
2703    /// `colorSpace`at the time of the notification, to determine which of these two properties (potentially both) changed.
2704    ///
2705    /// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowdidchangebackingpropertiesnotification?language=objc)
2706    pub static NSWindowDidChangeBackingPropertiesNotification: &'static NSNotificationName;
2707}
2708
2709extern "C" {
2710    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsbackingpropertyoldscalefactorkey?language=objc)
2711    pub static NSBackingPropertyOldScaleFactorKey: &'static NSString;
2712}
2713
2714extern "C" {
2715    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsbackingpropertyoldcolorspacekey?language=objc)
2716    pub static NSBackingPropertyOldColorSpaceKey: &'static NSString;
2717}
2718
2719extern "C" {
2720    /// `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
2721    /// `NSWindowDidChangeBackingPropertiesNotification,`which is posted for both color space and resolution changes, and facilitates handling both in a single update and redisplay pass.
2722    ///
2723    /// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowdidchangescreenprofilenotification?language=objc)
2724    pub static NSWindowDidChangeScreenProfileNotification: &'static NSNotificationName;
2725}
2726
2727extern "C" {
2728    /// `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
2729    ///
2730    /// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowwillstartliveresizenotification?language=objc)
2731    pub static NSWindowWillStartLiveResizeNotification: &'static NSNotificationName;
2732}
2733
2734extern "C" {
2735    /// `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
2736    ///
2737    /// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowdidendliveresizenotification?language=objc)
2738    pub static NSWindowDidEndLiveResizeNotification: &'static NSNotificationName;
2739}
2740
2741extern "C" {
2742    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowwillenterfullscreennotification?language=objc)
2743    pub static NSWindowWillEnterFullScreenNotification: &'static NSNotificationName;
2744}
2745
2746extern "C" {
2747    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowdidenterfullscreennotification?language=objc)
2748    pub static NSWindowDidEnterFullScreenNotification: &'static NSNotificationName;
2749}
2750
2751extern "C" {
2752    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowwillexitfullscreennotification?language=objc)
2753    pub static NSWindowWillExitFullScreenNotification: &'static NSNotificationName;
2754}
2755
2756extern "C" {
2757    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowdidexitfullscreennotification?language=objc)
2758    pub static NSWindowDidExitFullScreenNotification: &'static NSNotificationName;
2759}
2760
2761extern "C" {
2762    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowwillenterversionbrowsernotification?language=objc)
2763    pub static NSWindowWillEnterVersionBrowserNotification: &'static NSNotificationName;
2764}
2765
2766extern "C" {
2767    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowdidenterversionbrowsernotification?language=objc)
2768    pub static NSWindowDidEnterVersionBrowserNotification: &'static NSNotificationName;
2769}
2770
2771extern "C" {
2772    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowwillexitversionbrowsernotification?language=objc)
2773    pub static NSWindowWillExitVersionBrowserNotification: &'static NSNotificationName;
2774}
2775
2776extern "C" {
2777    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowdidexitversionbrowsernotification?language=objc)
2778    pub static NSWindowDidExitVersionBrowserNotification: &'static NSNotificationName;
2779}
2780
2781extern "C" {
2782    /// Upon receiving this notification, you can query the
2783    /// `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.
2784    ///
2785    /// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowdidchangeocclusionstatenotification?language=objc)
2786    pub static NSWindowDidChangeOcclusionStateNotification: &'static NSNotificationName;
2787}
2788
2789/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowbackinglocation?language=objc)
2790// NS_ENUM
2791#[deprecated]
2792#[repr(transparent)]
2793#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
2794pub struct NSWindowBackingLocation(pub NSUInteger);
2795impl NSWindowBackingLocation {
2796    #[doc(alias = "NSWindowBackingLocationDefault")]
2797    pub const Default: Self = Self(0);
2798    #[doc(alias = "NSWindowBackingLocationVideoMemory")]
2799    pub const VideoMemory: Self = Self(1);
2800    #[doc(alias = "NSWindowBackingLocationMainMemory")]
2801    pub const MainMemory: Self = Self(2);
2802}
2803
2804unsafe impl Encode for NSWindowBackingLocation {
2805    const ENCODING: Encoding = NSUInteger::ENCODING;
2806}
2807
2808unsafe impl RefEncode for NSWindowBackingLocation {
2809    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
2810}
2811
2812/// NSDeprecated.
2813#[cfg(feature = "NSResponder")]
2814impl NSWindow {
2815    extern_methods!(
2816        #[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"]
2817        #[unsafe(method(cacheImageInRect:))]
2818        #[unsafe(method_family = none)]
2819        pub unsafe fn cacheImageInRect(&self, rect: NSRect);
2820
2821        #[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"]
2822        #[unsafe(method(restoreCachedImage))]
2823        #[unsafe(method_family = none)]
2824        pub unsafe fn restoreCachedImage(&self);
2825
2826        #[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"]
2827        #[unsafe(method(discardCachedImage))]
2828        #[unsafe(method_family = none)]
2829        pub unsafe fn discardCachedImage(&self);
2830
2831        #[cfg(feature = "NSMenu")]
2832        #[deprecated = "This method does not do anything and should not be called."]
2833        #[unsafe(method(menuChanged:))]
2834        #[unsafe(method_family = none)]
2835        pub unsafe fn menuChanged(menu: &NSMenu);
2836
2837        #[deprecated = "This method is unused and should not be called."]
2838        #[unsafe(method(gState))]
2839        #[unsafe(method_family = none)]
2840        pub unsafe fn gState(&self) -> NSInteger;
2841
2842        #[deprecated = "Use -convertRectToScreen: or -convertPointToScreen: instead"]
2843        #[unsafe(method(convertBaseToScreen:))]
2844        #[unsafe(method_family = none)]
2845        pub unsafe fn convertBaseToScreen(&self, point: NSPoint) -> NSPoint;
2846
2847        #[deprecated = "Use -convertRectFromScreen or -convertPointFromScreen: instead"]
2848        #[unsafe(method(convertScreenToBase:))]
2849        #[unsafe(method_family = none)]
2850        pub unsafe fn convertScreenToBase(&self, point: NSPoint) -> NSPoint;
2851
2852        #[cfg(feature = "objc2-core-foundation")]
2853        #[deprecated = "Use -convertRectToBacking: and -backingScaleFactor instead"]
2854        #[unsafe(method(userSpaceScaleFactor))]
2855        #[unsafe(method_family = none)]
2856        pub unsafe fn userSpaceScaleFactor(&self) -> CGFloat;
2857
2858        #[deprecated = "This method does not do anything and should not be called."]
2859        #[unsafe(method(useOptimizedDrawing:))]
2860        #[unsafe(method_family = none)]
2861        pub unsafe fn useOptimizedDrawing(&self, flag: bool);
2862
2863        #[deprecated = "This method does not do anything and should not be called."]
2864        #[unsafe(method(canStoreColor))]
2865        #[unsafe(method_family = none)]
2866        pub unsafe fn canStoreColor(&self) -> bool;
2867
2868        #[deprecated = "Use +[NSAnimationContext runAnimationGroup:completionHandler:] to perform atomic updates across runloop invocations."]
2869        #[unsafe(method(disableFlushWindow))]
2870        #[unsafe(method_family = none)]
2871        pub unsafe fn disableFlushWindow(&self);
2872
2873        #[deprecated = "Use +[NSAnimationContext runAnimationGroup:completionHandler:] to perform atomic updates across runloop invocations."]
2874        #[unsafe(method(enableFlushWindow))]
2875        #[unsafe(method_family = none)]
2876        pub unsafe fn enableFlushWindow(&self);
2877
2878        #[deprecated = "Use +[NSAnimationContext runAnimationGroup:completionHandler:] to perform atomic updates across runloop invocations."]
2879        #[unsafe(method(isFlushWindowDisabled))]
2880        #[unsafe(method_family = none)]
2881        pub unsafe fn isFlushWindowDisabled(&self) -> bool;
2882
2883        #[deprecated = "Allow AppKit's automatic deferred display mechanism to take care of flushing any graphics contexts as needed."]
2884        #[unsafe(method(flushWindow))]
2885        #[unsafe(method_family = none)]
2886        pub unsafe fn flushWindow(&self);
2887
2888        #[deprecated = "Allow AppKit's automatic deferred display mechanism to take care of flushing any graphics contexts as needed."]
2889        #[unsafe(method(flushWindowIfNeeded))]
2890        #[unsafe(method_family = none)]
2891        pub unsafe fn flushWindowIfNeeded(&self);
2892
2893        #[deprecated = "Use +[NSAnimationContext runAnimationGroup:completionHandler:] to temporarily prevent AppKit's automatic deferred display mechanism from drawing."]
2894        #[unsafe(method(isAutodisplay))]
2895        #[unsafe(method_family = none)]
2896        pub unsafe fn isAutodisplay(&self) -> bool;
2897
2898        /// Setter for [`isAutodisplay`][Self::isAutodisplay].
2899        #[deprecated = "Use +[NSAnimationContext runAnimationGroup:completionHandler:] to temporarily prevent AppKit's automatic deferred display mechanism from drawing."]
2900        #[unsafe(method(setAutodisplay:))]
2901        #[unsafe(method_family = none)]
2902        pub unsafe fn setAutodisplay(&self, autodisplay: bool);
2903
2904        #[cfg(feature = "NSGraphicsContext")]
2905        #[deprecated = "Add instances of NSView to display content in a window."]
2906        #[unsafe(method(graphicsContext))]
2907        #[unsafe(method_family = none)]
2908        pub unsafe fn graphicsContext(&self) -> Option<Retained<NSGraphicsContext>>;
2909
2910        #[deprecated = "This property does not do anything and should not be used"]
2911        #[unsafe(method(isOneShot))]
2912        #[unsafe(method_family = none)]
2913        pub unsafe fn isOneShot(&self) -> bool;
2914
2915        /// Setter for [`isOneShot`][Self::isOneShot].
2916        #[deprecated = "This property does not do anything and should not be used"]
2917        #[unsafe(method(setOneShot:))]
2918        #[unsafe(method_family = none)]
2919        pub unsafe fn setOneShot(&self, one_shot: bool);
2920
2921        #[deprecated = "This property does not do anything and should not be used"]
2922        #[unsafe(method(preferredBackingLocation))]
2923        #[unsafe(method_family = none)]
2924        pub unsafe fn preferredBackingLocation(&self) -> NSWindowBackingLocation;
2925
2926        /// Setter for [`preferredBackingLocation`][Self::preferredBackingLocation].
2927        #[deprecated = "This property does not do anything and should not be used"]
2928        #[unsafe(method(setPreferredBackingLocation:))]
2929        #[unsafe(method_family = none)]
2930        pub unsafe fn setPreferredBackingLocation(
2931            &self,
2932            preferred_backing_location: NSWindowBackingLocation,
2933        );
2934
2935        #[deprecated = "This property does not do anything and should not be used"]
2936        #[unsafe(method(backingLocation))]
2937        #[unsafe(method_family = none)]
2938        pub unsafe fn backingLocation(&self) -> NSWindowBackingLocation;
2939
2940        #[deprecated = "This property does not do anything and should not be used."]
2941        #[unsafe(method(showsResizeIndicator))]
2942        #[unsafe(method_family = none)]
2943        pub unsafe fn showsResizeIndicator(&self) -> bool;
2944
2945        /// Setter for [`showsResizeIndicator`][Self::showsResizeIndicator].
2946        #[deprecated = "This property does not do anything and should not be used."]
2947        #[unsafe(method(setShowsResizeIndicator:))]
2948        #[unsafe(method_family = none)]
2949        pub unsafe fn setShowsResizeIndicator(&self, shows_resize_indicator: bool);
2950
2951        #[deprecated = "This method should not be used."]
2952        #[unsafe(method(initWithWindowRef:))]
2953        #[unsafe(method_family = init)]
2954        pub unsafe fn initWithWindowRef(
2955            this: Allocated<Self>,
2956            window_ref: NonNull<c_void>,
2957        ) -> Option<Retained<NSWindow>>;
2958
2959        #[deprecated = "This method should not be used."]
2960        #[unsafe(method(windowRef))]
2961        #[unsafe(method_family = none)]
2962        pub unsafe fn windowRef(&self) -> NonNull<c_void>;
2963
2964        #[deprecated = "This method does not do anything and should not be called."]
2965        #[unsafe(method(disableScreenUpdatesUntilFlush))]
2966        #[unsafe(method_family = none)]
2967        pub unsafe fn disableScreenUpdatesUntilFlush(&self);
2968    );
2969}
2970
2971/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsborderlesswindowmask?language=objc)
2972pub static NSBorderlessWindowMask: NSWindowStyleMask =
2973    NSWindowStyleMask(NSWindowStyleMask::Borderless.0);
2974
2975/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstitledwindowmask?language=objc)
2976pub static NSTitledWindowMask: NSWindowStyleMask = NSWindowStyleMask(NSWindowStyleMask::Titled.0);
2977
2978/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsclosablewindowmask?language=objc)
2979pub static NSClosableWindowMask: NSWindowStyleMask =
2980    NSWindowStyleMask(NSWindowStyleMask::Closable.0);
2981
2982/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsminiaturizablewindowmask?language=objc)
2983pub static NSMiniaturizableWindowMask: NSWindowStyleMask =
2984    NSWindowStyleMask(NSWindowStyleMask::Miniaturizable.0);
2985
2986/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsresizablewindowmask?language=objc)
2987pub static NSResizableWindowMask: NSWindowStyleMask =
2988    NSWindowStyleMask(NSWindowStyleMask::Resizable.0);
2989
2990/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstexturedbackgroundwindowmask?language=objc)
2991pub static NSTexturedBackgroundWindowMask: NSWindowStyleMask =
2992    NSWindowStyleMask(NSWindowStyleMask::TexturedBackground.0);
2993
2994/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsunifiedtitleandtoolbarwindowmask?language=objc)
2995pub static NSUnifiedTitleAndToolbarWindowMask: NSWindowStyleMask =
2996    NSWindowStyleMask(NSWindowStyleMask::UnifiedTitleAndToolbar.0);
2997
2998/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsfullscreenwindowmask?language=objc)
2999pub static NSFullScreenWindowMask: NSWindowStyleMask =
3000    NSWindowStyleMask(NSWindowStyleMask::FullScreen.0);
3001
3002/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsfullsizecontentviewwindowmask?language=objc)
3003pub static NSFullSizeContentViewWindowMask: NSWindowStyleMask =
3004    NSWindowStyleMask(NSWindowStyleMask::FullSizeContentView.0);
3005
3006/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsutilitywindowmask?language=objc)
3007pub static NSUtilityWindowMask: NSWindowStyleMask =
3008    NSWindowStyleMask(NSWindowStyleMask::UtilityWindow.0);
3009
3010/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdocmodalwindowmask?language=objc)
3011pub static NSDocModalWindowMask: NSWindowStyleMask =
3012    NSWindowStyleMask(NSWindowStyleMask::DocModalWindow.0);
3013
3014/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsnonactivatingpanelmask?language=objc)
3015pub static NSNonactivatingPanelMask: NSWindowStyleMask =
3016    NSWindowStyleMask(NSWindowStyleMask::NonactivatingPanel.0);
3017
3018/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nshudwindowmask?language=objc)
3019pub static NSHUDWindowMask: NSWindowStyleMask = NSWindowStyleMask(NSWindowStyleMask::HUDWindow.0);
3020
3021/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsunscaledwindowmask?language=objc)
3022pub static NSUnscaledWindowMask: NSWindowStyleMask = NSWindowStyleMask(1 << 11);
3023
3024/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowfullscreenbutton?language=objc)
3025pub static NSWindowFullScreenButton: NSWindowButton = NSWindowButton(7);
3026
3027/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdockwindowlevel?language=objc)
3028pub static NSDockWindowLevel: NSWindowLevel = 20;
3029
3030/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowsharingreadwrite?language=objc)
3031pub static NSWindowSharingReadWrite: NSWindowSharingType = NSWindowSharingType(2);