Skip to main content

PlatformWindow

Trait PlatformWindow 

Source
pub trait PlatformWindow: HasWindowHandle + HasDisplayHandle {
Show 68 methods // Required methods fn bounds(&self) -> Bounds<Pixels>; fn is_maximized(&self) -> bool; fn window_bounds(&self) -> WindowBounds; fn content_size(&self) -> Size<Pixels>; fn resize(&mut self, size: Size<Pixels>); fn scale_factor(&self) -> f32; fn appearance(&self) -> WindowAppearance; fn display(&self) -> Option<Rc<dyn PlatformDisplay>>; fn mouse_position(&self) -> Point<Pixels>; fn modifiers(&self) -> Modifiers; fn capslock(&self) -> Capslock; fn set_input_handler(&mut self, input_handler: PlatformInputHandler); fn take_input_handler(&mut self) -> Option<PlatformInputHandler>; fn prompt( &self, level: PromptLevel, msg: &str, detail: Option<&str>, answers: &[PromptButton], ) -> Option<Receiver<usize>>; fn activate(&self); fn is_active(&self) -> bool; fn is_hovered(&self) -> bool; fn background_appearance(&self) -> WindowBackgroundAppearance; fn set_title(&mut self, title: &str); fn set_background_appearance( &self, background_appearance: WindowBackgroundAppearance, ); fn minimize(&self); fn zoom(&self); fn toggle_fullscreen(&self); fn is_fullscreen(&self) -> bool; fn on_request_frame(&self, callback: Box<dyn FnMut(RequestFrameOptions)>); fn on_input( &self, callback: Box<dyn FnMut(PlatformInput) -> DispatchEventResult>, ); fn on_active_status_change(&self, callback: Box<dyn FnMut(bool)>); fn on_hover_status_change(&self, callback: Box<dyn FnMut(bool)>); fn on_resize(&self, callback: Box<dyn FnMut(Size<Pixels>, f32)>); fn on_moved(&self, callback: Box<dyn FnMut()>); fn on_should_close(&self, callback: Box<dyn FnMut() -> bool>); fn on_hit_test_window_control( &self, callback: Box<dyn FnMut() -> Option<WindowControlArea>>, ); fn on_close(&self, callback: Box<dyn FnOnce()>); fn on_appearance_changed(&self, callback: Box<dyn FnMut()>); fn draw(&self, scene: &Scene); fn sprite_atlas(&self) -> Arc<dyn PlatformAtlas> ; fn is_subpixel_rendering_supported(&self) -> bool; fn gpu_specs(&self) -> Option<GpuSpecs>; fn update_ime_position(&self, _bounds: Bounds<Pixels>); // Provided methods fn on_button_layout_changed(&self, _callback: Box<dyn FnMut()>) { ... } fn completed_frame(&self) { ... } fn get_title(&self) -> String { ... } fn tabbed_windows(&self) -> Option<Vec<SystemWindowTab>> { ... } fn tab_bar_visible(&self) -> bool { ... } fn set_edited(&mut self, _edited: bool) { ... } fn set_document_path(&self, _path: Option<&Path>) { ... } fn show_character_palette(&self) { ... } fn titlebar_double_click(&self) { ... } fn on_move_tab_to_new_window(&self, _callback: Box<dyn FnMut()>) { ... } fn on_merge_all_windows(&self, _callback: Box<dyn FnMut()>) { ... } fn on_select_previous_tab(&self, _callback: Box<dyn FnMut()>) { ... } fn on_select_next_tab(&self, _callback: Box<dyn FnMut()>) { ... } fn on_toggle_tab_bar(&self, _callback: Box<dyn FnMut()>) { ... } fn merge_all_windows(&self) { ... } fn move_tab_to_new_window(&self) { ... } fn toggle_window_tab_overview(&self) { ... } fn set_tabbing_identifier(&self, _identifier: Option<String>) { ... } fn inner_window_bounds(&self) -> WindowBounds { ... } fn request_decorations(&self, _decorations: WindowDecorations) { ... } fn show_window_menu(&self, _position: Point<Pixels>) { ... } fn start_window_move(&self) { ... } fn start_window_resize(&self, _edge: ResizeEdge) { ... } fn window_decorations(&self) -> Decorations { ... } fn set_app_id(&mut self, _app_id: &str) { ... } fn map_window(&mut self) -> Result<()> { ... } fn window_controls(&self) -> WindowControls { ... } fn set_client_inset(&self, _inset: Pixels) { ... } fn play_system_bell(&self) { ... }
}

Required Methods§

Source

fn bounds(&self) -> Bounds<Pixels>

Source

fn is_maximized(&self) -> bool

Source

fn window_bounds(&self) -> WindowBounds

Source

fn content_size(&self) -> Size<Pixels>

Source

fn resize(&mut self, size: Size<Pixels>)

Source

fn scale_factor(&self) -> f32

Source

fn appearance(&self) -> WindowAppearance

Source

fn display(&self) -> Option<Rc<dyn PlatformDisplay>>

Source

fn mouse_position(&self) -> Point<Pixels>

Source

fn modifiers(&self) -> Modifiers

Source

fn capslock(&self) -> Capslock

Source

fn set_input_handler(&mut self, input_handler: PlatformInputHandler)

Source

fn take_input_handler(&mut self) -> Option<PlatformInputHandler>

Source

fn prompt( &self, level: PromptLevel, msg: &str, detail: Option<&str>, answers: &[PromptButton], ) -> Option<Receiver<usize>>

Source

fn activate(&self)

Source

fn is_active(&self) -> bool

Source

fn is_hovered(&self) -> bool

Source

fn background_appearance(&self) -> WindowBackgroundAppearance

Source

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

Source

fn set_background_appearance( &self, background_appearance: WindowBackgroundAppearance, )

Source

fn minimize(&self)

Source

fn zoom(&self)

Source

fn toggle_fullscreen(&self)

Source

fn is_fullscreen(&self) -> bool

Source

fn on_request_frame(&self, callback: Box<dyn FnMut(RequestFrameOptions)>)

Source

fn on_input( &self, callback: Box<dyn FnMut(PlatformInput) -> DispatchEventResult>, )

Source

fn on_active_status_change(&self, callback: Box<dyn FnMut(bool)>)

Source

fn on_hover_status_change(&self, callback: Box<dyn FnMut(bool)>)

Source

fn on_resize(&self, callback: Box<dyn FnMut(Size<Pixels>, f32)>)

Source

fn on_moved(&self, callback: Box<dyn FnMut()>)

Source

fn on_should_close(&self, callback: Box<dyn FnMut() -> bool>)

Source

fn on_hit_test_window_control( &self, callback: Box<dyn FnMut() -> Option<WindowControlArea>>, )

Source

fn on_close(&self, callback: Box<dyn FnOnce()>)

Source

fn on_appearance_changed(&self, callback: Box<dyn FnMut()>)

Source

fn draw(&self, scene: &Scene)

Source

fn sprite_atlas(&self) -> Arc<dyn PlatformAtlas>

Source

fn is_subpixel_rendering_supported(&self) -> bool

Source

fn gpu_specs(&self) -> Option<GpuSpecs>

Source

fn update_ime_position(&self, _bounds: Bounds<Pixels>)

Provided Methods§

Implementors§