pub trait WindowShell {
// Required methods
fn metrics(&self) -> ShellMetrics;
fn request_redraw(&self);
fn set_title(&self, title: &str);
fn set_visible(&self, visible: bool);
fn set_ime_allowed(&self, allowed: bool);
fn set_ime_cursor_area(&self, rect: Rect);
}Expand description
窗口/DPI/IME 能力——应用只依赖此接口,不直接依赖 winit。
逻辑坐标约定:set_ime_cursor_area 接收 root layer 逻辑坐标(与布局一致),
由具体 shell 负责换算成平台需要的物理/逻辑单位。
Required Methods§
fn metrics(&self) -> ShellMetrics
fn request_redraw(&self)
fn set_title(&self, title: &str)
fn set_visible(&self, visible: bool)
fn set_ime_allowed(&self, allowed: bool)
fn set_ime_cursor_area(&self, rect: Rect)
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".