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#[deprecated = "Textured window style should no longer be used"]
41 #[doc(alias = "NSWindowStyleMaskTexturedBackground")]
42 const TexturedBackground = 1<<8;
43 #[doc(alias = "NSWindowStyleMaskUnifiedTitleAndToolbar")]
44 const UnifiedTitleAndToolbar = 1<<12;
45 #[doc(alias = "NSWindowStyleMaskFullScreen")]
46 const FullScreen = 1<<14;
47 #[doc(alias = "NSWindowStyleMaskFullSizeContentView")]
48 const FullSizeContentView = 1<<15;
49 #[doc(alias = "NSWindowStyleMaskUtilityWindow")]
50 const UtilityWindow = 1<<4;
51 #[doc(alias = "NSWindowStyleMaskDocModalWindow")]
52 const DocModalWindow = 1<<6;
53 #[doc(alias = "NSWindowStyleMaskNonactivatingPanel")]
54 const NonactivatingPanel = 1<<7;
55 #[doc(alias = "NSWindowStyleMaskHUDWindow")]
56 const HUDWindow = 1<<13;
57 }
58}
59
60unsafe impl Encode for NSWindowStyleMask {
61 const ENCODING: Encoding = NSUInteger::ENCODING;
62}
63
64unsafe impl RefEncode for NSWindowStyleMask {
65 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
66}
67
68#[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"))]
479unsafe impl NSAccessibility for NSWindow {}
480
481#[cfg(all(feature = "NSAccessibilityProtocols", feature = "NSResponder"))]
482unsafe impl NSAccessibilityElementProtocol for NSWindow {}
483
484#[cfg(all(feature = "NSAnimation", feature = "NSResponder"))]
485unsafe impl NSAnimatablePropertyContainer for NSWindow {}
486
487#[cfg(all(feature = "NSAppearance", feature = "NSResponder"))]
488unsafe impl NSAppearanceCustomization for NSWindow {}
489
490#[cfg(feature = "NSResponder")]
491unsafe impl NSCoding for NSWindow {}
492
493#[cfg(all(feature = "NSMenu", feature = "NSResponder"))]
494unsafe impl NSMenuItemValidation for NSWindow {}
495
496#[cfg(feature = "NSResponder")]
497unsafe impl NSObjectProtocol for NSWindow {}
498
499#[cfg(all(feature = "NSResponder", feature = "NSUserInterfaceItemIdentification"))]
500unsafe impl NSUserInterfaceItemIdentification for NSWindow {}
501
502#[cfg(all(feature = "NSResponder", feature = "NSUserInterfaceValidation"))]
503unsafe impl NSUserInterfaceValidations for NSWindow {}
504
505#[cfg(feature = "NSResponder")]
506impl NSWindow {
507 extern_methods!(
508 #[unsafe(method(frameRectForContentRect:styleMask:))]
509 #[unsafe(method_family = none)]
510 pub unsafe fn frameRectForContentRect_styleMask(
511 c_rect: NSRect,
512 style: NSWindowStyleMask,
513 mtm: MainThreadMarker,
514 ) -> NSRect;
515
516 #[unsafe(method(contentRectForFrameRect:styleMask:))]
517 #[unsafe(method_family = none)]
518 pub unsafe fn contentRectForFrameRect_styleMask(
519 f_rect: NSRect,
520 style: NSWindowStyleMask,
521 mtm: MainThreadMarker,
522 ) -> NSRect;
523
524 #[cfg(feature = "objc2-core-foundation")]
525 #[unsafe(method(minFrameWidthWithTitle:styleMask:))]
526 #[unsafe(method_family = none)]
527 pub unsafe fn minFrameWidthWithTitle_styleMask(
528 title: &NSString,
529 style: NSWindowStyleMask,
530 mtm: MainThreadMarker,
531 ) -> CGFloat;
532
533 #[cfg(feature = "NSGraphics")]
534 #[unsafe(method(defaultDepthLimit))]
535 #[unsafe(method_family = none)]
536 pub unsafe fn defaultDepthLimit(mtm: MainThreadMarker) -> NSWindowDepth;
537
538 #[unsafe(method(frameRectForContentRect:))]
539 #[unsafe(method_family = none)]
540 pub unsafe fn frameRectForContentRect(&self, content_rect: NSRect) -> NSRect;
541
542 #[unsafe(method(contentRectForFrameRect:))]
543 #[unsafe(method_family = none)]
544 pub fn contentRectForFrameRect(&self, frame_rect: NSRect) -> NSRect;
545
546 #[cfg(feature = "NSGraphics")]
547 #[unsafe(method(initWithContentRect:styleMask:backing:defer:))]
548 #[unsafe(method_family = init)]
549 pub unsafe fn initWithContentRect_styleMask_backing_defer(
550 this: Allocated<Self>,
551 content_rect: NSRect,
552 style: NSWindowStyleMask,
553 backing_store_type: NSBackingStoreType,
554 flag: bool,
555 ) -> Retained<Self>;
556
557 #[cfg(all(feature = "NSGraphics", feature = "NSScreen"))]
558 #[unsafe(method(initWithContentRect:styleMask:backing:defer:screen:))]
559 #[unsafe(method_family = init)]
560 pub unsafe fn initWithContentRect_styleMask_backing_defer_screen(
561 this: Allocated<Self>,
562 content_rect: NSRect,
563 style: NSWindowStyleMask,
564 backing_store_type: NSBackingStoreType,
565 flag: bool,
566 screen: Option<&NSScreen>,
567 ) -> Retained<Self>;
568
569 #[unsafe(method(initWithCoder:))]
570 #[unsafe(method_family = init)]
571 pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
572
573 #[unsafe(method(title))]
574 #[unsafe(method_family = none)]
575 pub fn title(&self) -> Retained<NSString>;
576
577 #[unsafe(method(setTitle:))]
579 #[unsafe(method_family = none)]
580 pub fn setTitle(&self, title: &NSString);
581
582 #[unsafe(method(subtitle))]
585 #[unsafe(method_family = none)]
586 pub unsafe fn subtitle(&self) -> Retained<NSString>;
587
588 #[unsafe(method(setSubtitle:))]
590 #[unsafe(method_family = none)]
591 pub unsafe fn setSubtitle(&self, subtitle: &NSString);
592
593 #[unsafe(method(titleVisibility))]
595 #[unsafe(method_family = none)]
596 pub unsafe fn titleVisibility(&self) -> NSWindowTitleVisibility;
597
598 #[unsafe(method(setTitleVisibility:))]
600 #[unsafe(method_family = none)]
601 pub fn setTitleVisibility(&self, title_visibility: NSWindowTitleVisibility);
602
603 #[unsafe(method(titlebarAppearsTransparent))]
607 #[unsafe(method_family = none)]
608 pub unsafe fn titlebarAppearsTransparent(&self) -> bool;
609
610 #[unsafe(method(setTitlebarAppearsTransparent:))]
612 #[unsafe(method_family = none)]
613 pub fn setTitlebarAppearsTransparent(&self, titlebar_appears_transparent: bool);
614
615 #[unsafe(method(toolbarStyle))]
617 #[unsafe(method_family = none)]
618 pub unsafe fn toolbarStyle(&self) -> NSWindowToolbarStyle;
619
620 #[unsafe(method(setToolbarStyle:))]
622 #[unsafe(method_family = none)]
623 pub unsafe fn setToolbarStyle(&self, toolbar_style: NSWindowToolbarStyle);
624
625 #[unsafe(method(contentLayoutRect))]
631 #[unsafe(method_family = none)]
632 pub unsafe fn contentLayoutRect(&self) -> NSRect;
633
634 #[unsafe(method(contentLayoutGuide))]
638 #[unsafe(method_family = none)]
639 pub unsafe fn contentLayoutGuide(&self) -> Option<Retained<AnyObject>>;
640
641 #[cfg(all(
642 feature = "NSTitlebarAccessoryViewController",
643 feature = "NSViewController"
644 ))]
645 #[unsafe(method(titlebarAccessoryViewControllers))]
646 #[unsafe(method_family = none)]
647 pub unsafe fn titlebarAccessoryViewControllers(
648 &self,
649 ) -> Retained<NSArray<NSTitlebarAccessoryViewController>>;
650
651 #[cfg(all(
652 feature = "NSTitlebarAccessoryViewController",
653 feature = "NSViewController"
654 ))]
655 #[unsafe(method(setTitlebarAccessoryViewControllers:))]
657 #[unsafe(method_family = none)]
658 pub unsafe fn setTitlebarAccessoryViewControllers(
659 &self,
660 titlebar_accessory_view_controllers: &NSArray<NSTitlebarAccessoryViewController>,
661 );
662
663 #[cfg(all(
664 feature = "NSTitlebarAccessoryViewController",
665 feature = "NSViewController"
666 ))]
667 #[unsafe(method(addTitlebarAccessoryViewController:))]
668 #[unsafe(method_family = none)]
669 pub unsafe fn addTitlebarAccessoryViewController(
670 &self,
671 child_view_controller: &NSTitlebarAccessoryViewController,
672 );
673
674 #[cfg(all(
675 feature = "NSTitlebarAccessoryViewController",
676 feature = "NSViewController"
677 ))]
678 #[unsafe(method(insertTitlebarAccessoryViewController:atIndex:))]
679 #[unsafe(method_family = none)]
680 pub unsafe fn insertTitlebarAccessoryViewController_atIndex(
681 &self,
682 child_view_controller: &NSTitlebarAccessoryViewController,
683 index: NSInteger,
684 );
685
686 #[unsafe(method(removeTitlebarAccessoryViewControllerAtIndex:))]
687 #[unsafe(method_family = none)]
688 pub unsafe fn removeTitlebarAccessoryViewControllerAtIndex(&self, index: NSInteger);
689
690 #[unsafe(method(representedURL))]
694 #[unsafe(method_family = none)]
695 pub unsafe fn representedURL(&self) -> Option<Retained<NSURL>>;
696
697 #[unsafe(method(setRepresentedURL:))]
699 #[unsafe(method_family = none)]
700 pub unsafe fn setRepresentedURL(&self, represented_url: Option<&NSURL>);
701
702 #[unsafe(method(representedFilename))]
703 #[unsafe(method_family = none)]
704 pub unsafe fn representedFilename(&self) -> Retained<NSString>;
705
706 #[unsafe(method(setRepresentedFilename:))]
708 #[unsafe(method_family = none)]
709 pub unsafe fn setRepresentedFilename(&self, represented_filename: &NSString);
710
711 #[unsafe(method(setTitleWithRepresentedFilename:))]
712 #[unsafe(method_family = none)]
713 pub unsafe fn setTitleWithRepresentedFilename(&self, filename: &NSString);
714
715 #[unsafe(method(isExcludedFromWindowsMenu))]
716 #[unsafe(method_family = none)]
717 pub unsafe fn isExcludedFromWindowsMenu(&self) -> bool;
718
719 #[unsafe(method(setExcludedFromWindowsMenu:))]
721 #[unsafe(method_family = none)]
722 pub unsafe fn setExcludedFromWindowsMenu(&self, excluded_from_windows_menu: bool);
723
724 #[cfg(feature = "NSView")]
725 #[unsafe(method(contentView))]
726 #[unsafe(method_family = none)]
727 pub fn contentView(&self) -> Option<Retained<NSView>>;
728
729 #[cfg(feature = "NSView")]
730 #[unsafe(method(setContentView:))]
732 #[unsafe(method_family = none)]
733 pub fn setContentView(&self, content_view: Option<&NSView>);
734
735 #[unsafe(method(delegate))]
736 #[unsafe(method_family = none)]
737 pub unsafe fn delegate(&self) -> Option<Retained<ProtocolObject<dyn NSWindowDelegate>>>;
738
739 #[unsafe(method(setDelegate:))]
742 #[unsafe(method_family = none)]
743 pub fn setDelegate(&self, delegate: Option<&ProtocolObject<dyn NSWindowDelegate>>);
744
745 #[unsafe(method(windowNumber))]
746 #[unsafe(method_family = none)]
747 pub unsafe fn windowNumber(&self) -> NSInteger;
748
749 #[unsafe(method(styleMask))]
754 #[unsafe(method_family = none)]
755 pub fn styleMask(&self) -> NSWindowStyleMask;
756
757 #[unsafe(method(setStyleMask:))]
759 #[unsafe(method_family = none)]
760 pub fn setStyleMask(&self, style_mask: NSWindowStyleMask);
761
762 #[cfg(all(feature = "NSText", feature = "NSView"))]
763 #[unsafe(method(fieldEditor:forObject:))]
764 #[unsafe(method_family = none)]
765 pub unsafe fn fieldEditor_forObject(
766 &self,
767 create_flag: bool,
768 object: Option<&AnyObject>,
769 ) -> Option<Retained<NSText>>;
770
771 #[unsafe(method(endEditingFor:))]
772 #[unsafe(method_family = none)]
773 pub unsafe fn endEditingFor(&self, object: Option<&AnyObject>);
774
775 #[cfg(feature = "NSScreen")]
776 #[unsafe(method(constrainFrameRect:toScreen:))]
777 #[unsafe(method_family = none)]
778 pub unsafe fn constrainFrameRect_toScreen(
779 &self,
780 frame_rect: NSRect,
781 screen: Option<&NSScreen>,
782 ) -> NSRect;
783
784 #[unsafe(method(setFrame:display:))]
785 #[unsafe(method_family = none)]
786 pub fn setFrame_display(&self, frame_rect: NSRect, flag: bool);
787
788 #[unsafe(method(setContentSize:))]
789 #[unsafe(method_family = none)]
790 pub fn setContentSize(&self, size: NSSize);
791
792 #[unsafe(method(setFrameOrigin:))]
793 #[unsafe(method_family = none)]
794 pub unsafe fn setFrameOrigin(&self, point: NSPoint);
795
796 #[unsafe(method(setFrameTopLeftPoint:))]
797 #[unsafe(method_family = none)]
798 pub fn setFrameTopLeftPoint(&self, point: NSPoint);
799
800 #[unsafe(method(cascadeTopLeftFromPoint:))]
801 #[unsafe(method_family = none)]
802 pub unsafe fn cascadeTopLeftFromPoint(&self, top_left_point: NSPoint) -> NSPoint;
803
804 #[unsafe(method(cascadingReferenceFrame))]
806 #[unsafe(method_family = none)]
807 pub unsafe fn cascadingReferenceFrame(&self) -> NSRect;
808
809 #[unsafe(method(frame))]
810 #[unsafe(method_family = none)]
811 pub fn frame(&self) -> NSRect;
812
813 #[unsafe(method(animationResizeTime:))]
818 #[unsafe(method_family = none)]
819 pub unsafe fn animationResizeTime(&self, new_frame: NSRect) -> NSTimeInterval;
820
821 #[unsafe(method(setFrame:display:animate:))]
828 #[unsafe(method_family = none)]
829 pub unsafe fn setFrame_display_animate(
830 &self,
831 frame_rect: NSRect,
832 display_flag: bool,
833 animate_flag: bool,
834 );
835
836 #[unsafe(method(inLiveResize))]
837 #[unsafe(method_family = none)]
838 pub unsafe fn inLiveResize(&self) -> bool;
839
840 #[unsafe(method(resizeIncrements))]
841 #[unsafe(method_family = none)]
842 pub unsafe fn resizeIncrements(&self) -> NSSize;
843
844 #[unsafe(method(setResizeIncrements:))]
846 #[unsafe(method_family = none)]
847 pub fn setResizeIncrements(&self, resize_increments: NSSize);
848
849 #[unsafe(method(aspectRatio))]
850 #[unsafe(method_family = none)]
851 pub unsafe fn aspectRatio(&self) -> NSSize;
852
853 #[unsafe(method(setAspectRatio:))]
855 #[unsafe(method_family = none)]
856 pub unsafe fn setAspectRatio(&self, aspect_ratio: NSSize);
857
858 #[unsafe(method(contentResizeIncrements))]
859 #[unsafe(method_family = none)]
860 pub fn contentResizeIncrements(&self) -> NSSize;
861
862 #[unsafe(method(setContentResizeIncrements:))]
864 #[unsafe(method_family = none)]
865 pub fn setContentResizeIncrements(&self, content_resize_increments: NSSize);
866
867 #[unsafe(method(contentAspectRatio))]
868 #[unsafe(method_family = none)]
869 pub unsafe fn contentAspectRatio(&self) -> NSSize;
870
871 #[unsafe(method(setContentAspectRatio:))]
873 #[unsafe(method_family = none)]
874 pub unsafe fn setContentAspectRatio(&self, content_aspect_ratio: NSSize);
875
876 #[unsafe(method(viewsNeedDisplay))]
877 #[unsafe(method_family = none)]
878 pub unsafe fn viewsNeedDisplay(&self) -> bool;
879
880 #[unsafe(method(setViewsNeedDisplay:))]
882 #[unsafe(method_family = none)]
883 pub unsafe fn setViewsNeedDisplay(&self, views_need_display: bool);
884
885 #[unsafe(method(displayIfNeeded))]
886 #[unsafe(method_family = none)]
887 pub unsafe fn displayIfNeeded(&self);
888
889 #[unsafe(method(display))]
890 #[unsafe(method_family = none)]
891 pub unsafe fn display(&self);
892
893 #[unsafe(method(preservesContentDuringLiveResize))]
894 #[unsafe(method_family = none)]
895 pub unsafe fn preservesContentDuringLiveResize(&self) -> bool;
896
897 #[unsafe(method(setPreservesContentDuringLiveResize:))]
899 #[unsafe(method_family = none)]
900 pub unsafe fn setPreservesContentDuringLiveResize(
901 &self,
902 preserves_content_during_live_resize: bool,
903 );
904
905 #[unsafe(method(update))]
906 #[unsafe(method_family = none)]
907 pub unsafe fn update(&self);
908
909 #[unsafe(method(makeFirstResponder:))]
910 #[unsafe(method_family = none)]
911 pub fn makeFirstResponder(&self, responder: Option<&NSResponder>) -> bool;
912
913 #[unsafe(method(firstResponder))]
914 #[unsafe(method_family = none)]
915 pub fn firstResponder(&self) -> Option<Retained<NSResponder>>;
916
917 #[cfg(feature = "NSEvent")]
918 #[unsafe(method(resizeFlags))]
919 #[unsafe(method_family = none)]
920 pub unsafe fn resizeFlags(&self) -> NSEventModifierFlags;
921
922 #[unsafe(method(close))]
923 #[unsafe(method_family = none)]
924 pub fn close(&self);
925
926 #[unsafe(method(isReleasedWhenClosed))]
927 #[unsafe(method_family = none)]
928 pub unsafe fn isReleasedWhenClosed(&self) -> bool;
929
930 #[unsafe(method(setReleasedWhenClosed:))]
932 #[unsafe(method_family = none)]
933 pub unsafe fn setReleasedWhenClosed(&self, released_when_closed: bool);
934
935 #[unsafe(method(miniaturize:))]
936 #[unsafe(method_family = none)]
937 pub fn miniaturize(&self, sender: Option<&AnyObject>);
938
939 #[unsafe(method(deminiaturize:))]
940 #[unsafe(method_family = none)]
941 pub unsafe fn deminiaturize(&self, sender: Option<&AnyObject>);
942
943 #[unsafe(method(isZoomed))]
944 #[unsafe(method_family = none)]
945 pub fn isZoomed(&self) -> bool;
946
947 #[unsafe(method(zoom:))]
948 #[unsafe(method_family = none)]
949 pub fn zoom(&self, sender: Option<&AnyObject>);
950
951 #[unsafe(method(isMiniaturized))]
952 #[unsafe(method_family = none)]
953 pub fn isMiniaturized(&self) -> bool;
954
955 #[unsafe(method(tryToPerform:with:))]
956 #[unsafe(method_family = none)]
957 pub unsafe fn tryToPerform_with(&self, action: Sel, object: Option<&AnyObject>) -> bool;
958
959 #[cfg(feature = "NSPasteboard")]
960 #[unsafe(method(validRequestorForSendType:returnType:))]
961 #[unsafe(method_family = none)]
962 pub unsafe fn validRequestorForSendType_returnType(
963 &self,
964 send_type: Option<&NSPasteboardType>,
965 return_type: Option<&NSPasteboardType>,
966 ) -> Option<Retained<AnyObject>>;
967
968 #[cfg(feature = "NSColor")]
969 #[unsafe(method(backgroundColor))]
970 #[unsafe(method_family = none)]
971 pub unsafe fn backgroundColor(&self) -> Retained<NSColor>;
972
973 #[cfg(feature = "NSColor")]
974 #[unsafe(method(setBackgroundColor:))]
976 #[unsafe(method_family = none)]
977 pub fn setBackgroundColor(&self, background_color: Option<&NSColor>);
978
979 #[cfg(feature = "objc2-core-foundation")]
980 #[unsafe(method(setContentBorderThickness:forEdge:))]
981 #[unsafe(method_family = none)]
982 pub unsafe fn setContentBorderThickness_forEdge(
983 &self,
984 thickness: CGFloat,
985 edge: NSRectEdge,
986 );
987
988 #[cfg(feature = "objc2-core-foundation")]
989 #[unsafe(method(contentBorderThicknessForEdge:))]
990 #[unsafe(method_family = none)]
991 pub unsafe fn contentBorderThicknessForEdge(&self, edge: NSRectEdge) -> CGFloat;
992
993 #[unsafe(method(setAutorecalculatesContentBorderThickness:forEdge:))]
994 #[unsafe(method_family = none)]
995 pub unsafe fn setAutorecalculatesContentBorderThickness_forEdge(
996 &self,
997 flag: bool,
998 edge: NSRectEdge,
999 );
1000
1001 #[unsafe(method(autorecalculatesContentBorderThicknessForEdge:))]
1002 #[unsafe(method_family = none)]
1003 pub unsafe fn autorecalculatesContentBorderThicknessForEdge(
1004 &self,
1005 edge: NSRectEdge,
1006 ) -> bool;
1007
1008 #[unsafe(method(isMovable))]
1009 #[unsafe(method_family = none)]
1010 pub unsafe fn isMovable(&self) -> bool;
1011
1012 #[unsafe(method(setMovable:))]
1014 #[unsafe(method_family = none)]
1015 pub fn setMovable(&self, movable: bool);
1016
1017 #[unsafe(method(isMovableByWindowBackground))]
1018 #[unsafe(method_family = none)]
1019 pub unsafe fn isMovableByWindowBackground(&self) -> bool;
1020
1021 #[unsafe(method(setMovableByWindowBackground:))]
1023 #[unsafe(method_family = none)]
1024 pub fn setMovableByWindowBackground(&self, movable_by_window_background: bool);
1025
1026 #[unsafe(method(hidesOnDeactivate))]
1027 #[unsafe(method_family = none)]
1028 pub unsafe fn hidesOnDeactivate(&self) -> bool;
1029
1030 #[unsafe(method(setHidesOnDeactivate:))]
1032 #[unsafe(method_family = none)]
1033 pub unsafe fn setHidesOnDeactivate(&self, hides_on_deactivate: bool);
1034
1035 #[unsafe(method(canHide))]
1038 #[unsafe(method_family = none)]
1039 pub unsafe fn canHide(&self) -> bool;
1040
1041 #[unsafe(method(setCanHide:))]
1043 #[unsafe(method_family = none)]
1044 pub unsafe fn setCanHide(&self, can_hide: bool);
1045
1046 #[unsafe(method(center))]
1047 #[unsafe(method_family = none)]
1048 pub fn center(&self);
1049
1050 #[unsafe(method(makeKeyAndOrderFront:))]
1051 #[unsafe(method_family = none)]
1052 pub fn makeKeyAndOrderFront(&self, sender: Option<&AnyObject>);
1053
1054 #[unsafe(method(orderFront:))]
1055 #[unsafe(method_family = none)]
1056 pub fn orderFront(&self, sender: Option<&AnyObject>);
1057
1058 #[unsafe(method(orderBack:))]
1059 #[unsafe(method_family = none)]
1060 pub unsafe fn orderBack(&self, sender: Option<&AnyObject>);
1061
1062 #[unsafe(method(orderOut:))]
1063 #[unsafe(method_family = none)]
1064 pub fn orderOut(&self, sender: Option<&AnyObject>);
1065
1066 #[cfg(feature = "NSGraphics")]
1067 #[unsafe(method(orderWindow:relativeTo:))]
1068 #[unsafe(method_family = none)]
1069 pub unsafe fn orderWindow_relativeTo(
1070 &self,
1071 place: NSWindowOrderingMode,
1072 other_win: NSInteger,
1073 );
1074
1075 #[unsafe(method(orderFrontRegardless))]
1076 #[unsafe(method_family = none)]
1077 pub unsafe fn orderFrontRegardless(&self);
1078
1079 #[cfg(feature = "NSImage")]
1080 #[unsafe(method(miniwindowImage))]
1081 #[unsafe(method_family = none)]
1082 pub unsafe fn miniwindowImage(&self) -> Option<Retained<NSImage>>;
1083
1084 #[cfg(feature = "NSImage")]
1085 #[unsafe(method(setMiniwindowImage:))]
1087 #[unsafe(method_family = none)]
1088 pub unsafe fn setMiniwindowImage(&self, miniwindow_image: Option<&NSImage>);
1089
1090 #[unsafe(method(miniwindowTitle))]
1091 #[unsafe(method_family = none)]
1092 pub unsafe fn miniwindowTitle(&self) -> Retained<NSString>;
1093
1094 #[unsafe(method(setMiniwindowTitle:))]
1096 #[unsafe(method_family = none)]
1097 pub unsafe fn setMiniwindowTitle(&self, miniwindow_title: Option<&NSString>);
1098
1099 #[cfg(feature = "NSDockTile")]
1100 #[unsafe(method(dockTile))]
1101 #[unsafe(method_family = none)]
1102 pub unsafe fn dockTile(&self) -> Retained<NSDockTile>;
1103
1104 #[unsafe(method(isDocumentEdited))]
1105 #[unsafe(method_family = none)]
1106 pub fn isDocumentEdited(&self) -> bool;
1107
1108 #[unsafe(method(setDocumentEdited:))]
1110 #[unsafe(method_family = none)]
1111 pub fn setDocumentEdited(&self, document_edited: bool);
1112
1113 #[unsafe(method(isVisible))]
1114 #[unsafe(method_family = none)]
1115 pub fn isVisible(&self) -> bool;
1116
1117 #[unsafe(method(isKeyWindow))]
1118 #[unsafe(method_family = none)]
1119 pub fn isKeyWindow(&self) -> bool;
1120
1121 #[unsafe(method(isMainWindow))]
1122 #[unsafe(method_family = none)]
1123 pub unsafe fn isMainWindow(&self) -> bool;
1124
1125 #[unsafe(method(canBecomeKeyWindow))]
1126 #[unsafe(method_family = none)]
1127 pub unsafe fn canBecomeKeyWindow(&self) -> bool;
1128
1129 #[unsafe(method(canBecomeMainWindow))]
1130 #[unsafe(method_family = none)]
1131 pub unsafe fn canBecomeMainWindow(&self) -> bool;
1132
1133 #[unsafe(method(makeKeyWindow))]
1135 #[unsafe(method_family = none)]
1136 pub unsafe fn makeKeyWindow(&self);
1137
1138 #[unsafe(method(makeMainWindow))]
1140 #[unsafe(method_family = none)]
1141 pub unsafe fn makeMainWindow(&self);
1142
1143 #[unsafe(method(becomeKeyWindow))]
1145 #[unsafe(method_family = none)]
1146 pub unsafe fn becomeKeyWindow(&self);
1147
1148 #[unsafe(method(resignKeyWindow))]
1150 #[unsafe(method_family = none)]
1151 pub unsafe fn resignKeyWindow(&self);
1152
1153 #[unsafe(method(becomeMainWindow))]
1155 #[unsafe(method_family = none)]
1156 pub unsafe fn becomeMainWindow(&self);
1157
1158 #[unsafe(method(resignMainWindow))]
1160 #[unsafe(method_family = none)]
1161 pub unsafe fn resignMainWindow(&self);
1162
1163 #[unsafe(method(worksWhenModal))]
1164 #[unsafe(method_family = none)]
1165 pub unsafe fn worksWhenModal(&self) -> bool;
1166
1167 #[unsafe(method(preventsApplicationTerminationWhenModal))]
1170 #[unsafe(method_family = none)]
1171 pub unsafe fn preventsApplicationTerminationWhenModal(&self) -> bool;
1172
1173 #[unsafe(method(setPreventsApplicationTerminationWhenModal:))]
1175 #[unsafe(method_family = none)]
1176 pub unsafe fn setPreventsApplicationTerminationWhenModal(
1177 &self,
1178 prevents_application_termination_when_modal: bool,
1179 );
1180
1181 #[unsafe(method(convertRectToScreen:))]
1182 #[unsafe(method_family = none)]
1183 pub fn convertRectToScreen(&self, rect: NSRect) -> NSRect;
1184
1185 #[unsafe(method(convertRectFromScreen:))]
1186 #[unsafe(method_family = none)]
1187 pub unsafe fn convertRectFromScreen(&self, rect: NSRect) -> NSRect;
1188
1189 #[unsafe(method(convertPointToScreen:))]
1190 #[unsafe(method_family = none)]
1191 pub unsafe fn convertPointToScreen(&self, point: NSPoint) -> NSPoint;
1192
1193 #[unsafe(method(convertPointFromScreen:))]
1194 #[unsafe(method_family = none)]
1195 pub fn convertPointFromScreen(&self, point: NSPoint) -> NSPoint;
1196
1197 #[unsafe(method(convertRectToBacking:))]
1198 #[unsafe(method_family = none)]
1199 pub unsafe fn convertRectToBacking(&self, rect: NSRect) -> NSRect;
1200
1201 #[unsafe(method(convertRectFromBacking:))]
1202 #[unsafe(method_family = none)]
1203 pub unsafe fn convertRectFromBacking(&self, rect: NSRect) -> NSRect;
1204
1205 #[unsafe(method(convertPointToBacking:))]
1206 #[unsafe(method_family = none)]
1207 pub unsafe fn convertPointToBacking(&self, point: NSPoint) -> NSPoint;
1208
1209 #[unsafe(method(convertPointFromBacking:))]
1210 #[unsafe(method_family = none)]
1211 pub unsafe fn convertPointFromBacking(&self, point: NSPoint) -> NSPoint;
1212
1213 #[unsafe(method(backingAlignedRect:options:))]
1215 #[unsafe(method_family = none)]
1216 pub unsafe fn backingAlignedRect_options(
1217 &self,
1218 rect: NSRect,
1219 options: NSAlignmentOptions,
1220 ) -> NSRect;
1221
1222 #[cfg(feature = "objc2-core-foundation")]
1223 #[unsafe(method(backingScaleFactor))]
1226 #[unsafe(method_family = none)]
1227 pub fn backingScaleFactor(&self) -> CGFloat;
1228
1229 #[unsafe(method(performClose:))]
1230 #[unsafe(method_family = none)]
1231 pub unsafe fn performClose(&self, sender: Option<&AnyObject>);
1232
1233 #[unsafe(method(performMiniaturize:))]
1234 #[unsafe(method_family = none)]
1235 pub unsafe fn performMiniaturize(&self, sender: Option<&AnyObject>);
1236
1237 #[unsafe(method(performZoom:))]
1238 #[unsafe(method_family = none)]
1239 pub unsafe fn performZoom(&self, sender: Option<&AnyObject>);
1240
1241 #[unsafe(method(dataWithEPSInsideRect:))]
1242 #[unsafe(method_family = none)]
1243 pub unsafe fn dataWithEPSInsideRect(&self, rect: NSRect) -> Retained<NSData>;
1244
1245 #[unsafe(method(dataWithPDFInsideRect:))]
1246 #[unsafe(method_family = none)]
1247 pub unsafe fn dataWithPDFInsideRect(&self, rect: NSRect) -> Retained<NSData>;
1248
1249 #[unsafe(method(print:))]
1250 #[unsafe(method_family = none)]
1251 pub unsafe fn print(&self, sender: Option<&AnyObject>);
1252
1253 #[unsafe(method(allowsToolTipsWhenApplicationIsInactive))]
1259 #[unsafe(method_family = none)]
1260 pub unsafe fn allowsToolTipsWhenApplicationIsInactive(&self) -> bool;
1261
1262 #[unsafe(method(setAllowsToolTipsWhenApplicationIsInactive:))]
1264 #[unsafe(method_family = none)]
1265 pub unsafe fn setAllowsToolTipsWhenApplicationIsInactive(
1266 &self,
1267 allows_tool_tips_when_application_is_inactive: bool,
1268 );
1269
1270 #[cfg(feature = "NSGraphics")]
1271 #[unsafe(method(backingType))]
1272 #[unsafe(method_family = none)]
1273 pub unsafe fn backingType(&self) -> NSBackingStoreType;
1274
1275 #[cfg(feature = "NSGraphics")]
1276 #[unsafe(method(setBackingType:))]
1278 #[unsafe(method_family = none)]
1279 pub unsafe fn setBackingType(&self, backing_type: NSBackingStoreType);
1280
1281 #[unsafe(method(level))]
1282 #[unsafe(method_family = none)]
1283 pub unsafe fn level(&self) -> NSWindowLevel;
1284
1285 #[unsafe(method(setLevel:))]
1287 #[unsafe(method_family = none)]
1288 pub fn setLevel(&self, level: NSWindowLevel);
1289
1290 #[cfg(feature = "NSGraphics")]
1291 #[unsafe(method(depthLimit))]
1292 #[unsafe(method_family = none)]
1293 pub unsafe fn depthLimit(&self) -> NSWindowDepth;
1294
1295 #[cfg(feature = "NSGraphics")]
1296 #[unsafe(method(setDepthLimit:))]
1298 #[unsafe(method_family = none)]
1299 pub unsafe fn setDepthLimit(&self, depth_limit: NSWindowDepth);
1300
1301 #[unsafe(method(setDynamicDepthLimit:))]
1302 #[unsafe(method_family = none)]
1303 pub unsafe fn setDynamicDepthLimit(&self, flag: bool);
1304
1305 #[unsafe(method(hasDynamicDepthLimit))]
1306 #[unsafe(method_family = none)]
1307 pub unsafe fn hasDynamicDepthLimit(&self) -> bool;
1308
1309 #[cfg(feature = "NSScreen")]
1310 #[unsafe(method(screen))]
1312 #[unsafe(method_family = none)]
1313 pub fn screen(&self) -> Option<Retained<NSScreen>>;
1314
1315 #[cfg(feature = "NSScreen")]
1316 #[unsafe(method(deepestScreen))]
1317 #[unsafe(method_family = none)]
1318 pub unsafe fn deepestScreen(&self) -> Option<Retained<NSScreen>>;
1319
1320 #[unsafe(method(hasShadow))]
1321 #[unsafe(method_family = none)]
1322 pub fn hasShadow(&self) -> bool;
1323
1324 #[unsafe(method(setHasShadow:))]
1326 #[unsafe(method_family = none)]
1327 pub fn setHasShadow(&self, has_shadow: bool);
1328
1329 #[unsafe(method(invalidateShadow))]
1330 #[unsafe(method_family = none)]
1331 pub unsafe fn invalidateShadow(&self);
1332
1333 #[cfg(feature = "objc2-core-foundation")]
1334 #[unsafe(method(alphaValue))]
1335 #[unsafe(method_family = none)]
1336 pub unsafe fn alphaValue(&self) -> CGFloat;
1337
1338 #[cfg(feature = "objc2-core-foundation")]
1339 #[unsafe(method(setAlphaValue:))]
1341 #[unsafe(method_family = none)]
1342 pub unsafe fn setAlphaValue(&self, alpha_value: CGFloat);
1343
1344 #[unsafe(method(isOpaque))]
1345 #[unsafe(method_family = none)]
1346 pub unsafe fn isOpaque(&self) -> bool;
1347
1348 #[unsafe(method(setOpaque:))]
1350 #[unsafe(method_family = none)]
1351 pub fn setOpaque(&self, opaque: bool);
1352
1353 #[unsafe(method(sharingType))]
1357 #[unsafe(method_family = none)]
1358 pub unsafe fn sharingType(&self) -> NSWindowSharingType;
1359
1360 #[unsafe(method(setSharingType:))]
1362 #[unsafe(method_family = none)]
1363 pub fn setSharingType(&self, sharing_type: NSWindowSharingType);
1364
1365 #[unsafe(method(allowsConcurrentViewDrawing))]
1370 #[unsafe(method_family = none)]
1371 pub unsafe fn allowsConcurrentViewDrawing(&self) -> bool;
1372
1373 #[unsafe(method(setAllowsConcurrentViewDrawing:))]
1375 #[unsafe(method_family = none)]
1376 pub unsafe fn setAllowsConcurrentViewDrawing(&self, allows_concurrent_view_drawing: bool);
1377
1378 #[unsafe(method(displaysWhenScreenProfileChanges))]
1379 #[unsafe(method_family = none)]
1380 pub unsafe fn displaysWhenScreenProfileChanges(&self) -> bool;
1381
1382 #[unsafe(method(setDisplaysWhenScreenProfileChanges:))]
1384 #[unsafe(method_family = none)]
1385 pub unsafe fn setDisplaysWhenScreenProfileChanges(
1386 &self,
1387 displays_when_screen_profile_changes: bool,
1388 );
1389
1390 #[unsafe(method(canBecomeVisibleWithoutLogin))]
1392 #[unsafe(method_family = none)]
1393 pub unsafe fn canBecomeVisibleWithoutLogin(&self) -> bool;
1394
1395 #[unsafe(method(setCanBecomeVisibleWithoutLogin:))]
1397 #[unsafe(method_family = none)]
1398 pub unsafe fn setCanBecomeVisibleWithoutLogin(
1399 &self,
1400 can_become_visible_without_login: bool,
1401 );
1402
1403 #[unsafe(method(collectionBehavior))]
1404 #[unsafe(method_family = none)]
1405 pub unsafe fn collectionBehavior(&self) -> NSWindowCollectionBehavior;
1406
1407 #[unsafe(method(setCollectionBehavior:))]
1409 #[unsafe(method_family = none)]
1410 pub unsafe fn setCollectionBehavior(&self, collection_behavior: NSWindowCollectionBehavior);
1411
1412 #[unsafe(method(animationBehavior))]
1416 #[unsafe(method_family = none)]
1417 pub unsafe fn animationBehavior(&self) -> NSWindowAnimationBehavior;
1418
1419 #[unsafe(method(setAnimationBehavior:))]
1421 #[unsafe(method_family = none)]
1422 pub unsafe fn setAnimationBehavior(&self, animation_behavior: NSWindowAnimationBehavior);
1423
1424 #[unsafe(method(isOnActiveSpace))]
1427 #[unsafe(method_family = none)]
1428 pub unsafe fn isOnActiveSpace(&self) -> bool;
1429
1430 #[unsafe(method(toggleFullScreen:))]
1435 #[unsafe(method_family = none)]
1436 pub fn toggleFullScreen(&self, sender: Option<&AnyObject>);
1437
1438 #[unsafe(method(stringWithSavedFrame))]
1439 #[unsafe(method_family = none)]
1440 pub unsafe fn stringWithSavedFrame(&self) -> Retained<NSWindowPersistableFrameDescriptor>;
1441
1442 #[unsafe(method(setFrameFromString:))]
1443 #[unsafe(method_family = none)]
1444 pub unsafe fn setFrameFromString(&self, string: &NSWindowPersistableFrameDescriptor);
1445
1446 #[unsafe(method(saveFrameUsingName:))]
1447 #[unsafe(method_family = none)]
1448 pub unsafe fn saveFrameUsingName(&self, name: &NSWindowFrameAutosaveName);
1449
1450 #[unsafe(method(setFrameUsingName:force:))]
1451 #[unsafe(method_family = none)]
1452 pub unsafe fn setFrameUsingName_force(
1453 &self,
1454 name: &NSWindowFrameAutosaveName,
1455 force: bool,
1456 ) -> bool;
1457
1458 #[unsafe(method(setFrameUsingName:))]
1459 #[unsafe(method_family = none)]
1460 pub unsafe fn setFrameUsingName(&self, name: &NSWindowFrameAutosaveName) -> bool;
1461
1462 #[unsafe(method(setFrameAutosaveName:))]
1463 #[unsafe(method_family = none)]
1464 pub unsafe fn setFrameAutosaveName(&self, name: &NSWindowFrameAutosaveName) -> bool;
1465
1466 #[unsafe(method(frameAutosaveName))]
1467 #[unsafe(method_family = none)]
1468 pub unsafe fn frameAutosaveName(&self) -> Retained<NSWindowFrameAutosaveName>;
1469
1470 #[unsafe(method(removeFrameUsingName:))]
1471 #[unsafe(method_family = none)]
1472 pub unsafe fn removeFrameUsingName(name: &NSWindowFrameAutosaveName, mtm: MainThreadMarker);
1473
1474 #[unsafe(method(minSize))]
1475 #[unsafe(method_family = none)]
1476 pub unsafe fn minSize(&self) -> NSSize;
1477
1478 #[unsafe(method(setMinSize:))]
1480 #[unsafe(method_family = none)]
1481 pub fn setMinSize(&self, min_size: NSSize);
1482
1483 #[unsafe(method(maxSize))]
1484 #[unsafe(method_family = none)]
1485 pub unsafe fn maxSize(&self) -> NSSize;
1486
1487 #[unsafe(method(setMaxSize:))]
1489 #[unsafe(method_family = none)]
1490 pub fn setMaxSize(&self, max_size: NSSize);
1491
1492 #[unsafe(method(contentMinSize))]
1493 #[unsafe(method_family = none)]
1494 pub unsafe fn contentMinSize(&self) -> NSSize;
1495
1496 #[unsafe(method(setContentMinSize:))]
1498 #[unsafe(method_family = none)]
1499 pub unsafe fn setContentMinSize(&self, content_min_size: NSSize);
1500
1501 #[unsafe(method(contentMaxSize))]
1502 #[unsafe(method_family = none)]
1503 pub unsafe fn contentMaxSize(&self) -> NSSize;
1504
1505 #[unsafe(method(setContentMaxSize:))]
1507 #[unsafe(method_family = none)]
1508 pub unsafe fn setContentMaxSize(&self, content_max_size: NSSize);
1509
1510 #[unsafe(method(minFullScreenContentSize))]
1511 #[unsafe(method_family = none)]
1512 pub unsafe fn minFullScreenContentSize(&self) -> NSSize;
1513
1514 #[unsafe(method(setMinFullScreenContentSize:))]
1516 #[unsafe(method_family = none)]
1517 pub unsafe fn setMinFullScreenContentSize(&self, min_full_screen_content_size: NSSize);
1518
1519 #[unsafe(method(maxFullScreenContentSize))]
1520 #[unsafe(method_family = none)]
1521 pub unsafe fn maxFullScreenContentSize(&self) -> NSSize;
1522
1523 #[unsafe(method(setMaxFullScreenContentSize:))]
1525 #[unsafe(method_family = none)]
1526 pub unsafe fn setMaxFullScreenContentSize(&self, max_full_screen_content_size: NSSize);
1527
1528 #[cfg(feature = "NSGraphics")]
1529 #[unsafe(method(deviceDescription))]
1530 #[unsafe(method_family = none)]
1531 pub unsafe fn deviceDescription(
1532 &self,
1533 ) -> Retained<NSDictionary<NSDeviceDescriptionKey, AnyObject>>;
1534
1535 #[cfg(feature = "NSWindowController")]
1536 #[unsafe(method(windowController))]
1537 #[unsafe(method_family = none)]
1538 pub unsafe fn windowController(&self) -> Option<Retained<NSWindowController>>;
1539
1540 #[cfg(feature = "NSWindowController")]
1541 #[unsafe(method(setWindowController:))]
1544 #[unsafe(method_family = none)]
1545 pub unsafe fn setWindowController(&self, window_controller: Option<&NSWindowController>);
1546
1547 #[cfg(all(feature = "NSApplication", feature = "block2"))]
1548 #[unsafe(method(beginSheet:completionHandler:))]
1549 #[unsafe(method_family = none)]
1550 pub unsafe fn beginSheet_completionHandler(
1551 &self,
1552 sheet_window: &NSWindow,
1553 handler: Option<&block2::Block<dyn Fn(NSModalResponse)>>,
1554 );
1555
1556 #[cfg(all(feature = "NSApplication", feature = "block2"))]
1557 #[unsafe(method(beginCriticalSheet:completionHandler:))]
1558 #[unsafe(method_family = none)]
1559 pub unsafe fn beginCriticalSheet_completionHandler(
1560 &self,
1561 sheet_window: &NSWindow,
1562 handler: Option<&block2::Block<dyn Fn(NSModalResponse)>>,
1563 );
1564
1565 #[unsafe(method(endSheet:))]
1566 #[unsafe(method_family = none)]
1567 pub unsafe fn endSheet(&self, sheet_window: &NSWindow);
1568
1569 #[cfg(feature = "NSApplication")]
1570 #[unsafe(method(endSheet:returnCode:))]
1571 #[unsafe(method_family = none)]
1572 pub unsafe fn endSheet_returnCode(
1573 &self,
1574 sheet_window: &NSWindow,
1575 return_code: NSModalResponse,
1576 );
1577
1578 #[unsafe(method(sheets))]
1580 #[unsafe(method_family = none)]
1581 pub unsafe fn sheets(&self) -> Retained<NSArray<NSWindow>>;
1582
1583 #[unsafe(method(attachedSheet))]
1585 #[unsafe(method_family = none)]
1586 pub unsafe fn attachedSheet(&self) -> Option<Retained<NSWindow>>;
1587
1588 #[unsafe(method(isSheet))]
1589 #[unsafe(method_family = none)]
1590 pub unsafe fn isSheet(&self) -> bool;
1591
1592 #[unsafe(method(sheetParent))]
1597 #[unsafe(method_family = none)]
1598 pub unsafe fn sheetParent(&self) -> Option<Retained<NSWindow>>;
1599
1600 #[cfg(all(feature = "NSButton", feature = "NSControl", feature = "NSView"))]
1601 #[unsafe(method(standardWindowButton:forStyleMask:))]
1602 #[unsafe(method_family = none)]
1603 pub unsafe fn standardWindowButton_forStyleMask(
1604 b: NSWindowButton,
1605 style_mask: NSWindowStyleMask,
1606 mtm: MainThreadMarker,
1607 ) -> Option<Retained<NSButton>>;
1608
1609 #[cfg(all(feature = "NSButton", feature = "NSControl", feature = "NSView"))]
1610 #[unsafe(method(standardWindowButton:))]
1611 #[unsafe(method_family = none)]
1612 pub fn standardWindowButton(&self, b: NSWindowButton) -> Option<Retained<NSButton>>;
1613
1614 #[cfg(feature = "NSGraphics")]
1615 #[unsafe(method(addChildWindow:ordered:))]
1616 #[unsafe(method_family = none)]
1617 pub unsafe fn addChildWindow_ordered(
1618 &self,
1619 child_win: &NSWindow,
1620 place: NSWindowOrderingMode,
1621 );
1622
1623 #[unsafe(method(removeChildWindow:))]
1624 #[unsafe(method_family = none)]
1625 pub unsafe fn removeChildWindow(&self, child_win: &NSWindow);
1626
1627 #[unsafe(method(childWindows))]
1628 #[unsafe(method_family = none)]
1629 pub unsafe fn childWindows(&self) -> Option<Retained<NSArray<NSWindow>>>;
1630
1631 #[unsafe(method(parentWindow))]
1632 #[unsafe(method_family = none)]
1633 pub unsafe fn parentWindow(&self) -> Option<Retained<NSWindow>>;
1634
1635 #[unsafe(method(setParentWindow:))]
1638 #[unsafe(method_family = none)]
1639 pub unsafe fn setParentWindow(&self, parent_window: Option<&NSWindow>);
1640
1641 #[cfg(feature = "NSAppearance")]
1642 #[unsafe(method(appearanceSource))]
1644 #[unsafe(method_family = none)]
1645 pub unsafe fn appearanceSource(&self) -> Option<Retained<NSObject>>;
1646
1647 #[cfg(feature = "NSAppearance")]
1648 #[unsafe(method(setAppearanceSource:))]
1651 #[unsafe(method_family = none)]
1652 pub unsafe fn setAppearanceSource(&self, appearance_source: Option<&NSObject>);
1653
1654 #[cfg(feature = "NSColorSpace")]
1655 #[unsafe(method(colorSpace))]
1656 #[unsafe(method_family = none)]
1657 pub unsafe fn colorSpace(&self) -> Option<Retained<NSColorSpace>>;
1658
1659 #[cfg(feature = "NSColorSpace")]
1660 #[unsafe(method(setColorSpace:))]
1662 #[unsafe(method_family = none)]
1663 pub unsafe fn setColorSpace(&self, color_space: Option<&NSColorSpace>);
1664
1665 #[cfg(feature = "NSGraphics")]
1666 #[unsafe(method(canRepresentDisplayGamut:))]
1670 #[unsafe(method_family = none)]
1671 pub unsafe fn canRepresentDisplayGamut(&self, display_gamut: NSDisplayGamut) -> bool;
1672
1673 #[unsafe(method(windowNumbersWithOptions:))]
1685 #[unsafe(method_family = none)]
1686 pub unsafe fn windowNumbersWithOptions(
1687 options: NSWindowNumberListOptions,
1688 mtm: MainThreadMarker,
1689 ) -> Option<Retained<NSArray<NSNumber>>>;
1690
1691 #[unsafe(method(windowNumberAtPoint:belowWindowWithWindowNumber:))]
1693 #[unsafe(method_family = none)]
1694 pub unsafe fn windowNumberAtPoint_belowWindowWithWindowNumber(
1695 point: NSPoint,
1696 window_number: NSInteger,
1697 mtm: MainThreadMarker,
1698 ) -> NSInteger;
1699
1700 #[unsafe(method(occlusionState))]
1701 #[unsafe(method_family = none)]
1702 pub fn occlusionState(&self) -> NSWindowOcclusionState;
1703
1704 #[unsafe(method(titlebarSeparatorStyle))]
1708 #[unsafe(method_family = none)]
1709 pub unsafe fn titlebarSeparatorStyle(&self) -> NSTitlebarSeparatorStyle;
1710
1711 #[unsafe(method(setTitlebarSeparatorStyle:))]
1713 #[unsafe(method_family = none)]
1714 pub unsafe fn setTitlebarSeparatorStyle(
1715 &self,
1716 titlebar_separator_style: NSTitlebarSeparatorStyle,
1717 );
1718
1719 #[cfg(feature = "NSViewController")]
1720 #[unsafe(method(contentViewController))]
1724 #[unsafe(method_family = none)]
1725 pub unsafe fn contentViewController(&self) -> Option<Retained<NSViewController>>;
1726
1727 #[cfg(feature = "NSViewController")]
1728 #[unsafe(method(setContentViewController:))]
1730 #[unsafe(method_family = none)]
1731 pub unsafe fn setContentViewController(
1732 &self,
1733 content_view_controller: Option<&NSViewController>,
1734 );
1735
1736 #[cfg(feature = "NSViewController")]
1737 #[unsafe(method(windowWithContentViewController:))]
1739 #[unsafe(method_family = none)]
1740 pub unsafe fn windowWithContentViewController(
1741 content_view_controller: &NSViewController,
1742 ) -> Retained<Self>;
1743
1744 #[cfg(feature = "NSEvent")]
1745 #[unsafe(method(performWindowDragWithEvent:))]
1747 #[unsafe(method_family = none)]
1748 pub fn performWindowDragWithEvent(&self, event: &NSEvent);
1749
1750 #[cfg(feature = "NSView")]
1751 #[unsafe(method(initialFirstResponder))]
1752 #[unsafe(method_family = none)]
1753 pub unsafe fn initialFirstResponder(&self) -> Option<Retained<NSView>>;
1754
1755 #[cfg(feature = "NSView")]
1756 #[unsafe(method(setInitialFirstResponder:))]
1759 #[unsafe(method_family = none)]
1760 pub fn setInitialFirstResponder(&self, initial_first_responder: Option<&NSView>);
1761
1762 #[unsafe(method(selectNextKeyView:))]
1763 #[unsafe(method_family = none)]
1764 pub fn selectNextKeyView(&self, sender: Option<&AnyObject>);
1765
1766 #[unsafe(method(selectPreviousKeyView:))]
1767 #[unsafe(method_family = none)]
1768 pub fn selectPreviousKeyView(&self, sender: Option<&AnyObject>);
1769
1770 #[cfg(feature = "NSView")]
1771 #[unsafe(method(selectKeyViewFollowingView:))]
1772 #[unsafe(method_family = none)]
1773 pub unsafe fn selectKeyViewFollowingView(&self, view: &NSView);
1774
1775 #[cfg(feature = "NSView")]
1776 #[unsafe(method(selectKeyViewPrecedingView:))]
1777 #[unsafe(method_family = none)]
1778 pub unsafe fn selectKeyViewPrecedingView(&self, view: &NSView);
1779
1780 #[unsafe(method(keyViewSelectionDirection))]
1781 #[unsafe(method_family = none)]
1782 pub unsafe fn keyViewSelectionDirection(&self) -> NSSelectionDirection;
1783
1784 #[cfg(all(feature = "NSActionCell", feature = "NSButtonCell", feature = "NSCell"))]
1785 #[unsafe(method(defaultButtonCell))]
1786 #[unsafe(method_family = none)]
1787 pub unsafe fn defaultButtonCell(&self) -> Option<Retained<NSButtonCell>>;
1788
1789 #[cfg(all(feature = "NSActionCell", feature = "NSButtonCell", feature = "NSCell"))]
1790 #[unsafe(method(setDefaultButtonCell:))]
1792 #[unsafe(method_family = none)]
1793 pub unsafe fn setDefaultButtonCell(&self, default_button_cell: Option<&NSButtonCell>);
1794
1795 #[unsafe(method(disableKeyEquivalentForDefaultButtonCell))]
1796 #[unsafe(method_family = none)]
1797 pub unsafe fn disableKeyEquivalentForDefaultButtonCell(&self);
1798
1799 #[unsafe(method(enableKeyEquivalentForDefaultButtonCell))]
1800 #[unsafe(method_family = none)]
1801 pub unsafe fn enableKeyEquivalentForDefaultButtonCell(&self);
1802
1803 #[unsafe(method(autorecalculatesKeyViewLoop))]
1804 #[unsafe(method_family = none)]
1805 pub unsafe fn autorecalculatesKeyViewLoop(&self) -> bool;
1806
1807 #[unsafe(method(setAutorecalculatesKeyViewLoop:))]
1809 #[unsafe(method_family = none)]
1810 pub unsafe fn setAutorecalculatesKeyViewLoop(&self, autorecalculates_key_view_loop: bool);
1811
1812 #[unsafe(method(recalculateKeyViewLoop))]
1813 #[unsafe(method_family = none)]
1814 pub unsafe fn recalculateKeyViewLoop(&self);
1815
1816 #[cfg(feature = "NSToolbar")]
1817 #[unsafe(method(toolbar))]
1818 #[unsafe(method_family = none)]
1819 pub unsafe fn toolbar(&self) -> Option<Retained<NSToolbar>>;
1820
1821 #[cfg(feature = "NSToolbar")]
1822 #[unsafe(method(setToolbar:))]
1824 #[unsafe(method_family = none)]
1825 pub unsafe fn setToolbar(&self, toolbar: Option<&NSToolbar>);
1826
1827 #[unsafe(method(toggleToolbarShown:))]
1828 #[unsafe(method_family = none)]
1829 pub unsafe fn toggleToolbarShown(&self, sender: Option<&AnyObject>);
1830
1831 #[unsafe(method(runToolbarCustomizationPalette:))]
1832 #[unsafe(method_family = none)]
1833 pub unsafe fn runToolbarCustomizationPalette(&self, sender: Option<&AnyObject>);
1834
1835 #[deprecated = "This property has no effect"]
1836 #[unsafe(method(showsToolbarButton))]
1837 #[unsafe(method_family = none)]
1838 pub unsafe fn showsToolbarButton(&self) -> bool;
1839
1840 #[deprecated = "This property has no effect"]
1842 #[unsafe(method(setShowsToolbarButton:))]
1843 #[unsafe(method_family = none)]
1844 pub unsafe fn setShowsToolbarButton(&self, shows_toolbar_button: bool);
1845
1846 #[unsafe(method(allowsAutomaticWindowTabbing))]
1850 #[unsafe(method_family = none)]
1851 pub fn allowsAutomaticWindowTabbing(mtm: MainThreadMarker) -> bool;
1852
1853 #[unsafe(method(setAllowsAutomaticWindowTabbing:))]
1855 #[unsafe(method_family = none)]
1856 pub fn setAllowsAutomaticWindowTabbing(
1857 allows_automatic_window_tabbing: bool,
1858 mtm: MainThreadMarker,
1859 );
1860
1861 #[unsafe(method(userTabbingPreference))]
1863 #[unsafe(method_family = none)]
1864 pub unsafe fn userTabbingPreference(mtm: MainThreadMarker)
1865 -> NSWindowUserTabbingPreference;
1866
1867 #[unsafe(method(tabbingMode))]
1872 #[unsafe(method_family = none)]
1873 pub unsafe fn tabbingMode(&self) -> NSWindowTabbingMode;
1874
1875 #[unsafe(method(setTabbingMode:))]
1877 #[unsafe(method_family = none)]
1878 pub fn setTabbingMode(&self, tabbing_mode: NSWindowTabbingMode);
1879
1880 #[unsafe(method(tabbingIdentifier))]
1885 #[unsafe(method_family = none)]
1886 pub fn tabbingIdentifier(&self) -> Retained<NSWindowTabbingIdentifier>;
1887
1888 #[unsafe(method(setTabbingIdentifier:))]
1890 #[unsafe(method_family = none)]
1891 pub fn setTabbingIdentifier(&self, tabbing_identifier: &NSWindowTabbingIdentifier);
1892
1893 #[unsafe(method(selectNextTab:))]
1896 #[unsafe(method_family = none)]
1897 pub fn selectNextTab(&self, sender: Option<&AnyObject>);
1898
1899 #[unsafe(method(selectPreviousTab:))]
1900 #[unsafe(method_family = none)]
1901 pub unsafe fn selectPreviousTab(&self, sender: Option<&AnyObject>);
1902
1903 #[unsafe(method(moveTabToNewWindow:))]
1904 #[unsafe(method_family = none)]
1905 pub unsafe fn moveTabToNewWindow(&self, sender: Option<&AnyObject>);
1906
1907 #[unsafe(method(mergeAllWindows:))]
1908 #[unsafe(method_family = none)]
1909 pub unsafe fn mergeAllWindows(&self, sender: Option<&AnyObject>);
1910
1911 #[unsafe(method(toggleTabBar:))]
1912 #[unsafe(method_family = none)]
1913 pub unsafe fn toggleTabBar(&self, sender: Option<&AnyObject>);
1914
1915 #[unsafe(method(toggleTabOverview:))]
1917 #[unsafe(method_family = none)]
1918 pub unsafe fn toggleTabOverview(&self, sender: Option<&AnyObject>);
1919
1920 #[unsafe(method(tabbedWindows))]
1922 #[unsafe(method_family = none)]
1923 pub unsafe fn tabbedWindows(&self) -> Option<Retained<NSArray<NSWindow>>>;
1924
1925 #[cfg(feature = "NSGraphics")]
1926 #[unsafe(method(addTabbedWindow:ordered:))]
1928 #[unsafe(method_family = none)]
1929 pub unsafe fn addTabbedWindow_ordered(
1930 &self,
1931 window: &NSWindow,
1932 ordered: NSWindowOrderingMode,
1933 );
1934
1935 #[cfg(feature = "NSWindowTab")]
1936 #[unsafe(method(tab))]
1939 #[unsafe(method_family = none)]
1940 pub unsafe fn tab(&self) -> Retained<NSWindowTab>;
1941
1942 #[cfg(feature = "NSWindowTabGroup")]
1943 #[unsafe(method(tabGroup))]
1946 #[unsafe(method_family = none)]
1947 pub fn tabGroup(&self) -> Option<Retained<NSWindowTabGroup>>;
1948
1949 #[cfg(feature = "block2")]
1950 #[unsafe(method(transferWindowSharingToWindow:completionHandler:))]
1957 #[unsafe(method_family = none)]
1958 pub unsafe fn transferWindowSharingToWindow_completionHandler(
1959 &self,
1960 window: &NSWindow,
1961 completion_handler: &block2::Block<dyn Fn(*mut NSError)>,
1962 );
1963
1964 #[unsafe(method(hasActiveWindowSharingSession))]
1966 #[unsafe(method_family = none)]
1967 pub unsafe fn hasActiveWindowSharingSession(&self) -> bool;
1968
1969 #[cfg(feature = "block2")]
1970 #[unsafe(method(requestSharingOfWindow:completionHandler:))]
1977 #[unsafe(method_family = none)]
1978 pub unsafe fn requestSharingOfWindow_completionHandler(
1979 &self,
1980 window: &NSWindow,
1981 completion_handler: &block2::Block<dyn Fn(*mut NSError)>,
1982 );
1983
1984 #[cfg(all(feature = "NSImage", feature = "block2"))]
1985 #[unsafe(method(requestSharingOfWindowUsingPreview:title:completionHandler:))]
1994 #[unsafe(method_family = none)]
1995 pub unsafe fn requestSharingOfWindowUsingPreview_title_completionHandler(
1996 &self,
1997 image: &NSImage,
1998 title: &NSString,
1999 completion_handler: &block2::Block<dyn Fn(*mut NSError)>,
2000 );
2001
2002 #[cfg(feature = "NSUserInterfaceLayout")]
2003 #[unsafe(method(windowTitlebarLayoutDirection))]
2005 #[unsafe(method_family = none)]
2006 pub unsafe fn windowTitlebarLayoutDirection(&self) -> NSUserInterfaceLayoutDirection;
2007 );
2008}
2009
2010#[cfg(feature = "NSResponder")]
2012impl NSWindow {
2013 extern_methods!(
2014 #[unsafe(method(init))]
2015 #[unsafe(method_family = init)]
2016 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
2017 );
2018}
2019
2020#[cfg(feature = "NSResponder")]
2022impl NSWindow {
2023 extern_methods!(
2024 #[unsafe(method(new))]
2025 #[unsafe(method_family = new)]
2026 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
2027 );
2028}
2029
2030#[cfg(feature = "NSResponder")]
2032impl NSWindow {
2033 extern_methods!(
2034 #[cfg(all(feature = "NSEvent", feature = "block2"))]
2035 #[unsafe(method(trackEventsMatchingMask:timeout:mode:handler:))]
2039 #[unsafe(method_family = none)]
2040 pub unsafe fn trackEventsMatchingMask_timeout_mode_handler(
2041 &self,
2042 mask: NSEventMask,
2043 timeout: NSTimeInterval,
2044 mode: &NSRunLoopMode,
2045 tracking_handler: &block2::Block<dyn Fn(*mut NSEvent, NonNull<Bool>) + '_>,
2046 );
2047
2048 #[cfg(feature = "NSEvent")]
2049 #[unsafe(method(nextEventMatchingMask:))]
2050 #[unsafe(method_family = none)]
2051 pub unsafe fn nextEventMatchingMask(&self, mask: NSEventMask) -> Option<Retained<NSEvent>>;
2052
2053 #[cfg(feature = "NSEvent")]
2054 #[unsafe(method(nextEventMatchingMask:untilDate:inMode:dequeue:))]
2055 #[unsafe(method_family = none)]
2056 pub unsafe fn nextEventMatchingMask_untilDate_inMode_dequeue(
2057 &self,
2058 mask: NSEventMask,
2059 expiration: Option<&NSDate>,
2060 mode: &NSRunLoopMode,
2061 deq_flag: bool,
2062 ) -> Option<Retained<NSEvent>>;
2063
2064 #[cfg(feature = "NSEvent")]
2065 #[unsafe(method(discardEventsMatchingMask:beforeEvent:))]
2066 #[unsafe(method_family = none)]
2067 pub unsafe fn discardEventsMatchingMask_beforeEvent(
2068 &self,
2069 mask: NSEventMask,
2070 last_event: Option<&NSEvent>,
2071 );
2072
2073 #[cfg(feature = "NSEvent")]
2074 #[unsafe(method(postEvent:atStart:))]
2075 #[unsafe(method_family = none)]
2076 pub unsafe fn postEvent_atStart(&self, event: &NSEvent, flag: bool);
2077
2078 #[cfg(feature = "NSEvent")]
2079 #[unsafe(method(sendEvent:))]
2080 #[unsafe(method_family = none)]
2081 pub fn sendEvent(&self, event: &NSEvent);
2082
2083 #[cfg(feature = "NSEvent")]
2084 #[unsafe(method(currentEvent))]
2085 #[unsafe(method_family = none)]
2086 pub unsafe fn currentEvent(&self) -> Option<Retained<NSEvent>>;
2087
2088 #[unsafe(method(acceptsMouseMovedEvents))]
2089 #[unsafe(method_family = none)]
2090 pub unsafe fn acceptsMouseMovedEvents(&self) -> bool;
2091
2092 #[unsafe(method(setAcceptsMouseMovedEvents:))]
2094 #[unsafe(method_family = none)]
2095 pub fn setAcceptsMouseMovedEvents(&self, accepts_mouse_moved_events: bool);
2096
2097 #[unsafe(method(ignoresMouseEvents))]
2098 #[unsafe(method_family = none)]
2099 pub unsafe fn ignoresMouseEvents(&self) -> bool;
2100
2101 #[unsafe(method(setIgnoresMouseEvents:))]
2103 #[unsafe(method_family = none)]
2104 pub fn setIgnoresMouseEvents(&self, ignores_mouse_events: bool);
2105
2106 #[unsafe(method(mouseLocationOutsideOfEventStream))]
2107 #[unsafe(method_family = none)]
2108 pub unsafe fn mouseLocationOutsideOfEventStream(&self) -> NSPoint;
2109 );
2110}
2111
2112#[cfg(feature = "NSResponder")]
2114impl NSWindow {
2115 extern_methods!(
2116 #[unsafe(method(disableCursorRects))]
2117 #[unsafe(method_family = none)]
2118 pub unsafe fn disableCursorRects(&self);
2119
2120 #[unsafe(method(enableCursorRects))]
2121 #[unsafe(method_family = none)]
2122 pub unsafe fn enableCursorRects(&self);
2123
2124 #[unsafe(method(discardCursorRects))]
2125 #[unsafe(method_family = none)]
2126 pub unsafe fn discardCursorRects(&self);
2127
2128 #[unsafe(method(areCursorRectsEnabled))]
2129 #[unsafe(method_family = none)]
2130 pub unsafe fn areCursorRectsEnabled(&self) -> bool;
2131
2132 #[cfg(feature = "NSView")]
2133 #[unsafe(method(invalidateCursorRectsForView:))]
2134 #[unsafe(method_family = none)]
2135 pub fn invalidateCursorRectsForView(&self, view: &NSView);
2136
2137 #[unsafe(method(resetCursorRects))]
2138 #[unsafe(method_family = none)]
2139 pub unsafe fn resetCursorRects(&self);
2140 );
2141}
2142
2143#[cfg(feature = "NSResponder")]
2145impl NSWindow {
2146 extern_methods!(
2147 #[cfg(all(
2148 feature = "NSDragging",
2149 feature = "NSDraggingItem",
2150 feature = "NSDraggingSession",
2151 feature = "NSEvent"
2152 ))]
2153 #[unsafe(method(beginDraggingSessionWithItems:event:source:))]
2154 #[unsafe(method_family = none)]
2155 pub unsafe fn beginDraggingSessionWithItems_event_source(
2156 &self,
2157 items: &NSArray<NSDraggingItem>,
2158 event: &NSEvent,
2159 source: &ProtocolObject<dyn NSDraggingSource>,
2160 ) -> Retained<NSDraggingSession>;
2161
2162 #[cfg(all(feature = "NSEvent", feature = "NSImage", feature = "NSPasteboard"))]
2163 #[deprecated = "Use -[NSWindow beginDraggingSessionWithItems:event:source:] instead."]
2164 #[unsafe(method(dragImage:at:offset:event:pasteboard:source:slideBack:))]
2165 #[unsafe(method_family = none)]
2166 pub unsafe fn dragImage_at_offset_event_pasteboard_source_slideBack(
2167 &self,
2168 image: &NSImage,
2169 base_location: NSPoint,
2170 initial_offset: NSSize,
2171 event: &NSEvent,
2172 pboard: &NSPasteboard,
2173 source_obj: &AnyObject,
2174 slide_flag: bool,
2175 );
2176
2177 #[cfg(feature = "NSPasteboard")]
2178 #[unsafe(method(registerForDraggedTypes:))]
2179 #[unsafe(method_family = none)]
2180 pub fn registerForDraggedTypes(&self, new_types: &NSArray<NSPasteboardType>);
2181
2182 #[unsafe(method(unregisterDraggedTypes))]
2183 #[unsafe(method_family = none)]
2184 pub unsafe fn unregisterDraggedTypes(&self);
2185 );
2186}
2187
2188#[cfg(feature = "NSResponder")]
2190impl NSWindow {
2191 extern_methods!(
2192 #[cfg(feature = "objc2-quartz-core")]
2193 #[cfg(target_vendor = "apple")]
2194 #[unsafe(method(displayLinkWithTarget:selector:))]
2195 #[unsafe(method_family = none)]
2196 pub unsafe fn displayLinkWithTarget_selector(
2197 &self,
2198 target: &AnyObject,
2199 selector: Sel,
2200 ) -> Retained<CADisplayLink>;
2201 );
2202}
2203
2204extern_protocol!(
2205 pub unsafe trait NSWindowDelegate: NSObjectProtocol + MainThreadOnly {
2207 #[cfg(feature = "NSResponder")]
2208 #[optional]
2209 #[unsafe(method(windowShouldClose:))]
2210 #[unsafe(method_family = none)]
2211 unsafe fn windowShouldClose(&self, sender: &NSWindow) -> bool;
2212
2213 #[cfg(feature = "NSResponder")]
2214 #[optional]
2215 #[unsafe(method(windowWillReturnFieldEditor:toObject:))]
2216 #[unsafe(method_family = none)]
2217 unsafe fn windowWillReturnFieldEditor_toObject(
2218 &self,
2219 sender: &NSWindow,
2220 client: Option<&AnyObject>,
2221 ) -> Option<Retained<AnyObject>>;
2222
2223 #[cfg(feature = "NSResponder")]
2224 #[optional]
2225 #[unsafe(method(windowWillResize:toSize:))]
2226 #[unsafe(method_family = none)]
2227 unsafe fn windowWillResize_toSize(&self, sender: &NSWindow, frame_size: NSSize) -> NSSize;
2228
2229 #[cfg(feature = "NSResponder")]
2230 #[optional]
2231 #[unsafe(method(windowWillUseStandardFrame:defaultFrame:))]
2232 #[unsafe(method_family = none)]
2233 unsafe fn windowWillUseStandardFrame_defaultFrame(
2234 &self,
2235 window: &NSWindow,
2236 new_frame: NSRect,
2237 ) -> NSRect;
2238
2239 #[cfg(feature = "NSResponder")]
2240 #[optional]
2241 #[unsafe(method(windowShouldZoom:toFrame:))]
2242 #[unsafe(method_family = none)]
2243 unsafe fn windowShouldZoom_toFrame(&self, window: &NSWindow, new_frame: NSRect) -> bool;
2244
2245 #[cfg(feature = "NSResponder")]
2246 #[optional]
2247 #[unsafe(method(windowWillReturnUndoManager:))]
2248 #[unsafe(method_family = none)]
2249 unsafe fn windowWillReturnUndoManager(
2250 &self,
2251 window: &NSWindow,
2252 ) -> Option<Retained<NSUndoManager>>;
2253
2254 #[cfg(feature = "NSResponder")]
2255 #[optional]
2257 #[unsafe(method(window:willPositionSheet:usingRect:))]
2258 #[unsafe(method_family = none)]
2259 unsafe fn window_willPositionSheet_usingRect(
2260 &self,
2261 window: &NSWindow,
2262 sheet: &NSWindow,
2263 rect: NSRect,
2264 ) -> NSRect;
2265
2266 #[cfg(all(feature = "NSMenu", feature = "NSResponder"))]
2267 #[optional]
2275 #[unsafe(method(window:shouldPopUpDocumentPathMenu:))]
2276 #[unsafe(method_family = none)]
2277 unsafe fn window_shouldPopUpDocumentPathMenu(
2278 &self,
2279 window: &NSWindow,
2280 menu: &NSMenu,
2281 ) -> bool;
2282
2283 #[cfg(all(feature = "NSEvent", feature = "NSPasteboard", feature = "NSResponder"))]
2284 #[optional]
2291 #[unsafe(method(window:shouldDragDocumentWithEvent:from:withPasteboard:))]
2292 #[unsafe(method_family = none)]
2293 unsafe fn window_shouldDragDocumentWithEvent_from_withPasteboard(
2294 &self,
2295 window: &NSWindow,
2296 event: &NSEvent,
2297 drag_image_location: NSPoint,
2298 pasteboard: &NSPasteboard,
2299 ) -> bool;
2300
2301 #[cfg(feature = "NSResponder")]
2302 #[optional]
2303 #[unsafe(method(window:willUseFullScreenContentSize:))]
2304 #[unsafe(method_family = none)]
2305 unsafe fn window_willUseFullScreenContentSize(
2306 &self,
2307 window: &NSWindow,
2308 proposed_size: NSSize,
2309 ) -> NSSize;
2310
2311 #[cfg(all(feature = "NSApplication", feature = "NSResponder"))]
2312 #[optional]
2313 #[unsafe(method(window:willUseFullScreenPresentationOptions:))]
2314 #[unsafe(method_family = none)]
2315 unsafe fn window_willUseFullScreenPresentationOptions(
2316 &self,
2317 window: &NSWindow,
2318 proposed_options: NSApplicationPresentationOptions,
2319 ) -> NSApplicationPresentationOptions;
2320
2321 #[cfg(feature = "NSResponder")]
2322 #[optional]
2324 #[unsafe(method(customWindowsToEnterFullScreenForWindow:))]
2325 #[unsafe(method_family = none)]
2326 unsafe fn customWindowsToEnterFullScreenForWindow(
2327 &self,
2328 window: &NSWindow,
2329 ) -> Option<Retained<NSArray<NSWindow>>>;
2330
2331 #[cfg(feature = "NSResponder")]
2332 #[optional]
2334 #[unsafe(method(window:startCustomAnimationToEnterFullScreenWithDuration:))]
2335 #[unsafe(method_family = none)]
2336 unsafe fn window_startCustomAnimationToEnterFullScreenWithDuration(
2337 &self,
2338 window: &NSWindow,
2339 duration: NSTimeInterval,
2340 );
2341
2342 #[cfg(feature = "NSResponder")]
2343 #[optional]
2345 #[unsafe(method(windowDidFailToEnterFullScreen:))]
2346 #[unsafe(method_family = none)]
2347 unsafe fn windowDidFailToEnterFullScreen(&self, window: &NSWindow);
2348
2349 #[cfg(feature = "NSResponder")]
2350 #[optional]
2352 #[unsafe(method(customWindowsToExitFullScreenForWindow:))]
2353 #[unsafe(method_family = none)]
2354 unsafe fn customWindowsToExitFullScreenForWindow(
2355 &self,
2356 window: &NSWindow,
2357 ) -> Option<Retained<NSArray<NSWindow>>>;
2358
2359 #[cfg(feature = "NSResponder")]
2360 #[optional]
2362 #[unsafe(method(window:startCustomAnimationToExitFullScreenWithDuration:))]
2363 #[unsafe(method_family = none)]
2364 unsafe fn window_startCustomAnimationToExitFullScreenWithDuration(
2365 &self,
2366 window: &NSWindow,
2367 duration: NSTimeInterval,
2368 );
2369
2370 #[cfg(all(feature = "NSResponder", feature = "NSScreen"))]
2371 #[optional]
2373 #[unsafe(method(customWindowsToEnterFullScreenForWindow:onScreen:))]
2374 #[unsafe(method_family = none)]
2375 unsafe fn customWindowsToEnterFullScreenForWindow_onScreen(
2376 &self,
2377 window: &NSWindow,
2378 screen: &NSScreen,
2379 ) -> Option<Retained<NSArray<NSWindow>>>;
2380
2381 #[cfg(all(feature = "NSResponder", feature = "NSScreen"))]
2382 #[optional]
2384 #[unsafe(method(window:startCustomAnimationToEnterFullScreenOnScreen:withDuration:))]
2385 #[unsafe(method_family = none)]
2386 unsafe fn window_startCustomAnimationToEnterFullScreenOnScreen_withDuration(
2387 &self,
2388 window: &NSWindow,
2389 screen: &NSScreen,
2390 duration: NSTimeInterval,
2391 );
2392
2393 #[cfg(feature = "NSResponder")]
2394 #[optional]
2396 #[unsafe(method(windowDidFailToExitFullScreen:))]
2397 #[unsafe(method_family = none)]
2398 unsafe fn windowDidFailToExitFullScreen(&self, window: &NSWindow);
2399
2400 #[cfg(feature = "NSResponder")]
2401 #[optional]
2405 #[unsafe(method(window:willResizeForVersionBrowserWithMaxPreferredSize:maxAllowedSize:))]
2406 #[unsafe(method_family = none)]
2407 unsafe fn window_willResizeForVersionBrowserWithMaxPreferredSize_maxAllowedSize(
2408 &self,
2409 window: &NSWindow,
2410 max_preferred_frame_size: NSSize,
2411 max_allowed_frame_size: NSSize,
2412 ) -> NSSize;
2413
2414 #[cfg(feature = "NSResponder")]
2415 #[optional]
2417 #[unsafe(method(window:willEncodeRestorableState:))]
2418 #[unsafe(method_family = none)]
2419 unsafe fn window_willEncodeRestorableState(&self, window: &NSWindow, state: &NSCoder);
2420
2421 #[cfg(feature = "NSResponder")]
2422 #[optional]
2425 #[unsafe(method(window:didDecodeRestorableState:))]
2426 #[unsafe(method_family = none)]
2427 unsafe fn window_didDecodeRestorableState(&self, window: &NSWindow, state: &NSCoder);
2428
2429 #[cfg(all(feature = "NSPreviewRepresentingActivityItem", feature = "NSResponder"))]
2430 #[optional]
2432 #[unsafe(method(previewRepresentableActivityItemsForWindow:))]
2433 #[unsafe(method_family = none)]
2434 unsafe fn previewRepresentableActivityItemsForWindow(
2435 &self,
2436 window: &NSWindow,
2437 ) -> Option<Retained<NSArray<ProtocolObject<dyn NSPreviewRepresentableActivityItem>>>>;
2438
2439 #[cfg(feature = "NSResponder")]
2440 #[optional]
2442 #[unsafe(method(windowForSharingRequestFromWindow:))]
2443 #[unsafe(method_family = none)]
2444 unsafe fn windowForSharingRequestFromWindow(
2445 &self,
2446 window: &NSWindow,
2447 ) -> Option<Retained<NSWindow>>;
2448
2449 #[optional]
2450 #[unsafe(method(windowDidResize:))]
2451 #[unsafe(method_family = none)]
2452 unsafe fn windowDidResize(&self, notification: &NSNotification);
2453
2454 #[optional]
2455 #[unsafe(method(windowDidExpose:))]
2456 #[unsafe(method_family = none)]
2457 unsafe fn windowDidExpose(&self, notification: &NSNotification);
2458
2459 #[optional]
2460 #[unsafe(method(windowWillMove:))]
2461 #[unsafe(method_family = none)]
2462 unsafe fn windowWillMove(&self, notification: &NSNotification);
2463
2464 #[optional]
2465 #[unsafe(method(windowDidMove:))]
2466 #[unsafe(method_family = none)]
2467 unsafe fn windowDidMove(&self, notification: &NSNotification);
2468
2469 #[optional]
2470 #[unsafe(method(windowDidBecomeKey:))]
2471 #[unsafe(method_family = none)]
2472 unsafe fn windowDidBecomeKey(&self, notification: &NSNotification);
2473
2474 #[optional]
2475 #[unsafe(method(windowDidResignKey:))]
2476 #[unsafe(method_family = none)]
2477 unsafe fn windowDidResignKey(&self, notification: &NSNotification);
2478
2479 #[optional]
2480 #[unsafe(method(windowDidBecomeMain:))]
2481 #[unsafe(method_family = none)]
2482 unsafe fn windowDidBecomeMain(&self, notification: &NSNotification);
2483
2484 #[optional]
2485 #[unsafe(method(windowDidResignMain:))]
2486 #[unsafe(method_family = none)]
2487 unsafe fn windowDidResignMain(&self, notification: &NSNotification);
2488
2489 #[optional]
2490 #[unsafe(method(windowWillClose:))]
2491 #[unsafe(method_family = none)]
2492 unsafe fn windowWillClose(&self, notification: &NSNotification);
2493
2494 #[optional]
2495 #[unsafe(method(windowWillMiniaturize:))]
2496 #[unsafe(method_family = none)]
2497 unsafe fn windowWillMiniaturize(&self, notification: &NSNotification);
2498
2499 #[optional]
2500 #[unsafe(method(windowDidMiniaturize:))]
2501 #[unsafe(method_family = none)]
2502 unsafe fn windowDidMiniaturize(&self, notification: &NSNotification);
2503
2504 #[optional]
2505 #[unsafe(method(windowDidDeminiaturize:))]
2506 #[unsafe(method_family = none)]
2507 unsafe fn windowDidDeminiaturize(&self, notification: &NSNotification);
2508
2509 #[optional]
2510 #[unsafe(method(windowDidUpdate:))]
2511 #[unsafe(method_family = none)]
2512 unsafe fn windowDidUpdate(&self, notification: &NSNotification);
2513
2514 #[optional]
2515 #[unsafe(method(windowDidChangeScreen:))]
2516 #[unsafe(method_family = none)]
2517 unsafe fn windowDidChangeScreen(&self, notification: &NSNotification);
2518
2519 #[optional]
2520 #[unsafe(method(windowDidChangeScreenProfile:))]
2521 #[unsafe(method_family = none)]
2522 unsafe fn windowDidChangeScreenProfile(&self, notification: &NSNotification);
2523
2524 #[optional]
2525 #[unsafe(method(windowDidChangeBackingProperties:))]
2526 #[unsafe(method_family = none)]
2527 unsafe fn windowDidChangeBackingProperties(&self, notification: &NSNotification);
2528
2529 #[optional]
2530 #[unsafe(method(windowWillBeginSheet:))]
2531 #[unsafe(method_family = none)]
2532 unsafe fn windowWillBeginSheet(&self, notification: &NSNotification);
2533
2534 #[optional]
2535 #[unsafe(method(windowDidEndSheet:))]
2536 #[unsafe(method_family = none)]
2537 unsafe fn windowDidEndSheet(&self, notification: &NSNotification);
2538
2539 #[optional]
2540 #[unsafe(method(windowWillStartLiveResize:))]
2541 #[unsafe(method_family = none)]
2542 unsafe fn windowWillStartLiveResize(&self, notification: &NSNotification);
2543
2544 #[optional]
2545 #[unsafe(method(windowDidEndLiveResize:))]
2546 #[unsafe(method_family = none)]
2547 unsafe fn windowDidEndLiveResize(&self, notification: &NSNotification);
2548
2549 #[optional]
2550 #[unsafe(method(windowWillEnterFullScreen:))]
2551 #[unsafe(method_family = none)]
2552 unsafe fn windowWillEnterFullScreen(&self, notification: &NSNotification);
2553
2554 #[optional]
2555 #[unsafe(method(windowDidEnterFullScreen:))]
2556 #[unsafe(method_family = none)]
2557 unsafe fn windowDidEnterFullScreen(&self, notification: &NSNotification);
2558
2559 #[optional]
2560 #[unsafe(method(windowWillExitFullScreen:))]
2561 #[unsafe(method_family = none)]
2562 unsafe fn windowWillExitFullScreen(&self, notification: &NSNotification);
2563
2564 #[optional]
2565 #[unsafe(method(windowDidExitFullScreen:))]
2566 #[unsafe(method_family = none)]
2567 unsafe fn windowDidExitFullScreen(&self, notification: &NSNotification);
2568
2569 #[optional]
2570 #[unsafe(method(windowWillEnterVersionBrowser:))]
2571 #[unsafe(method_family = none)]
2572 unsafe fn windowWillEnterVersionBrowser(&self, notification: &NSNotification);
2573
2574 #[optional]
2575 #[unsafe(method(windowDidEnterVersionBrowser:))]
2576 #[unsafe(method_family = none)]
2577 unsafe fn windowDidEnterVersionBrowser(&self, notification: &NSNotification);
2578
2579 #[optional]
2580 #[unsafe(method(windowWillExitVersionBrowser:))]
2581 #[unsafe(method_family = none)]
2582 unsafe fn windowWillExitVersionBrowser(&self, notification: &NSNotification);
2583
2584 #[optional]
2585 #[unsafe(method(windowDidExitVersionBrowser:))]
2586 #[unsafe(method_family = none)]
2587 unsafe fn windowDidExitVersionBrowser(&self, notification: &NSNotification);
2588
2589 #[optional]
2590 #[unsafe(method(windowDidChangeOcclusionState:))]
2591 #[unsafe(method_family = none)]
2592 unsafe fn windowDidChangeOcclusionState(&self, notification: &NSNotification);
2593 }
2594);
2595
2596extern "C" {
2597 pub static NSWindowDidBecomeKeyNotification: &'static NSNotificationName;
2599}
2600
2601extern "C" {
2602 pub static NSWindowDidBecomeMainNotification: &'static NSNotificationName;
2604}
2605
2606extern "C" {
2607 pub static NSWindowDidChangeScreenNotification: &'static NSNotificationName;
2609}
2610
2611extern "C" {
2612 pub static NSWindowDidDeminiaturizeNotification: &'static NSNotificationName;
2614}
2615
2616extern "C" {
2617 pub static NSWindowDidExposeNotification: &'static NSNotificationName;
2619}
2620
2621extern "C" {
2622 pub static NSWindowDidMiniaturizeNotification: &'static NSNotificationName;
2624}
2625
2626extern "C" {
2627 pub static NSWindowDidMoveNotification: &'static NSNotificationName;
2629}
2630
2631extern "C" {
2632 pub static NSWindowDidResignKeyNotification: &'static NSNotificationName;
2634}
2635
2636extern "C" {
2637 pub static NSWindowDidResignMainNotification: &'static NSNotificationName;
2639}
2640
2641extern "C" {
2642 pub static NSWindowDidResizeNotification: &'static NSNotificationName;
2644}
2645
2646extern "C" {
2647 pub static NSWindowDidUpdateNotification: &'static NSNotificationName;
2649}
2650
2651extern "C" {
2652 pub static NSWindowWillCloseNotification: &'static NSNotificationName;
2654}
2655
2656extern "C" {
2657 pub static NSWindowWillMiniaturizeNotification: &'static NSNotificationName;
2659}
2660
2661extern "C" {
2662 pub static NSWindowWillMoveNotification: &'static NSNotificationName;
2664}
2665
2666extern "C" {
2667 pub static NSWindowWillBeginSheetNotification: &'static NSNotificationName;
2669}
2670
2671extern "C" {
2672 pub static NSWindowDidEndSheetNotification: &'static NSNotificationName;
2674}
2675
2676extern "C" {
2677 pub static NSWindowDidChangeBackingPropertiesNotification: &'static NSNotificationName;
2688}
2689
2690extern "C" {
2691 pub static NSBackingPropertyOldScaleFactorKey: &'static NSString;
2693}
2694
2695extern "C" {
2696 pub static NSBackingPropertyOldColorSpaceKey: &'static NSString;
2698}
2699
2700extern "C" {
2701 pub static NSWindowDidChangeScreenProfileNotification: &'static NSNotificationName;
2706}
2707
2708extern "C" {
2709 pub static NSWindowWillStartLiveResizeNotification: &'static NSNotificationName;
2713}
2714
2715extern "C" {
2716 pub static NSWindowDidEndLiveResizeNotification: &'static NSNotificationName;
2720}
2721
2722extern "C" {
2723 pub static NSWindowWillEnterFullScreenNotification: &'static NSNotificationName;
2725}
2726
2727extern "C" {
2728 pub static NSWindowDidEnterFullScreenNotification: &'static NSNotificationName;
2730}
2731
2732extern "C" {
2733 pub static NSWindowWillExitFullScreenNotification: &'static NSNotificationName;
2735}
2736
2737extern "C" {
2738 pub static NSWindowDidExitFullScreenNotification: &'static NSNotificationName;
2740}
2741
2742extern "C" {
2743 pub static NSWindowWillEnterVersionBrowserNotification: &'static NSNotificationName;
2745}
2746
2747extern "C" {
2748 pub static NSWindowDidEnterVersionBrowserNotification: &'static NSNotificationName;
2750}
2751
2752extern "C" {
2753 pub static NSWindowWillExitVersionBrowserNotification: &'static NSNotificationName;
2755}
2756
2757extern "C" {
2758 pub static NSWindowDidExitVersionBrowserNotification: &'static NSNotificationName;
2760}
2761
2762extern "C" {
2763 pub static NSWindowDidChangeOcclusionStateNotification: &'static NSNotificationName;
2768}
2769
2770#[deprecated]
2773#[repr(transparent)]
2774#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
2775pub struct NSWindowBackingLocation(pub NSUInteger);
2776impl NSWindowBackingLocation {
2777 #[doc(alias = "NSWindowBackingLocationDefault")]
2778 pub const Default: Self = Self(0);
2779 #[doc(alias = "NSWindowBackingLocationVideoMemory")]
2780 pub const VideoMemory: Self = Self(1);
2781 #[doc(alias = "NSWindowBackingLocationMainMemory")]
2782 pub const MainMemory: Self = Self(2);
2783}
2784
2785unsafe impl Encode for NSWindowBackingLocation {
2786 const ENCODING: Encoding = NSUInteger::ENCODING;
2787}
2788
2789unsafe impl RefEncode for NSWindowBackingLocation {
2790 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
2791}
2792
2793#[cfg(feature = "NSResponder")]
2795impl NSWindow {
2796 extern_methods!(
2797 #[deprecated = "This method shouldn’t be used as it doesn’t work in all drawing situations; instead, a subview should be used that implements the desired drawing behavior"]
2798 #[unsafe(method(cacheImageInRect:))]
2799 #[unsafe(method_family = none)]
2800 pub unsafe fn cacheImageInRect(&self, rect: NSRect);
2801
2802 #[deprecated = "This method shouldn’t be used as it doesn’t work in all drawing situations; instead, a subview should be used that implements the desired drawing behavior"]
2803 #[unsafe(method(restoreCachedImage))]
2804 #[unsafe(method_family = none)]
2805 pub unsafe fn restoreCachedImage(&self);
2806
2807 #[deprecated = "This method shouldn’t be used as it doesn’t work in all drawing situations; instead, a subview should be used that implements the desired drawing behavior"]
2808 #[unsafe(method(discardCachedImage))]
2809 #[unsafe(method_family = none)]
2810 pub unsafe fn discardCachedImage(&self);
2811
2812 #[cfg(feature = "NSMenu")]
2813 #[deprecated = "This method does not do anything and should not be called."]
2814 #[unsafe(method(menuChanged:))]
2815 #[unsafe(method_family = none)]
2816 pub unsafe fn menuChanged(menu: &NSMenu);
2817
2818 #[deprecated = "This method is unused and should not be called."]
2819 #[unsafe(method(gState))]
2820 #[unsafe(method_family = none)]
2821 pub unsafe fn gState(&self) -> NSInteger;
2822
2823 #[deprecated = "Use -convertRectToScreen: or -convertPointToScreen: instead"]
2824 #[unsafe(method(convertBaseToScreen:))]
2825 #[unsafe(method_family = none)]
2826 pub unsafe fn convertBaseToScreen(&self, point: NSPoint) -> NSPoint;
2827
2828 #[deprecated = "Use -convertRectFromScreen or -convertPointFromScreen: instead"]
2829 #[unsafe(method(convertScreenToBase:))]
2830 #[unsafe(method_family = none)]
2831 pub unsafe fn convertScreenToBase(&self, point: NSPoint) -> NSPoint;
2832
2833 #[cfg(feature = "objc2-core-foundation")]
2834 #[deprecated = "Use -convertRectToBacking: and -backingScaleFactor instead"]
2835 #[unsafe(method(userSpaceScaleFactor))]
2836 #[unsafe(method_family = none)]
2837 pub unsafe fn userSpaceScaleFactor(&self) -> CGFloat;
2838
2839 #[deprecated = "This method does not do anything and should not be called."]
2840 #[unsafe(method(useOptimizedDrawing:))]
2841 #[unsafe(method_family = none)]
2842 pub unsafe fn useOptimizedDrawing(&self, flag: bool);
2843
2844 #[deprecated = "This method does not do anything and should not be called."]
2845 #[unsafe(method(canStoreColor))]
2846 #[unsafe(method_family = none)]
2847 pub unsafe fn canStoreColor(&self) -> bool;
2848
2849 #[deprecated = "Use +[NSAnimationContext runAnimationGroup:completionHandler:] to perform atomic updates across runloop invocations."]
2850 #[unsafe(method(disableFlushWindow))]
2851 #[unsafe(method_family = none)]
2852 pub unsafe fn disableFlushWindow(&self);
2853
2854 #[deprecated = "Use +[NSAnimationContext runAnimationGroup:completionHandler:] to perform atomic updates across runloop invocations."]
2855 #[unsafe(method(enableFlushWindow))]
2856 #[unsafe(method_family = none)]
2857 pub unsafe fn enableFlushWindow(&self);
2858
2859 #[deprecated = "Use +[NSAnimationContext runAnimationGroup:completionHandler:] to perform atomic updates across runloop invocations."]
2860 #[unsafe(method(isFlushWindowDisabled))]
2861 #[unsafe(method_family = none)]
2862 pub unsafe fn isFlushWindowDisabled(&self) -> bool;
2863
2864 #[deprecated = "Allow AppKit's automatic deferred display mechanism to take care of flushing any graphics contexts as needed."]
2865 #[unsafe(method(flushWindow))]
2866 #[unsafe(method_family = none)]
2867 pub unsafe fn flushWindow(&self);
2868
2869 #[deprecated = "Allow AppKit's automatic deferred display mechanism to take care of flushing any graphics contexts as needed."]
2870 #[unsafe(method(flushWindowIfNeeded))]
2871 #[unsafe(method_family = none)]
2872 pub unsafe fn flushWindowIfNeeded(&self);
2873
2874 #[deprecated = "Use +[NSAnimationContext runAnimationGroup:completionHandler:] to temporarily prevent AppKit's automatic deferred display mechanism from drawing."]
2875 #[unsafe(method(isAutodisplay))]
2876 #[unsafe(method_family = none)]
2877 pub unsafe fn isAutodisplay(&self) -> bool;
2878
2879 #[deprecated = "Use +[NSAnimationContext runAnimationGroup:completionHandler:] to temporarily prevent AppKit's automatic deferred display mechanism from drawing."]
2881 #[unsafe(method(setAutodisplay:))]
2882 #[unsafe(method_family = none)]
2883 pub unsafe fn setAutodisplay(&self, autodisplay: bool);
2884
2885 #[cfg(feature = "NSGraphicsContext")]
2886 #[deprecated = "Add instances of NSView to display content in a window."]
2887 #[unsafe(method(graphicsContext))]
2888 #[unsafe(method_family = none)]
2889 pub unsafe fn graphicsContext(&self) -> Option<Retained<NSGraphicsContext>>;
2890
2891 #[deprecated = "This property does not do anything and should not be used"]
2892 #[unsafe(method(isOneShot))]
2893 #[unsafe(method_family = none)]
2894 pub unsafe fn isOneShot(&self) -> bool;
2895
2896 #[deprecated = "This property does not do anything and should not be used"]
2898 #[unsafe(method(setOneShot:))]
2899 #[unsafe(method_family = none)]
2900 pub unsafe fn setOneShot(&self, one_shot: bool);
2901
2902 #[deprecated = "This property does not do anything and should not be used"]
2903 #[unsafe(method(preferredBackingLocation))]
2904 #[unsafe(method_family = none)]
2905 pub unsafe fn preferredBackingLocation(&self) -> NSWindowBackingLocation;
2906
2907 #[deprecated = "This property does not do anything and should not be used"]
2909 #[unsafe(method(setPreferredBackingLocation:))]
2910 #[unsafe(method_family = none)]
2911 pub unsafe fn setPreferredBackingLocation(
2912 &self,
2913 preferred_backing_location: NSWindowBackingLocation,
2914 );
2915
2916 #[deprecated = "This property does not do anything and should not be used"]
2917 #[unsafe(method(backingLocation))]
2918 #[unsafe(method_family = none)]
2919 pub unsafe fn backingLocation(&self) -> NSWindowBackingLocation;
2920
2921 #[deprecated = "This property does not do anything and should not be used."]
2922 #[unsafe(method(showsResizeIndicator))]
2923 #[unsafe(method_family = none)]
2924 pub unsafe fn showsResizeIndicator(&self) -> bool;
2925
2926 #[deprecated = "This property does not do anything and should not be used."]
2928 #[unsafe(method(setShowsResizeIndicator:))]
2929 #[unsafe(method_family = none)]
2930 pub unsafe fn setShowsResizeIndicator(&self, shows_resize_indicator: bool);
2931
2932 #[deprecated = "This method should not be used."]
2933 #[unsafe(method(initWithWindowRef:))]
2934 #[unsafe(method_family = init)]
2935 pub unsafe fn initWithWindowRef(
2936 this: Allocated<Self>,
2937 window_ref: NonNull<c_void>,
2938 ) -> Option<Retained<NSWindow>>;
2939
2940 #[deprecated = "This method should not be used."]
2941 #[unsafe(method(windowRef))]
2942 #[unsafe(method_family = none)]
2943 pub unsafe fn windowRef(&self) -> NonNull<c_void>;
2944
2945 #[deprecated = "This method does not do anything and should not be called."]
2946 #[unsafe(method(disableScreenUpdatesUntilFlush))]
2947 #[unsafe(method_family = none)]
2948 pub unsafe fn disableScreenUpdatesUntilFlush(&self);
2949 );
2950}
2951
2952pub static NSBorderlessWindowMask: NSWindowStyleMask =
2954 NSWindowStyleMask(NSWindowStyleMask::Borderless.0);
2955
2956pub static NSTitledWindowMask: NSWindowStyleMask = NSWindowStyleMask(NSWindowStyleMask::Titled.0);
2958
2959pub static NSClosableWindowMask: NSWindowStyleMask =
2961 NSWindowStyleMask(NSWindowStyleMask::Closable.0);
2962
2963pub static NSMiniaturizableWindowMask: NSWindowStyleMask =
2965 NSWindowStyleMask(NSWindowStyleMask::Miniaturizable.0);
2966
2967pub static NSResizableWindowMask: NSWindowStyleMask =
2969 NSWindowStyleMask(NSWindowStyleMask::Resizable.0);
2970
2971pub static NSTexturedBackgroundWindowMask: NSWindowStyleMask =
2973 NSWindowStyleMask(NSWindowStyleMask::TexturedBackground.0);
2974
2975pub static NSUnifiedTitleAndToolbarWindowMask: NSWindowStyleMask =
2977 NSWindowStyleMask(NSWindowStyleMask::UnifiedTitleAndToolbar.0);
2978
2979pub static NSFullScreenWindowMask: NSWindowStyleMask =
2981 NSWindowStyleMask(NSWindowStyleMask::FullScreen.0);
2982
2983pub static NSFullSizeContentViewWindowMask: NSWindowStyleMask =
2985 NSWindowStyleMask(NSWindowStyleMask::FullSizeContentView.0);
2986
2987pub static NSUtilityWindowMask: NSWindowStyleMask =
2989 NSWindowStyleMask(NSWindowStyleMask::UtilityWindow.0);
2990
2991pub static NSDocModalWindowMask: NSWindowStyleMask =
2993 NSWindowStyleMask(NSWindowStyleMask::DocModalWindow.0);
2994
2995pub static NSNonactivatingPanelMask: NSWindowStyleMask =
2997 NSWindowStyleMask(NSWindowStyleMask::NonactivatingPanel.0);
2998
2999pub static NSHUDWindowMask: NSWindowStyleMask = NSWindowStyleMask(NSWindowStyleMask::HUDWindow.0);
3001
3002pub static NSUnscaledWindowMask: NSWindowStyleMask = NSWindowStyleMask(1 << 11);
3004
3005pub static NSWindowFullScreenButton: NSWindowButton = NSWindowButton(7);
3007
3008pub static NSDockWindowLevel: NSWindowLevel = 20;
3010
3011pub static NSWindowSharingReadWrite: NSWindowSharingType = NSWindowSharingType(2);