1use 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#[cfg(feature = "NSApplication")]
17pub static NSAppKitVersionNumberWithCustomSheetPosition: NSAppKitVersion = 686.0 as _;
18
19#[cfg(feature = "NSApplication")]
21pub static NSAppKitVersionNumberWithDeferredWindowDisplaySupport: NSAppKitVersion = 1019.0 as _;
22
23#[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#[cfg(feature = "NSApplication")]
70pub static NSModalResponseOK: NSModalResponse = 1;
71
72#[cfg(feature = "NSApplication")]
74pub static NSModalResponseCancel: NSModalResponse = 0;
75
76pub const NSDisplayWindowRunLoopOrdering: c_uint = 600000;
78pub const NSResetCursorRectsRunLoopOrdering: c_uint = 700000;
80
81#[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#[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#[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#[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#[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
263pub type NSWindowLevel = NSInteger;
266
267pub static NSNormalWindowLevel: NSWindowLevel = 0;
269
270pub static NSFloatingWindowLevel: NSWindowLevel = 3;
272
273pub static NSSubmenuWindowLevel: NSWindowLevel = 3;
275
276pub static NSTornOffMenuWindowLevel: NSWindowLevel = 3;
278
279pub static NSMainMenuWindowLevel: NSWindowLevel = 24;
281
282pub static NSStatusWindowLevel: NSWindowLevel = 25;
284
285pub static NSModalPanelWindowLevel: NSWindowLevel = 8;
287
288pub static NSPopUpMenuWindowLevel: NSWindowLevel = 101;
290
291pub static NSScreenSaverWindowLevel: NSWindowLevel = 1000;
293
294#[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#[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#[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#[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
392pub static NSEventDurationForever: NSTimeInterval = c_double::MAX as _;
394
395#[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#[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#[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
463pub type NSWindowFrameAutosaveName = NSString;
465
466pub type NSWindowPersistableFrameDescriptor = NSString;
468
469pub type NSWindowTabbingIdentifier = NSString;
471
472extern_class!(
473 #[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 #[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 #[unsafe(method(setTitle:))]
605 #[unsafe(method_family = none)]
606 pub fn setTitle(&self, title: &NSString);
607
608 #[unsafe(method(subtitle))]
611 #[unsafe(method_family = none)]
612 pub fn subtitle(&self) -> Retained<NSString>;
613
614 #[unsafe(method(setSubtitle:))]
618 #[unsafe(method_family = none)]
619 pub fn setSubtitle(&self, subtitle: &NSString);
620
621 #[unsafe(method(titleVisibility))]
623 #[unsafe(method_family = none)]
624 pub fn titleVisibility(&self) -> NSWindowTitleVisibility;
625
626 #[unsafe(method(setTitleVisibility:))]
628 #[unsafe(method_family = none)]
629 pub fn setTitleVisibility(&self, title_visibility: NSWindowTitleVisibility);
630
631 #[unsafe(method(titlebarAppearsTransparent))]
635 #[unsafe(method_family = none)]
636 pub fn titlebarAppearsTransparent(&self) -> bool;
637
638 #[unsafe(method(setTitlebarAppearsTransparent:))]
640 #[unsafe(method_family = none)]
641 pub fn setTitlebarAppearsTransparent(&self, titlebar_appears_transparent: bool);
642
643 #[unsafe(method(toolbarStyle))]
645 #[unsafe(method_family = none)]
646 pub fn toolbarStyle(&self) -> NSWindowToolbarStyle;
647
648 #[unsafe(method(setToolbarStyle:))]
650 #[unsafe(method_family = none)]
651 pub fn setToolbarStyle(&self, toolbar_style: NSWindowToolbarStyle);
652
653 #[unsafe(method(contentLayoutRect))]
659 #[unsafe(method_family = none)]
660 pub fn contentLayoutRect(&self) -> NSRect;
661
662 #[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 #[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 #[unsafe(method(representedURL))]
724 #[unsafe(method_family = none)]
725 pub fn representedURL(&self) -> Option<Retained<NSURL>>;
726
727 #[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 #[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 #[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 #[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 #[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 #[unsafe(method(styleMask))]
789 #[unsafe(method_family = none)]
790 pub fn styleMask(&self) -> NSWindowStyleMask;
791
792 #[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 #[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 #[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 #[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 #[unsafe(method(animationResizeTime:))]
859 #[unsafe(method_family = none)]
860 pub fn animationResizeTime(&self, new_frame: NSRect) -> NSTimeInterval;
861
862 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[unsafe(method(setHidesOnDeactivate:))]
1072 #[unsafe(method_family = none)]
1073 pub fn setHidesOnDeactivate(&self, hides_on_deactivate: bool);
1074
1075 #[unsafe(method(canHide))]
1078 #[unsafe(method_family = none)]
1079 pub fn canHide(&self) -> bool;
1080
1081 #[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 #[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 #[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 #[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 #[unsafe(method(makeKeyWindow))]
1173 #[unsafe(method_family = none)]
1174 pub fn makeKeyWindow(&self);
1175
1176 #[unsafe(method(makeMainWindow))]
1178 #[unsafe(method_family = none)]
1179 pub fn makeMainWindow(&self);
1180
1181 #[unsafe(method(becomeKeyWindow))]
1183 #[unsafe(method_family = none)]
1184 pub fn becomeKeyWindow(&self);
1185
1186 #[unsafe(method(resignKeyWindow))]
1188 #[unsafe(method_family = none)]
1189 pub fn resignKeyWindow(&self);
1190
1191 #[unsafe(method(becomeMainWindow))]
1193 #[unsafe(method_family = none)]
1194 pub fn becomeMainWindow(&self);
1195
1196 #[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 #[unsafe(method(preventsApplicationTerminationWhenModal))]
1209 #[unsafe(method_family = none)]
1210 pub fn preventsApplicationTerminationWhenModal(&self) -> bool;
1211
1212 #[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 #[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 #[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 #[unsafe(method(allowsToolTipsWhenApplicationIsInactive))]
1298 #[unsafe(method_family = none)]
1299 pub fn allowsToolTipsWhenApplicationIsInactive(&self) -> bool;
1300
1301 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[unsafe(method(setOpaque:))]
1389 #[unsafe(method_family = none)]
1390 pub fn setOpaque(&self, opaque: bool);
1391
1392 #[unsafe(method(sharingType))]
1396 #[unsafe(method_family = none)]
1397 pub fn sharingType(&self) -> NSWindowSharingType;
1398
1399 #[unsafe(method(setSharingType:))]
1401 #[unsafe(method_family = none)]
1402 pub fn setSharingType(&self, sharing_type: NSWindowSharingType);
1403
1404 #[unsafe(method(allowsConcurrentViewDrawing))]
1409 #[unsafe(method_family = none)]
1410 pub fn allowsConcurrentViewDrawing(&self) -> bool;
1411
1412 #[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 #[unsafe(method(setDisplaysWhenScreenProfileChanges:))]
1423 #[unsafe(method_family = none)]
1424 pub fn setDisplaysWhenScreenProfileChanges(
1425 &self,
1426 displays_when_screen_profile_changes: bool,
1427 );
1428
1429 #[unsafe(method(canBecomeVisibleWithoutLogin))]
1431 #[unsafe(method_family = none)]
1432 pub fn canBecomeVisibleWithoutLogin(&self) -> bool;
1433
1434 #[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 #[unsafe(method(setCollectionBehavior:))]
1445 #[unsafe(method_family = none)]
1446 pub fn setCollectionBehavior(&self, collection_behavior: NSWindowCollectionBehavior);
1447
1448 #[unsafe(method(animationBehavior))]
1452 #[unsafe(method_family = none)]
1453 pub fn animationBehavior(&self) -> NSWindowAnimationBehavior;
1454
1455 #[unsafe(method(setAnimationBehavior:))]
1457 #[unsafe(method_family = none)]
1458 pub fn setAnimationBehavior(&self, animation_behavior: NSWindowAnimationBehavior);
1459
1460 #[unsafe(method(isOnActiveSpace))]
1463 #[unsafe(method_family = none)]
1464 pub fn isOnActiveSpace(&self) -> bool;
1465
1466 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[unsafe(method(sheets))]
1613 #[unsafe(method_family = none)]
1614 pub fn sheets(&self) -> Retained<NSArray<NSWindow>>;
1615
1616 #[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 #[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 #[unsafe(method(setParentWindow:))]
1672 #[unsafe(method_family = none)]
1673 pub unsafe fn setParentWindow(&self, parent_window: Option<&NSWindow>);
1674
1675 #[cfg(feature = "NSAppearance")]
1676 #[unsafe(method(appearanceSource))]
1678 #[unsafe(method_family = none)]
1679 pub fn appearanceSource(&self) -> Option<Retained<NSObject>>;
1680
1681 #[cfg(feature = "NSAppearance")]
1682 #[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 #[unsafe(method(setColorSpace:))]
1702 #[unsafe(method_family = none)]
1703 pub fn setColorSpace(&self, color_space: Option<&NSColorSpace>);
1704
1705 #[cfg(feature = "NSGraphics")]
1706 #[unsafe(method(canRepresentDisplayGamut:))]
1710 #[unsafe(method_family = none)]
1711 pub fn canRepresentDisplayGamut(&self, display_gamut: NSDisplayGamut) -> bool;
1712
1713 #[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 #[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 #[unsafe(method(titlebarSeparatorStyle))]
1748 #[unsafe(method_family = none)]
1749 pub fn titlebarSeparatorStyle(&self) -> NSTitlebarSeparatorStyle;
1750
1751 #[unsafe(method(setTitlebarSeparatorStyle:))]
1753 #[unsafe(method_family = none)]
1754 pub fn setTitlebarSeparatorStyle(&self, titlebar_separator_style: NSTitlebarSeparatorStyle);
1755
1756 #[cfg(feature = "NSViewController")]
1757 #[unsafe(method(contentViewController))]
1761 #[unsafe(method_family = none)]
1762 pub fn contentViewController(&self) -> Option<Retained<NSViewController>>;
1763
1764 #[cfg(feature = "NSViewController")]
1765 #[unsafe(method(setContentViewController:))]
1767 #[unsafe(method_family = none)]
1768 pub fn setContentViewController(&self, content_view_controller: Option<&NSViewController>);
1769
1770 #[cfg(feature = "NSViewController")]
1771 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[unsafe(method(allowsAutomaticWindowTabbing))]
1885 #[unsafe(method_family = none)]
1886 pub fn allowsAutomaticWindowTabbing(mtm: MainThreadMarker) -> bool;
1887
1888 #[unsafe(method(setAllowsAutomaticWindowTabbing:))]
1890 #[unsafe(method_family = none)]
1891 pub fn setAllowsAutomaticWindowTabbing(
1892 allows_automatic_window_tabbing: bool,
1893 mtm: MainThreadMarker,
1894 );
1895
1896 #[unsafe(method(userTabbingPreference))]
1898 #[unsafe(method_family = none)]
1899 pub fn userTabbingPreference(mtm: MainThreadMarker) -> NSWindowUserTabbingPreference;
1900
1901 #[unsafe(method(tabbingMode))]
1906 #[unsafe(method_family = none)]
1907 pub fn tabbingMode(&self) -> NSWindowTabbingMode;
1908
1909 #[unsafe(method(setTabbingMode:))]
1911 #[unsafe(method_family = none)]
1912 pub fn setTabbingMode(&self, tabbing_mode: NSWindowTabbingMode);
1913
1914 #[unsafe(method(tabbingIdentifier))]
1919 #[unsafe(method_family = none)]
1920 pub fn tabbingIdentifier(&self) -> Retained<NSWindowTabbingIdentifier>;
1921
1922 #[unsafe(method(setTabbingIdentifier:))]
1926 #[unsafe(method_family = none)]
1927 pub fn setTabbingIdentifier(&self, tabbing_identifier: &NSWindowTabbingIdentifier);
1928
1929 #[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 #[unsafe(method(toggleTabOverview:))]
1953 #[unsafe(method_family = none)]
1954 pub fn toggleTabOverview(&self, sender: Option<&AnyObject>);
1955
1956 #[unsafe(method(tabbedWindows))]
1958 #[unsafe(method_family = none)]
1959 pub fn tabbedWindows(&self) -> Option<Retained<NSArray<NSWindow>>>;
1960
1961 #[cfg(feature = "NSGraphics")]
1962 #[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 #[unsafe(method(tab))]
1971 #[unsafe(method_family = none)]
1972 pub fn tab(&self) -> Retained<NSWindowTab>;
1973
1974 #[cfg(feature = "NSWindowTabGroup")]
1975 #[unsafe(method(tabGroup))]
1978 #[unsafe(method_family = none)]
1979 pub fn tabGroup(&self) -> Option<Retained<NSWindowTabGroup>>;
1980
1981 #[cfg(feature = "block2")]
1982 #[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 #[unsafe(method(hasActiveWindowSharingSession))]
1998 #[unsafe(method_family = none)]
1999 pub fn hasActiveWindowSharingSession(&self) -> bool;
2000
2001 #[cfg(feature = "block2")]
2002 #[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 #[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 #[unsafe(method(windowTitlebarLayoutDirection))]
2037 #[unsafe(method_family = none)]
2038 pub fn windowTitlebarLayoutDirection(&self) -> NSUserInterfaceLayoutDirection;
2039 );
2040}
2041
2042#[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#[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#[cfg(feature = "NSResponder")]
2064impl NSWindow {
2065 extern_methods!(
2066 #[cfg(all(feature = "NSEvent", feature = "block2"))]
2067 #[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 #[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 #[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#[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#[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 #[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#[cfg(feature = "NSResponder")]
2225impl NSWindow {
2226 extern_methods!(
2227 #[cfg(feature = "objc2-quartz-core")]
2228 #[cfg(target_vendor = "apple")]
2229 #[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 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 #[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 #[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 #[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 #[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 #[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 #[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 #[optional]
2381 #[unsafe(method(windowDidFailToEnterFullScreen:))]
2382 #[unsafe(method_family = none)]
2383 fn windowDidFailToEnterFullScreen(&self, window: &NSWindow);
2384
2385 #[cfg(feature = "NSResponder")]
2386 #[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 #[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 #[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 #[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 #[optional]
2432 #[unsafe(method(windowDidFailToExitFullScreen:))]
2433 #[unsafe(method_family = none)]
2434 fn windowDidFailToExitFullScreen(&self, window: &NSWindow);
2435
2436 #[cfg(feature = "NSResponder")]
2437 #[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 #[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 #[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 #[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 #[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 pub static NSWindowDidBecomeKeyNotification: &'static NSNotificationName;
2643}
2644
2645extern "C" {
2646 pub static NSWindowDidBecomeMainNotification: &'static NSNotificationName;
2648}
2649
2650extern "C" {
2651 pub static NSWindowDidChangeScreenNotification: &'static NSNotificationName;
2653}
2654
2655extern "C" {
2656 pub static NSWindowDidDeminiaturizeNotification: &'static NSNotificationName;
2658}
2659
2660extern "C" {
2661 pub static NSWindowDidExposeNotification: &'static NSNotificationName;
2663}
2664
2665extern "C" {
2666 pub static NSWindowDidMiniaturizeNotification: &'static NSNotificationName;
2668}
2669
2670extern "C" {
2671 pub static NSWindowDidMoveNotification: &'static NSNotificationName;
2673}
2674
2675extern "C" {
2676 pub static NSWindowDidResignKeyNotification: &'static NSNotificationName;
2678}
2679
2680extern "C" {
2681 pub static NSWindowDidResignMainNotification: &'static NSNotificationName;
2683}
2684
2685extern "C" {
2686 pub static NSWindowDidResizeNotification: &'static NSNotificationName;
2688}
2689
2690extern "C" {
2691 pub static NSWindowDidUpdateNotification: &'static NSNotificationName;
2693}
2694
2695extern "C" {
2696 pub static NSWindowWillCloseNotification: &'static NSNotificationName;
2698}
2699
2700extern "C" {
2701 pub static NSWindowWillMiniaturizeNotification: &'static NSNotificationName;
2703}
2704
2705extern "C" {
2706 pub static NSWindowWillMoveNotification: &'static NSNotificationName;
2708}
2709
2710extern "C" {
2711 pub static NSWindowWillBeginSheetNotification: &'static NSNotificationName;
2713}
2714
2715extern "C" {
2716 pub static NSWindowDidEndSheetNotification: &'static NSNotificationName;
2718}
2719
2720extern "C" {
2721 pub static NSWindowDidChangeBackingPropertiesNotification: &'static NSNotificationName;
2732}
2733
2734extern "C" {
2735 pub static NSBackingPropertyOldScaleFactorKey: &'static NSString;
2737}
2738
2739extern "C" {
2740 pub static NSBackingPropertyOldColorSpaceKey: &'static NSString;
2742}
2743
2744extern "C" {
2745 pub static NSWindowDidChangeScreenProfileNotification: &'static NSNotificationName;
2750}
2751
2752extern "C" {
2753 pub static NSWindowWillStartLiveResizeNotification: &'static NSNotificationName;
2757}
2758
2759extern "C" {
2760 pub static NSWindowDidEndLiveResizeNotification: &'static NSNotificationName;
2764}
2765
2766extern "C" {
2767 pub static NSWindowWillEnterFullScreenNotification: &'static NSNotificationName;
2769}
2770
2771extern "C" {
2772 pub static NSWindowDidEnterFullScreenNotification: &'static NSNotificationName;
2774}
2775
2776extern "C" {
2777 pub static NSWindowWillExitFullScreenNotification: &'static NSNotificationName;
2779}
2780
2781extern "C" {
2782 pub static NSWindowDidExitFullScreenNotification: &'static NSNotificationName;
2784}
2785
2786extern "C" {
2787 pub static NSWindowWillEnterVersionBrowserNotification: &'static NSNotificationName;
2789}
2790
2791extern "C" {
2792 pub static NSWindowDidEnterVersionBrowserNotification: &'static NSNotificationName;
2794}
2795
2796extern "C" {
2797 pub static NSWindowWillExitVersionBrowserNotification: &'static NSNotificationName;
2799}
2800
2801extern "C" {
2802 pub static NSWindowDidExitVersionBrowserNotification: &'static NSNotificationName;
2804}
2805
2806extern "C" {
2807 pub static NSWindowDidChangeOcclusionStateNotification: &'static NSNotificationName;
2812}
2813
2814#[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#[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 #[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 #[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 #[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 #[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 #[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#[deprecated]
3001pub static NSBorderlessWindowMask: NSWindowStyleMask =
3002 NSWindowStyleMask(NSWindowStyleMask::Borderless.0);
3003
3004#[deprecated]
3006pub static NSTitledWindowMask: NSWindowStyleMask = NSWindowStyleMask(NSWindowStyleMask::Titled.0);
3007
3008#[deprecated]
3010pub static NSClosableWindowMask: NSWindowStyleMask =
3011 NSWindowStyleMask(NSWindowStyleMask::Closable.0);
3012
3013#[deprecated]
3015pub static NSMiniaturizableWindowMask: NSWindowStyleMask =
3016 NSWindowStyleMask(NSWindowStyleMask::Miniaturizable.0);
3017
3018#[deprecated]
3020pub static NSResizableWindowMask: NSWindowStyleMask =
3021 NSWindowStyleMask(NSWindowStyleMask::Resizable.0);
3022
3023#[deprecated]
3025pub static NSTexturedBackgroundWindowMask: NSWindowStyleMask =
3026 NSWindowStyleMask(NSWindowStyleMask::TexturedBackground.0);
3027
3028#[deprecated]
3030pub static NSUnifiedTitleAndToolbarWindowMask: NSWindowStyleMask =
3031 NSWindowStyleMask(NSWindowStyleMask::UnifiedTitleAndToolbar.0);
3032
3033#[deprecated]
3035pub static NSFullScreenWindowMask: NSWindowStyleMask =
3036 NSWindowStyleMask(NSWindowStyleMask::FullScreen.0);
3037
3038#[deprecated]
3040pub static NSFullSizeContentViewWindowMask: NSWindowStyleMask =
3041 NSWindowStyleMask(NSWindowStyleMask::FullSizeContentView.0);
3042
3043#[deprecated]
3045pub static NSUtilityWindowMask: NSWindowStyleMask =
3046 NSWindowStyleMask(NSWindowStyleMask::UtilityWindow.0);
3047
3048#[deprecated]
3050pub static NSDocModalWindowMask: NSWindowStyleMask =
3051 NSWindowStyleMask(NSWindowStyleMask::DocModalWindow.0);
3052
3053#[deprecated]
3055pub static NSNonactivatingPanelMask: NSWindowStyleMask =
3056 NSWindowStyleMask(NSWindowStyleMask::NonactivatingPanel.0);
3057
3058#[deprecated]
3060pub static NSHUDWindowMask: NSWindowStyleMask = NSWindowStyleMask(NSWindowStyleMask::HUDWindow.0);
3061
3062#[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#[deprecated = "The standard window button for NSWindowFullScreenButton is always nil; use NSWindowZoomButton instead"]
3068pub static NSWindowFullScreenButton: NSWindowButton = NSWindowButton(7);
3069
3070#[deprecated]
3072pub static NSDockWindowLevel: NSWindowLevel = 20;
3073
3074#[deprecated = "Use NSWindowSharingReadOnly instead"]
3076pub static NSWindowSharingReadWrite: NSWindowSharingType = NSWindowSharingType(2);