Skip to main content

WindowManager

Struct WindowManager 

Source
pub struct WindowManager { /* private fields */ }
Expand description

Multi-window desktop manager coordinating multiple concurrent windows.

Implementations§

Source§

impl WindowManager

Source

pub fn new() -> Self

Creates a new empty window manager.

Source

pub fn create_window(&mut self, config: WindowConfig) -> WindowId

Spawns a new independent top-level window with the specified configuration.

Source

pub fn register_window(&mut self, window: Box<dyn PlatformWindow>) -> WindowId

Registers an existing platform window instance into the manager.

Source

pub fn create_modal( &mut self, parent: WindowId, config: WindowConfig, ) -> Result<WindowId, String>

Spawns a modal child dialog window attached to a specified parent window.

Source

pub fn register_modal( &mut self, parent: WindowId, window: Box<dyn PlatformWindow>, ) -> Result<WindowId, String>

Registers a modal platform window attached to a parent window.

Source

pub fn close_window(&mut self, id: WindowId) -> Result<(), String>

Closes a managed window, unblocking any parents and dismissing descendants.

Source

pub fn get_window(&self, id: WindowId) -> Option<&dyn PlatformWindow>

Returns a reference to the window with the given ID.

Source

pub fn get_window_mut( &mut self, id: WindowId, ) -> Option<&mut (dyn PlatformWindow + 'static)>

Returns a mutable reference to the window with the given ID.

Source

pub fn active_window(&self) -> Option<WindowId>

Returns the active window ID currently possessing focus.

Source

pub fn set_active_window(&mut self, id: WindowId) -> Result<(), String>

Sets the active focused window ID.

Source

pub fn is_modal_blocked(&self, id: WindowId) -> bool

Checks if a window is blocked from interaction by an active modal child.

Source

pub fn window_count(&self) -> usize

Total number of open windows.

Source

pub fn broadcast_event(&mut self, event: PlatformEvent)

Dispatches an event to all open non-blocked windows (e.g. system theme changes).

Source

pub fn poll_all_events(&mut self) -> Vec<(WindowId, PlatformEvent)>

Polls all window event queues and collects pending events labeled by WindowId.

Trait Implementations§

Source§

impl Default for WindowManager

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoInitialState<T> for T

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>