#[cfg(feature = "block2")]
use block2::*;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
#[cfg(feature = "NSApplication")]
pub static NSAppKitVersionNumberWithCustomSheetPosition: NSAppKitVersion = 686.0 as _;
#[cfg(feature = "NSApplication")]
pub static NSAppKitVersionNumberWithDeferredWindowDisplaySupport: NSAppKitVersion = 1019.0 as _;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSWindowStyleMask(pub NSUInteger);
impl NSWindowStyleMask {
#[doc(alias = "NSWindowStyleMaskBorderless")]
pub const Borderless: Self = Self(0);
#[doc(alias = "NSWindowStyleMaskTitled")]
pub const Titled: Self = Self(1 << 0);
#[doc(alias = "NSWindowStyleMaskClosable")]
pub const Closable: Self = Self(1 << 1);
#[doc(alias = "NSWindowStyleMaskMiniaturizable")]
pub const Miniaturizable: Self = Self(1 << 2);
#[doc(alias = "NSWindowStyleMaskResizable")]
pub const Resizable: Self = Self(1 << 3);
#[deprecated = "Textured window style should no longer be used"]
#[doc(alias = "NSWindowStyleMaskTexturedBackground")]
pub const TexturedBackground: Self = Self(1 << 8);
#[doc(alias = "NSWindowStyleMaskUnifiedTitleAndToolbar")]
pub const UnifiedTitleAndToolbar: Self = Self(1 << 12);
#[doc(alias = "NSWindowStyleMaskFullScreen")]
pub const FullScreen: Self = Self(1 << 14);
#[doc(alias = "NSWindowStyleMaskFullSizeContentView")]
pub const FullSizeContentView: Self = Self(1 << 15);
#[doc(alias = "NSWindowStyleMaskUtilityWindow")]
pub const UtilityWindow: Self = Self(1 << 4);
#[doc(alias = "NSWindowStyleMaskDocModalWindow")]
pub const DocModalWindow: Self = Self(1 << 6);
#[doc(alias = "NSWindowStyleMaskNonactivatingPanel")]
pub const NonactivatingPanel: Self = Self(1 << 7);
#[doc(alias = "NSWindowStyleMaskHUDWindow")]
pub const HUDWindow: Self = Self(1 << 13);
}
unsafe impl Encode for NSWindowStyleMask {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for NSWindowStyleMask {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[cfg(feature = "NSApplication")]
pub static NSModalResponseOK: NSModalResponse = 1;
#[cfg(feature = "NSApplication")]
pub static NSModalResponseCancel: NSModalResponse = 0;
pub const NSDisplayWindowRunLoopOrdering: c_uint = 600000;
pub const NSResetCursorRectsRunLoopOrdering: c_uint = 700000;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSWindowSharingType(pub NSUInteger);
impl NSWindowSharingType {
pub const NSWindowSharingNone: Self = Self(0);
pub const NSWindowSharingReadOnly: Self = Self(1);
pub const NSWindowSharingReadWrite: Self = Self(2);
}
unsafe impl Encode for NSWindowSharingType {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for NSWindowSharingType {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSWindowCollectionBehavior(pub NSUInteger);
impl NSWindowCollectionBehavior {
#[doc(alias = "NSWindowCollectionBehaviorDefault")]
pub const Default: Self = Self(0);
#[doc(alias = "NSWindowCollectionBehaviorCanJoinAllSpaces")]
pub const CanJoinAllSpaces: Self = Self(1 << 0);
#[doc(alias = "NSWindowCollectionBehaviorMoveToActiveSpace")]
pub const MoveToActiveSpace: Self = Self(1 << 1);
#[doc(alias = "NSWindowCollectionBehaviorManaged")]
pub const Managed: Self = Self(1 << 2);
#[doc(alias = "NSWindowCollectionBehaviorTransient")]
pub const Transient: Self = Self(1 << 3);
#[doc(alias = "NSWindowCollectionBehaviorStationary")]
pub const Stationary: Self = Self(1 << 4);
#[doc(alias = "NSWindowCollectionBehaviorParticipatesInCycle")]
pub const ParticipatesInCycle: Self = Self(1 << 5);
#[doc(alias = "NSWindowCollectionBehaviorIgnoresCycle")]
pub const IgnoresCycle: Self = Self(1 << 6);
#[doc(alias = "NSWindowCollectionBehaviorFullScreenPrimary")]
pub const FullScreenPrimary: Self = Self(1 << 7);
#[doc(alias = "NSWindowCollectionBehaviorFullScreenAuxiliary")]
pub const FullScreenAuxiliary: Self = Self(1 << 8);
#[doc(alias = "NSWindowCollectionBehaviorFullScreenNone")]
pub const FullScreenNone: Self = Self(1 << 9);
#[doc(alias = "NSWindowCollectionBehaviorFullScreenAllowsTiling")]
pub const FullScreenAllowsTiling: Self = Self(1 << 11);
#[doc(alias = "NSWindowCollectionBehaviorFullScreenDisallowsTiling")]
pub const FullScreenDisallowsTiling: Self = Self(1 << 12);
#[doc(alias = "NSWindowCollectionBehaviorPrimary")]
pub const Primary: Self = Self(1 << 16);
#[doc(alias = "NSWindowCollectionBehaviorAuxiliary")]
pub const Auxiliary: Self = Self(1 << 17);
#[doc(alias = "NSWindowCollectionBehaviorCanJoinAllApplications")]
pub const CanJoinAllApplications: Self = Self(1 << 18);
}
unsafe impl Encode for NSWindowCollectionBehavior {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for NSWindowCollectionBehavior {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSWindowAnimationBehavior(pub NSInteger);
impl NSWindowAnimationBehavior {
#[doc(alias = "NSWindowAnimationBehaviorDefault")]
pub const Default: Self = Self(0);
#[doc(alias = "NSWindowAnimationBehaviorNone")]
pub const None: Self = Self(2);
#[doc(alias = "NSWindowAnimationBehaviorDocumentWindow")]
pub const DocumentWindow: Self = Self(3);
#[doc(alias = "NSWindowAnimationBehaviorUtilityWindow")]
pub const UtilityWindow: Self = Self(4);
#[doc(alias = "NSWindowAnimationBehaviorAlertPanel")]
pub const AlertPanel: Self = Self(5);
}
unsafe impl Encode for NSWindowAnimationBehavior {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for NSWindowAnimationBehavior {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSWindowNumberListOptions(pub NSUInteger);
impl NSWindowNumberListOptions {
pub const NSWindowNumberListAllApplications: Self = Self(1 << 0);
pub const NSWindowNumberListAllSpaces: Self = Self(1 << 4);
}
unsafe impl Encode for NSWindowNumberListOptions {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for NSWindowNumberListOptions {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSWindowOcclusionState(pub NSUInteger);
impl NSWindowOcclusionState {
#[doc(alias = "NSWindowOcclusionStateVisible")]
pub const Visible: Self = Self(1 << 1);
}
unsafe impl Encode for NSWindowOcclusionState {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for NSWindowOcclusionState {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
pub type NSWindowLevel = NSInteger;
pub static NSNormalWindowLevel: NSWindowLevel = 0;
pub static NSFloatingWindowLevel: NSWindowLevel = 3;
pub static NSSubmenuWindowLevel: NSWindowLevel = 3;
pub static NSTornOffMenuWindowLevel: NSWindowLevel = 3;
pub static NSMainMenuWindowLevel: NSWindowLevel = 24;
pub static NSStatusWindowLevel: NSWindowLevel = 25;
pub static NSModalPanelWindowLevel: NSWindowLevel = 8;
pub static NSPopUpMenuWindowLevel: NSWindowLevel = 101;
pub static NSScreenSaverWindowLevel: NSWindowLevel = 1000;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSSelectionDirection(pub NSUInteger);
impl NSSelectionDirection {
pub const NSDirectSelection: Self = Self(0);
pub const NSSelectingNext: Self = Self(1);
pub const NSSelectingPrevious: Self = Self(2);
}
unsafe impl Encode for NSSelectionDirection {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for NSSelectionDirection {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSWindowButton(pub NSUInteger);
impl NSWindowButton {
pub const NSWindowCloseButton: Self = Self(0);
pub const NSWindowMiniaturizeButton: Self = Self(1);
pub const NSWindowZoomButton: Self = Self(2);
pub const NSWindowToolbarButton: Self = Self(3);
pub const NSWindowDocumentIconButton: Self = Self(4);
pub const NSWindowDocumentVersionsButton: Self = Self(6);
}
unsafe impl Encode for NSWindowButton {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for NSWindowButton {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSWindowTitleVisibility(pub NSInteger);
impl NSWindowTitleVisibility {
pub const NSWindowTitleVisible: Self = Self(0);
pub const NSWindowTitleHidden: Self = Self(1);
}
unsafe impl Encode for NSWindowTitleVisibility {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for NSWindowTitleVisibility {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSWindowToolbarStyle(pub NSInteger);
impl NSWindowToolbarStyle {
#[doc(alias = "NSWindowToolbarStyleAutomatic")]
pub const Automatic: Self = Self(0);
#[doc(alias = "NSWindowToolbarStyleExpanded")]
pub const Expanded: Self = Self(1);
#[doc(alias = "NSWindowToolbarStylePreference")]
pub const Preference: Self = Self(2);
#[doc(alias = "NSWindowToolbarStyleUnified")]
pub const Unified: Self = Self(3);
#[doc(alias = "NSWindowToolbarStyleUnifiedCompact")]
pub const UnifiedCompact: Self = Self(4);
}
unsafe impl Encode for NSWindowToolbarStyle {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for NSWindowToolbarStyle {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
pub static NSEventDurationForever: NSTimeInterval = c_double::MAX as _;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSWindowUserTabbingPreference(pub NSInteger);
impl NSWindowUserTabbingPreference {
#[doc(alias = "NSWindowUserTabbingPreferenceManual")]
pub const Manual: Self = Self(0);
#[doc(alias = "NSWindowUserTabbingPreferenceAlways")]
pub const Always: Self = Self(1);
#[doc(alias = "NSWindowUserTabbingPreferenceInFullScreen")]
pub const InFullScreen: Self = Self(2);
}
unsafe impl Encode for NSWindowUserTabbingPreference {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for NSWindowUserTabbingPreference {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSWindowTabbingMode(pub NSInteger);
impl NSWindowTabbingMode {
#[doc(alias = "NSWindowTabbingModeAutomatic")]
pub const Automatic: Self = Self(0);
#[doc(alias = "NSWindowTabbingModePreferred")]
pub const Preferred: Self = Self(1);
#[doc(alias = "NSWindowTabbingModeDisallowed")]
pub const Disallowed: Self = Self(2);
}
unsafe impl Encode for NSWindowTabbingMode {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for NSWindowTabbingMode {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSTitlebarSeparatorStyle(pub NSInteger);
impl NSTitlebarSeparatorStyle {
#[doc(alias = "NSTitlebarSeparatorStyleAutomatic")]
pub const Automatic: Self = Self(0);
#[doc(alias = "NSTitlebarSeparatorStyleNone")]
pub const None: Self = Self(1);
#[doc(alias = "NSTitlebarSeparatorStyleLine")]
pub const Line: Self = Self(2);
#[doc(alias = "NSTitlebarSeparatorStyleShadow")]
pub const Shadow: Self = Self(3);
}
unsafe impl Encode for NSTitlebarSeparatorStyle {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for NSTitlebarSeparatorStyle {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
pub type NSWindowFrameAutosaveName = NSString;
pub type NSWindowPersistableFrameDescriptor = NSString;
pub type NSWindowTabbingIdentifier = NSString;
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "NSResponder")]
pub struct NSWindow;
#[cfg(feature = "NSResponder")]
unsafe impl ClassType for NSWindow {
#[inherits(NSObject)]
type Super = NSResponder;
type Mutability = MainThreadOnly;
}
);
#[cfg(all(feature = "NSAccessibilityProtocols", feature = "NSResponder"))]
unsafe impl NSAccessibility for NSWindow {}
#[cfg(all(feature = "NSAccessibilityProtocols", feature = "NSResponder"))]
unsafe impl NSAccessibilityElementProtocol for NSWindow {}
#[cfg(all(feature = "NSAnimation", feature = "NSResponder"))]
unsafe impl NSAnimatablePropertyContainer for NSWindow {}
#[cfg(all(feature = "NSAppearance", feature = "NSResponder"))]
unsafe impl NSAppearanceCustomization for NSWindow {}
#[cfg(feature = "NSResponder")]
unsafe impl NSCoding for NSWindow {}
#[cfg(all(feature = "NSMenu", feature = "NSResponder"))]
unsafe impl NSMenuItemValidation for NSWindow {}
#[cfg(feature = "NSResponder")]
unsafe impl NSObjectProtocol for NSWindow {}
#[cfg(all(feature = "NSResponder", feature = "NSUserInterfaceItemIdentification"))]
unsafe impl NSUserInterfaceItemIdentification for NSWindow {}
#[cfg(all(feature = "NSResponder", feature = "NSUserInterfaceValidation"))]
unsafe impl NSUserInterfaceValidations for NSWindow {}
extern_methods!(
#[cfg(feature = "NSResponder")]
unsafe impl NSWindow {
#[method(frameRectForContentRect:styleMask:)]
pub unsafe fn frameRectForContentRect_styleMask(
c_rect: NSRect,
style: NSWindowStyleMask,
mtm: MainThreadMarker,
) -> NSRect;
#[method(contentRectForFrameRect:styleMask:)]
pub unsafe fn contentRectForFrameRect_styleMask(
f_rect: NSRect,
style: NSWindowStyleMask,
mtm: MainThreadMarker,
) -> NSRect;
#[method(minFrameWidthWithTitle:styleMask:)]
pub unsafe fn minFrameWidthWithTitle_styleMask(
title: &NSString,
style: NSWindowStyleMask,
mtm: MainThreadMarker,
) -> CGFloat;
#[cfg(feature = "NSGraphics")]
#[method(defaultDepthLimit)]
pub unsafe fn defaultDepthLimit(mtm: MainThreadMarker) -> NSWindowDepth;
#[method(frameRectForContentRect:)]
pub unsafe fn frameRectForContentRect(&self, content_rect: NSRect) -> NSRect;
#[method(contentRectForFrameRect:)]
pub fn contentRectForFrameRect(&self, frame_rect: NSRect) -> NSRect;
#[cfg(feature = "NSGraphics")]
#[method_id(@__retain_semantics Init initWithContentRect:styleMask:backing:defer:)]
pub unsafe fn initWithContentRect_styleMask_backing_defer(
this: Allocated<Self>,
content_rect: NSRect,
style: NSWindowStyleMask,
backing_store_type: NSBackingStoreType,
flag: bool,
) -> Id<Self>;
#[cfg(all(feature = "NSGraphics", feature = "NSScreen"))]
#[method_id(@__retain_semantics Init initWithContentRect:styleMask:backing:defer:screen:)]
pub unsafe fn initWithContentRect_styleMask_backing_defer_screen(
this: Allocated<Self>,
content_rect: NSRect,
style: NSWindowStyleMask,
backing_store_type: NSBackingStoreType,
flag: bool,
screen: Option<&NSScreen>,
) -> Id<Self>;
#[method_id(@__retain_semantics Init initWithCoder:)]
pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Id<Self>;
#[method_id(@__retain_semantics Other title)]
pub fn title(&self) -> Id<NSString>;
#[method(setTitle:)]
pub fn setTitle(&self, title: &NSString);
#[method_id(@__retain_semantics Other subtitle)]
pub unsafe fn subtitle(&self) -> Id<NSString>;
#[method(setSubtitle:)]
pub unsafe fn setSubtitle(&self, subtitle: &NSString);
#[method(titleVisibility)]
pub unsafe fn titleVisibility(&self) -> NSWindowTitleVisibility;
#[method(setTitleVisibility:)]
pub fn setTitleVisibility(&self, title_visibility: NSWindowTitleVisibility);
#[method(titlebarAppearsTransparent)]
pub unsafe fn titlebarAppearsTransparent(&self) -> bool;
#[method(setTitlebarAppearsTransparent:)]
pub fn setTitlebarAppearsTransparent(&self, titlebar_appears_transparent: bool);
#[method(toolbarStyle)]
pub unsafe fn toolbarStyle(&self) -> NSWindowToolbarStyle;
#[method(setToolbarStyle:)]
pub unsafe fn setToolbarStyle(&self, toolbar_style: NSWindowToolbarStyle);
#[method(contentLayoutRect)]
pub unsafe fn contentLayoutRect(&self) -> NSRect;
#[method_id(@__retain_semantics Other contentLayoutGuide)]
pub unsafe fn contentLayoutGuide(&self) -> Option<Id<AnyObject>>;
#[cfg(all(
feature = "NSTitlebarAccessoryViewController",
feature = "NSViewController"
))]
#[method_id(@__retain_semantics Other titlebarAccessoryViewControllers)]
pub unsafe fn titlebarAccessoryViewControllers(
&self,
) -> Id<NSArray<NSTitlebarAccessoryViewController>>;
#[cfg(all(
feature = "NSTitlebarAccessoryViewController",
feature = "NSViewController"
))]
#[method(setTitlebarAccessoryViewControllers:)]
pub unsafe fn setTitlebarAccessoryViewControllers(
&self,
titlebar_accessory_view_controllers: &NSArray<NSTitlebarAccessoryViewController>,
);
#[cfg(all(
feature = "NSTitlebarAccessoryViewController",
feature = "NSViewController"
))]
#[method(addTitlebarAccessoryViewController:)]
pub unsafe fn addTitlebarAccessoryViewController(
&self,
child_view_controller: &NSTitlebarAccessoryViewController,
);
#[cfg(all(
feature = "NSTitlebarAccessoryViewController",
feature = "NSViewController"
))]
#[method(insertTitlebarAccessoryViewController:atIndex:)]
pub unsafe fn insertTitlebarAccessoryViewController_atIndex(
&self,
child_view_controller: &NSTitlebarAccessoryViewController,
index: NSInteger,
);
#[method(removeTitlebarAccessoryViewControllerAtIndex:)]
pub unsafe fn removeTitlebarAccessoryViewControllerAtIndex(&self, index: NSInteger);
#[method_id(@__retain_semantics Other representedURL)]
pub unsafe fn representedURL(&self) -> Option<Id<NSURL>>;
#[method(setRepresentedURL:)]
pub unsafe fn setRepresentedURL(&self, represented_url: Option<&NSURL>);
#[method_id(@__retain_semantics Other representedFilename)]
pub unsafe fn representedFilename(&self) -> Id<NSString>;
#[method(setRepresentedFilename:)]
pub unsafe fn setRepresentedFilename(&self, represented_filename: &NSString);
#[method(setTitleWithRepresentedFilename:)]
pub unsafe fn setTitleWithRepresentedFilename(&self, filename: &NSString);
#[method(isExcludedFromWindowsMenu)]
pub unsafe fn isExcludedFromWindowsMenu(&self) -> bool;
#[method(setExcludedFromWindowsMenu:)]
pub unsafe fn setExcludedFromWindowsMenu(&self, excluded_from_windows_menu: bool);
#[cfg(feature = "NSView")]
#[method_id(@__retain_semantics Other contentView)]
pub fn contentView(&self) -> Option<Id<NSView>>;
#[cfg(feature = "NSView")]
#[method(setContentView:)]
pub fn setContentView(&self, content_view: Option<&NSView>);
#[method_id(@__retain_semantics Other delegate)]
pub unsafe fn delegate(&self) -> Option<Id<ProtocolObject<dyn NSWindowDelegate>>>;
#[method(setDelegate:)]
pub fn setDelegate(&self, delegate: Option<&ProtocolObject<dyn NSWindowDelegate>>);
#[method(windowNumber)]
pub unsafe fn windowNumber(&self) -> NSInteger;
#[method(styleMask)]
pub fn styleMask(&self) -> NSWindowStyleMask;
#[method(setStyleMask:)]
pub fn setStyleMask(&self, style_mask: NSWindowStyleMask);
#[cfg(all(feature = "NSText", feature = "NSView"))]
#[method_id(@__retain_semantics Other fieldEditor:forObject:)]
pub unsafe fn fieldEditor_forObject(
&self,
create_flag: bool,
object: Option<&AnyObject>,
) -> Option<Id<NSText>>;
#[method(endEditingFor:)]
pub unsafe fn endEditingFor(&self, object: Option<&AnyObject>);
#[cfg(feature = "NSScreen")]
#[method(constrainFrameRect:toScreen:)]
pub unsafe fn constrainFrameRect_toScreen(
&self,
frame_rect: NSRect,
screen: Option<&NSScreen>,
) -> NSRect;
#[method(setFrame:display:)]
pub fn setFrame_display(&self, frame_rect: NSRect, flag: bool);
#[method(setContentSize:)]
pub fn setContentSize(&self, size: NSSize);
#[method(setFrameOrigin:)]
pub unsafe fn setFrameOrigin(&self, point: NSPoint);
#[method(setFrameTopLeftPoint:)]
pub fn setFrameTopLeftPoint(&self, point: NSPoint);
#[method(cascadeTopLeftFromPoint:)]
pub unsafe fn cascadeTopLeftFromPoint(&self, top_left_point: NSPoint) -> NSPoint;
#[method(frame)]
pub fn frame(&self) -> NSRect;
#[method(animationResizeTime:)]
pub unsafe fn animationResizeTime(&self, new_frame: NSRect) -> NSTimeInterval;
#[method(setFrame:display:animate:)]
pub unsafe fn setFrame_display_animate(
&self,
frame_rect: NSRect,
display_flag: bool,
animate_flag: bool,
);
#[method(inLiveResize)]
pub unsafe fn inLiveResize(&self) -> bool;
#[method(resizeIncrements)]
pub unsafe fn resizeIncrements(&self) -> NSSize;
#[method(setResizeIncrements:)]
pub fn setResizeIncrements(&self, resize_increments: NSSize);
#[method(aspectRatio)]
pub unsafe fn aspectRatio(&self) -> NSSize;
#[method(setAspectRatio:)]
pub unsafe fn setAspectRatio(&self, aspect_ratio: NSSize);
#[method(contentResizeIncrements)]
pub fn contentResizeIncrements(&self) -> NSSize;
#[method(setContentResizeIncrements:)]
pub fn setContentResizeIncrements(&self, content_resize_increments: NSSize);
#[method(contentAspectRatio)]
pub unsafe fn contentAspectRatio(&self) -> NSSize;
#[method(setContentAspectRatio:)]
pub unsafe fn setContentAspectRatio(&self, content_aspect_ratio: NSSize);
#[method(viewsNeedDisplay)]
pub unsafe fn viewsNeedDisplay(&self) -> bool;
#[method(setViewsNeedDisplay:)]
pub unsafe fn setViewsNeedDisplay(&self, views_need_display: bool);
#[method(displayIfNeeded)]
pub unsafe fn displayIfNeeded(&self);
#[method(display)]
pub unsafe fn display(&self);
#[method(preservesContentDuringLiveResize)]
pub unsafe fn preservesContentDuringLiveResize(&self) -> bool;
#[method(setPreservesContentDuringLiveResize:)]
pub unsafe fn setPreservesContentDuringLiveResize(
&self,
preserves_content_during_live_resize: bool,
);
#[method(update)]
pub unsafe fn update(&self);
#[method(makeFirstResponder:)]
pub fn makeFirstResponder(&self, responder: Option<&NSResponder>) -> bool;
#[method_id(@__retain_semantics Other firstResponder)]
pub fn firstResponder(&self) -> Option<Id<NSResponder>>;
#[cfg(feature = "NSEvent")]
#[method(resizeFlags)]
pub unsafe fn resizeFlags(&self) -> NSEventModifierFlags;
#[method(close)]
pub fn close(&self);
#[method(isReleasedWhenClosed)]
pub unsafe fn isReleasedWhenClosed(&self) -> bool;
#[method(setReleasedWhenClosed:)]
pub unsafe fn setReleasedWhenClosed(&self, released_when_closed: bool);
#[method(miniaturize:)]
pub fn miniaturize(&self, sender: Option<&AnyObject>);
#[method(deminiaturize:)]
pub unsafe fn deminiaturize(&self, sender: Option<&AnyObject>);
#[method(isZoomed)]
pub fn isZoomed(&self) -> bool;
#[method(zoom:)]
pub fn zoom(&self, sender: Option<&AnyObject>);
#[method(isMiniaturized)]
pub fn isMiniaturized(&self) -> bool;
#[method(tryToPerform:with:)]
pub unsafe fn tryToPerform_with(&self, action: Sel, object: Option<&AnyObject>) -> bool;
#[cfg(feature = "NSPasteboard")]
#[method_id(@__retain_semantics Other validRequestorForSendType:returnType:)]
pub unsafe fn validRequestorForSendType_returnType(
&self,
send_type: Option<&NSPasteboardType>,
return_type: Option<&NSPasteboardType>,
) -> Option<Id<AnyObject>>;
#[cfg(feature = "NSColor")]
#[method_id(@__retain_semantics Other backgroundColor)]
pub unsafe fn backgroundColor(&self) -> Id<NSColor>;
#[cfg(feature = "NSColor")]
#[method(setBackgroundColor:)]
pub fn setBackgroundColor(&self, background_color: Option<&NSColor>);
#[method(setContentBorderThickness:forEdge:)]
pub unsafe fn setContentBorderThickness_forEdge(
&self,
thickness: CGFloat,
edge: NSRectEdge,
);
#[method(contentBorderThicknessForEdge:)]
pub unsafe fn contentBorderThicknessForEdge(&self, edge: NSRectEdge) -> CGFloat;
#[method(setAutorecalculatesContentBorderThickness:forEdge:)]
pub unsafe fn setAutorecalculatesContentBorderThickness_forEdge(
&self,
flag: bool,
edge: NSRectEdge,
);
#[method(autorecalculatesContentBorderThicknessForEdge:)]
pub unsafe fn autorecalculatesContentBorderThicknessForEdge(
&self,
edge: NSRectEdge,
) -> bool;
#[method(isMovable)]
pub unsafe fn isMovable(&self) -> bool;
#[method(setMovable:)]
pub fn setMovable(&self, movable: bool);
#[method(isMovableByWindowBackground)]
pub unsafe fn isMovableByWindowBackground(&self) -> bool;
#[method(setMovableByWindowBackground:)]
pub fn setMovableByWindowBackground(&self, movable_by_window_background: bool);
#[method(hidesOnDeactivate)]
pub unsafe fn hidesOnDeactivate(&self) -> bool;
#[method(setHidesOnDeactivate:)]
pub unsafe fn setHidesOnDeactivate(&self, hides_on_deactivate: bool);
#[method(canHide)]
pub unsafe fn canHide(&self) -> bool;
#[method(setCanHide:)]
pub unsafe fn setCanHide(&self, can_hide: bool);
#[method(center)]
pub fn center(&self);
#[method(makeKeyAndOrderFront:)]
pub fn makeKeyAndOrderFront(&self, sender: Option<&AnyObject>);
#[method(orderFront:)]
pub fn orderFront(&self, sender: Option<&AnyObject>);
#[method(orderBack:)]
pub unsafe fn orderBack(&self, sender: Option<&AnyObject>);
#[method(orderOut:)]
pub fn orderOut(&self, sender: Option<&AnyObject>);
#[cfg(feature = "NSGraphics")]
#[method(orderWindow:relativeTo:)]
pub unsafe fn orderWindow_relativeTo(
&self,
place: NSWindowOrderingMode,
other_win: NSInteger,
);
#[method(orderFrontRegardless)]
pub unsafe fn orderFrontRegardless(&self);
#[cfg(feature = "NSImage")]
#[method_id(@__retain_semantics Other miniwindowImage)]
pub unsafe fn miniwindowImage(&self) -> Option<Id<NSImage>>;
#[cfg(feature = "NSImage")]
#[method(setMiniwindowImage:)]
pub unsafe fn setMiniwindowImage(&self, miniwindow_image: Option<&NSImage>);
#[method_id(@__retain_semantics Other miniwindowTitle)]
pub unsafe fn miniwindowTitle(&self) -> Id<NSString>;
#[method(setMiniwindowTitle:)]
pub unsafe fn setMiniwindowTitle(&self, miniwindow_title: Option<&NSString>);
#[cfg(feature = "NSDockTile")]
#[method_id(@__retain_semantics Other dockTile)]
pub unsafe fn dockTile(&self) -> Id<NSDockTile>;
#[method(isDocumentEdited)]
pub fn isDocumentEdited(&self) -> bool;
#[method(setDocumentEdited:)]
pub fn setDocumentEdited(&self, document_edited: bool);
#[method(isVisible)]
pub fn isVisible(&self) -> bool;
#[method(isKeyWindow)]
pub fn isKeyWindow(&self) -> bool;
#[method(isMainWindow)]
pub unsafe fn isMainWindow(&self) -> bool;
#[method(canBecomeKeyWindow)]
pub unsafe fn canBecomeKeyWindow(&self) -> bool;
#[method(canBecomeMainWindow)]
pub unsafe fn canBecomeMainWindow(&self) -> bool;
#[method(makeKeyWindow)]
pub unsafe fn makeKeyWindow(&self);
#[method(makeMainWindow)]
pub unsafe fn makeMainWindow(&self);
#[method(becomeKeyWindow)]
pub unsafe fn becomeKeyWindow(&self);
#[method(resignKeyWindow)]
pub unsafe fn resignKeyWindow(&self);
#[method(becomeMainWindow)]
pub unsafe fn becomeMainWindow(&self);
#[method(resignMainWindow)]
pub unsafe fn resignMainWindow(&self);
#[method(worksWhenModal)]
pub unsafe fn worksWhenModal(&self) -> bool;
#[method(preventsApplicationTerminationWhenModal)]
pub unsafe fn preventsApplicationTerminationWhenModal(&self) -> bool;
#[method(setPreventsApplicationTerminationWhenModal:)]
pub unsafe fn setPreventsApplicationTerminationWhenModal(
&self,
prevents_application_termination_when_modal: bool,
);
#[method(convertRectToScreen:)]
pub fn convertRectToScreen(&self, rect: NSRect) -> NSRect;
#[method(convertRectFromScreen:)]
pub unsafe fn convertRectFromScreen(&self, rect: NSRect) -> NSRect;
#[method(convertPointToScreen:)]
pub unsafe fn convertPointToScreen(&self, point: NSPoint) -> NSPoint;
#[method(convertPointFromScreen:)]
pub fn convertPointFromScreen(&self, point: NSPoint) -> NSPoint;
#[method(convertRectToBacking:)]
pub unsafe fn convertRectToBacking(&self, rect: NSRect) -> NSRect;
#[method(convertRectFromBacking:)]
pub unsafe fn convertRectFromBacking(&self, rect: NSRect) -> NSRect;
#[method(convertPointToBacking:)]
pub unsafe fn convertPointToBacking(&self, point: NSPoint) -> NSPoint;
#[method(convertPointFromBacking:)]
pub unsafe fn convertPointFromBacking(&self, point: NSPoint) -> NSPoint;
#[method(backingAlignedRect:options:)]
pub unsafe fn backingAlignedRect_options(
&self,
rect: NSRect,
options: NSAlignmentOptions,
) -> NSRect;
#[method(backingScaleFactor)]
pub fn backingScaleFactor(&self) -> CGFloat;
#[method(performClose:)]
pub unsafe fn performClose(&self, sender: Option<&AnyObject>);
#[method(performMiniaturize:)]
pub unsafe fn performMiniaturize(&self, sender: Option<&AnyObject>);
#[method(performZoom:)]
pub unsafe fn performZoom(&self, sender: Option<&AnyObject>);
#[method_id(@__retain_semantics Other dataWithEPSInsideRect:)]
pub unsafe fn dataWithEPSInsideRect(&self, rect: NSRect) -> Id<NSData>;
#[method_id(@__retain_semantics Other dataWithPDFInsideRect:)]
pub unsafe fn dataWithPDFInsideRect(&self, rect: NSRect) -> Id<NSData>;
#[method(print:)]
pub unsafe fn print(&self, sender: Option<&AnyObject>);
#[method(allowsToolTipsWhenApplicationIsInactive)]
pub unsafe fn allowsToolTipsWhenApplicationIsInactive(&self) -> bool;
#[method(setAllowsToolTipsWhenApplicationIsInactive:)]
pub unsafe fn setAllowsToolTipsWhenApplicationIsInactive(
&self,
allows_tool_tips_when_application_is_inactive: bool,
);
#[cfg(feature = "NSGraphics")]
#[method(backingType)]
pub unsafe fn backingType(&self) -> NSBackingStoreType;
#[cfg(feature = "NSGraphics")]
#[method(setBackingType:)]
pub unsafe fn setBackingType(&self, backing_type: NSBackingStoreType);
#[method(level)]
pub unsafe fn level(&self) -> NSWindowLevel;
#[method(setLevel:)]
pub fn setLevel(&self, level: NSWindowLevel);
#[cfg(feature = "NSGraphics")]
#[method(depthLimit)]
pub unsafe fn depthLimit(&self) -> NSWindowDepth;
#[cfg(feature = "NSGraphics")]
#[method(setDepthLimit:)]
pub unsafe fn setDepthLimit(&self, depth_limit: NSWindowDepth);
#[method(setDynamicDepthLimit:)]
pub unsafe fn setDynamicDepthLimit(&self, flag: bool);
#[method(hasDynamicDepthLimit)]
pub unsafe fn hasDynamicDepthLimit(&self) -> bool;
#[cfg(feature = "NSScreen")]
#[method_id(@__retain_semantics Other screen)]
pub fn screen(&self) -> Option<Id<NSScreen>>;
#[cfg(feature = "NSScreen")]
#[method_id(@__retain_semantics Other deepestScreen)]
pub unsafe fn deepestScreen(&self) -> Option<Id<NSScreen>>;
#[method(hasShadow)]
pub fn hasShadow(&self) -> bool;
#[method(setHasShadow:)]
pub fn setHasShadow(&self, has_shadow: bool);
#[method(invalidateShadow)]
pub unsafe fn invalidateShadow(&self);
#[method(alphaValue)]
pub unsafe fn alphaValue(&self) -> CGFloat;
#[method(setAlphaValue:)]
pub unsafe fn setAlphaValue(&self, alpha_value: CGFloat);
#[method(isOpaque)]
pub unsafe fn isOpaque(&self) -> bool;
#[method(setOpaque:)]
pub fn setOpaque(&self, opaque: bool);
#[method(sharingType)]
pub unsafe fn sharingType(&self) -> NSWindowSharingType;
#[method(setSharingType:)]
pub fn setSharingType(&self, sharing_type: NSWindowSharingType);
#[method(allowsConcurrentViewDrawing)]
pub unsafe fn allowsConcurrentViewDrawing(&self) -> bool;
#[method(setAllowsConcurrentViewDrawing:)]
pub unsafe fn setAllowsConcurrentViewDrawing(&self, allows_concurrent_view_drawing: bool);
#[method(displaysWhenScreenProfileChanges)]
pub unsafe fn displaysWhenScreenProfileChanges(&self) -> bool;
#[method(setDisplaysWhenScreenProfileChanges:)]
pub unsafe fn setDisplaysWhenScreenProfileChanges(
&self,
displays_when_screen_profile_changes: bool,
);
#[method(disableScreenUpdatesUntilFlush)]
pub unsafe fn disableScreenUpdatesUntilFlush(&self);
#[method(canBecomeVisibleWithoutLogin)]
pub unsafe fn canBecomeVisibleWithoutLogin(&self) -> bool;
#[method(setCanBecomeVisibleWithoutLogin:)]
pub unsafe fn setCanBecomeVisibleWithoutLogin(
&self,
can_become_visible_without_login: bool,
);
#[method(collectionBehavior)]
pub unsafe fn collectionBehavior(&self) -> NSWindowCollectionBehavior;
#[method(setCollectionBehavior:)]
pub unsafe fn setCollectionBehavior(&self, collection_behavior: NSWindowCollectionBehavior);
#[method(animationBehavior)]
pub unsafe fn animationBehavior(&self) -> NSWindowAnimationBehavior;
#[method(setAnimationBehavior:)]
pub unsafe fn setAnimationBehavior(&self, animation_behavior: NSWindowAnimationBehavior);
#[method(isOnActiveSpace)]
pub unsafe fn isOnActiveSpace(&self) -> bool;
#[method(toggleFullScreen:)]
pub fn toggleFullScreen(&self, sender: Option<&AnyObject>);
#[method_id(@__retain_semantics Other stringWithSavedFrame)]
pub unsafe fn stringWithSavedFrame(&self) -> Id<NSWindowPersistableFrameDescriptor>;
#[method(setFrameFromString:)]
pub unsafe fn setFrameFromString(&self, string: &NSWindowPersistableFrameDescriptor);
#[method(saveFrameUsingName:)]
pub unsafe fn saveFrameUsingName(&self, name: &NSWindowFrameAutosaveName);
#[method(setFrameUsingName:force:)]
pub unsafe fn setFrameUsingName_force(
&self,
name: &NSWindowFrameAutosaveName,
force: bool,
) -> bool;
#[method(setFrameUsingName:)]
pub unsafe fn setFrameUsingName(&self, name: &NSWindowFrameAutosaveName) -> bool;
#[method(setFrameAutosaveName:)]
pub unsafe fn setFrameAutosaveName(&self, name: &NSWindowFrameAutosaveName) -> bool;
#[method_id(@__retain_semantics Other frameAutosaveName)]
pub unsafe fn frameAutosaveName(&self) -> Id<NSWindowFrameAutosaveName>;
#[method(removeFrameUsingName:)]
pub unsafe fn removeFrameUsingName(name: &NSWindowFrameAutosaveName, mtm: MainThreadMarker);
#[method(minSize)]
pub unsafe fn minSize(&self) -> NSSize;
#[method(setMinSize:)]
pub fn setMinSize(&self, min_size: NSSize);
#[method(maxSize)]
pub unsafe fn maxSize(&self) -> NSSize;
#[method(setMaxSize:)]
pub fn setMaxSize(&self, max_size: NSSize);
#[method(contentMinSize)]
pub unsafe fn contentMinSize(&self) -> NSSize;
#[method(setContentMinSize:)]
pub unsafe fn setContentMinSize(&self, content_min_size: NSSize);
#[method(contentMaxSize)]
pub unsafe fn contentMaxSize(&self) -> NSSize;
#[method(setContentMaxSize:)]
pub unsafe fn setContentMaxSize(&self, content_max_size: NSSize);
#[method(minFullScreenContentSize)]
pub unsafe fn minFullScreenContentSize(&self) -> NSSize;
#[method(setMinFullScreenContentSize:)]
pub unsafe fn setMinFullScreenContentSize(&self, min_full_screen_content_size: NSSize);
#[method(maxFullScreenContentSize)]
pub unsafe fn maxFullScreenContentSize(&self) -> NSSize;
#[method(setMaxFullScreenContentSize:)]
pub unsafe fn setMaxFullScreenContentSize(&self, max_full_screen_content_size: NSSize);
#[cfg(feature = "NSGraphics")]
#[method_id(@__retain_semantics Other deviceDescription)]
pub unsafe fn deviceDescription(
&self,
) -> Id<NSDictionary<NSDeviceDescriptionKey, AnyObject>>;
#[cfg(feature = "NSWindowController")]
#[method_id(@__retain_semantics Other windowController)]
pub unsafe fn windowController(&self) -> Option<Id<NSWindowController>>;
#[cfg(feature = "NSWindowController")]
#[method(setWindowController:)]
pub unsafe fn setWindowController(&self, window_controller: Option<&NSWindowController>);
#[cfg(all(feature = "NSApplication", feature = "block2"))]
#[method(beginSheet:completionHandler:)]
pub unsafe fn beginSheet_completionHandler(
&self,
sheet_window: &NSWindow,
handler: Option<&Block<dyn Fn(NSModalResponse)>>,
);
#[cfg(all(feature = "NSApplication", feature = "block2"))]
#[method(beginCriticalSheet:completionHandler:)]
pub unsafe fn beginCriticalSheet_completionHandler(
&self,
sheet_window: &NSWindow,
handler: Option<&Block<dyn Fn(NSModalResponse)>>,
);
#[method(endSheet:)]
pub unsafe fn endSheet(&self, sheet_window: &NSWindow);
#[cfg(feature = "NSApplication")]
#[method(endSheet:returnCode:)]
pub unsafe fn endSheet_returnCode(
&self,
sheet_window: &NSWindow,
return_code: NSModalResponse,
);
#[method_id(@__retain_semantics Other sheets)]
pub unsafe fn sheets(&self) -> Id<NSArray<NSWindow>>;
#[method_id(@__retain_semantics Other attachedSheet)]
pub unsafe fn attachedSheet(&self) -> Option<Id<NSWindow>>;
#[method(isSheet)]
pub unsafe fn isSheet(&self) -> bool;
#[method_id(@__retain_semantics Other sheetParent)]
pub unsafe fn sheetParent(&self) -> Option<Id<NSWindow>>;
#[cfg(all(feature = "NSButton", feature = "NSControl", feature = "NSView"))]
#[method_id(@__retain_semantics Other standardWindowButton:forStyleMask:)]
pub unsafe fn standardWindowButton_forStyleMask(
b: NSWindowButton,
style_mask: NSWindowStyleMask,
mtm: MainThreadMarker,
) -> Option<Id<NSButton>>;
#[cfg(all(feature = "NSButton", feature = "NSControl", feature = "NSView"))]
#[method_id(@__retain_semantics Other standardWindowButton:)]
pub fn standardWindowButton(&self, b: NSWindowButton) -> Option<Id<NSButton>>;
#[cfg(feature = "NSGraphics")]
#[method(addChildWindow:ordered:)]
pub unsafe fn addChildWindow_ordered(
&self,
child_win: &NSWindow,
place: NSWindowOrderingMode,
);
#[method(removeChildWindow:)]
pub unsafe fn removeChildWindow(&self, child_win: &NSWindow);
#[method_id(@__retain_semantics Other childWindows)]
pub unsafe fn childWindows(&self) -> Option<Id<NSArray<NSWindow>>>;
#[method_id(@__retain_semantics Other parentWindow)]
pub unsafe fn parentWindow(&self) -> Option<Id<NSWindow>>;
#[method(setParentWindow:)]
pub unsafe fn setParentWindow(&self, parent_window: Option<&NSWindow>);
#[cfg(feature = "NSAppearance")]
#[method_id(@__retain_semantics Other appearanceSource)]
pub unsafe fn appearanceSource(&self) -> Option<Id<NSObject>>;
#[cfg(feature = "NSAppearance")]
#[method(setAppearanceSource:)]
pub unsafe fn setAppearanceSource(&self, appearance_source: Option<&NSObject>);
#[cfg(feature = "NSColorSpace")]
#[method_id(@__retain_semantics Other colorSpace)]
pub unsafe fn colorSpace(&self) -> Option<Id<NSColorSpace>>;
#[cfg(feature = "NSColorSpace")]
#[method(setColorSpace:)]
pub unsafe fn setColorSpace(&self, color_space: Option<&NSColorSpace>);
#[cfg(feature = "NSGraphics")]
#[method(canRepresentDisplayGamut:)]
pub unsafe fn canRepresentDisplayGamut(&self, display_gamut: NSDisplayGamut) -> bool;
#[method_id(@__retain_semantics Other windowNumbersWithOptions:)]
pub unsafe fn windowNumbersWithOptions(
options: NSWindowNumberListOptions,
mtm: MainThreadMarker,
) -> Option<Id<NSArray<NSNumber>>>;
#[method(windowNumberAtPoint:belowWindowWithWindowNumber:)]
pub unsafe fn windowNumberAtPoint_belowWindowWithWindowNumber(
point: NSPoint,
window_number: NSInteger,
mtm: MainThreadMarker,
) -> NSInteger;
#[method(occlusionState)]
pub fn occlusionState(&self) -> NSWindowOcclusionState;
#[method(titlebarSeparatorStyle)]
pub unsafe fn titlebarSeparatorStyle(&self) -> NSTitlebarSeparatorStyle;
#[method(setTitlebarSeparatorStyle:)]
pub unsafe fn setTitlebarSeparatorStyle(
&self,
titlebar_separator_style: NSTitlebarSeparatorStyle,
);
#[cfg(feature = "NSViewController")]
#[method_id(@__retain_semantics Other contentViewController)]
pub unsafe fn contentViewController(&self) -> Option<Id<NSViewController>>;
#[cfg(feature = "NSViewController")]
#[method(setContentViewController:)]
pub unsafe fn setContentViewController(
&self,
content_view_controller: Option<&NSViewController>,
);
#[cfg(feature = "NSViewController")]
#[method_id(@__retain_semantics Other windowWithContentViewController:)]
pub unsafe fn windowWithContentViewController(
content_view_controller: &NSViewController,
) -> Id<Self>;
#[cfg(feature = "NSEvent")]
#[method(performWindowDragWithEvent:)]
pub fn performWindowDragWithEvent(&self, event: &NSEvent);
#[cfg(feature = "NSView")]
#[method_id(@__retain_semantics Other initialFirstResponder)]
pub unsafe fn initialFirstResponder(&self) -> Option<Id<NSView>>;
#[cfg(feature = "NSView")]
#[method(setInitialFirstResponder:)]
pub fn setInitialFirstResponder(&self, initial_first_responder: Option<&NSView>);
#[method(selectNextKeyView:)]
pub fn selectNextKeyView(&self, sender: Option<&AnyObject>);
#[method(selectPreviousKeyView:)]
pub fn selectPreviousKeyView(&self, sender: Option<&AnyObject>);
#[cfg(feature = "NSView")]
#[method(selectKeyViewFollowingView:)]
pub unsafe fn selectKeyViewFollowingView(&self, view: &NSView);
#[cfg(feature = "NSView")]
#[method(selectKeyViewPrecedingView:)]
pub unsafe fn selectKeyViewPrecedingView(&self, view: &NSView);
#[method(keyViewSelectionDirection)]
pub unsafe fn keyViewSelectionDirection(&self) -> NSSelectionDirection;
#[cfg(all(feature = "NSActionCell", feature = "NSButtonCell", feature = "NSCell"))]
#[method_id(@__retain_semantics Other defaultButtonCell)]
pub unsafe fn defaultButtonCell(&self) -> Option<Id<NSButtonCell>>;
#[cfg(all(feature = "NSActionCell", feature = "NSButtonCell", feature = "NSCell"))]
#[method(setDefaultButtonCell:)]
pub unsafe fn setDefaultButtonCell(&self, default_button_cell: Option<&NSButtonCell>);
#[method(disableKeyEquivalentForDefaultButtonCell)]
pub unsafe fn disableKeyEquivalentForDefaultButtonCell(&self);
#[method(enableKeyEquivalentForDefaultButtonCell)]
pub unsafe fn enableKeyEquivalentForDefaultButtonCell(&self);
#[method(autorecalculatesKeyViewLoop)]
pub unsafe fn autorecalculatesKeyViewLoop(&self) -> bool;
#[method(setAutorecalculatesKeyViewLoop:)]
pub unsafe fn setAutorecalculatesKeyViewLoop(&self, autorecalculates_key_view_loop: bool);
#[method(recalculateKeyViewLoop)]
pub unsafe fn recalculateKeyViewLoop(&self);
#[cfg(feature = "NSToolbar")]
#[method_id(@__retain_semantics Other toolbar)]
pub unsafe fn toolbar(&self) -> Option<Id<NSToolbar>>;
#[cfg(feature = "NSToolbar")]
#[method(setToolbar:)]
pub unsafe fn setToolbar(&self, toolbar: Option<&NSToolbar>);
#[method(toggleToolbarShown:)]
pub unsafe fn toggleToolbarShown(&self, sender: Option<&AnyObject>);
#[method(runToolbarCustomizationPalette:)]
pub unsafe fn runToolbarCustomizationPalette(&self, sender: Option<&AnyObject>);
#[deprecated = "This property has no effect"]
#[method(showsToolbarButton)]
pub unsafe fn showsToolbarButton(&self) -> bool;
#[deprecated = "This property has no effect"]
#[method(setShowsToolbarButton:)]
pub unsafe fn setShowsToolbarButton(&self, shows_toolbar_button: bool);
#[method(allowsAutomaticWindowTabbing)]
pub fn allowsAutomaticWindowTabbing(mtm: MainThreadMarker) -> bool;
#[method(setAllowsAutomaticWindowTabbing:)]
pub fn setAllowsAutomaticWindowTabbing(
allows_automatic_window_tabbing: bool,
mtm: MainThreadMarker,
);
#[method(userTabbingPreference)]
pub unsafe fn userTabbingPreference(mtm: MainThreadMarker)
-> NSWindowUserTabbingPreference;
#[method(tabbingMode)]
pub unsafe fn tabbingMode(&self) -> NSWindowTabbingMode;
#[method(setTabbingMode:)]
pub fn setTabbingMode(&self, tabbing_mode: NSWindowTabbingMode);
#[method_id(@__retain_semantics Other tabbingIdentifier)]
pub fn tabbingIdentifier(&self) -> Id<NSWindowTabbingIdentifier>;
#[method(setTabbingIdentifier:)]
pub fn setTabbingIdentifier(&self, tabbing_identifier: &NSWindowTabbingIdentifier);
#[method(selectNextTab:)]
pub fn selectNextTab(&self, sender: Option<&AnyObject>);
#[method(selectPreviousTab:)]
pub unsafe fn selectPreviousTab(&self, sender: Option<&AnyObject>);
#[method(moveTabToNewWindow:)]
pub unsafe fn moveTabToNewWindow(&self, sender: Option<&AnyObject>);
#[method(mergeAllWindows:)]
pub unsafe fn mergeAllWindows(&self, sender: Option<&AnyObject>);
#[method(toggleTabBar:)]
pub unsafe fn toggleTabBar(&self, sender: Option<&AnyObject>);
#[method(toggleTabOverview:)]
pub unsafe fn toggleTabOverview(&self, sender: Option<&AnyObject>);
#[method_id(@__retain_semantics Other tabbedWindows)]
pub unsafe fn tabbedWindows(&self) -> Option<Id<NSArray<NSWindow>>>;
#[cfg(feature = "NSGraphics")]
#[method(addTabbedWindow:ordered:)]
pub unsafe fn addTabbedWindow_ordered(
&self,
window: &NSWindow,
ordered: NSWindowOrderingMode,
);
#[cfg(feature = "NSWindowTab")]
#[method_id(@__retain_semantics Other tab)]
pub unsafe fn tab(&self) -> Id<NSWindowTab>;
#[cfg(feature = "NSWindowTabGroup")]
#[method_id(@__retain_semantics Other tabGroup)]
pub fn tabGroup(&self) -> Option<Id<NSWindowTabGroup>>;
#[cfg(feature = "block2")]
#[method(transferWindowSharingToWindow:completionHandler:)]
pub unsafe fn transferWindowSharingToWindow_completionHandler(
&self,
window: &NSWindow,
completion_handler: &Block<dyn Fn(*mut NSError)>,
);
#[method(hasActiveWindowSharingSession)]
pub unsafe fn hasActiveWindowSharingSession(&self) -> bool;
#[cfg(feature = "NSUserInterfaceLayout")]
#[method(windowTitlebarLayoutDirection)]
pub unsafe fn windowTitlebarLayoutDirection(&self) -> NSUserInterfaceLayoutDirection;
}
);
extern_methods!(
#[cfg(feature = "NSResponder")]
unsafe impl NSWindow {
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;
}
);
extern_methods!(
#[cfg(feature = "NSResponder")]
unsafe impl NSWindow {
#[method_id(@__retain_semantics New new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Id<Self>;
}
);
extern_methods!(
#[cfg(feature = "NSResponder")]
unsafe impl NSWindow {
#[cfg(all(feature = "NSEvent", feature = "block2"))]
#[method(trackEventsMatchingMask:timeout:mode:handler:)]
pub unsafe fn trackEventsMatchingMask_timeout_mode_handler(
&self,
mask: NSEventMask,
timeout: NSTimeInterval,
mode: &NSRunLoopMode,
tracking_handler: &Block<dyn Fn(*mut NSEvent, NonNull<Bool>) + '_>,
);
#[cfg(feature = "NSEvent")]
#[method_id(@__retain_semantics Other nextEventMatchingMask:)]
pub unsafe fn nextEventMatchingMask(&self, mask: NSEventMask) -> Option<Id<NSEvent>>;
#[cfg(feature = "NSEvent")]
#[method_id(@__retain_semantics Other nextEventMatchingMask:untilDate:inMode:dequeue:)]
pub unsafe fn nextEventMatchingMask_untilDate_inMode_dequeue(
&self,
mask: NSEventMask,
expiration: Option<&NSDate>,
mode: &NSRunLoopMode,
deq_flag: bool,
) -> Option<Id<NSEvent>>;
#[cfg(feature = "NSEvent")]
#[method(discardEventsMatchingMask:beforeEvent:)]
pub unsafe fn discardEventsMatchingMask_beforeEvent(
&self,
mask: NSEventMask,
last_event: Option<&NSEvent>,
);
#[cfg(feature = "NSEvent")]
#[method(postEvent:atStart:)]
pub unsafe fn postEvent_atStart(&self, event: &NSEvent, flag: bool);
#[cfg(feature = "NSEvent")]
#[method(sendEvent:)]
pub fn sendEvent(&self, event: &NSEvent);
#[cfg(feature = "NSEvent")]
#[method_id(@__retain_semantics Other currentEvent)]
pub unsafe fn currentEvent(&self) -> Option<Id<NSEvent>>;
#[method(acceptsMouseMovedEvents)]
pub unsafe fn acceptsMouseMovedEvents(&self) -> bool;
#[method(setAcceptsMouseMovedEvents:)]
pub fn setAcceptsMouseMovedEvents(&self, accepts_mouse_moved_events: bool);
#[method(ignoresMouseEvents)]
pub unsafe fn ignoresMouseEvents(&self) -> bool;
#[method(setIgnoresMouseEvents:)]
pub fn setIgnoresMouseEvents(&self, ignores_mouse_events: bool);
#[method(mouseLocationOutsideOfEventStream)]
pub unsafe fn mouseLocationOutsideOfEventStream(&self) -> NSPoint;
}
);
extern_methods!(
#[cfg(feature = "NSResponder")]
unsafe impl NSWindow {
#[method(disableCursorRects)]
pub unsafe fn disableCursorRects(&self);
#[method(enableCursorRects)]
pub unsafe fn enableCursorRects(&self);
#[method(discardCursorRects)]
pub unsafe fn discardCursorRects(&self);
#[method(areCursorRectsEnabled)]
pub unsafe fn areCursorRectsEnabled(&self) -> bool;
#[cfg(feature = "NSView")]
#[method(invalidateCursorRectsForView:)]
pub fn invalidateCursorRectsForView(&self, view: &NSView);
#[method(resetCursorRects)]
pub unsafe fn resetCursorRects(&self);
}
);
extern_methods!(
#[cfg(feature = "NSResponder")]
unsafe impl NSWindow {
#[cfg(all(feature = "NSEvent", feature = "NSImage", feature = "NSPasteboard"))]
#[method(dragImage:at:offset:event:pasteboard:source:slideBack:)]
pub unsafe fn dragImage_at_offset_event_pasteboard_source_slideBack(
&self,
image: &NSImage,
base_location: NSPoint,
initial_offset: NSSize,
event: &NSEvent,
pboard: &NSPasteboard,
source_obj: &AnyObject,
slide_flag: bool,
);
#[cfg(feature = "NSPasteboard")]
#[method(registerForDraggedTypes:)]
pub fn registerForDraggedTypes(&self, new_types: &NSArray<NSPasteboardType>);
#[method(unregisterDraggedTypes)]
pub unsafe fn unregisterDraggedTypes(&self);
}
);
extern_methods!(
#[cfg(feature = "NSResponder")]
unsafe impl NSWindow {
#[method_id(@__retain_semantics Init initWithWindowRef:)]
pub unsafe fn initWithWindowRef(
this: Allocated<Self>,
window_ref: NonNull<c_void>,
) -> Option<Id<NSWindow>>;
#[method(windowRef)]
pub unsafe fn windowRef(&self) -> NonNull<c_void>;
}
);
extern_methods!(
#[cfg(feature = "NSResponder")]
unsafe impl NSWindow {}
);
extern_protocol!(
pub unsafe trait NSWindowDelegate: NSObjectProtocol + IsMainThreadOnly {
#[cfg(feature = "NSResponder")]
#[optional]
#[method(windowShouldClose:)]
unsafe fn windowShouldClose(&self, sender: &NSWindow) -> bool;
#[cfg(feature = "NSResponder")]
#[optional]
#[method_id(@__retain_semantics Other windowWillReturnFieldEditor:toObject:)]
unsafe fn windowWillReturnFieldEditor_toObject(
&self,
sender: &NSWindow,
client: Option<&AnyObject>,
) -> Option<Id<AnyObject>>;
#[cfg(feature = "NSResponder")]
#[optional]
#[method(windowWillResize:toSize:)]
unsafe fn windowWillResize_toSize(&self, sender: &NSWindow, frame_size: NSSize) -> NSSize;
#[cfg(feature = "NSResponder")]
#[optional]
#[method(windowWillUseStandardFrame:defaultFrame:)]
unsafe fn windowWillUseStandardFrame_defaultFrame(
&self,
window: &NSWindow,
new_frame: NSRect,
) -> NSRect;
#[cfg(feature = "NSResponder")]
#[optional]
#[method(windowShouldZoom:toFrame:)]
unsafe fn windowShouldZoom_toFrame(&self, window: &NSWindow, new_frame: NSRect) -> bool;
#[cfg(feature = "NSResponder")]
#[optional]
#[method_id(@__retain_semantics Other windowWillReturnUndoManager:)]
unsafe fn windowWillReturnUndoManager(
&self,
window: &NSWindow,
) -> Option<Id<NSUndoManager>>;
#[cfg(feature = "NSResponder")]
#[optional]
#[method(window:willPositionSheet:usingRect:)]
unsafe fn window_willPositionSheet_usingRect(
&self,
window: &NSWindow,
sheet: &NSWindow,
rect: NSRect,
) -> NSRect;
#[cfg(all(feature = "NSMenu", feature = "NSResponder"))]
#[optional]
#[method(window:shouldPopUpDocumentPathMenu:)]
unsafe fn window_shouldPopUpDocumentPathMenu(
&self,
window: &NSWindow,
menu: &NSMenu,
) -> bool;
#[cfg(all(feature = "NSEvent", feature = "NSPasteboard", feature = "NSResponder"))]
#[optional]
#[method(window:shouldDragDocumentWithEvent:from:withPasteboard:)]
unsafe fn window_shouldDragDocumentWithEvent_from_withPasteboard(
&self,
window: &NSWindow,
event: &NSEvent,
drag_image_location: NSPoint,
pasteboard: &NSPasteboard,
) -> bool;
#[cfg(feature = "NSResponder")]
#[optional]
#[method(window:willUseFullScreenContentSize:)]
unsafe fn window_willUseFullScreenContentSize(
&self,
window: &NSWindow,
proposed_size: NSSize,
) -> NSSize;
#[cfg(all(feature = "NSApplication", feature = "NSResponder"))]
#[optional]
#[method(window:willUseFullScreenPresentationOptions:)]
unsafe fn window_willUseFullScreenPresentationOptions(
&self,
window: &NSWindow,
proposed_options: NSApplicationPresentationOptions,
) -> NSApplicationPresentationOptions;
#[cfg(feature = "NSResponder")]
#[optional]
#[method_id(@__retain_semantics Other customWindowsToEnterFullScreenForWindow:)]
unsafe fn customWindowsToEnterFullScreenForWindow(
&self,
window: &NSWindow,
) -> Option<Id<NSArray<NSWindow>>>;
#[cfg(feature = "NSResponder")]
#[optional]
#[method(window:startCustomAnimationToEnterFullScreenWithDuration:)]
unsafe fn window_startCustomAnimationToEnterFullScreenWithDuration(
&self,
window: &NSWindow,
duration: NSTimeInterval,
);
#[cfg(feature = "NSResponder")]
#[optional]
#[method(windowDidFailToEnterFullScreen:)]
unsafe fn windowDidFailToEnterFullScreen(&self, window: &NSWindow);
#[cfg(feature = "NSResponder")]
#[optional]
#[method_id(@__retain_semantics Other customWindowsToExitFullScreenForWindow:)]
unsafe fn customWindowsToExitFullScreenForWindow(
&self,
window: &NSWindow,
) -> Option<Id<NSArray<NSWindow>>>;
#[cfg(feature = "NSResponder")]
#[optional]
#[method(window:startCustomAnimationToExitFullScreenWithDuration:)]
unsafe fn window_startCustomAnimationToExitFullScreenWithDuration(
&self,
window: &NSWindow,
duration: NSTimeInterval,
);
#[cfg(all(feature = "NSResponder", feature = "NSScreen"))]
#[optional]
#[method_id(@__retain_semantics Other customWindowsToEnterFullScreenForWindow:onScreen:)]
unsafe fn customWindowsToEnterFullScreenForWindow_onScreen(
&self,
window: &NSWindow,
screen: &NSScreen,
) -> Option<Id<NSArray<NSWindow>>>;
#[cfg(all(feature = "NSResponder", feature = "NSScreen"))]
#[optional]
#[method(window:startCustomAnimationToEnterFullScreenOnScreen:withDuration:)]
unsafe fn window_startCustomAnimationToEnterFullScreenOnScreen_withDuration(
&self,
window: &NSWindow,
screen: &NSScreen,
duration: NSTimeInterval,
);
#[cfg(feature = "NSResponder")]
#[optional]
#[method(windowDidFailToExitFullScreen:)]
unsafe fn windowDidFailToExitFullScreen(&self, window: &NSWindow);
#[cfg(feature = "NSResponder")]
#[optional]
#[method(window:willResizeForVersionBrowserWithMaxPreferredSize:maxAllowedSize:)]
unsafe fn window_willResizeForVersionBrowserWithMaxPreferredSize_maxAllowedSize(
&self,
window: &NSWindow,
max_preferred_frame_size: NSSize,
max_allowed_frame_size: NSSize,
) -> NSSize;
#[cfg(feature = "NSResponder")]
#[optional]
#[method(window:willEncodeRestorableState:)]
unsafe fn window_willEncodeRestorableState(&self, window: &NSWindow, state: &NSCoder);
#[cfg(feature = "NSResponder")]
#[optional]
#[method(window:didDecodeRestorableState:)]
unsafe fn window_didDecodeRestorableState(&self, window: &NSWindow, state: &NSCoder);
#[cfg(all(feature = "NSPreviewRepresentingActivityItem", feature = "NSResponder"))]
#[optional]
#[method_id(@__retain_semantics Other previewRepresentableActivityItemsForWindow:)]
unsafe fn previewRepresentableActivityItemsForWindow(
&self,
window: &NSWindow,
) -> Option<Id<NSArray<ProtocolObject<dyn NSPreviewRepresentableActivityItem>>>>;
#[optional]
#[method(windowDidResize:)]
unsafe fn windowDidResize(&self, notification: &NSNotification);
#[optional]
#[method(windowDidExpose:)]
unsafe fn windowDidExpose(&self, notification: &NSNotification);
#[optional]
#[method(windowWillMove:)]
unsafe fn windowWillMove(&self, notification: &NSNotification);
#[optional]
#[method(windowDidMove:)]
unsafe fn windowDidMove(&self, notification: &NSNotification);
#[optional]
#[method(windowDidBecomeKey:)]
unsafe fn windowDidBecomeKey(&self, notification: &NSNotification);
#[optional]
#[method(windowDidResignKey:)]
unsafe fn windowDidResignKey(&self, notification: &NSNotification);
#[optional]
#[method(windowDidBecomeMain:)]
unsafe fn windowDidBecomeMain(&self, notification: &NSNotification);
#[optional]
#[method(windowDidResignMain:)]
unsafe fn windowDidResignMain(&self, notification: &NSNotification);
#[optional]
#[method(windowWillClose:)]
unsafe fn windowWillClose(&self, notification: &NSNotification);
#[optional]
#[method(windowWillMiniaturize:)]
unsafe fn windowWillMiniaturize(&self, notification: &NSNotification);
#[optional]
#[method(windowDidMiniaturize:)]
unsafe fn windowDidMiniaturize(&self, notification: &NSNotification);
#[optional]
#[method(windowDidDeminiaturize:)]
unsafe fn windowDidDeminiaturize(&self, notification: &NSNotification);
#[optional]
#[method(windowDidUpdate:)]
unsafe fn windowDidUpdate(&self, notification: &NSNotification);
#[optional]
#[method(windowDidChangeScreen:)]
unsafe fn windowDidChangeScreen(&self, notification: &NSNotification);
#[optional]
#[method(windowDidChangeScreenProfile:)]
unsafe fn windowDidChangeScreenProfile(&self, notification: &NSNotification);
#[optional]
#[method(windowDidChangeBackingProperties:)]
unsafe fn windowDidChangeBackingProperties(&self, notification: &NSNotification);
#[optional]
#[method(windowWillBeginSheet:)]
unsafe fn windowWillBeginSheet(&self, notification: &NSNotification);
#[optional]
#[method(windowDidEndSheet:)]
unsafe fn windowDidEndSheet(&self, notification: &NSNotification);
#[optional]
#[method(windowWillStartLiveResize:)]
unsafe fn windowWillStartLiveResize(&self, notification: &NSNotification);
#[optional]
#[method(windowDidEndLiveResize:)]
unsafe fn windowDidEndLiveResize(&self, notification: &NSNotification);
#[optional]
#[method(windowWillEnterFullScreen:)]
unsafe fn windowWillEnterFullScreen(&self, notification: &NSNotification);
#[optional]
#[method(windowDidEnterFullScreen:)]
unsafe fn windowDidEnterFullScreen(&self, notification: &NSNotification);
#[optional]
#[method(windowWillExitFullScreen:)]
unsafe fn windowWillExitFullScreen(&self, notification: &NSNotification);
#[optional]
#[method(windowDidExitFullScreen:)]
unsafe fn windowDidExitFullScreen(&self, notification: &NSNotification);
#[optional]
#[method(windowWillEnterVersionBrowser:)]
unsafe fn windowWillEnterVersionBrowser(&self, notification: &NSNotification);
#[optional]
#[method(windowDidEnterVersionBrowser:)]
unsafe fn windowDidEnterVersionBrowser(&self, notification: &NSNotification);
#[optional]
#[method(windowWillExitVersionBrowser:)]
unsafe fn windowWillExitVersionBrowser(&self, notification: &NSNotification);
#[optional]
#[method(windowDidExitVersionBrowser:)]
unsafe fn windowDidExitVersionBrowser(&self, notification: &NSNotification);
#[optional]
#[method(windowDidChangeOcclusionState:)]
unsafe fn windowDidChangeOcclusionState(&self, notification: &NSNotification);
}
unsafe impl ProtocolType for dyn NSWindowDelegate {}
);
extern "C" {
pub static NSWindowDidBecomeKeyNotification: &'static NSNotificationName;
}
extern "C" {
pub static NSWindowDidBecomeMainNotification: &'static NSNotificationName;
}
extern "C" {
pub static NSWindowDidChangeScreenNotification: &'static NSNotificationName;
}
extern "C" {
pub static NSWindowDidDeminiaturizeNotification: &'static NSNotificationName;
}
extern "C" {
pub static NSWindowDidExposeNotification: &'static NSNotificationName;
}
extern "C" {
pub static NSWindowDidMiniaturizeNotification: &'static NSNotificationName;
}
extern "C" {
pub static NSWindowDidMoveNotification: &'static NSNotificationName;
}
extern "C" {
pub static NSWindowDidResignKeyNotification: &'static NSNotificationName;
}
extern "C" {
pub static NSWindowDidResignMainNotification: &'static NSNotificationName;
}
extern "C" {
pub static NSWindowDidResizeNotification: &'static NSNotificationName;
}
extern "C" {
pub static NSWindowDidUpdateNotification: &'static NSNotificationName;
}
extern "C" {
pub static NSWindowWillCloseNotification: &'static NSNotificationName;
}
extern "C" {
pub static NSWindowWillMiniaturizeNotification: &'static NSNotificationName;
}
extern "C" {
pub static NSWindowWillMoveNotification: &'static NSNotificationName;
}
extern "C" {
pub static NSWindowWillBeginSheetNotification: &'static NSNotificationName;
}
extern "C" {
pub static NSWindowDidEndSheetNotification: &'static NSNotificationName;
}
extern "C" {
pub static NSWindowDidChangeBackingPropertiesNotification: &'static NSNotificationName;
}
extern "C" {
pub static NSBackingPropertyOldScaleFactorKey: &'static NSString;
}
extern "C" {
pub static NSBackingPropertyOldColorSpaceKey: &'static NSString;
}
extern "C" {
pub static NSWindowDidChangeScreenProfileNotification: &'static NSNotificationName;
}
extern "C" {
pub static NSWindowWillStartLiveResizeNotification: &'static NSNotificationName;
}
extern "C" {
pub static NSWindowDidEndLiveResizeNotification: &'static NSNotificationName;
}
extern "C" {
pub static NSWindowWillEnterFullScreenNotification: &'static NSNotificationName;
}
extern "C" {
pub static NSWindowDidEnterFullScreenNotification: &'static NSNotificationName;
}
extern "C" {
pub static NSWindowWillExitFullScreenNotification: &'static NSNotificationName;
}
extern "C" {
pub static NSWindowDidExitFullScreenNotification: &'static NSNotificationName;
}
extern "C" {
pub static NSWindowWillEnterVersionBrowserNotification: &'static NSNotificationName;
}
extern "C" {
pub static NSWindowDidEnterVersionBrowserNotification: &'static NSNotificationName;
}
extern "C" {
pub static NSWindowWillExitVersionBrowserNotification: &'static NSNotificationName;
}
extern "C" {
pub static NSWindowDidExitVersionBrowserNotification: &'static NSNotificationName;
}
extern "C" {
pub static NSWindowDidChangeOcclusionStateNotification: &'static NSNotificationName;
}
#[deprecated]
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSWindowBackingLocation(pub NSUInteger);
impl NSWindowBackingLocation {
#[doc(alias = "NSWindowBackingLocationDefault")]
pub const Default: Self = Self(0);
#[doc(alias = "NSWindowBackingLocationVideoMemory")]
pub const VideoMemory: Self = Self(1);
#[doc(alias = "NSWindowBackingLocationMainMemory")]
pub const MainMemory: Self = Self(2);
}
unsafe impl Encode for NSWindowBackingLocation {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for NSWindowBackingLocation {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_methods!(
#[cfg(feature = "NSResponder")]
unsafe impl NSWindow {
#[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"]
#[method(cacheImageInRect:)]
pub unsafe fn cacheImageInRect(&self, rect: NSRect);
#[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"]
#[method(restoreCachedImage)]
pub unsafe fn restoreCachedImage(&self);
#[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"]
#[method(discardCachedImage)]
pub unsafe fn discardCachedImage(&self);
#[cfg(feature = "NSMenu")]
#[deprecated = "This method does not do anything and should not be called."]
#[method(menuChanged:)]
pub unsafe fn menuChanged(menu: &NSMenu);
#[deprecated = "This method is unused and should not be called."]
#[method(gState)]
pub unsafe fn gState(&self) -> NSInteger;
#[deprecated = "Use -convertRectToScreen: or -convertPointToScreen: instead"]
#[method(convertBaseToScreen:)]
pub unsafe fn convertBaseToScreen(&self, point: NSPoint) -> NSPoint;
#[deprecated = "Use -convertRectFromScreen or -convertPointFromScreen: instead"]
#[method(convertScreenToBase:)]
pub unsafe fn convertScreenToBase(&self, point: NSPoint) -> NSPoint;
#[deprecated = "Use -convertRectToBacking: and -backingScaleFactor instead"]
#[method(userSpaceScaleFactor)]
pub unsafe fn userSpaceScaleFactor(&self) -> CGFloat;
#[deprecated = "This method does not do anything and should not be called."]
#[method(useOptimizedDrawing:)]
pub unsafe fn useOptimizedDrawing(&self, flag: bool);
#[deprecated = "This method does not do anything and should not be called."]
#[method(canStoreColor)]
pub unsafe fn canStoreColor(&self) -> bool;
#[deprecated = "Use +[NSAnimationContext runAnimationGroup:completionHandler:] to perform atomic updates across runloop invocations."]
#[method(disableFlushWindow)]
pub unsafe fn disableFlushWindow(&self);
#[deprecated = "Use +[NSAnimationContext runAnimationGroup:completionHandler:] to perform atomic updates across runloop invocations."]
#[method(enableFlushWindow)]
pub unsafe fn enableFlushWindow(&self);
#[deprecated = "Use +[NSAnimationContext runAnimationGroup:completionHandler:] to perform atomic updates across runloop invocations."]
#[method(isFlushWindowDisabled)]
pub unsafe fn isFlushWindowDisabled(&self) -> bool;
#[deprecated = "Allow AppKit's automatic deferred display mechanism to take care of flushing any graphics contexts as needed."]
#[method(flushWindow)]
pub unsafe fn flushWindow(&self);
#[deprecated = "Allow AppKit's automatic deferred display mechanism to take care of flushing any graphics contexts as needed."]
#[method(flushWindowIfNeeded)]
pub unsafe fn flushWindowIfNeeded(&self);
#[deprecated = "Use +[NSAnimationContext runAnimationGroup:completionHandler:] to temporarily prevent AppKit's automatic deferred display mechanism from drawing."]
#[method(isAutodisplay)]
pub unsafe fn isAutodisplay(&self) -> bool;
#[deprecated = "Use +[NSAnimationContext runAnimationGroup:completionHandler:] to temporarily prevent AppKit's automatic deferred display mechanism from drawing."]
#[method(setAutodisplay:)]
pub unsafe fn setAutodisplay(&self, autodisplay: bool);
#[cfg(feature = "NSGraphicsContext")]
#[deprecated = "Add instances of NSView to display content in a window."]
#[method_id(@__retain_semantics Other graphicsContext)]
pub unsafe fn graphicsContext(&self) -> Option<Id<NSGraphicsContext>>;
#[deprecated = "This property does not do anything and should not be used"]
#[method(isOneShot)]
pub unsafe fn isOneShot(&self) -> bool;
#[deprecated = "This property does not do anything and should not be used"]
#[method(setOneShot:)]
pub unsafe fn setOneShot(&self, one_shot: bool);
#[deprecated = "This property does not do anything and should not be used"]
#[method(preferredBackingLocation)]
pub unsafe fn preferredBackingLocation(&self) -> NSWindowBackingLocation;
#[deprecated = "This property does not do anything and should not be used"]
#[method(setPreferredBackingLocation:)]
pub unsafe fn setPreferredBackingLocation(
&self,
preferred_backing_location: NSWindowBackingLocation,
);
#[deprecated = "This property does not do anything and should not be used"]
#[method(backingLocation)]
pub unsafe fn backingLocation(&self) -> NSWindowBackingLocation;
#[method(showsResizeIndicator)]
pub unsafe fn showsResizeIndicator(&self) -> bool;
#[method(setShowsResizeIndicator:)]
pub unsafe fn setShowsResizeIndicator(&self, shows_resize_indicator: bool);
}
);
pub static NSBorderlessWindowMask: NSWindowStyleMask =
NSWindowStyleMask(NSWindowStyleMask::Borderless.0);
pub static NSTitledWindowMask: NSWindowStyleMask = NSWindowStyleMask(NSWindowStyleMask::Titled.0);
pub static NSClosableWindowMask: NSWindowStyleMask =
NSWindowStyleMask(NSWindowStyleMask::Closable.0);
pub static NSMiniaturizableWindowMask: NSWindowStyleMask =
NSWindowStyleMask(NSWindowStyleMask::Miniaturizable.0);
pub static NSResizableWindowMask: NSWindowStyleMask =
NSWindowStyleMask(NSWindowStyleMask::Resizable.0);
pub static NSTexturedBackgroundWindowMask: NSWindowStyleMask =
NSWindowStyleMask(NSWindowStyleMask::TexturedBackground.0);
pub static NSUnifiedTitleAndToolbarWindowMask: NSWindowStyleMask =
NSWindowStyleMask(NSWindowStyleMask::UnifiedTitleAndToolbar.0);
pub static NSFullScreenWindowMask: NSWindowStyleMask =
NSWindowStyleMask(NSWindowStyleMask::FullScreen.0);
pub static NSFullSizeContentViewWindowMask: NSWindowStyleMask =
NSWindowStyleMask(NSWindowStyleMask::FullSizeContentView.0);
pub static NSUtilityWindowMask: NSWindowStyleMask =
NSWindowStyleMask(NSWindowStyleMask::UtilityWindow.0);
pub static NSDocModalWindowMask: NSWindowStyleMask =
NSWindowStyleMask(NSWindowStyleMask::DocModalWindow.0);
pub static NSNonactivatingPanelMask: NSWindowStyleMask =
NSWindowStyleMask(NSWindowStyleMask::NonactivatingPanel.0);
pub static NSHUDWindowMask: NSWindowStyleMask = NSWindowStyleMask(NSWindowStyleMask::HUDWindow.0);
pub static NSUnscaledWindowMask: NSWindowStyleMask = NSWindowStyleMask(1 << 11);
pub static NSWindowFullScreenButton: NSWindowButton = NSWindowButton(7);
pub static NSDockWindowLevel: NSWindowLevel = 20;