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