pub struct Window(/* private fields */);Expand description
A wrapper around platform-specific window implementations.
Implementations§
Source§impl Window
impl Window
Sourcepub fn new(platform_window: PlatformWindow) -> Self
pub fn new(platform_window: PlatformWindow) -> Self
Creates a new Window instance from a platform-specific window.
Sourcepub fn inner(&self) -> &PlatformWindow
pub fn inner(&self) -> &PlatformWindow
Retrieves the underlying platform-specific window implementation.
Sourcepub fn is_focused(&self) -> Result<bool, Error>
pub fn is_focused(&self) -> Result<bool, Error>
Sourcepub fn id(&self) -> Result<WindowId, Error>
Available on crate feature macos-private-api only.
pub fn id(&self) -> Result<WindowId, Error>
macos-private-api only.Retrieves the unique identifier of the window.
§Platform-specific
- macOS: It will return a
CGWindowIDwhich is wrapped bywindow_getter::WindowId. Warning: It uses the private API_AXUIElementGetWindowof macOS. - Windows: It will always return
Ok.
Sourcepub fn create_window_getter_window(&self) -> Result<Option<Window>, Error>
Available on crate feature macos-private-api only.
pub fn create_window_getter_window(&self) -> Result<Option<Window>, Error>
macos-private-api only.Retrieves the Window implementation by window-getter-rs.
§Panics
On macOS, if there is no window environment, it will panic.
§Platform-specific
- Windows: It will always return
Ok(Some(Window)).
Trait Implementations§
impl Eq for Window
impl StructuralPartialEq for Window
Auto Trait Implementations§
impl Freeze for Window
impl RefUnwindSafe for Window
impl Send for Window
impl Sync for Window
impl Unpin for Window
impl UnwindSafe for Window
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more