pub struct WindowManager { /* private fields */ }Expand description
Multi-window desktop manager coordinating multiple concurrent windows.
Implementations§
Source§impl WindowManager
impl WindowManager
Sourcepub fn create_window(&mut self, config: WindowConfig) -> WindowId
pub fn create_window(&mut self, config: WindowConfig) -> WindowId
Spawns a new independent top-level window with the specified configuration.
Sourcepub fn register_window(&mut self, window: Box<dyn PlatformWindow>) -> WindowId
pub fn register_window(&mut self, window: Box<dyn PlatformWindow>) -> WindowId
Registers an existing platform window instance into the manager.
Sourcepub fn create_modal(
&mut self,
parent: WindowId,
config: WindowConfig,
) -> Result<WindowId, String>
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.
Sourcepub fn register_modal(
&mut self,
parent: WindowId,
window: Box<dyn PlatformWindow>,
) -> Result<WindowId, String>
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.
Sourcepub fn close_window(&mut self, id: WindowId) -> Result<(), String>
pub fn close_window(&mut self, id: WindowId) -> Result<(), String>
Closes a managed window, unblocking any parents and dismissing descendants.
Sourcepub fn get_window(&self, id: WindowId) -> Option<&dyn PlatformWindow>
pub fn get_window(&self, id: WindowId) -> Option<&dyn PlatformWindow>
Returns a reference to the window with the given ID.
Sourcepub fn get_window_mut(
&mut self,
id: WindowId,
) -> Option<&mut (dyn PlatformWindow + 'static)>
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.
Sourcepub fn active_window(&self) -> Option<WindowId>
pub fn active_window(&self) -> Option<WindowId>
Returns the active window ID currently possessing focus.
Sourcepub fn set_active_window(&mut self, id: WindowId) -> Result<(), String>
pub fn set_active_window(&mut self, id: WindowId) -> Result<(), String>
Sets the active focused window ID.
Sourcepub fn is_modal_blocked(&self, id: WindowId) -> bool
pub fn is_modal_blocked(&self, id: WindowId) -> bool
Checks if a window is blocked from interaction by an active modal child.
Sourcepub fn window_count(&self) -> usize
pub fn window_count(&self) -> usize
Total number of open windows.
Sourcepub fn broadcast_event(&mut self, event: PlatformEvent)
pub fn broadcast_event(&mut self, event: PlatformEvent)
Dispatches an event to all open non-blocked windows (e.g. system theme changes).
Sourcepub fn poll_all_events(&mut self) -> Vec<(WindowId, PlatformEvent)>
pub fn poll_all_events(&mut self) -> Vec<(WindowId, PlatformEvent)>
Polls all window event queues and collects pending events labeled by WindowId.