Skip to main content

PlatformWindow

Trait PlatformWindow 

Source
pub trait PlatformWindow {
Show 26 methods // Required methods fn title(&self) -> &str; fn set_title(&mut self, title: &str); fn size(&self) -> (u32, u32); fn set_size(&mut self, width: u32, height: u32); fn scale_factor(&self) -> f32; fn set_scale_factor(&mut self, scale_factor: f32); fn mode(&self) -> WindowMode; fn set_mode(&mut self, mode: WindowMode); fn is_focused(&self) -> bool; fn set_focused(&mut self, focused: bool); fn cursor(&self) -> CursorIcon; fn set_cursor(&mut self, cursor: CursorIcon); fn request_redraw(&mut self); fn is_redraw_requested(&self) -> bool; fn poll_events(&mut self) -> Vec<PlatformEvent>; fn push_event(&mut self, event: PlatformEvent); // Provided methods fn current_monitor(&self) -> Option<MonitorInfo> { ... } fn available_monitors(&self) -> Vec<MonitorInfo> { ... } fn primary_monitor(&self) -> Option<MonitorInfo> { ... } fn on_accessibility_update(&mut self, _json_payload: &str) { ... } fn set_ime_cursor_location( &mut self, _x: i32, _y: i32, _width: i32, _height: i32, ) { ... } fn set_ime_surrounding_text(&mut self, _text: &str, _cursor_index: i32) { ... } fn reset_ime(&mut self) { ... } fn begin_window_drag(&mut self, _x: f32, _y: f32) { ... } fn begin_window_resize(&mut self, _edge: CsdHitZone, _x: f32, _y: f32) { ... } fn toggle_maximize(&mut self) -> bool { ... }
}
Expand description

Abstract platform window trait defining common cross-platform window operations.

Required Methods§

Source

fn title(&self) -> &str

Source

fn set_title(&mut self, title: &str)

Source

fn size(&self) -> (u32, u32)

Source

fn set_size(&mut self, width: u32, height: u32)

Source

fn scale_factor(&self) -> f32

Source

fn set_scale_factor(&mut self, scale_factor: f32)

Source

fn mode(&self) -> WindowMode

Source

fn set_mode(&mut self, mode: WindowMode)

Source

fn is_focused(&self) -> bool

Source

fn set_focused(&mut self, focused: bool)

Source

fn cursor(&self) -> CursorIcon

Source

fn set_cursor(&mut self, cursor: CursorIcon)

Source

fn request_redraw(&mut self)

Source

fn is_redraw_requested(&self) -> bool

Source

fn poll_events(&mut self) -> Vec<PlatformEvent>

Source

fn push_event(&mut self, event: PlatformEvent)

Provided Methods§

Source

fn current_monitor(&self) -> Option<MonitorInfo>

Returns the monitor containing the center of this window, if known.

Source

fn available_monitors(&self) -> Vec<MonitorInfo>

Returns the list of currently connected physical display monitors.

Source

fn primary_monitor(&self) -> Option<MonitorInfo>

Returns the primary system monitor.

Source

fn on_accessibility_update(&mut self, _json_payload: &str)

Transmits an incremental AccessKit/OS accessibility tree update to native screen readers.

Source

fn set_ime_cursor_location( &mut self, _x: i32, _y: i32, _width: i32, _height: i32, )

Sets candidate window positioning following active text caret coordinate.

Source

fn set_ime_surrounding_text(&mut self, _text: &str, _cursor_index: i32)

Updates surrounding text buffer for context-aware IME prediction.

Source

fn reset_ime(&mut self)

Resets active IME composition session.

Source

fn begin_window_drag(&mut self, _x: f32, _y: f32)

Initiates an interactive window drag operation with the native window manager.

Source

fn begin_window_resize(&mut self, _edge: CsdHitZone, _x: f32, _y: f32)

Initiates an interactive window resize operation with the native window manager.

Source

fn toggle_maximize(&mut self) -> bool

Toggles the window maximized state and returns true if the window is now maximized.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§