Trait winit::platform::macos::WindowExtMacOS
source · pub trait WindowExtMacOS {
// Required methods
fn ns_window(&self) -> *mut c_void;
fn ns_view(&self) -> *mut c_void;
fn simple_fullscreen(&self) -> bool;
fn set_simple_fullscreen(&self, fullscreen: bool) -> bool;
fn has_shadow(&self) -> bool;
fn set_has_shadow(&self, has_shadow: bool);
fn is_document_edited(&self) -> bool;
fn set_document_edited(&self, edited: bool);
fn set_option_as_alt(&self, option_as_alt: OptionAsAlt);
fn option_as_alt(&self) -> OptionAsAlt;
}
Expand description
Additional methods on Window
that are specific to MacOS.
Required Methods§
sourcefn ns_window(&self) -> *mut c_void
fn ns_window(&self) -> *mut c_void
Returns a pointer to the cocoa NSWindow
that is used by this window.
The pointer will become invalid when the Window
is destroyed.
sourcefn ns_view(&self) -> *mut c_void
fn ns_view(&self) -> *mut c_void
Returns a pointer to the cocoa NSView
that is used by this window.
The pointer will become invalid when the Window
is destroyed.
sourcefn simple_fullscreen(&self) -> bool
fn simple_fullscreen(&self) -> bool
Returns whether or not the window is in simple fullscreen mode.
sourcefn set_simple_fullscreen(&self, fullscreen: bool) -> bool
fn set_simple_fullscreen(&self, fullscreen: bool) -> bool
Toggles a fullscreen mode that doesn’t require a new macOS space. Returns a boolean indicating whether the transition was successful (this won’t work if the window was already in the native fullscreen).
This is how fullscreen used to work on macOS in versions before Lion. And allows the user to have a fullscreen window without using another space or taking control over the entire monitor.
sourcefn has_shadow(&self) -> bool
fn has_shadow(&self) -> bool
Returns whether or not the window has shadow.
sourcefn set_has_shadow(&self, has_shadow: bool)
fn set_has_shadow(&self, has_shadow: bool)
Sets whether or not the window has shadow.
sourcefn is_document_edited(&self) -> bool
fn is_document_edited(&self) -> bool
sourcefn set_document_edited(&self, edited: bool)
fn set_document_edited(&self, edited: bool)
Put the window in a state which indicates a file save is required.
sourcefn set_option_as_alt(&self, option_as_alt: OptionAsAlt)
fn set_option_as_alt(&self, option_as_alt: OptionAsAlt)
Set option as alt behavior as described in OptionAsAlt
.
This will ignore diacritical marks and accent characters from being processed as received characters. Instead, the input device’s raw character will be placed in event queues with the Alt modifier set.
sourcefn option_as_alt(&self) -> OptionAsAlt
fn option_as_alt(&self) -> OptionAsAlt
Getter for the WindowExtMacOS::set_option_as_alt
.