Skip to main content

PlatformWindow

Trait PlatformWindow 

Source
pub trait PlatformWindow: HasWindowHandle + HasDisplayHandle {
Show 87 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 request_attention(&self) { ... } fn on_button_layout_changed(&self, _callback: Box<dyn FnMut()>) { ... } fn draw_layered(&self, scene: &Scene, _overlay_start: usize) { ... } fn enable_scene_overlay(&self) -> Result<()> { ... } fn create_native_surface(&self) -> Result<Rc<dyn PlatformNativeSurface>> { ... } 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, _is_resizable: bool, _is_minimizable: bool) { ... } 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 can_start_external_drag(&self) -> bool { ... } fn start_external_drag(&self, _payload: &ExternalDragPayload) -> bool { ... } fn start_window_resize(&self, _edge: ResizeEdge) { ... } fn set_exclusive_zone(&self, _zone: Pixels) { ... } fn set_exclusive_edge(&self, _edge: Anchor) { ... } fn set_input_region(&self, _region: Option<&[Bounds<Pixels>]>) { ... } 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 insets(&self) -> WindowInsets { ... } fn on_insets_changed(&self, _callback: Box<dyn FnMut(WindowInsets)>) { ... } fn set_back_handler(&self, _callback: Box<dyn FnMut()>) { ... } fn set_back_enabled(&self, _enabled: bool) { ... } fn show_soft_keyboard(&self) { ... } fn hide_soft_keyboard(&self) { ... } fn text_input_state_changed(&self, _change: TextInputStateChange) { ... } fn play_system_bell(&self) { ... } fn a11y_init(&self, _callbacks: A11yCallbacks) { ... } fn a11y_tree_update(&self, _tree_update: TreeUpdate) { ... } fn a11y_update_window_bounds(&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§

Source

fn request_attention(&self)

Requests that the operating system draw attention to this window.

Source

fn on_button_layout_changed(&self, _callback: Box<dyn FnMut()>)

Source

fn draw_layered(&self, scene: &Scene, _overlay_start: usize)

Draws a scene with primitives at and after overlay_start on a platform overlay surface when one has been enabled.

Platforms without layered scene support fall back to drawing the complete scene on their primary surface.

Source

fn enable_scene_overlay(&self) -> Result<()>

Enables a transparent GPUI surface above native child views.

This is currently an experimental capability for embedding native surfaces between GPUI’s base and deferred-overlay paint planes.

Source

fn create_native_surface(&self) -> Result<Rc<dyn PlatformNativeSurface>>

Creates a native surface slot between GPUI’s base and overlay planes.

Source

fn completed_frame(&self)

Source

fn get_title(&self) -> String

Source

fn tabbed_windows(&self) -> Option<Vec<SystemWindowTab>>

Source

fn tab_bar_visible(&self) -> bool

Source

fn set_edited(&mut self, _edited: bool)

Source

fn set_document_path(&self, _path: Option<&Path>)

Source

fn show_character_palette(&self)

Source

fn titlebar_double_click(&self, _is_resizable: bool, _is_minimizable: bool)

Source

fn on_move_tab_to_new_window(&self, _callback: Box<dyn FnMut()>)

Source

fn on_merge_all_windows(&self, _callback: Box<dyn FnMut()>)

Source

fn on_select_previous_tab(&self, _callback: Box<dyn FnMut()>)

Source

fn on_select_next_tab(&self, _callback: Box<dyn FnMut()>)

Source

fn on_toggle_tab_bar(&self, _callback: Box<dyn FnMut()>)

Source

fn merge_all_windows(&self)

Source

fn move_tab_to_new_window(&self)

Source

fn toggle_window_tab_overview(&self)

Source

fn set_tabbing_identifier(&self, _identifier: Option<String>)

Source

fn inner_window_bounds(&self) -> WindowBounds

Source

fn request_decorations(&self, _decorations: WindowDecorations)

Source

fn show_window_menu(&self, _position: Point<Pixels>)

Source

fn start_window_move(&self)

Source

fn can_start_external_drag(&self) -> bool

Source

fn start_external_drag(&self, _payload: &ExternalDragPayload) -> bool

Source

fn start_window_resize(&self, _edge: ResizeEdge)

Source

fn set_exclusive_zone(&self, _zone: Pixels)

Source

fn set_exclusive_edge(&self, _edge: Anchor)

Source

fn set_input_region(&self, _region: Option<&[Bounds<Pixels>]>)

Source

fn window_decorations(&self) -> Decorations

Source

fn set_app_id(&mut self, _app_id: &str)

Source

fn map_window(&mut self) -> Result<()>

Source

fn window_controls(&self) -> WindowControls

Source

fn set_client_inset(&self, _inset: Pixels)

Source

fn insets(&self) -> WindowInsets

The regions of this window currently obscured or reserved by the system. Zero on platforms without such regions.

Source

fn on_insets_changed(&self, _callback: Box<dyn FnMut(WindowInsets)>)

Registers a callback invoked whenever Self::insets change.

Contract: fires continuously during animated transitions (Android WindowInsetsAnimation progress; on iOS the platform interpolates the keyboard animation curve on frame ticks) and is exact at rest.

Source

fn set_back_handler(&self, _callback: Box<dyn FnMut()>)

Sets the handler for the system back action (Android back button/gesture; no source on iOS or desktop).

Source

fn set_back_enabled(&self, _enabled: bool)

Declares whether the application would currently handle the system back action (e.g. navigation depth > 0).

Source

fn show_soft_keyboard(&self)

Requests that the soft keyboard be shown.

Source

fn hide_soft_keyboard(&self)

Requests that the soft keyboard be hidden.

Source

fn text_input_state_changed(&self, _change: TextInputStateChange)

Inform the operating system that the text input state has changed

Source

fn play_system_bell(&self)

Source

fn a11y_init(&self, _callbacks: A11yCallbacks)

Initialize the accessibility adapter with callbacks.

Source

fn a11y_tree_update(&self, _tree_update: TreeUpdate)

Provide a TreeUpdate to the accessibility adapter.

Source

fn a11y_update_window_bounds(&self)

Inform the adapter of updated window bounds.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§