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)]
143#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
144pub struct NSWindowCollectionBehavior(pub NSUInteger);
145bitflags::bitflags! {
146 impl NSWindowCollectionBehavior: NSUInteger {
147 #[doc(alias = "NSWindowCollectionBehaviorDefault")]
148 const Default = 0;
149 #[doc(alias = "NSWindowCollectionBehaviorCanJoinAllSpaces")]
150 const CanJoinAllSpaces = 1<<0;
151 #[doc(alias = "NSWindowCollectionBehaviorMoveToActiveSpace")]
152 const MoveToActiveSpace = 1<<1;
153 #[doc(alias = "NSWindowCollectionBehaviorManaged")]
154 const Managed = 1<<2;
155 #[doc(alias = "NSWindowCollectionBehaviorTransient")]
156 const Transient = 1<<3;
157 #[doc(alias = "NSWindowCollectionBehaviorStationary")]
158 const Stationary = 1<<4;
159 #[doc(alias = "NSWindowCollectionBehaviorParticipatesInCycle")]
160 const ParticipatesInCycle = 1<<5;
161 #[doc(alias = "NSWindowCollectionBehaviorIgnoresCycle")]
162 const IgnoresCycle = 1<<6;
163 #[doc(alias = "NSWindowCollectionBehaviorFullScreenPrimary")]
164 const FullScreenPrimary = 1<<7;
165 #[doc(alias = "NSWindowCollectionBehaviorFullScreenAuxiliary")]
166 const FullScreenAuxiliary = 1<<8;
167 #[doc(alias = "NSWindowCollectionBehaviorFullScreenNone")]
168 const FullScreenNone = 1<<9;
169 #[doc(alias = "NSWindowCollectionBehaviorFullScreenAllowsTiling")]
170 const FullScreenAllowsTiling = 1<<11;
171 #[doc(alias = "NSWindowCollectionBehaviorFullScreenDisallowsTiling")]
172 const FullScreenDisallowsTiling = 1<<12;
173 #[doc(alias = "NSWindowCollectionBehaviorPrimary")]
174 const Primary = 1<<16;
175 #[doc(alias = "NSWindowCollectionBehaviorAuxiliary")]
176 const Auxiliary = 1<<17;
177 #[doc(alias = "NSWindowCollectionBehaviorCanJoinAllApplications")]
178 const CanJoinAllApplications = 1<<18;
179 }
180}
181
182unsafe impl Encode for NSWindowCollectionBehavior {
183 const ENCODING: Encoding = NSUInteger::ENCODING;
184}
185
186unsafe impl RefEncode for NSWindowCollectionBehavior {
187 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
188}
189
190#[repr(transparent)]
193#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
194pub struct NSWindowAnimationBehavior(pub NSInteger);
195impl NSWindowAnimationBehavior {
196 #[doc(alias = "NSWindowAnimationBehaviorDefault")]
197 pub const Default: Self = Self(0);
198 #[doc(alias = "NSWindowAnimationBehaviorNone")]
199 pub const None: Self = Self(2);
200 #[doc(alias = "NSWindowAnimationBehaviorDocumentWindow")]
201 pub const DocumentWindow: Self = Self(3);
202 #[doc(alias = "NSWindowAnimationBehaviorUtilityWindow")]
203 pub const UtilityWindow: Self = Self(4);
204 #[doc(alias = "NSWindowAnimationBehaviorAlertPanel")]
205 pub const AlertPanel: Self = Self(5);
206}
207
208unsafe impl Encode for NSWindowAnimationBehavior {
209 const ENCODING: Encoding = NSInteger::ENCODING;
210}
211
212unsafe impl RefEncode for NSWindowAnimationBehavior {
213 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
214}
215
216#[repr(transparent)]
221#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
222pub struct NSWindowNumberListOptions(pub NSUInteger);
223bitflags::bitflags! {
224 impl NSWindowNumberListOptions: NSUInteger {
225 #[doc(alias = "NSWindowNumberListAllApplications")]
226 const AllApplications = 1<<0;
227 #[doc(alias = "NSWindowNumberListAllSpaces")]
228 const AllSpaces = 1<<4;
229 }
230}
231
232unsafe impl Encode for NSWindowNumberListOptions {
233 const ENCODING: Encoding = NSUInteger::ENCODING;
234}
235
236unsafe impl RefEncode for NSWindowNumberListOptions {
237 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
238}
239
240#[repr(transparent)]
243#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
244pub struct NSWindowOcclusionState(pub NSUInteger);
245bitflags::bitflags! {
246 impl NSWindowOcclusionState: NSUInteger {
247 #[doc(alias = "NSWindowOcclusionStateVisible")]
248 const Visible = 1<<1;
249 }
250}
251
252unsafe impl Encode for NSWindowOcclusionState {
253 const ENCODING: Encoding = NSUInteger::ENCODING;
254}
255
256unsafe impl RefEncode for NSWindowOcclusionState {
257 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
258}
259
260pub type NSWindowLevel = NSInteger;
263
264pub static NSNormalWindowLevel: NSWindowLevel = 0;
266
267pub static NSFloatingWindowLevel: NSWindowLevel = 3;
269
270pub static NSSubmenuWindowLevel: NSWindowLevel = 3;
272
273pub static NSTornOffMenuWindowLevel: NSWindowLevel = 3;
275
276pub static NSMainMenuWindowLevel: NSWindowLevel = 24;
278
279pub static NSStatusWindowLevel: NSWindowLevel = 25;
281
282pub static NSModalPanelWindowLevel: NSWindowLevel = 8;
284
285pub static NSPopUpMenuWindowLevel: NSWindowLevel = 101;
287
288pub static NSScreenSaverWindowLevel: NSWindowLevel = 1000;
290
291#[repr(transparent)]
294#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
295pub struct NSSelectionDirection(pub NSUInteger);
296impl NSSelectionDirection {
297 #[doc(alias = "NSDirectSelection")]
298 pub const DirectSelection: Self = Self(0);
299 #[doc(alias = "NSSelectingNext")]
300 pub const SelectingNext: Self = Self(1);
301 #[doc(alias = "NSSelectingPrevious")]
302 pub const SelectingPrevious: Self = Self(2);
303}
304
305unsafe impl Encode for NSSelectionDirection {
306 const ENCODING: Encoding = NSUInteger::ENCODING;
307}
308
309unsafe impl RefEncode for NSSelectionDirection {
310 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
311}
312
313#[repr(transparent)]
318#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
319pub struct NSWindowButton(pub NSUInteger);
320impl NSWindowButton {
321 #[doc(alias = "NSWindowCloseButton")]
322 pub const CloseButton: Self = Self(0);
323 #[doc(alias = "NSWindowMiniaturizeButton")]
324 pub const MiniaturizeButton: Self = Self(1);
325 #[doc(alias = "NSWindowZoomButton")]
326 pub const ZoomButton: Self = Self(2);
327 #[doc(alias = "NSWindowToolbarButton")]
328 pub const ToolbarButton: Self = Self(3);
329 #[doc(alias = "NSWindowDocumentIconButton")]
330 pub const DocumentIconButton: Self = Self(4);
331 #[doc(alias = "NSWindowDocumentVersionsButton")]
332 pub const DocumentVersionsButton: Self = Self(6);
333}
334
335unsafe impl Encode for NSWindowButton {
336 const ENCODING: Encoding = NSUInteger::ENCODING;
337}
338
339unsafe impl RefEncode for NSWindowButton {
340 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
341}
342
343#[repr(transparent)]
346#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
347pub struct NSWindowTitleVisibility(pub NSInteger);
348impl NSWindowTitleVisibility {
349 #[doc(alias = "NSWindowTitleVisible")]
350 pub const Visible: Self = Self(0);
351 #[doc(alias = "NSWindowTitleHidden")]
352 pub const Hidden: Self = Self(1);
353}
354
355unsafe impl Encode for NSWindowTitleVisibility {
356 const ENCODING: Encoding = NSInteger::ENCODING;
357}
358
359unsafe impl RefEncode for NSWindowTitleVisibility {
360 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
361}
362
363#[repr(transparent)]
366#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
367pub struct NSWindowToolbarStyle(pub NSInteger);
368impl NSWindowToolbarStyle {
369 #[doc(alias = "NSWindowToolbarStyleAutomatic")]
370 pub const Automatic: Self = Self(0);
371 #[doc(alias = "NSWindowToolbarStyleExpanded")]
372 pub const Expanded: Self = Self(1);
373 #[doc(alias = "NSWindowToolbarStylePreference")]
374 pub const Preference: Self = Self(2);
375 #[doc(alias = "NSWindowToolbarStyleUnified")]
376 pub const Unified: Self = Self(3);
377 #[doc(alias = "NSWindowToolbarStyleUnifiedCompact")]
378 pub const UnifiedCompact: Self = Self(4);
379}
380
381unsafe impl Encode for NSWindowToolbarStyle {
382 const ENCODING: Encoding = NSInteger::ENCODING;
383}
384
385unsafe impl RefEncode for NSWindowToolbarStyle {
386 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
387}
388
389pub static NSEventDurationForever: NSTimeInterval = c_double::MAX as _;
391
392#[repr(transparent)]
395#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
396pub struct NSWindowUserTabbingPreference(pub NSInteger);
397impl NSWindowUserTabbingPreference {
398 #[doc(alias = "NSWindowUserTabbingPreferenceManual")]
399 pub const Manual: Self = Self(0);
400 #[doc(alias = "NSWindowUserTabbingPreferenceAlways")]
401 pub const Always: Self = Self(1);
402 #[doc(alias = "NSWindowUserTabbingPreferenceInFullScreen")]
403 pub const InFullScreen: Self = Self(2);
404}
405
406unsafe impl Encode for NSWindowUserTabbingPreference {
407 const ENCODING: Encoding = NSInteger::ENCODING;
408}
409
410unsafe impl RefEncode for NSWindowUserTabbingPreference {
411 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
412}
413
414#[repr(transparent)]
417#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
418pub struct NSWindowTabbingMode(pub NSInteger);
419impl NSWindowTabbingMode {
420 #[doc(alias = "NSWindowTabbingModeAutomatic")]
421 pub const Automatic: Self = Self(0);
422 #[doc(alias = "NSWindowTabbingModePreferred")]
423 pub const Preferred: Self = Self(1);
424 #[doc(alias = "NSWindowTabbingModeDisallowed")]
425 pub const Disallowed: Self = Self(2);
426}
427
428unsafe impl Encode for NSWindowTabbingMode {
429 const ENCODING: Encoding = NSInteger::ENCODING;
430}
431
432unsafe impl RefEncode for NSWindowTabbingMode {
433 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
434}
435
436#[repr(transparent)]
439#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
440pub struct NSTitlebarSeparatorStyle(pub NSInteger);
441impl NSTitlebarSeparatorStyle {
442 #[doc(alias = "NSTitlebarSeparatorStyleAutomatic")]
443 pub const Automatic: Self = Self(0);
444 #[doc(alias = "NSTitlebarSeparatorStyleNone")]
445 pub const None: Self = Self(1);
446 #[doc(alias = "NSTitlebarSeparatorStyleLine")]
447 pub const Line: Self = Self(2);
448 #[doc(alias = "NSTitlebarSeparatorStyleShadow")]
449 pub const Shadow: Self = Self(3);
450}
451
452unsafe impl Encode for NSTitlebarSeparatorStyle {
453 const ENCODING: Encoding = NSInteger::ENCODING;
454}
455
456unsafe impl RefEncode for NSTitlebarSeparatorStyle {
457 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
458}
459
460pub type NSWindowFrameAutosaveName = NSString;
462
463pub type NSWindowPersistableFrameDescriptor = NSString;
465
466pub type NSWindowTabbingIdentifier = NSString;
468
469extern_class!(
470 #[unsafe(super(NSResponder, NSObject))]
472 #[thread_kind = MainThreadOnly]
473 #[derive(Debug, PartialEq, Eq, Hash)]
474 #[cfg(feature = "NSResponder")]
475 pub struct NSWindow;
476);
477
478#[cfg(all(feature = "NSAccessibilityProtocols", feature = "NSResponder"))]
479extern_conformance!(
480 unsafe impl NSAccessibility for NSWindow {}
481);
482
483#[cfg(all(feature = "NSAccessibilityProtocols", feature = "NSResponder"))]
484extern_conformance!(
485 unsafe impl NSAccessibilityElementProtocol for NSWindow {}
486);
487
488#[cfg(all(feature = "NSAnimation", feature = "NSResponder"))]
489extern_conformance!(
490 unsafe impl NSAnimatablePropertyContainer for NSWindow {}
491);
492
493#[cfg(all(feature = "NSAppearance", feature = "NSResponder"))]
494extern_conformance!(
495 unsafe impl NSAppearanceCustomization for NSWindow {}
496);
497
498#[cfg(feature = "NSResponder")]
499extern_conformance!(
500 unsafe impl NSCoding for NSWindow {}
501);
502
503#[cfg(all(feature = "NSMenu", feature = "NSResponder"))]
504extern_conformance!(
505 unsafe impl NSMenuItemValidation for NSWindow {}
506);
507
508#[cfg(feature = "NSResponder")]
509extern_conformance!(
510 unsafe impl NSObjectProtocol for NSWindow {}
511);
512
513#[cfg(all(feature = "NSResponder", feature = "NSUserInterfaceItemIdentification"))]
514extern_conformance!(
515 unsafe impl NSUserInterfaceItemIdentification for NSWindow {}
516);
517
518#[cfg(all(feature = "NSResponder", feature = "NSUserInterfaceValidation"))]
519extern_conformance!(
520 unsafe impl NSUserInterfaceValidations for NSWindow {}
521);
522
523#[cfg(feature = "NSResponder")]
524impl NSWindow {
525 extern_methods!(
526 #[unsafe(method(frameRectForContentRect:styleMask:))]
527 #[unsafe(method_family = none)]
528 pub unsafe fn frameRectForContentRect_styleMask(
529 c_rect: NSRect,
530 style: NSWindowStyleMask,
531 mtm: MainThreadMarker,
532 ) -> NSRect;
533
534 #[unsafe(method(contentRectForFrameRect:styleMask:))]
535 #[unsafe(method_family = none)]
536 pub unsafe fn contentRectForFrameRect_styleMask(
537 f_rect: NSRect,
538 style: NSWindowStyleMask,
539 mtm: MainThreadMarker,
540 ) -> NSRect;
541
542 #[cfg(feature = "objc2-core-foundation")]
543 #[unsafe(method(minFrameWidthWithTitle:styleMask:))]
544 #[unsafe(method_family = none)]
545 pub unsafe fn minFrameWidthWithTitle_styleMask(
546 title: &NSString,
547 style: NSWindowStyleMask,
548 mtm: MainThreadMarker,
549 ) -> CGFloat;
550
551 #[cfg(feature = "NSGraphics")]
552 #[unsafe(method(defaultDepthLimit))]
553 #[unsafe(method_family = none)]
554 pub unsafe fn defaultDepthLimit(mtm: MainThreadMarker) -> NSWindowDepth;
555
556 #[unsafe(method(frameRectForContentRect:))]
557 #[unsafe(method_family = none)]
558 pub unsafe fn frameRectForContentRect(&self, content_rect: NSRect) -> NSRect;
559
560 #[unsafe(method(contentRectForFrameRect:))]
561 #[unsafe(method_family = none)]
562 pub fn contentRectForFrameRect(&self, frame_rect: NSRect) -> NSRect;
563
564 #[cfg(feature = "NSGraphics")]
565 #[unsafe(method(initWithContentRect:styleMask:backing:defer:))]
566 #[unsafe(method_family = init)]
567 pub unsafe fn initWithContentRect_styleMask_backing_defer(
568 this: Allocated<Self>,
569 content_rect: NSRect,
570 style: NSWindowStyleMask,
571 backing_store_type: NSBackingStoreType,
572 flag: bool,
573 ) -> Retained<Self>;
574
575 #[cfg(all(feature = "NSGraphics", feature = "NSScreen"))]
576 #[unsafe(method(initWithContentRect:styleMask:backing:defer:screen:))]
577 #[unsafe(method_family = init)]
578 pub unsafe fn initWithContentRect_styleMask_backing_defer_screen(
579 this: Allocated<Self>,
580 content_rect: NSRect,
581 style: NSWindowStyleMask,
582 backing_store_type: NSBackingStoreType,
583 flag: bool,
584 screen: Option<&NSScreen>,
585 ) -> Retained<Self>;
586
587 #[unsafe(method(initWithCoder:))]
588 #[unsafe(method_family = init)]
589 pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
590
591 #[unsafe(method(title))]
592 #[unsafe(method_family = none)]
593 pub fn title(&self) -> Retained<NSString>;
594
595 #[unsafe(method(setTitle:))]
597 #[unsafe(method_family = none)]
598 pub fn setTitle(&self, title: &NSString);
599
600 #[unsafe(method(subtitle))]
603 #[unsafe(method_family = none)]
604 pub unsafe fn subtitle(&self) -> Retained<NSString>;
605
606 #[unsafe(method(setSubtitle:))]
608 #[unsafe(method_family = none)]
609 pub unsafe fn setSubtitle(&self, subtitle: &NSString);
610
611 #[unsafe(method(titleVisibility))]
613 #[unsafe(method_family = none)]
614 pub unsafe fn titleVisibility(&self) -> NSWindowTitleVisibility;
615
616 #[unsafe(method(setTitleVisibility:))]
618 #[unsafe(method_family = none)]
619 pub fn setTitleVisibility(&self, title_visibility: NSWindowTitleVisibility);
620
621 #[unsafe(method(titlebarAppearsTransparent))]
625 #[unsafe(method_family = none)]
626 pub unsafe fn titlebarAppearsTransparent(&self) -> bool;
627
628 #[unsafe(method(setTitlebarAppearsTransparent:))]
630 #[unsafe(method_family = none)]
631 pub fn setTitlebarAppearsTransparent(&self, titlebar_appears_transparent: bool);
632
633 #[unsafe(method(toolbarStyle))]
635 #[unsafe(method_family = none)]
636 pub unsafe fn toolbarStyle(&self) -> NSWindowToolbarStyle;
637
638 #[unsafe(method(setToolbarStyle:))]
640 #[unsafe(method_family = none)]
641 pub unsafe fn setToolbarStyle(&self, toolbar_style: NSWindowToolbarStyle);
642
643 #[unsafe(method(contentLayoutRect))]
649 #[unsafe(method_family = none)]
650 pub unsafe fn contentLayoutRect(&self) -> NSRect;
651
652 #[unsafe(method(contentLayoutGuide))]
656 #[unsafe(method_family = none)]
657 pub unsafe fn contentLayoutGuide(&self) -> Option<Retained<AnyObject>>;
658
659 #[cfg(all(
660 feature = "NSTitlebarAccessoryViewController",
661 feature = "NSViewController"
662 ))]
663 #[unsafe(method(titlebarAccessoryViewControllers))]
664 #[unsafe(method_family = none)]
665 pub unsafe fn titlebarAccessoryViewControllers(
666 &self,
667 ) -> Retained<NSArray<NSTitlebarAccessoryViewController>>;
668
669 #[cfg(all(
670 feature = "NSTitlebarAccessoryViewController",
671 feature = "NSViewController"
672 ))]
673 #[unsafe(method(setTitlebarAccessoryViewControllers:))]
675 #[unsafe(method_family = none)]
676 pub unsafe fn setTitlebarAccessoryViewControllers(
677 &self,
678 titlebar_accessory_view_controllers: &NSArray<NSTitlebarAccessoryViewController>,
679 );
680
681 #[cfg(all(
682 feature = "NSTitlebarAccessoryViewController",
683 feature = "NSViewController"
684 ))]
685 #[unsafe(method(addTitlebarAccessoryViewController:))]
686 #[unsafe(method_family = none)]
687 pub unsafe fn addTitlebarAccessoryViewController(
688 &self,
689 child_view_controller: &NSTitlebarAccessoryViewController,
690 );
691
692 #[cfg(all(
693 feature = "NSTitlebarAccessoryViewController",
694 feature = "NSViewController"
695 ))]
696 #[unsafe(method(insertTitlebarAccessoryViewController:atIndex:))]
697 #[unsafe(method_family = none)]
698 pub unsafe fn insertTitlebarAccessoryViewController_atIndex(
699 &self,
700 child_view_controller: &NSTitlebarAccessoryViewController,
701 index: NSInteger,
702 );
703
704 #[unsafe(method(removeTitlebarAccessoryViewControllerAtIndex:))]
705 #[unsafe(method_family = none)]
706 pub unsafe fn removeTitlebarAccessoryViewControllerAtIndex(&self, index: NSInteger);
707
708 #[unsafe(method(representedURL))]
712 #[unsafe(method_family = none)]
713 pub unsafe fn representedURL(&self) -> Option<Retained<NSURL>>;
714
715 #[unsafe(method(setRepresentedURL:))]
717 #[unsafe(method_family = none)]
718 pub unsafe fn setRepresentedURL(&self, represented_url: Option<&NSURL>);
719
720 #[unsafe(method(representedFilename))]
721 #[unsafe(method_family = none)]
722 pub unsafe fn representedFilename(&self) -> Retained<NSString>;
723
724 #[unsafe(method(setRepresentedFilename:))]
726 #[unsafe(method_family = none)]
727 pub unsafe fn setRepresentedFilename(&self, represented_filename: &NSString);
728
729 #[unsafe(method(setTitleWithRepresentedFilename:))]
730 #[unsafe(method_family = none)]
731 pub unsafe fn setTitleWithRepresentedFilename(&self, filename: &NSString);
732
733 #[unsafe(method(isExcludedFromWindowsMenu))]
734 #[unsafe(method_family = none)]
735 pub unsafe fn isExcludedFromWindowsMenu(&self) -> bool;
736
737 #[unsafe(method(setExcludedFromWindowsMenu:))]
739 #[unsafe(method_family = none)]
740 pub unsafe fn setExcludedFromWindowsMenu(&self, excluded_from_windows_menu: bool);
741
742 #[cfg(feature = "NSView")]
743 #[unsafe(method(contentView))]
744 #[unsafe(method_family = none)]
745 pub fn contentView(&self) -> Option<Retained<NSView>>;
746
747 #[cfg(feature = "NSView")]
748 #[unsafe(method(setContentView:))]
750 #[unsafe(method_family = none)]
751 pub fn setContentView(&self, content_view: Option<&NSView>);
752
753 #[unsafe(method(delegate))]
754 #[unsafe(method_family = none)]
755 pub unsafe fn delegate(&self) -> Option<Retained<ProtocolObject<dyn NSWindowDelegate>>>;
756
757 #[unsafe(method(setDelegate:))]
760 #[unsafe(method_family = none)]
761 pub fn setDelegate(&self, delegate: Option<&ProtocolObject<dyn NSWindowDelegate>>);
762
763 #[unsafe(method(windowNumber))]
764 #[unsafe(method_family = none)]
765 pub unsafe fn windowNumber(&self) -> NSInteger;
766
767 #[unsafe(method(styleMask))]
772 #[unsafe(method_family = none)]
773 pub fn styleMask(&self) -> NSWindowStyleMask;
774
775 #[unsafe(method(setStyleMask:))]
777 #[unsafe(method_family = none)]
778 pub fn setStyleMask(&self, style_mask: NSWindowStyleMask);
779
780 #[cfg(all(feature = "NSText", feature = "NSView"))]
781 #[unsafe(method(fieldEditor:forObject:))]
782 #[unsafe(method_family = none)]
783 pub unsafe fn fieldEditor_forObject(
784 &self,
785 create_flag: bool,
786 object: Option<&AnyObject>,
787 ) -> Option<Retained<NSText>>;
788
789 #[unsafe(method(endEditingFor:))]
790 #[unsafe(method_family = none)]
791 pub unsafe fn endEditingFor(&self, object: Option<&AnyObject>);
792
793 #[cfg(feature = "NSScreen")]
794 #[unsafe(method(constrainFrameRect:toScreen:))]
795 #[unsafe(method_family = none)]
796 pub unsafe fn constrainFrameRect_toScreen(
797 &self,
798 frame_rect: NSRect,
799 screen: Option<&NSScreen>,
800 ) -> NSRect;
801
802 #[unsafe(method(setFrame:display:))]
803 #[unsafe(method_family = none)]
804 pub fn setFrame_display(&self, frame_rect: NSRect, flag: bool);
805
806 #[unsafe(method(setContentSize:))]
807 #[unsafe(method_family = none)]
808 pub fn setContentSize(&self, size: NSSize);
809
810 #[unsafe(method(setFrameOrigin:))]
811 #[unsafe(method_family = none)]
812 pub unsafe fn setFrameOrigin(&self, point: NSPoint);
813
814 #[unsafe(method(setFrameTopLeftPoint:))]
815 #[unsafe(method_family = none)]
816 pub fn setFrameTopLeftPoint(&self, point: NSPoint);
817
818 #[unsafe(method(cascadeTopLeftFromPoint:))]
819 #[unsafe(method_family = none)]
820 pub unsafe fn cascadeTopLeftFromPoint(&self, top_left_point: NSPoint) -> NSPoint;
821
822 #[unsafe(method(cascadingReferenceFrame))]
824 #[unsafe(method_family = none)]
825 pub unsafe fn cascadingReferenceFrame(&self) -> NSRect;
826
827 #[unsafe(method(frame))]
828 #[unsafe(method_family = none)]
829 pub fn frame(&self) -> NSRect;
830
831 #[unsafe(method(animationResizeTime:))]
836 #[unsafe(method_family = none)]
837 pub unsafe fn animationResizeTime(&self, new_frame: NSRect) -> NSTimeInterval;
838
839 #[unsafe(method(setFrame:display:animate:))]
846 #[unsafe(method_family = none)]
847 pub unsafe fn setFrame_display_animate(
848 &self,
849 frame_rect: NSRect,
850 display_flag: bool,
851 animate_flag: bool,
852 );
853
854 #[unsafe(method(inLiveResize))]
855 #[unsafe(method_family = none)]
856 pub unsafe fn inLiveResize(&self) -> bool;
857
858 #[unsafe(method(resizeIncrements))]
859 #[unsafe(method_family = none)]
860 pub unsafe fn resizeIncrements(&self) -> NSSize;
861
862 #[unsafe(method(setResizeIncrements:))]
864 #[unsafe(method_family = none)]
865 pub fn setResizeIncrements(&self, resize_increments: NSSize);
866
867 #[unsafe(method(aspectRatio))]
868 #[unsafe(method_family = none)]
869 pub unsafe fn aspectRatio(&self) -> NSSize;
870
871 #[unsafe(method(setAspectRatio:))]
873 #[unsafe(method_family = none)]
874 pub unsafe fn setAspectRatio(&self, aspect_ratio: NSSize);
875
876 #[unsafe(method(contentResizeIncrements))]
877 #[unsafe(method_family = none)]
878 pub fn contentResizeIncrements(&self) -> NSSize;
879
880 #[unsafe(method(setContentResizeIncrements:))]
882 #[unsafe(method_family = none)]
883 pub fn setContentResizeIncrements(&self, content_resize_increments: NSSize);
884
885 #[unsafe(method(contentAspectRatio))]
886 #[unsafe(method_family = none)]
887 pub unsafe fn contentAspectRatio(&self) -> NSSize;
888
889 #[unsafe(method(setContentAspectRatio:))]
891 #[unsafe(method_family = none)]
892 pub unsafe fn setContentAspectRatio(&self, content_aspect_ratio: NSSize);
893
894 #[unsafe(method(viewsNeedDisplay))]
895 #[unsafe(method_family = none)]
896 pub unsafe fn viewsNeedDisplay(&self) -> bool;
897
898 #[unsafe(method(setViewsNeedDisplay:))]
900 #[unsafe(method_family = none)]
901 pub unsafe fn setViewsNeedDisplay(&self, views_need_display: bool);
902
903 #[unsafe(method(displayIfNeeded))]
904 #[unsafe(method_family = none)]
905 pub unsafe fn displayIfNeeded(&self);
906
907 #[unsafe(method(display))]
908 #[unsafe(method_family = none)]
909 pub unsafe fn display(&self);
910
911 #[unsafe(method(preservesContentDuringLiveResize))]
912 #[unsafe(method_family = none)]
913 pub unsafe fn preservesContentDuringLiveResize(&self) -> bool;
914
915 #[unsafe(method(setPreservesContentDuringLiveResize:))]
917 #[unsafe(method_family = none)]
918 pub unsafe fn setPreservesContentDuringLiveResize(
919 &self,
920 preserves_content_during_live_resize: bool,
921 );
922
923 #[unsafe(method(update))]
924 #[unsafe(method_family = none)]
925 pub unsafe fn update(&self);
926
927 #[unsafe(method(makeFirstResponder:))]
928 #[unsafe(method_family = none)]
929 pub fn makeFirstResponder(&self, responder: Option<&NSResponder>) -> bool;
930
931 #[unsafe(method(firstResponder))]
932 #[unsafe(method_family = none)]
933 pub fn firstResponder(&self) -> Option<Retained<NSResponder>>;
934
935 #[cfg(feature = "NSEvent")]
936 #[unsafe(method(resizeFlags))]
937 #[unsafe(method_family = none)]
938 pub unsafe fn resizeFlags(&self) -> NSEventModifierFlags;
939
940 #[unsafe(method(close))]
941 #[unsafe(method_family = none)]
942 pub fn close(&self);
943
944 #[unsafe(method(isReleasedWhenClosed))]
945 #[unsafe(method_family = none)]
946 pub unsafe fn isReleasedWhenClosed(&self) -> bool;
947
948 #[unsafe(method(setReleasedWhenClosed:))]
950 #[unsafe(method_family = none)]
951 pub unsafe fn setReleasedWhenClosed(&self, released_when_closed: bool);
952
953 #[unsafe(method(miniaturize:))]
954 #[unsafe(method_family = none)]
955 pub fn miniaturize(&self, sender: Option<&AnyObject>);
956
957 #[unsafe(method(deminiaturize:))]
958 #[unsafe(method_family = none)]
959 pub unsafe fn deminiaturize(&self, sender: Option<&AnyObject>);
960
961 #[unsafe(method(isZoomed))]
962 #[unsafe(method_family = none)]
963 pub fn isZoomed(&self) -> bool;
964
965 #[unsafe(method(zoom:))]
966 #[unsafe(method_family = none)]
967 pub fn zoom(&self, sender: Option<&AnyObject>);
968
969 #[unsafe(method(isMiniaturized))]
970 #[unsafe(method_family = none)]
971 pub fn isMiniaturized(&self) -> bool;
972
973 #[unsafe(method(tryToPerform:with:))]
974 #[unsafe(method_family = none)]
975 pub unsafe fn tryToPerform_with(&self, action: Sel, object: Option<&AnyObject>) -> bool;
976
977 #[cfg(feature = "NSPasteboard")]
978 #[unsafe(method(validRequestorForSendType:returnType:))]
979 #[unsafe(method_family = none)]
980 pub unsafe fn validRequestorForSendType_returnType(
981 &self,
982 send_type: Option<&NSPasteboardType>,
983 return_type: Option<&NSPasteboardType>,
984 ) -> Option<Retained<AnyObject>>;
985
986 #[cfg(feature = "NSColor")]
987 #[unsafe(method(backgroundColor))]
988 #[unsafe(method_family = none)]
989 pub unsafe fn backgroundColor(&self) -> Retained<NSColor>;
990
991 #[cfg(feature = "NSColor")]
992 #[unsafe(method(setBackgroundColor:))]
994 #[unsafe(method_family = none)]
995 pub fn setBackgroundColor(&self, background_color: Option<&NSColor>);
996
997 #[cfg(feature = "objc2-core-foundation")]
998 #[unsafe(method(setContentBorderThickness:forEdge:))]
999 #[unsafe(method_family = none)]
1000 pub unsafe fn setContentBorderThickness_forEdge(
1001 &self,
1002 thickness: CGFloat,
1003 edge: NSRectEdge,
1004 );
1005
1006 #[cfg(feature = "objc2-core-foundation")]
1007 #[unsafe(method(contentBorderThicknessForEdge:))]
1008 #[unsafe(method_family = none)]
1009 pub unsafe fn contentBorderThicknessForEdge(&self, edge: NSRectEdge) -> CGFloat;
1010
1011 #[unsafe(method(setAutorecalculatesContentBorderThickness:forEdge:))]
1012 #[unsafe(method_family = none)]
1013 pub unsafe fn setAutorecalculatesContentBorderThickness_forEdge(
1014 &self,
1015 flag: bool,
1016 edge: NSRectEdge,
1017 );
1018
1019 #[unsafe(method(autorecalculatesContentBorderThicknessForEdge:))]
1020 #[unsafe(method_family = none)]
1021 pub unsafe fn autorecalculatesContentBorderThicknessForEdge(
1022 &self,
1023 edge: NSRectEdge,
1024 ) -> bool;
1025
1026 #[unsafe(method(isMovable))]
1027 #[unsafe(method_family = none)]
1028 pub unsafe fn isMovable(&self) -> bool;
1029
1030 #[unsafe(method(setMovable:))]
1032 #[unsafe(method_family = none)]
1033 pub fn setMovable(&self, movable: bool);
1034
1035 #[unsafe(method(isMovableByWindowBackground))]
1036 #[unsafe(method_family = none)]
1037 pub unsafe fn isMovableByWindowBackground(&self) -> bool;
1038
1039 #[unsafe(method(setMovableByWindowBackground:))]
1041 #[unsafe(method_family = none)]
1042 pub fn setMovableByWindowBackground(&self, movable_by_window_background: bool);
1043
1044 #[unsafe(method(hidesOnDeactivate))]
1045 #[unsafe(method_family = none)]
1046 pub unsafe fn hidesOnDeactivate(&self) -> bool;
1047
1048 #[unsafe(method(setHidesOnDeactivate:))]
1050 #[unsafe(method_family = none)]
1051 pub unsafe fn setHidesOnDeactivate(&self, hides_on_deactivate: bool);
1052
1053 #[unsafe(method(canHide))]
1056 #[unsafe(method_family = none)]
1057 pub unsafe fn canHide(&self) -> bool;
1058
1059 #[unsafe(method(setCanHide:))]
1061 #[unsafe(method_family = none)]
1062 pub unsafe fn setCanHide(&self, can_hide: bool);
1063
1064 #[unsafe(method(center))]
1065 #[unsafe(method_family = none)]
1066 pub fn center(&self);
1067
1068 #[unsafe(method(makeKeyAndOrderFront:))]
1069 #[unsafe(method_family = none)]
1070 pub fn makeKeyAndOrderFront(&self, sender: Option<&AnyObject>);
1071
1072 #[unsafe(method(orderFront:))]
1073 #[unsafe(method_family = none)]
1074 pub fn orderFront(&self, sender: Option<&AnyObject>);
1075
1076 #[unsafe(method(orderBack:))]
1077 #[unsafe(method_family = none)]
1078 pub unsafe fn orderBack(&self, sender: Option<&AnyObject>);
1079
1080 #[unsafe(method(orderOut:))]
1081 #[unsafe(method_family = none)]
1082 pub fn orderOut(&self, sender: Option<&AnyObject>);
1083
1084 #[cfg(feature = "NSGraphics")]
1085 #[unsafe(method(orderWindow:relativeTo:))]
1086 #[unsafe(method_family = none)]
1087 pub unsafe fn orderWindow_relativeTo(
1088 &self,
1089 place: NSWindowOrderingMode,
1090 other_win: NSInteger,
1091 );
1092
1093 #[unsafe(method(orderFrontRegardless))]
1094 #[unsafe(method_family = none)]
1095 pub unsafe fn orderFrontRegardless(&self);
1096
1097 #[cfg(feature = "NSImage")]
1098 #[unsafe(method(miniwindowImage))]
1099 #[unsafe(method_family = none)]
1100 pub unsafe fn miniwindowImage(&self) -> Option<Retained<NSImage>>;
1101
1102 #[cfg(feature = "NSImage")]
1103 #[unsafe(method(setMiniwindowImage:))]
1105 #[unsafe(method_family = none)]
1106 pub unsafe fn setMiniwindowImage(&self, miniwindow_image: Option<&NSImage>);
1107
1108 #[unsafe(method(miniwindowTitle))]
1109 #[unsafe(method_family = none)]
1110 pub unsafe fn miniwindowTitle(&self) -> Retained<NSString>;
1111
1112 #[unsafe(method(setMiniwindowTitle:))]
1114 #[unsafe(method_family = none)]
1115 pub unsafe fn setMiniwindowTitle(&self, miniwindow_title: Option<&NSString>);
1116
1117 #[cfg(feature = "NSDockTile")]
1118 #[unsafe(method(dockTile))]
1119 #[unsafe(method_family = none)]
1120 pub unsafe fn dockTile(&self) -> Retained<NSDockTile>;
1121
1122 #[unsafe(method(isDocumentEdited))]
1123 #[unsafe(method_family = none)]
1124 pub fn isDocumentEdited(&self) -> bool;
1125
1126 #[unsafe(method(setDocumentEdited:))]
1128 #[unsafe(method_family = none)]
1129 pub fn setDocumentEdited(&self, document_edited: bool);
1130
1131 #[unsafe(method(isVisible))]
1132 #[unsafe(method_family = none)]
1133 pub fn isVisible(&self) -> bool;
1134
1135 #[unsafe(method(isKeyWindow))]
1136 #[unsafe(method_family = none)]
1137 pub fn isKeyWindow(&self) -> bool;
1138
1139 #[unsafe(method(isMainWindow))]
1140 #[unsafe(method_family = none)]
1141 pub unsafe fn isMainWindow(&self) -> bool;
1142
1143 #[unsafe(method(canBecomeKeyWindow))]
1144 #[unsafe(method_family = none)]
1145 pub unsafe fn canBecomeKeyWindow(&self) -> bool;
1146
1147 #[unsafe(method(canBecomeMainWindow))]
1148 #[unsafe(method_family = none)]
1149 pub unsafe fn canBecomeMainWindow(&self) -> bool;
1150
1151 #[unsafe(method(makeKeyWindow))]
1153 #[unsafe(method_family = none)]
1154 pub unsafe fn makeKeyWindow(&self);
1155
1156 #[unsafe(method(makeMainWindow))]
1158 #[unsafe(method_family = none)]
1159 pub unsafe fn makeMainWindow(&self);
1160
1161 #[unsafe(method(becomeKeyWindow))]
1163 #[unsafe(method_family = none)]
1164 pub unsafe fn becomeKeyWindow(&self);
1165
1166 #[unsafe(method(resignKeyWindow))]
1168 #[unsafe(method_family = none)]
1169 pub unsafe fn resignKeyWindow(&self);
1170
1171 #[unsafe(method(becomeMainWindow))]
1173 #[unsafe(method_family = none)]
1174 pub unsafe fn becomeMainWindow(&self);
1175
1176 #[unsafe(method(resignMainWindow))]
1178 #[unsafe(method_family = none)]
1179 pub unsafe fn resignMainWindow(&self);
1180
1181 #[unsafe(method(worksWhenModal))]
1182 #[unsafe(method_family = none)]
1183 pub unsafe fn worksWhenModal(&self) -> bool;
1184
1185 #[unsafe(method(preventsApplicationTerminationWhenModal))]
1189 #[unsafe(method_family = none)]
1190 pub unsafe fn preventsApplicationTerminationWhenModal(&self) -> bool;
1191
1192 #[unsafe(method(setPreventsApplicationTerminationWhenModal:))]
1194 #[unsafe(method_family = none)]
1195 pub unsafe fn setPreventsApplicationTerminationWhenModal(
1196 &self,
1197 prevents_application_termination_when_modal: bool,
1198 );
1199
1200 #[unsafe(method(convertRectToScreen:))]
1201 #[unsafe(method_family = none)]
1202 pub fn convertRectToScreen(&self, rect: NSRect) -> NSRect;
1203
1204 #[unsafe(method(convertRectFromScreen:))]
1205 #[unsafe(method_family = none)]
1206 pub unsafe fn convertRectFromScreen(&self, rect: NSRect) -> NSRect;
1207
1208 #[unsafe(method(convertPointToScreen:))]
1209 #[unsafe(method_family = none)]
1210 pub unsafe fn convertPointToScreen(&self, point: NSPoint) -> NSPoint;
1211
1212 #[unsafe(method(convertPointFromScreen:))]
1213 #[unsafe(method_family = none)]
1214 pub fn convertPointFromScreen(&self, point: NSPoint) -> NSPoint;
1215
1216 #[unsafe(method(convertRectToBacking:))]
1217 #[unsafe(method_family = none)]
1218 pub unsafe fn convertRectToBacking(&self, rect: NSRect) -> NSRect;
1219
1220 #[unsafe(method(convertRectFromBacking:))]
1221 #[unsafe(method_family = none)]
1222 pub unsafe fn convertRectFromBacking(&self, rect: NSRect) -> NSRect;
1223
1224 #[unsafe(method(convertPointToBacking:))]
1225 #[unsafe(method_family = none)]
1226 pub unsafe fn convertPointToBacking(&self, point: NSPoint) -> NSPoint;
1227
1228 #[unsafe(method(convertPointFromBacking:))]
1229 #[unsafe(method_family = none)]
1230 pub unsafe fn convertPointFromBacking(&self, point: NSPoint) -> NSPoint;
1231
1232 #[unsafe(method(backingAlignedRect:options:))]
1234 #[unsafe(method_family = none)]
1235 pub unsafe fn backingAlignedRect_options(
1236 &self,
1237 rect: NSRect,
1238 options: NSAlignmentOptions,
1239 ) -> NSRect;
1240
1241 #[cfg(feature = "objc2-core-foundation")]
1242 #[unsafe(method(backingScaleFactor))]
1245 #[unsafe(method_family = none)]
1246 pub fn backingScaleFactor(&self) -> CGFloat;
1247
1248 #[unsafe(method(performClose:))]
1249 #[unsafe(method_family = none)]
1250 pub unsafe fn performClose(&self, sender: Option<&AnyObject>);
1251
1252 #[unsafe(method(performMiniaturize:))]
1253 #[unsafe(method_family = none)]
1254 pub unsafe fn performMiniaturize(&self, sender: Option<&AnyObject>);
1255
1256 #[unsafe(method(performZoom:))]
1257 #[unsafe(method_family = none)]
1258 pub unsafe fn performZoom(&self, sender: Option<&AnyObject>);
1259
1260 #[unsafe(method(dataWithEPSInsideRect:))]
1261 #[unsafe(method_family = none)]
1262 pub unsafe fn dataWithEPSInsideRect(&self, rect: NSRect) -> Retained<NSData>;
1263
1264 #[unsafe(method(dataWithPDFInsideRect:))]
1265 #[unsafe(method_family = none)]
1266 pub unsafe fn dataWithPDFInsideRect(&self, rect: NSRect) -> Retained<NSData>;
1267
1268 #[unsafe(method(print:))]
1269 #[unsafe(method_family = none)]
1270 pub unsafe fn print(&self, sender: Option<&AnyObject>);
1271
1272 #[unsafe(method(allowsToolTipsWhenApplicationIsInactive))]
1278 #[unsafe(method_family = none)]
1279 pub unsafe fn allowsToolTipsWhenApplicationIsInactive(&self) -> bool;
1280
1281 #[unsafe(method(setAllowsToolTipsWhenApplicationIsInactive:))]
1283 #[unsafe(method_family = none)]
1284 pub unsafe fn setAllowsToolTipsWhenApplicationIsInactive(
1285 &self,
1286 allows_tool_tips_when_application_is_inactive: bool,
1287 );
1288
1289 #[cfg(feature = "NSGraphics")]
1290 #[unsafe(method(backingType))]
1291 #[unsafe(method_family = none)]
1292 pub unsafe fn backingType(&self) -> NSBackingStoreType;
1293
1294 #[cfg(feature = "NSGraphics")]
1295 #[unsafe(method(setBackingType:))]
1297 #[unsafe(method_family = none)]
1298 pub unsafe fn setBackingType(&self, backing_type: NSBackingStoreType);
1299
1300 #[unsafe(method(level))]
1301 #[unsafe(method_family = none)]
1302 pub unsafe fn level(&self) -> NSWindowLevel;
1303
1304 #[unsafe(method(setLevel:))]
1306 #[unsafe(method_family = none)]
1307 pub fn setLevel(&self, level: NSWindowLevel);
1308
1309 #[cfg(feature = "NSGraphics")]
1310 #[unsafe(method(depthLimit))]
1311 #[unsafe(method_family = none)]
1312 pub unsafe fn depthLimit(&self) -> NSWindowDepth;
1313
1314 #[cfg(feature = "NSGraphics")]
1315 #[unsafe(method(setDepthLimit:))]
1317 #[unsafe(method_family = none)]
1318 pub unsafe fn setDepthLimit(&self, depth_limit: NSWindowDepth);
1319
1320 #[unsafe(method(setDynamicDepthLimit:))]
1321 #[unsafe(method_family = none)]
1322 pub unsafe fn setDynamicDepthLimit(&self, flag: bool);
1323
1324 #[unsafe(method(hasDynamicDepthLimit))]
1325 #[unsafe(method_family = none)]
1326 pub unsafe fn hasDynamicDepthLimit(&self) -> bool;
1327
1328 #[cfg(feature = "NSScreen")]
1329 #[unsafe(method(screen))]
1331 #[unsafe(method_family = none)]
1332 pub fn screen(&self) -> Option<Retained<NSScreen>>;
1333
1334 #[cfg(feature = "NSScreen")]
1335 #[unsafe(method(deepestScreen))]
1336 #[unsafe(method_family = none)]
1337 pub unsafe fn deepestScreen(&self) -> Option<Retained<NSScreen>>;
1338
1339 #[unsafe(method(hasShadow))]
1340 #[unsafe(method_family = none)]
1341 pub fn hasShadow(&self) -> bool;
1342
1343 #[unsafe(method(setHasShadow:))]
1345 #[unsafe(method_family = none)]
1346 pub fn setHasShadow(&self, has_shadow: bool);
1347
1348 #[unsafe(method(invalidateShadow))]
1349 #[unsafe(method_family = none)]
1350 pub unsafe fn invalidateShadow(&self);
1351
1352 #[cfg(feature = "objc2-core-foundation")]
1353 #[unsafe(method(alphaValue))]
1354 #[unsafe(method_family = none)]
1355 pub unsafe fn alphaValue(&self) -> CGFloat;
1356
1357 #[cfg(feature = "objc2-core-foundation")]
1358 #[unsafe(method(setAlphaValue:))]
1360 #[unsafe(method_family = none)]
1361 pub unsafe fn setAlphaValue(&self, alpha_value: CGFloat);
1362
1363 #[unsafe(method(isOpaque))]
1364 #[unsafe(method_family = none)]
1365 pub unsafe fn isOpaque(&self) -> bool;
1366
1367 #[unsafe(method(setOpaque:))]
1369 #[unsafe(method_family = none)]
1370 pub fn setOpaque(&self, opaque: bool);
1371
1372 #[unsafe(method(sharingType))]
1376 #[unsafe(method_family = none)]
1377 pub unsafe fn sharingType(&self) -> NSWindowSharingType;
1378
1379 #[unsafe(method(setSharingType:))]
1381 #[unsafe(method_family = none)]
1382 pub fn setSharingType(&self, sharing_type: NSWindowSharingType);
1383
1384 #[unsafe(method(allowsConcurrentViewDrawing))]
1389 #[unsafe(method_family = none)]
1390 pub unsafe fn allowsConcurrentViewDrawing(&self) -> bool;
1391
1392 #[unsafe(method(setAllowsConcurrentViewDrawing:))]
1394 #[unsafe(method_family = none)]
1395 pub unsafe fn setAllowsConcurrentViewDrawing(&self, allows_concurrent_view_drawing: bool);
1396
1397 #[unsafe(method(displaysWhenScreenProfileChanges))]
1398 #[unsafe(method_family = none)]
1399 pub unsafe fn displaysWhenScreenProfileChanges(&self) -> bool;
1400
1401 #[unsafe(method(setDisplaysWhenScreenProfileChanges:))]
1403 #[unsafe(method_family = none)]
1404 pub unsafe fn setDisplaysWhenScreenProfileChanges(
1405 &self,
1406 displays_when_screen_profile_changes: bool,
1407 );
1408
1409 #[unsafe(method(canBecomeVisibleWithoutLogin))]
1411 #[unsafe(method_family = none)]
1412 pub unsafe fn canBecomeVisibleWithoutLogin(&self) -> bool;
1413
1414 #[unsafe(method(setCanBecomeVisibleWithoutLogin:))]
1416 #[unsafe(method_family = none)]
1417 pub unsafe fn setCanBecomeVisibleWithoutLogin(
1418 &self,
1419 can_become_visible_without_login: bool,
1420 );
1421
1422 #[unsafe(method(collectionBehavior))]
1423 #[unsafe(method_family = none)]
1424 pub unsafe fn collectionBehavior(&self) -> NSWindowCollectionBehavior;
1425
1426 #[unsafe(method(setCollectionBehavior:))]
1428 #[unsafe(method_family = none)]
1429 pub unsafe fn setCollectionBehavior(&self, collection_behavior: NSWindowCollectionBehavior);
1430
1431 #[unsafe(method(animationBehavior))]
1435 #[unsafe(method_family = none)]
1436 pub unsafe fn animationBehavior(&self) -> NSWindowAnimationBehavior;
1437
1438 #[unsafe(method(setAnimationBehavior:))]
1440 #[unsafe(method_family = none)]
1441 pub unsafe fn setAnimationBehavior(&self, animation_behavior: NSWindowAnimationBehavior);
1442
1443 #[unsafe(method(isOnActiveSpace))]
1446 #[unsafe(method_family = none)]
1447 pub unsafe fn isOnActiveSpace(&self) -> bool;
1448
1449 #[unsafe(method(toggleFullScreen:))]
1454 #[unsafe(method_family = none)]
1455 pub fn toggleFullScreen(&self, sender: Option<&AnyObject>);
1456
1457 #[unsafe(method(stringWithSavedFrame))]
1458 #[unsafe(method_family = none)]
1459 pub unsafe fn stringWithSavedFrame(&self) -> Retained<NSWindowPersistableFrameDescriptor>;
1460
1461 #[unsafe(method(setFrameFromString:))]
1462 #[unsafe(method_family = none)]
1463 pub unsafe fn setFrameFromString(&self, string: &NSWindowPersistableFrameDescriptor);
1464
1465 #[unsafe(method(saveFrameUsingName:))]
1466 #[unsafe(method_family = none)]
1467 pub unsafe fn saveFrameUsingName(&self, name: &NSWindowFrameAutosaveName);
1468
1469 #[unsafe(method(setFrameUsingName:force:))]
1470 #[unsafe(method_family = none)]
1471 pub unsafe fn setFrameUsingName_force(
1472 &self,
1473 name: &NSWindowFrameAutosaveName,
1474 force: bool,
1475 ) -> bool;
1476
1477 #[unsafe(method(setFrameUsingName:))]
1478 #[unsafe(method_family = none)]
1479 pub unsafe fn setFrameUsingName(&self, name: &NSWindowFrameAutosaveName) -> bool;
1480
1481 #[unsafe(method(setFrameAutosaveName:))]
1482 #[unsafe(method_family = none)]
1483 pub unsafe fn setFrameAutosaveName(&self, name: &NSWindowFrameAutosaveName) -> bool;
1484
1485 #[unsafe(method(frameAutosaveName))]
1486 #[unsafe(method_family = none)]
1487 pub unsafe fn frameAutosaveName(&self) -> Retained<NSWindowFrameAutosaveName>;
1488
1489 #[unsafe(method(removeFrameUsingName:))]
1490 #[unsafe(method_family = none)]
1491 pub unsafe fn removeFrameUsingName(name: &NSWindowFrameAutosaveName, mtm: MainThreadMarker);
1492
1493 #[unsafe(method(minSize))]
1494 #[unsafe(method_family = none)]
1495 pub unsafe fn minSize(&self) -> NSSize;
1496
1497 #[unsafe(method(setMinSize:))]
1499 #[unsafe(method_family = none)]
1500 pub fn setMinSize(&self, min_size: NSSize);
1501
1502 #[unsafe(method(maxSize))]
1503 #[unsafe(method_family = none)]
1504 pub unsafe fn maxSize(&self) -> NSSize;
1505
1506 #[unsafe(method(setMaxSize:))]
1508 #[unsafe(method_family = none)]
1509 pub fn setMaxSize(&self, max_size: NSSize);
1510
1511 #[unsafe(method(contentMinSize))]
1512 #[unsafe(method_family = none)]
1513 pub unsafe fn contentMinSize(&self) -> NSSize;
1514
1515 #[unsafe(method(setContentMinSize:))]
1517 #[unsafe(method_family = none)]
1518 pub unsafe fn setContentMinSize(&self, content_min_size: NSSize);
1519
1520 #[unsafe(method(contentMaxSize))]
1521 #[unsafe(method_family = none)]
1522 pub unsafe fn contentMaxSize(&self) -> NSSize;
1523
1524 #[unsafe(method(setContentMaxSize:))]
1526 #[unsafe(method_family = none)]
1527 pub unsafe fn setContentMaxSize(&self, content_max_size: NSSize);
1528
1529 #[unsafe(method(minFullScreenContentSize))]
1530 #[unsafe(method_family = none)]
1531 pub unsafe fn minFullScreenContentSize(&self) -> NSSize;
1532
1533 #[unsafe(method(setMinFullScreenContentSize:))]
1535 #[unsafe(method_family = none)]
1536 pub unsafe fn setMinFullScreenContentSize(&self, min_full_screen_content_size: NSSize);
1537
1538 #[unsafe(method(maxFullScreenContentSize))]
1539 #[unsafe(method_family = none)]
1540 pub unsafe fn maxFullScreenContentSize(&self) -> NSSize;
1541
1542 #[unsafe(method(setMaxFullScreenContentSize:))]
1544 #[unsafe(method_family = none)]
1545 pub unsafe fn setMaxFullScreenContentSize(&self, max_full_screen_content_size: NSSize);
1546
1547 #[cfg(feature = "NSGraphics")]
1548 #[unsafe(method(deviceDescription))]
1549 #[unsafe(method_family = none)]
1550 pub unsafe fn deviceDescription(
1551 &self,
1552 ) -> Retained<NSDictionary<NSDeviceDescriptionKey, AnyObject>>;
1553
1554 #[cfg(feature = "NSWindowController")]
1555 #[unsafe(method(windowController))]
1556 #[unsafe(method_family = none)]
1557 pub unsafe fn windowController(&self) -> Option<Retained<NSWindowController>>;
1558
1559 #[cfg(feature = "NSWindowController")]
1560 #[unsafe(method(setWindowController:))]
1563 #[unsafe(method_family = none)]
1564 pub unsafe fn setWindowController(&self, window_controller: Option<&NSWindowController>);
1565
1566 #[cfg(all(feature = "NSApplication", feature = "block2"))]
1567 #[unsafe(method(beginSheet:completionHandler:))]
1568 #[unsafe(method_family = none)]
1569 pub unsafe fn beginSheet_completionHandler(
1570 &self,
1571 sheet_window: &NSWindow,
1572 handler: Option<&block2::DynBlock<dyn Fn(NSModalResponse)>>,
1573 );
1574
1575 #[cfg(all(feature = "NSApplication", feature = "block2"))]
1576 #[unsafe(method(beginCriticalSheet:completionHandler:))]
1577 #[unsafe(method_family = none)]
1578 pub unsafe fn beginCriticalSheet_completionHandler(
1579 &self,
1580 sheet_window: &NSWindow,
1581 handler: Option<&block2::DynBlock<dyn Fn(NSModalResponse)>>,
1582 );
1583
1584 #[unsafe(method(endSheet:))]
1585 #[unsafe(method_family = none)]
1586 pub unsafe fn endSheet(&self, sheet_window: &NSWindow);
1587
1588 #[cfg(feature = "NSApplication")]
1589 #[unsafe(method(endSheet:returnCode:))]
1590 #[unsafe(method_family = none)]
1591 pub unsafe fn endSheet_returnCode(
1592 &self,
1593 sheet_window: &NSWindow,
1594 return_code: NSModalResponse,
1595 );
1596
1597 #[unsafe(method(sheets))]
1599 #[unsafe(method_family = none)]
1600 pub unsafe fn sheets(&self) -> Retained<NSArray<NSWindow>>;
1601
1602 #[unsafe(method(attachedSheet))]
1604 #[unsafe(method_family = none)]
1605 pub unsafe fn attachedSheet(&self) -> Option<Retained<NSWindow>>;
1606
1607 #[unsafe(method(isSheet))]
1608 #[unsafe(method_family = none)]
1609 pub unsafe fn isSheet(&self) -> bool;
1610
1611 #[unsafe(method(sheetParent))]
1616 #[unsafe(method_family = none)]
1617 pub unsafe fn sheetParent(&self) -> Option<Retained<NSWindow>>;
1618
1619 #[cfg(all(feature = "NSButton", feature = "NSControl", feature = "NSView"))]
1620 #[unsafe(method(standardWindowButton:forStyleMask:))]
1621 #[unsafe(method_family = none)]
1622 pub unsafe fn standardWindowButton_forStyleMask(
1623 b: NSWindowButton,
1624 style_mask: NSWindowStyleMask,
1625 mtm: MainThreadMarker,
1626 ) -> Option<Retained<NSButton>>;
1627
1628 #[cfg(all(feature = "NSButton", feature = "NSControl", feature = "NSView"))]
1629 #[unsafe(method(standardWindowButton:))]
1630 #[unsafe(method_family = none)]
1631 pub fn standardWindowButton(&self, b: NSWindowButton) -> Option<Retained<NSButton>>;
1632
1633 #[cfg(feature = "NSGraphics")]
1634 #[unsafe(method(addChildWindow:ordered:))]
1635 #[unsafe(method_family = none)]
1636 pub unsafe fn addChildWindow_ordered(
1637 &self,
1638 child_win: &NSWindow,
1639 place: NSWindowOrderingMode,
1640 );
1641
1642 #[unsafe(method(removeChildWindow:))]
1643 #[unsafe(method_family = none)]
1644 pub unsafe fn removeChildWindow(&self, child_win: &NSWindow);
1645
1646 #[unsafe(method(childWindows))]
1647 #[unsafe(method_family = none)]
1648 pub unsafe fn childWindows(&self) -> Option<Retained<NSArray<NSWindow>>>;
1649
1650 #[unsafe(method(parentWindow))]
1651 #[unsafe(method_family = none)]
1652 pub unsafe fn parentWindow(&self) -> Option<Retained<NSWindow>>;
1653
1654 #[unsafe(method(setParentWindow:))]
1657 #[unsafe(method_family = none)]
1658 pub unsafe fn setParentWindow(&self, parent_window: Option<&NSWindow>);
1659
1660 #[cfg(feature = "NSAppearance")]
1661 #[unsafe(method(appearanceSource))]
1663 #[unsafe(method_family = none)]
1664 pub unsafe fn appearanceSource(&self) -> Option<Retained<NSObject>>;
1665
1666 #[cfg(feature = "NSAppearance")]
1667 #[unsafe(method(setAppearanceSource:))]
1670 #[unsafe(method_family = none)]
1671 pub unsafe fn setAppearanceSource(&self, appearance_source: Option<&NSObject>);
1672
1673 #[cfg(feature = "NSColorSpace")]
1674 #[unsafe(method(colorSpace))]
1675 #[unsafe(method_family = none)]
1676 pub unsafe fn colorSpace(&self) -> Option<Retained<NSColorSpace>>;
1677
1678 #[cfg(feature = "NSColorSpace")]
1679 #[unsafe(method(setColorSpace:))]
1681 #[unsafe(method_family = none)]
1682 pub unsafe fn setColorSpace(&self, color_space: Option<&NSColorSpace>);
1683
1684 #[cfg(feature = "NSGraphics")]
1685 #[unsafe(method(canRepresentDisplayGamut:))]
1689 #[unsafe(method_family = none)]
1690 pub unsafe fn canRepresentDisplayGamut(&self, display_gamut: NSDisplayGamut) -> bool;
1691
1692 #[unsafe(method(windowNumbersWithOptions:))]
1704 #[unsafe(method_family = none)]
1705 pub unsafe fn windowNumbersWithOptions(
1706 options: NSWindowNumberListOptions,
1707 mtm: MainThreadMarker,
1708 ) -> Option<Retained<NSArray<NSNumber>>>;
1709
1710 #[unsafe(method(windowNumberAtPoint:belowWindowWithWindowNumber:))]
1712 #[unsafe(method_family = none)]
1713 pub unsafe fn windowNumberAtPoint_belowWindowWithWindowNumber(
1714 point: NSPoint,
1715 window_number: NSInteger,
1716 mtm: MainThreadMarker,
1717 ) -> NSInteger;
1718
1719 #[unsafe(method(occlusionState))]
1720 #[unsafe(method_family = none)]
1721 pub fn occlusionState(&self) -> NSWindowOcclusionState;
1722
1723 #[unsafe(method(titlebarSeparatorStyle))]
1727 #[unsafe(method_family = none)]
1728 pub unsafe fn titlebarSeparatorStyle(&self) -> NSTitlebarSeparatorStyle;
1729
1730 #[unsafe(method(setTitlebarSeparatorStyle:))]
1732 #[unsafe(method_family = none)]
1733 pub unsafe fn setTitlebarSeparatorStyle(
1734 &self,
1735 titlebar_separator_style: NSTitlebarSeparatorStyle,
1736 );
1737
1738 #[cfg(feature = "NSViewController")]
1739 #[unsafe(method(contentViewController))]
1743 #[unsafe(method_family = none)]
1744 pub unsafe fn contentViewController(&self) -> Option<Retained<NSViewController>>;
1745
1746 #[cfg(feature = "NSViewController")]
1747 #[unsafe(method(setContentViewController:))]
1749 #[unsafe(method_family = none)]
1750 pub unsafe fn setContentViewController(
1751 &self,
1752 content_view_controller: Option<&NSViewController>,
1753 );
1754
1755 #[cfg(feature = "NSViewController")]
1756 #[unsafe(method(windowWithContentViewController:))]
1758 #[unsafe(method_family = none)]
1759 pub unsafe fn windowWithContentViewController(
1760 content_view_controller: &NSViewController,
1761 ) -> Retained<Self>;
1762
1763 #[cfg(feature = "NSEvent")]
1764 #[unsafe(method(performWindowDragWithEvent:))]
1766 #[unsafe(method_family = none)]
1767 pub fn performWindowDragWithEvent(&self, event: &NSEvent);
1768
1769 #[cfg(feature = "NSView")]
1770 #[unsafe(method(initialFirstResponder))]
1771 #[unsafe(method_family = none)]
1772 pub unsafe fn initialFirstResponder(&self) -> Option<Retained<NSView>>;
1773
1774 #[cfg(feature = "NSView")]
1775 #[unsafe(method(setInitialFirstResponder:))]
1778 #[unsafe(method_family = none)]
1779 pub fn setInitialFirstResponder(&self, initial_first_responder: Option<&NSView>);
1780
1781 #[unsafe(method(selectNextKeyView:))]
1782 #[unsafe(method_family = none)]
1783 pub fn selectNextKeyView(&self, sender: Option<&AnyObject>);
1784
1785 #[unsafe(method(selectPreviousKeyView:))]
1786 #[unsafe(method_family = none)]
1787 pub fn selectPreviousKeyView(&self, sender: Option<&AnyObject>);
1788
1789 #[cfg(feature = "NSView")]
1790 #[unsafe(method(selectKeyViewFollowingView:))]
1791 #[unsafe(method_family = none)]
1792 pub unsafe fn selectKeyViewFollowingView(&self, view: &NSView);
1793
1794 #[cfg(feature = "NSView")]
1795 #[unsafe(method(selectKeyViewPrecedingView:))]
1796 #[unsafe(method_family = none)]
1797 pub unsafe fn selectKeyViewPrecedingView(&self, view: &NSView);
1798
1799 #[unsafe(method(keyViewSelectionDirection))]
1800 #[unsafe(method_family = none)]
1801 pub unsafe fn keyViewSelectionDirection(&self) -> NSSelectionDirection;
1802
1803 #[cfg(all(feature = "NSActionCell", feature = "NSButtonCell", feature = "NSCell"))]
1804 #[unsafe(method(defaultButtonCell))]
1805 #[unsafe(method_family = none)]
1806 pub unsafe fn defaultButtonCell(&self) -> Option<Retained<NSButtonCell>>;
1807
1808 #[cfg(all(feature = "NSActionCell", feature = "NSButtonCell", feature = "NSCell"))]
1809 #[unsafe(method(setDefaultButtonCell:))]
1811 #[unsafe(method_family = none)]
1812 pub unsafe fn setDefaultButtonCell(&self, default_button_cell: Option<&NSButtonCell>);
1813
1814 #[unsafe(method(disableKeyEquivalentForDefaultButtonCell))]
1815 #[unsafe(method_family = none)]
1816 pub unsafe fn disableKeyEquivalentForDefaultButtonCell(&self);
1817
1818 #[unsafe(method(enableKeyEquivalentForDefaultButtonCell))]
1819 #[unsafe(method_family = none)]
1820 pub unsafe fn enableKeyEquivalentForDefaultButtonCell(&self);
1821
1822 #[unsafe(method(autorecalculatesKeyViewLoop))]
1823 #[unsafe(method_family = none)]
1824 pub unsafe fn autorecalculatesKeyViewLoop(&self) -> bool;
1825
1826 #[unsafe(method(setAutorecalculatesKeyViewLoop:))]
1828 #[unsafe(method_family = none)]
1829 pub unsafe fn setAutorecalculatesKeyViewLoop(&self, autorecalculates_key_view_loop: bool);
1830
1831 #[unsafe(method(recalculateKeyViewLoop))]
1832 #[unsafe(method_family = none)]
1833 pub unsafe fn recalculateKeyViewLoop(&self);
1834
1835 #[cfg(feature = "NSToolbar")]
1836 #[unsafe(method(toolbar))]
1837 #[unsafe(method_family = none)]
1838 pub unsafe fn toolbar(&self) -> Option<Retained<NSToolbar>>;
1839
1840 #[cfg(feature = "NSToolbar")]
1841 #[unsafe(method(setToolbar:))]
1843 #[unsafe(method_family = none)]
1844 pub unsafe fn setToolbar(&self, toolbar: Option<&NSToolbar>);
1845
1846 #[unsafe(method(toggleToolbarShown:))]
1847 #[unsafe(method_family = none)]
1848 pub unsafe fn toggleToolbarShown(&self, sender: Option<&AnyObject>);
1849
1850 #[unsafe(method(runToolbarCustomizationPalette:))]
1851 #[unsafe(method_family = none)]
1852 pub unsafe fn runToolbarCustomizationPalette(&self, sender: Option<&AnyObject>);
1853
1854 #[deprecated = "This property has no effect"]
1855 #[unsafe(method(showsToolbarButton))]
1856 #[unsafe(method_family = none)]
1857 pub unsafe fn showsToolbarButton(&self) -> bool;
1858
1859 #[deprecated = "This property has no effect"]
1861 #[unsafe(method(setShowsToolbarButton:))]
1862 #[unsafe(method_family = none)]
1863 pub unsafe fn setShowsToolbarButton(&self, shows_toolbar_button: bool);
1864
1865 #[unsafe(method(allowsAutomaticWindowTabbing))]
1869 #[unsafe(method_family = none)]
1870 pub fn allowsAutomaticWindowTabbing(mtm: MainThreadMarker) -> bool;
1871
1872 #[unsafe(method(setAllowsAutomaticWindowTabbing:))]
1874 #[unsafe(method_family = none)]
1875 pub fn setAllowsAutomaticWindowTabbing(
1876 allows_automatic_window_tabbing: bool,
1877 mtm: MainThreadMarker,
1878 );
1879
1880 #[unsafe(method(userTabbingPreference))]
1882 #[unsafe(method_family = none)]
1883 pub unsafe fn userTabbingPreference(mtm: MainThreadMarker)
1884 -> NSWindowUserTabbingPreference;
1885
1886 #[unsafe(method(tabbingMode))]
1891 #[unsafe(method_family = none)]
1892 pub unsafe fn tabbingMode(&self) -> NSWindowTabbingMode;
1893
1894 #[unsafe(method(setTabbingMode:))]
1896 #[unsafe(method_family = none)]
1897 pub fn setTabbingMode(&self, tabbing_mode: NSWindowTabbingMode);
1898
1899 #[unsafe(method(tabbingIdentifier))]
1904 #[unsafe(method_family = none)]
1905 pub fn tabbingIdentifier(&self) -> Retained<NSWindowTabbingIdentifier>;
1906
1907 #[unsafe(method(setTabbingIdentifier:))]
1909 #[unsafe(method_family = none)]
1910 pub fn setTabbingIdentifier(&self, tabbing_identifier: &NSWindowTabbingIdentifier);
1911
1912 #[unsafe(method(selectNextTab:))]
1915 #[unsafe(method_family = none)]
1916 pub fn selectNextTab(&self, sender: Option<&AnyObject>);
1917
1918 #[unsafe(method(selectPreviousTab:))]
1919 #[unsafe(method_family = none)]
1920 pub unsafe fn selectPreviousTab(&self, sender: Option<&AnyObject>);
1921
1922 #[unsafe(method(moveTabToNewWindow:))]
1923 #[unsafe(method_family = none)]
1924 pub unsafe fn moveTabToNewWindow(&self, sender: Option<&AnyObject>);
1925
1926 #[unsafe(method(mergeAllWindows:))]
1927 #[unsafe(method_family = none)]
1928 pub unsafe fn mergeAllWindows(&self, sender: Option<&AnyObject>);
1929
1930 #[unsafe(method(toggleTabBar:))]
1931 #[unsafe(method_family = none)]
1932 pub unsafe fn toggleTabBar(&self, sender: Option<&AnyObject>);
1933
1934 #[unsafe(method(toggleTabOverview:))]
1936 #[unsafe(method_family = none)]
1937 pub unsafe fn toggleTabOverview(&self, sender: Option<&AnyObject>);
1938
1939 #[unsafe(method(tabbedWindows))]
1941 #[unsafe(method_family = none)]
1942 pub unsafe fn tabbedWindows(&self) -> Option<Retained<NSArray<NSWindow>>>;
1943
1944 #[cfg(feature = "NSGraphics")]
1945 #[unsafe(method(addTabbedWindow:ordered:))]
1947 #[unsafe(method_family = none)]
1948 pub unsafe fn addTabbedWindow_ordered(
1949 &self,
1950 window: &NSWindow,
1951 ordered: NSWindowOrderingMode,
1952 );
1953
1954 #[cfg(feature = "NSWindowTab")]
1955 #[unsafe(method(tab))]
1958 #[unsafe(method_family = none)]
1959 pub unsafe fn tab(&self) -> Retained<NSWindowTab>;
1960
1961 #[cfg(feature = "NSWindowTabGroup")]
1962 #[unsafe(method(tabGroup))]
1965 #[unsafe(method_family = none)]
1966 pub fn tabGroup(&self) -> Option<Retained<NSWindowTabGroup>>;
1967
1968 #[cfg(feature = "block2")]
1969 #[unsafe(method(transferWindowSharingToWindow:completionHandler:))]
1976 #[unsafe(method_family = none)]
1977 pub unsafe fn transferWindowSharingToWindow_completionHandler(
1978 &self,
1979 window: &NSWindow,
1980 completion_handler: &block2::DynBlock<dyn Fn(*mut NSError)>,
1981 );
1982
1983 #[unsafe(method(hasActiveWindowSharingSession))]
1985 #[unsafe(method_family = none)]
1986 pub unsafe fn hasActiveWindowSharingSession(&self) -> bool;
1987
1988 #[cfg(feature = "block2")]
1989 #[unsafe(method(requestSharingOfWindow:completionHandler:))]
1996 #[unsafe(method_family = none)]
1997 pub unsafe fn requestSharingOfWindow_completionHandler(
1998 &self,
1999 window: &NSWindow,
2000 completion_handler: &block2::DynBlock<dyn Fn(*mut NSError)>,
2001 );
2002
2003 #[cfg(all(feature = "NSImage", feature = "block2"))]
2004 #[unsafe(method(requestSharingOfWindowUsingPreview:title:completionHandler:))]
2013 #[unsafe(method_family = none)]
2014 pub unsafe fn requestSharingOfWindowUsingPreview_title_completionHandler(
2015 &self,
2016 image: &NSImage,
2017 title: &NSString,
2018 completion_handler: &block2::DynBlock<dyn Fn(*mut NSError)>,
2019 );
2020
2021 #[cfg(feature = "NSUserInterfaceLayout")]
2022 #[unsafe(method(windowTitlebarLayoutDirection))]
2024 #[unsafe(method_family = none)]
2025 pub unsafe fn windowTitlebarLayoutDirection(&self) -> NSUserInterfaceLayoutDirection;
2026 );
2027}
2028
2029#[cfg(feature = "NSResponder")]
2031impl NSWindow {
2032 extern_methods!(
2033 #[unsafe(method(init))]
2034 #[unsafe(method_family = init)]
2035 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
2036 );
2037}
2038
2039#[cfg(feature = "NSResponder")]
2041impl NSWindow {
2042 extern_methods!(
2043 #[unsafe(method(new))]
2044 #[unsafe(method_family = new)]
2045 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
2046 );
2047}
2048
2049#[cfg(feature = "NSResponder")]
2051impl NSWindow {
2052 extern_methods!(
2053 #[cfg(all(feature = "NSEvent", feature = "block2"))]
2054 #[unsafe(method(trackEventsMatchingMask:timeout:mode:handler:))]
2058 #[unsafe(method_family = none)]
2059 pub unsafe fn trackEventsMatchingMask_timeout_mode_handler(
2060 &self,
2061 mask: NSEventMask,
2062 timeout: NSTimeInterval,
2063 mode: &NSRunLoopMode,
2064 tracking_handler: &block2::DynBlock<dyn Fn(*mut NSEvent, NonNull<Bool>) + '_>,
2065 );
2066
2067 #[cfg(feature = "NSEvent")]
2068 #[unsafe(method(nextEventMatchingMask:))]
2069 #[unsafe(method_family = none)]
2070 pub unsafe fn nextEventMatchingMask(&self, mask: NSEventMask) -> Option<Retained<NSEvent>>;
2071
2072 #[cfg(feature = "NSEvent")]
2073 #[unsafe(method(nextEventMatchingMask:untilDate:inMode:dequeue:))]
2074 #[unsafe(method_family = none)]
2075 pub unsafe fn nextEventMatchingMask_untilDate_inMode_dequeue(
2076 &self,
2077 mask: NSEventMask,
2078 expiration: Option<&NSDate>,
2079 mode: &NSRunLoopMode,
2080 deq_flag: bool,
2081 ) -> Option<Retained<NSEvent>>;
2082
2083 #[cfg(feature = "NSEvent")]
2084 #[unsafe(method(discardEventsMatchingMask:beforeEvent:))]
2085 #[unsafe(method_family = none)]
2086 pub unsafe fn discardEventsMatchingMask_beforeEvent(
2087 &self,
2088 mask: NSEventMask,
2089 last_event: Option<&NSEvent>,
2090 );
2091
2092 #[cfg(feature = "NSEvent")]
2093 #[unsafe(method(postEvent:atStart:))]
2094 #[unsafe(method_family = none)]
2095 pub unsafe fn postEvent_atStart(&self, event: &NSEvent, flag: bool);
2096
2097 #[cfg(feature = "NSEvent")]
2098 #[unsafe(method(sendEvent:))]
2099 #[unsafe(method_family = none)]
2100 pub fn sendEvent(&self, event: &NSEvent);
2101
2102 #[cfg(feature = "NSEvent")]
2103 #[unsafe(method(currentEvent))]
2104 #[unsafe(method_family = none)]
2105 pub unsafe fn currentEvent(&self) -> Option<Retained<NSEvent>>;
2106
2107 #[unsafe(method(acceptsMouseMovedEvents))]
2108 #[unsafe(method_family = none)]
2109 pub unsafe fn acceptsMouseMovedEvents(&self) -> bool;
2110
2111 #[unsafe(method(setAcceptsMouseMovedEvents:))]
2113 #[unsafe(method_family = none)]
2114 pub fn setAcceptsMouseMovedEvents(&self, accepts_mouse_moved_events: bool);
2115
2116 #[unsafe(method(ignoresMouseEvents))]
2117 #[unsafe(method_family = none)]
2118 pub unsafe fn ignoresMouseEvents(&self) -> bool;
2119
2120 #[unsafe(method(setIgnoresMouseEvents:))]
2122 #[unsafe(method_family = none)]
2123 pub fn setIgnoresMouseEvents(&self, ignores_mouse_events: bool);
2124
2125 #[unsafe(method(mouseLocationOutsideOfEventStream))]
2126 #[unsafe(method_family = none)]
2127 pub unsafe fn mouseLocationOutsideOfEventStream(&self) -> NSPoint;
2128 );
2129}
2130
2131#[cfg(feature = "NSResponder")]
2133impl NSWindow {
2134 extern_methods!(
2135 #[unsafe(method(disableCursorRects))]
2136 #[unsafe(method_family = none)]
2137 pub unsafe fn disableCursorRects(&self);
2138
2139 #[unsafe(method(enableCursorRects))]
2140 #[unsafe(method_family = none)]
2141 pub unsafe fn enableCursorRects(&self);
2142
2143 #[unsafe(method(discardCursorRects))]
2144 #[unsafe(method_family = none)]
2145 pub unsafe fn discardCursorRects(&self);
2146
2147 #[unsafe(method(areCursorRectsEnabled))]
2148 #[unsafe(method_family = none)]
2149 pub unsafe fn areCursorRectsEnabled(&self) -> bool;
2150
2151 #[cfg(feature = "NSView")]
2152 #[unsafe(method(invalidateCursorRectsForView:))]
2153 #[unsafe(method_family = none)]
2154 pub fn invalidateCursorRectsForView(&self, view: &NSView);
2155
2156 #[unsafe(method(resetCursorRects))]
2157 #[unsafe(method_family = none)]
2158 pub unsafe fn resetCursorRects(&self);
2159 );
2160}
2161
2162#[cfg(feature = "NSResponder")]
2164impl NSWindow {
2165 extern_methods!(
2166 #[cfg(all(
2167 feature = "NSDragging",
2168 feature = "NSDraggingItem",
2169 feature = "NSDraggingSession",
2170 feature = "NSEvent"
2171 ))]
2172 #[unsafe(method(beginDraggingSessionWithItems:event:source:))]
2173 #[unsafe(method_family = none)]
2174 pub unsafe fn beginDraggingSessionWithItems_event_source(
2175 &self,
2176 items: &NSArray<NSDraggingItem>,
2177 event: &NSEvent,
2178 source: &ProtocolObject<dyn NSDraggingSource>,
2179 ) -> Retained<NSDraggingSession>;
2180
2181 #[cfg(all(feature = "NSEvent", feature = "NSImage", feature = "NSPasteboard"))]
2182 #[deprecated = "Use -[NSWindow beginDraggingSessionWithItems:event:source:] instead."]
2183 #[unsafe(method(dragImage:at:offset:event:pasteboard:source:slideBack:))]
2184 #[unsafe(method_family = none)]
2185 pub unsafe fn dragImage_at_offset_event_pasteboard_source_slideBack(
2186 &self,
2187 image: &NSImage,
2188 base_location: NSPoint,
2189 initial_offset: NSSize,
2190 event: &NSEvent,
2191 pboard: &NSPasteboard,
2192 source_obj: &AnyObject,
2193 slide_flag: bool,
2194 );
2195
2196 #[cfg(feature = "NSPasteboard")]
2197 #[unsafe(method(registerForDraggedTypes:))]
2198 #[unsafe(method_family = none)]
2199 pub fn registerForDraggedTypes(&self, new_types: &NSArray<NSPasteboardType>);
2200
2201 #[unsafe(method(unregisterDraggedTypes))]
2202 #[unsafe(method_family = none)]
2203 pub unsafe fn unregisterDraggedTypes(&self);
2204 );
2205}
2206
2207#[cfg(feature = "NSResponder")]
2209impl NSWindow {
2210 extern_methods!(
2211 #[cfg(feature = "objc2-quartz-core")]
2212 #[cfg(target_vendor = "apple")]
2213 #[unsafe(method(displayLinkWithTarget:selector:))]
2214 #[unsafe(method_family = none)]
2215 pub unsafe fn displayLinkWithTarget_selector(
2216 &self,
2217 target: &AnyObject,
2218 selector: Sel,
2219 ) -> Retained<CADisplayLink>;
2220 );
2221}
2222
2223extern_protocol!(
2224 pub unsafe trait NSWindowDelegate: NSObjectProtocol + MainThreadOnly {
2226 #[cfg(feature = "NSResponder")]
2227 #[optional]
2228 #[unsafe(method(windowShouldClose:))]
2229 #[unsafe(method_family = none)]
2230 unsafe fn windowShouldClose(&self, sender: &NSWindow) -> bool;
2231
2232 #[cfg(feature = "NSResponder")]
2233 #[optional]
2234 #[unsafe(method(windowWillReturnFieldEditor:toObject:))]
2235 #[unsafe(method_family = none)]
2236 unsafe fn windowWillReturnFieldEditor_toObject(
2237 &self,
2238 sender: &NSWindow,
2239 client: Option<&AnyObject>,
2240 ) -> Option<Retained<AnyObject>>;
2241
2242 #[cfg(feature = "NSResponder")]
2243 #[optional]
2244 #[unsafe(method(windowWillResize:toSize:))]
2245 #[unsafe(method_family = none)]
2246 unsafe fn windowWillResize_toSize(&self, sender: &NSWindow, frame_size: NSSize) -> NSSize;
2247
2248 #[cfg(feature = "NSResponder")]
2249 #[optional]
2250 #[unsafe(method(windowWillUseStandardFrame:defaultFrame:))]
2251 #[unsafe(method_family = none)]
2252 unsafe fn windowWillUseStandardFrame_defaultFrame(
2253 &self,
2254 window: &NSWindow,
2255 new_frame: NSRect,
2256 ) -> NSRect;
2257
2258 #[cfg(feature = "NSResponder")]
2259 #[optional]
2260 #[unsafe(method(windowShouldZoom:toFrame:))]
2261 #[unsafe(method_family = none)]
2262 unsafe fn windowShouldZoom_toFrame(&self, window: &NSWindow, new_frame: NSRect) -> bool;
2263
2264 #[cfg(feature = "NSResponder")]
2265 #[optional]
2266 #[unsafe(method(windowWillReturnUndoManager:))]
2267 #[unsafe(method_family = none)]
2268 unsafe fn windowWillReturnUndoManager(
2269 &self,
2270 window: &NSWindow,
2271 ) -> Option<Retained<NSUndoManager>>;
2272
2273 #[cfg(feature = "NSResponder")]
2274 #[optional]
2276 #[unsafe(method(window:willPositionSheet:usingRect:))]
2277 #[unsafe(method_family = none)]
2278 unsafe fn window_willPositionSheet_usingRect(
2279 &self,
2280 window: &NSWindow,
2281 sheet: &NSWindow,
2282 rect: NSRect,
2283 ) -> NSRect;
2284
2285 #[cfg(all(feature = "NSMenu", feature = "NSResponder"))]
2286 #[optional]
2294 #[unsafe(method(window:shouldPopUpDocumentPathMenu:))]
2295 #[unsafe(method_family = none)]
2296 unsafe fn window_shouldPopUpDocumentPathMenu(
2297 &self,
2298 window: &NSWindow,
2299 menu: &NSMenu,
2300 ) -> bool;
2301
2302 #[cfg(all(feature = "NSEvent", feature = "NSPasteboard", feature = "NSResponder"))]
2303 #[optional]
2310 #[unsafe(method(window:shouldDragDocumentWithEvent:from:withPasteboard:))]
2311 #[unsafe(method_family = none)]
2312 unsafe fn window_shouldDragDocumentWithEvent_from_withPasteboard(
2313 &self,
2314 window: &NSWindow,
2315 event: &NSEvent,
2316 drag_image_location: NSPoint,
2317 pasteboard: &NSPasteboard,
2318 ) -> bool;
2319
2320 #[cfg(feature = "NSResponder")]
2321 #[optional]
2322 #[unsafe(method(window:willUseFullScreenContentSize:))]
2323 #[unsafe(method_family = none)]
2324 unsafe fn window_willUseFullScreenContentSize(
2325 &self,
2326 window: &NSWindow,
2327 proposed_size: NSSize,
2328 ) -> NSSize;
2329
2330 #[cfg(all(feature = "NSApplication", feature = "NSResponder"))]
2331 #[optional]
2332 #[unsafe(method(window:willUseFullScreenPresentationOptions:))]
2333 #[unsafe(method_family = none)]
2334 unsafe fn window_willUseFullScreenPresentationOptions(
2335 &self,
2336 window: &NSWindow,
2337 proposed_options: NSApplicationPresentationOptions,
2338 ) -> NSApplicationPresentationOptions;
2339
2340 #[cfg(feature = "NSResponder")]
2341 #[optional]
2343 #[unsafe(method(customWindowsToEnterFullScreenForWindow:))]
2344 #[unsafe(method_family = none)]
2345 unsafe fn customWindowsToEnterFullScreenForWindow(
2346 &self,
2347 window: &NSWindow,
2348 ) -> Option<Retained<NSArray<NSWindow>>>;
2349
2350 #[cfg(feature = "NSResponder")]
2351 #[optional]
2353 #[unsafe(method(window:startCustomAnimationToEnterFullScreenWithDuration:))]
2354 #[unsafe(method_family = none)]
2355 unsafe fn window_startCustomAnimationToEnterFullScreenWithDuration(
2356 &self,
2357 window: &NSWindow,
2358 duration: NSTimeInterval,
2359 );
2360
2361 #[cfg(feature = "NSResponder")]
2362 #[optional]
2364 #[unsafe(method(windowDidFailToEnterFullScreen:))]
2365 #[unsafe(method_family = none)]
2366 unsafe fn windowDidFailToEnterFullScreen(&self, window: &NSWindow);
2367
2368 #[cfg(feature = "NSResponder")]
2369 #[optional]
2371 #[unsafe(method(customWindowsToExitFullScreenForWindow:))]
2372 #[unsafe(method_family = none)]
2373 unsafe fn customWindowsToExitFullScreenForWindow(
2374 &self,
2375 window: &NSWindow,
2376 ) -> Option<Retained<NSArray<NSWindow>>>;
2377
2378 #[cfg(feature = "NSResponder")]
2379 #[optional]
2381 #[unsafe(method(window:startCustomAnimationToExitFullScreenWithDuration:))]
2382 #[unsafe(method_family = none)]
2383 unsafe fn window_startCustomAnimationToExitFullScreenWithDuration(
2384 &self,
2385 window: &NSWindow,
2386 duration: NSTimeInterval,
2387 );
2388
2389 #[cfg(all(feature = "NSResponder", feature = "NSScreen"))]
2390 #[optional]
2392 #[unsafe(method(customWindowsToEnterFullScreenForWindow:onScreen:))]
2393 #[unsafe(method_family = none)]
2394 unsafe fn customWindowsToEnterFullScreenForWindow_onScreen(
2395 &self,
2396 window: &NSWindow,
2397 screen: &NSScreen,
2398 ) -> Option<Retained<NSArray<NSWindow>>>;
2399
2400 #[cfg(all(feature = "NSResponder", feature = "NSScreen"))]
2401 #[optional]
2403 #[unsafe(method(window:startCustomAnimationToEnterFullScreenOnScreen:withDuration:))]
2404 #[unsafe(method_family = none)]
2405 unsafe fn window_startCustomAnimationToEnterFullScreenOnScreen_withDuration(
2406 &self,
2407 window: &NSWindow,
2408 screen: &NSScreen,
2409 duration: NSTimeInterval,
2410 );
2411
2412 #[cfg(feature = "NSResponder")]
2413 #[optional]
2415 #[unsafe(method(windowDidFailToExitFullScreen:))]
2416 #[unsafe(method_family = none)]
2417 unsafe fn windowDidFailToExitFullScreen(&self, window: &NSWindow);
2418
2419 #[cfg(feature = "NSResponder")]
2420 #[optional]
2424 #[unsafe(method(window:willResizeForVersionBrowserWithMaxPreferredSize:maxAllowedSize:))]
2425 #[unsafe(method_family = none)]
2426 unsafe fn window_willResizeForVersionBrowserWithMaxPreferredSize_maxAllowedSize(
2427 &self,
2428 window: &NSWindow,
2429 max_preferred_frame_size: NSSize,
2430 max_allowed_frame_size: NSSize,
2431 ) -> NSSize;
2432
2433 #[cfg(feature = "NSResponder")]
2434 #[optional]
2436 #[unsafe(method(window:willEncodeRestorableState:))]
2437 #[unsafe(method_family = none)]
2438 unsafe fn window_willEncodeRestorableState(&self, window: &NSWindow, state: &NSCoder);
2439
2440 #[cfg(feature = "NSResponder")]
2441 #[optional]
2444 #[unsafe(method(window:didDecodeRestorableState:))]
2445 #[unsafe(method_family = none)]
2446 unsafe fn window_didDecodeRestorableState(&self, window: &NSWindow, state: &NSCoder);
2447
2448 #[cfg(all(feature = "NSPreviewRepresentingActivityItem", feature = "NSResponder"))]
2449 #[optional]
2451 #[unsafe(method(previewRepresentableActivityItemsForWindow:))]
2452 #[unsafe(method_family = none)]
2453 unsafe fn previewRepresentableActivityItemsForWindow(
2454 &self,
2455 window: &NSWindow,
2456 ) -> Option<Retained<NSArray<ProtocolObject<dyn NSPreviewRepresentableActivityItem>>>>;
2457
2458 #[cfg(feature = "NSResponder")]
2459 #[optional]
2461 #[unsafe(method(windowForSharingRequestFromWindow:))]
2462 #[unsafe(method_family = none)]
2463 unsafe fn windowForSharingRequestFromWindow(
2464 &self,
2465 window: &NSWindow,
2466 ) -> Option<Retained<NSWindow>>;
2467
2468 #[optional]
2469 #[unsafe(method(windowDidResize:))]
2470 #[unsafe(method_family = none)]
2471 unsafe fn windowDidResize(&self, notification: &NSNotification);
2472
2473 #[optional]
2474 #[unsafe(method(windowDidExpose:))]
2475 #[unsafe(method_family = none)]
2476 unsafe fn windowDidExpose(&self, notification: &NSNotification);
2477
2478 #[optional]
2479 #[unsafe(method(windowWillMove:))]
2480 #[unsafe(method_family = none)]
2481 unsafe fn windowWillMove(&self, notification: &NSNotification);
2482
2483 #[optional]
2484 #[unsafe(method(windowDidMove:))]
2485 #[unsafe(method_family = none)]
2486 unsafe fn windowDidMove(&self, notification: &NSNotification);
2487
2488 #[optional]
2489 #[unsafe(method(windowDidBecomeKey:))]
2490 #[unsafe(method_family = none)]
2491 unsafe fn windowDidBecomeKey(&self, notification: &NSNotification);
2492
2493 #[optional]
2494 #[unsafe(method(windowDidResignKey:))]
2495 #[unsafe(method_family = none)]
2496 unsafe fn windowDidResignKey(&self, notification: &NSNotification);
2497
2498 #[optional]
2499 #[unsafe(method(windowDidBecomeMain:))]
2500 #[unsafe(method_family = none)]
2501 unsafe fn windowDidBecomeMain(&self, notification: &NSNotification);
2502
2503 #[optional]
2504 #[unsafe(method(windowDidResignMain:))]
2505 #[unsafe(method_family = none)]
2506 unsafe fn windowDidResignMain(&self, notification: &NSNotification);
2507
2508 #[optional]
2509 #[unsafe(method(windowWillClose:))]
2510 #[unsafe(method_family = none)]
2511 unsafe fn windowWillClose(&self, notification: &NSNotification);
2512
2513 #[optional]
2514 #[unsafe(method(windowWillMiniaturize:))]
2515 #[unsafe(method_family = none)]
2516 unsafe fn windowWillMiniaturize(&self, notification: &NSNotification);
2517
2518 #[optional]
2519 #[unsafe(method(windowDidMiniaturize:))]
2520 #[unsafe(method_family = none)]
2521 unsafe fn windowDidMiniaturize(&self, notification: &NSNotification);
2522
2523 #[optional]
2524 #[unsafe(method(windowDidDeminiaturize:))]
2525 #[unsafe(method_family = none)]
2526 unsafe fn windowDidDeminiaturize(&self, notification: &NSNotification);
2527
2528 #[optional]
2529 #[unsafe(method(windowDidUpdate:))]
2530 #[unsafe(method_family = none)]
2531 unsafe fn windowDidUpdate(&self, notification: &NSNotification);
2532
2533 #[optional]
2534 #[unsafe(method(windowDidChangeScreen:))]
2535 #[unsafe(method_family = none)]
2536 unsafe fn windowDidChangeScreen(&self, notification: &NSNotification);
2537
2538 #[optional]
2539 #[unsafe(method(windowDidChangeScreenProfile:))]
2540 #[unsafe(method_family = none)]
2541 unsafe fn windowDidChangeScreenProfile(&self, notification: &NSNotification);
2542
2543 #[optional]
2544 #[unsafe(method(windowDidChangeBackingProperties:))]
2545 #[unsafe(method_family = none)]
2546 unsafe fn windowDidChangeBackingProperties(&self, notification: &NSNotification);
2547
2548 #[optional]
2549 #[unsafe(method(windowWillBeginSheet:))]
2550 #[unsafe(method_family = none)]
2551 unsafe fn windowWillBeginSheet(&self, notification: &NSNotification);
2552
2553 #[optional]
2554 #[unsafe(method(windowDidEndSheet:))]
2555 #[unsafe(method_family = none)]
2556 unsafe fn windowDidEndSheet(&self, notification: &NSNotification);
2557
2558 #[optional]
2559 #[unsafe(method(windowWillStartLiveResize:))]
2560 #[unsafe(method_family = none)]
2561 unsafe fn windowWillStartLiveResize(&self, notification: &NSNotification);
2562
2563 #[optional]
2564 #[unsafe(method(windowDidEndLiveResize:))]
2565 #[unsafe(method_family = none)]
2566 unsafe fn windowDidEndLiveResize(&self, notification: &NSNotification);
2567
2568 #[optional]
2569 #[unsafe(method(windowWillEnterFullScreen:))]
2570 #[unsafe(method_family = none)]
2571 unsafe fn windowWillEnterFullScreen(&self, notification: &NSNotification);
2572
2573 #[optional]
2574 #[unsafe(method(windowDidEnterFullScreen:))]
2575 #[unsafe(method_family = none)]
2576 unsafe fn windowDidEnterFullScreen(&self, notification: &NSNotification);
2577
2578 #[optional]
2579 #[unsafe(method(windowWillExitFullScreen:))]
2580 #[unsafe(method_family = none)]
2581 unsafe fn windowWillExitFullScreen(&self, notification: &NSNotification);
2582
2583 #[optional]
2584 #[unsafe(method(windowDidExitFullScreen:))]
2585 #[unsafe(method_family = none)]
2586 unsafe fn windowDidExitFullScreen(&self, notification: &NSNotification);
2587
2588 #[optional]
2589 #[unsafe(method(windowWillEnterVersionBrowser:))]
2590 #[unsafe(method_family = none)]
2591 unsafe fn windowWillEnterVersionBrowser(&self, notification: &NSNotification);
2592
2593 #[optional]
2594 #[unsafe(method(windowDidEnterVersionBrowser:))]
2595 #[unsafe(method_family = none)]
2596 unsafe fn windowDidEnterVersionBrowser(&self, notification: &NSNotification);
2597
2598 #[optional]
2599 #[unsafe(method(windowWillExitVersionBrowser:))]
2600 #[unsafe(method_family = none)]
2601 unsafe fn windowWillExitVersionBrowser(&self, notification: &NSNotification);
2602
2603 #[optional]
2604 #[unsafe(method(windowDidExitVersionBrowser:))]
2605 #[unsafe(method_family = none)]
2606 unsafe fn windowDidExitVersionBrowser(&self, notification: &NSNotification);
2607
2608 #[optional]
2609 #[unsafe(method(windowDidChangeOcclusionState:))]
2610 #[unsafe(method_family = none)]
2611 unsafe fn windowDidChangeOcclusionState(&self, notification: &NSNotification);
2612 }
2613);
2614
2615extern "C" {
2616 pub static NSWindowDidBecomeKeyNotification: &'static NSNotificationName;
2618}
2619
2620extern "C" {
2621 pub static NSWindowDidBecomeMainNotification: &'static NSNotificationName;
2623}
2624
2625extern "C" {
2626 pub static NSWindowDidChangeScreenNotification: &'static NSNotificationName;
2628}
2629
2630extern "C" {
2631 pub static NSWindowDidDeminiaturizeNotification: &'static NSNotificationName;
2633}
2634
2635extern "C" {
2636 pub static NSWindowDidExposeNotification: &'static NSNotificationName;
2638}
2639
2640extern "C" {
2641 pub static NSWindowDidMiniaturizeNotification: &'static NSNotificationName;
2643}
2644
2645extern "C" {
2646 pub static NSWindowDidMoveNotification: &'static NSNotificationName;
2648}
2649
2650extern "C" {
2651 pub static NSWindowDidResignKeyNotification: &'static NSNotificationName;
2653}
2654
2655extern "C" {
2656 pub static NSWindowDidResignMainNotification: &'static NSNotificationName;
2658}
2659
2660extern "C" {
2661 pub static NSWindowDidResizeNotification: &'static NSNotificationName;
2663}
2664
2665extern "C" {
2666 pub static NSWindowDidUpdateNotification: &'static NSNotificationName;
2668}
2669
2670extern "C" {
2671 pub static NSWindowWillCloseNotification: &'static NSNotificationName;
2673}
2674
2675extern "C" {
2676 pub static NSWindowWillMiniaturizeNotification: &'static NSNotificationName;
2678}
2679
2680extern "C" {
2681 pub static NSWindowWillMoveNotification: &'static NSNotificationName;
2683}
2684
2685extern "C" {
2686 pub static NSWindowWillBeginSheetNotification: &'static NSNotificationName;
2688}
2689
2690extern "C" {
2691 pub static NSWindowDidEndSheetNotification: &'static NSNotificationName;
2693}
2694
2695extern "C" {
2696 pub static NSWindowDidChangeBackingPropertiesNotification: &'static NSNotificationName;
2707}
2708
2709extern "C" {
2710 pub static NSBackingPropertyOldScaleFactorKey: &'static NSString;
2712}
2713
2714extern "C" {
2715 pub static NSBackingPropertyOldColorSpaceKey: &'static NSString;
2717}
2718
2719extern "C" {
2720 pub static NSWindowDidChangeScreenProfileNotification: &'static NSNotificationName;
2725}
2726
2727extern "C" {
2728 pub static NSWindowWillStartLiveResizeNotification: &'static NSNotificationName;
2732}
2733
2734extern "C" {
2735 pub static NSWindowDidEndLiveResizeNotification: &'static NSNotificationName;
2739}
2740
2741extern "C" {
2742 pub static NSWindowWillEnterFullScreenNotification: &'static NSNotificationName;
2744}
2745
2746extern "C" {
2747 pub static NSWindowDidEnterFullScreenNotification: &'static NSNotificationName;
2749}
2750
2751extern "C" {
2752 pub static NSWindowWillExitFullScreenNotification: &'static NSNotificationName;
2754}
2755
2756extern "C" {
2757 pub static NSWindowDidExitFullScreenNotification: &'static NSNotificationName;
2759}
2760
2761extern "C" {
2762 pub static NSWindowWillEnterVersionBrowserNotification: &'static NSNotificationName;
2764}
2765
2766extern "C" {
2767 pub static NSWindowDidEnterVersionBrowserNotification: &'static NSNotificationName;
2769}
2770
2771extern "C" {
2772 pub static NSWindowWillExitVersionBrowserNotification: &'static NSNotificationName;
2774}
2775
2776extern "C" {
2777 pub static NSWindowDidExitVersionBrowserNotification: &'static NSNotificationName;
2779}
2780
2781extern "C" {
2782 pub static NSWindowDidChangeOcclusionStateNotification: &'static NSNotificationName;
2787}
2788
2789#[deprecated]
2792#[repr(transparent)]
2793#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
2794pub struct NSWindowBackingLocation(pub NSUInteger);
2795impl NSWindowBackingLocation {
2796 #[doc(alias = "NSWindowBackingLocationDefault")]
2797 pub const Default: Self = Self(0);
2798 #[doc(alias = "NSWindowBackingLocationVideoMemory")]
2799 pub const VideoMemory: Self = Self(1);
2800 #[doc(alias = "NSWindowBackingLocationMainMemory")]
2801 pub const MainMemory: Self = Self(2);
2802}
2803
2804unsafe impl Encode for NSWindowBackingLocation {
2805 const ENCODING: Encoding = NSUInteger::ENCODING;
2806}
2807
2808unsafe impl RefEncode for NSWindowBackingLocation {
2809 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
2810}
2811
2812#[cfg(feature = "NSResponder")]
2814impl NSWindow {
2815 extern_methods!(
2816 #[deprecated = "This method shouldn’t be used as it doesn’t work in all drawing situations; instead, a subview should be used that implements the desired drawing behavior"]
2817 #[unsafe(method(cacheImageInRect:))]
2818 #[unsafe(method_family = none)]
2819 pub unsafe fn cacheImageInRect(&self, rect: NSRect);
2820
2821 #[deprecated = "This method shouldn’t be used as it doesn’t work in all drawing situations; instead, a subview should be used that implements the desired drawing behavior"]
2822 #[unsafe(method(restoreCachedImage))]
2823 #[unsafe(method_family = none)]
2824 pub unsafe fn restoreCachedImage(&self);
2825
2826 #[deprecated = "This method shouldn’t be used as it doesn’t work in all drawing situations; instead, a subview should be used that implements the desired drawing behavior"]
2827 #[unsafe(method(discardCachedImage))]
2828 #[unsafe(method_family = none)]
2829 pub unsafe fn discardCachedImage(&self);
2830
2831 #[cfg(feature = "NSMenu")]
2832 #[deprecated = "This method does not do anything and should not be called."]
2833 #[unsafe(method(menuChanged:))]
2834 #[unsafe(method_family = none)]
2835 pub unsafe fn menuChanged(menu: &NSMenu);
2836
2837 #[deprecated = "This method is unused and should not be called."]
2838 #[unsafe(method(gState))]
2839 #[unsafe(method_family = none)]
2840 pub unsafe fn gState(&self) -> NSInteger;
2841
2842 #[deprecated = "Use -convertRectToScreen: or -convertPointToScreen: instead"]
2843 #[unsafe(method(convertBaseToScreen:))]
2844 #[unsafe(method_family = none)]
2845 pub unsafe fn convertBaseToScreen(&self, point: NSPoint) -> NSPoint;
2846
2847 #[deprecated = "Use -convertRectFromScreen or -convertPointFromScreen: instead"]
2848 #[unsafe(method(convertScreenToBase:))]
2849 #[unsafe(method_family = none)]
2850 pub unsafe fn convertScreenToBase(&self, point: NSPoint) -> NSPoint;
2851
2852 #[cfg(feature = "objc2-core-foundation")]
2853 #[deprecated = "Use -convertRectToBacking: and -backingScaleFactor instead"]
2854 #[unsafe(method(userSpaceScaleFactor))]
2855 #[unsafe(method_family = none)]
2856 pub unsafe fn userSpaceScaleFactor(&self) -> CGFloat;
2857
2858 #[deprecated = "This method does not do anything and should not be called."]
2859 #[unsafe(method(useOptimizedDrawing:))]
2860 #[unsafe(method_family = none)]
2861 pub unsafe fn useOptimizedDrawing(&self, flag: bool);
2862
2863 #[deprecated = "This method does not do anything and should not be called."]
2864 #[unsafe(method(canStoreColor))]
2865 #[unsafe(method_family = none)]
2866 pub unsafe fn canStoreColor(&self) -> bool;
2867
2868 #[deprecated = "Use +[NSAnimationContext runAnimationGroup:completionHandler:] to perform atomic updates across runloop invocations."]
2869 #[unsafe(method(disableFlushWindow))]
2870 #[unsafe(method_family = none)]
2871 pub unsafe fn disableFlushWindow(&self);
2872
2873 #[deprecated = "Use +[NSAnimationContext runAnimationGroup:completionHandler:] to perform atomic updates across runloop invocations."]
2874 #[unsafe(method(enableFlushWindow))]
2875 #[unsafe(method_family = none)]
2876 pub unsafe fn enableFlushWindow(&self);
2877
2878 #[deprecated = "Use +[NSAnimationContext runAnimationGroup:completionHandler:] to perform atomic updates across runloop invocations."]
2879 #[unsafe(method(isFlushWindowDisabled))]
2880 #[unsafe(method_family = none)]
2881 pub unsafe fn isFlushWindowDisabled(&self) -> bool;
2882
2883 #[deprecated = "Allow AppKit's automatic deferred display mechanism to take care of flushing any graphics contexts as needed."]
2884 #[unsafe(method(flushWindow))]
2885 #[unsafe(method_family = none)]
2886 pub unsafe fn flushWindow(&self);
2887
2888 #[deprecated = "Allow AppKit's automatic deferred display mechanism to take care of flushing any graphics contexts as needed."]
2889 #[unsafe(method(flushWindowIfNeeded))]
2890 #[unsafe(method_family = none)]
2891 pub unsafe fn flushWindowIfNeeded(&self);
2892
2893 #[deprecated = "Use +[NSAnimationContext runAnimationGroup:completionHandler:] to temporarily prevent AppKit's automatic deferred display mechanism from drawing."]
2894 #[unsafe(method(isAutodisplay))]
2895 #[unsafe(method_family = none)]
2896 pub unsafe fn isAutodisplay(&self) -> bool;
2897
2898 #[deprecated = "Use +[NSAnimationContext runAnimationGroup:completionHandler:] to temporarily prevent AppKit's automatic deferred display mechanism from drawing."]
2900 #[unsafe(method(setAutodisplay:))]
2901 #[unsafe(method_family = none)]
2902 pub unsafe fn setAutodisplay(&self, autodisplay: bool);
2903
2904 #[cfg(feature = "NSGraphicsContext")]
2905 #[deprecated = "Add instances of NSView to display content in a window."]
2906 #[unsafe(method(graphicsContext))]
2907 #[unsafe(method_family = none)]
2908 pub unsafe fn graphicsContext(&self) -> Option<Retained<NSGraphicsContext>>;
2909
2910 #[deprecated = "This property does not do anything and should not be used"]
2911 #[unsafe(method(isOneShot))]
2912 #[unsafe(method_family = none)]
2913 pub unsafe fn isOneShot(&self) -> bool;
2914
2915 #[deprecated = "This property does not do anything and should not be used"]
2917 #[unsafe(method(setOneShot:))]
2918 #[unsafe(method_family = none)]
2919 pub unsafe fn setOneShot(&self, one_shot: bool);
2920
2921 #[deprecated = "This property does not do anything and should not be used"]
2922 #[unsafe(method(preferredBackingLocation))]
2923 #[unsafe(method_family = none)]
2924 pub unsafe fn preferredBackingLocation(&self) -> NSWindowBackingLocation;
2925
2926 #[deprecated = "This property does not do anything and should not be used"]
2928 #[unsafe(method(setPreferredBackingLocation:))]
2929 #[unsafe(method_family = none)]
2930 pub unsafe fn setPreferredBackingLocation(
2931 &self,
2932 preferred_backing_location: NSWindowBackingLocation,
2933 );
2934
2935 #[deprecated = "This property does not do anything and should not be used"]
2936 #[unsafe(method(backingLocation))]
2937 #[unsafe(method_family = none)]
2938 pub unsafe fn backingLocation(&self) -> NSWindowBackingLocation;
2939
2940 #[deprecated = "This property does not do anything and should not be used."]
2941 #[unsafe(method(showsResizeIndicator))]
2942 #[unsafe(method_family = none)]
2943 pub unsafe fn showsResizeIndicator(&self) -> bool;
2944
2945 #[deprecated = "This property does not do anything and should not be used."]
2947 #[unsafe(method(setShowsResizeIndicator:))]
2948 #[unsafe(method_family = none)]
2949 pub unsafe fn setShowsResizeIndicator(&self, shows_resize_indicator: bool);
2950
2951 #[deprecated = "This method should not be used."]
2952 #[unsafe(method(initWithWindowRef:))]
2953 #[unsafe(method_family = init)]
2954 pub unsafe fn initWithWindowRef(
2955 this: Allocated<Self>,
2956 window_ref: NonNull<c_void>,
2957 ) -> Option<Retained<NSWindow>>;
2958
2959 #[deprecated = "This method should not be used."]
2960 #[unsafe(method(windowRef))]
2961 #[unsafe(method_family = none)]
2962 pub unsafe fn windowRef(&self) -> NonNull<c_void>;
2963
2964 #[deprecated = "This method does not do anything and should not be called."]
2965 #[unsafe(method(disableScreenUpdatesUntilFlush))]
2966 #[unsafe(method_family = none)]
2967 pub unsafe fn disableScreenUpdatesUntilFlush(&self);
2968 );
2969}
2970
2971pub static NSBorderlessWindowMask: NSWindowStyleMask =
2973 NSWindowStyleMask(NSWindowStyleMask::Borderless.0);
2974
2975pub static NSTitledWindowMask: NSWindowStyleMask = NSWindowStyleMask(NSWindowStyleMask::Titled.0);
2977
2978pub static NSClosableWindowMask: NSWindowStyleMask =
2980 NSWindowStyleMask(NSWindowStyleMask::Closable.0);
2981
2982pub static NSMiniaturizableWindowMask: NSWindowStyleMask =
2984 NSWindowStyleMask(NSWindowStyleMask::Miniaturizable.0);
2985
2986pub static NSResizableWindowMask: NSWindowStyleMask =
2988 NSWindowStyleMask(NSWindowStyleMask::Resizable.0);
2989
2990pub static NSTexturedBackgroundWindowMask: NSWindowStyleMask =
2992 NSWindowStyleMask(NSWindowStyleMask::TexturedBackground.0);
2993
2994pub static NSUnifiedTitleAndToolbarWindowMask: NSWindowStyleMask =
2996 NSWindowStyleMask(NSWindowStyleMask::UnifiedTitleAndToolbar.0);
2997
2998pub static NSFullScreenWindowMask: NSWindowStyleMask =
3000 NSWindowStyleMask(NSWindowStyleMask::FullScreen.0);
3001
3002pub static NSFullSizeContentViewWindowMask: NSWindowStyleMask =
3004 NSWindowStyleMask(NSWindowStyleMask::FullSizeContentView.0);
3005
3006pub static NSUtilityWindowMask: NSWindowStyleMask =
3008 NSWindowStyleMask(NSWindowStyleMask::UtilityWindow.0);
3009
3010pub static NSDocModalWindowMask: NSWindowStyleMask =
3012 NSWindowStyleMask(NSWindowStyleMask::DocModalWindow.0);
3013
3014pub static NSNonactivatingPanelMask: NSWindowStyleMask =
3016 NSWindowStyleMask(NSWindowStyleMask::NonactivatingPanel.0);
3017
3018pub static NSHUDWindowMask: NSWindowStyleMask = NSWindowStyleMask(NSWindowStyleMask::HUDWindow.0);
3020
3021pub static NSUnscaledWindowMask: NSWindowStyleMask = NSWindowStyleMask(1 << 11);
3023
3024pub static NSWindowFullScreenButton: NSWindowButton = NSWindowButton(7);
3026
3027pub static NSDockWindowLevel: NSWindowLevel = 20;
3029
3030pub static NSWindowSharingReadWrite: NSWindowSharingType = NSWindowSharingType(2);