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§
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§
Sourcefn current_monitor(&self) -> Option<MonitorInfo>
fn current_monitor(&self) -> Option<MonitorInfo>
Returns the monitor containing the center of this window, if known.
Sourcefn available_monitors(&self) -> Vec<MonitorInfo>
fn available_monitors(&self) -> Vec<MonitorInfo>
Returns the list of currently connected physical display monitors.
Sourcefn primary_monitor(&self) -> Option<MonitorInfo>
fn primary_monitor(&self) -> Option<MonitorInfo>
Returns the primary system monitor.
Sourcefn on_accessibility_update(&mut self, _json_payload: &str)
fn on_accessibility_update(&mut self, _json_payload: &str)
Transmits an incremental AccessKit/OS accessibility tree update to native screen readers.
Sourcefn set_ime_cursor_location(
&mut self,
_x: i32,
_y: i32,
_width: i32,
_height: i32,
)
fn set_ime_cursor_location( &mut self, _x: i32, _y: i32, _width: i32, _height: i32, )
Sets candidate window positioning following active text caret coordinate.
Sourcefn set_ime_surrounding_text(&mut self, _text: &str, _cursor_index: i32)
fn set_ime_surrounding_text(&mut self, _text: &str, _cursor_index: i32)
Updates surrounding text buffer for context-aware IME prediction.
Sourcefn begin_window_drag(&mut self, _x: f32, _y: f32)
fn begin_window_drag(&mut self, _x: f32, _y: f32)
Initiates an interactive window drag operation with the native window manager.
Sourcefn begin_window_resize(&mut self, _edge: CsdHitZone, _x: f32, _y: f32)
fn begin_window_resize(&mut self, _edge: CsdHitZone, _x: f32, _y: f32)
Initiates an interactive window resize operation with the native window manager.
Sourcefn toggle_maximize(&mut self) -> bool
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".