pub trait PlatformWindow: HasWindowHandle + HasDisplayHandle {
Show 102 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, token: Option<&str>) -> bool;
fn is_active(&self) -> bool;
fn visibility(&self) -> WindowVisibility;
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_visibility_change(&self, callback: Box<dyn FnMut(WindowVisibility)>);
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_display_changed(&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 visual_viewport_bounds(&self) -> Bounds<Pixels> { ... }
fn on_visual_viewport_changed(&self, _callback: Box<dyn FnMut()>) { ... }
fn prepare_frame(&self) -> bool { ... }
fn set_text_input_configuration(
&mut self,
_configuration: TextInputConfiguration,
) { ... }
fn request_attention(&self) { ... }
fn set_visible(&self, _visible: bool) { ... }
fn frame_waker(&self) -> Option<Rc<dyn Fn()>> { ... }
fn on_button_layout_changed(&self, _callback: Box<dyn FnMut()>) { ... }
fn schedule_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 toggle_simple_fullscreen(&self) { ... }
fn is_simple_fullscreen(&self) -> bool { ... }
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 native_window_state(&self) -> Option<Vec<u8>> { ... }
fn restore_native_window_state(&self, _state: &[u8]) { ... }
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 gpu_context(&self) -> Option<Box<dyn Any>> { ... }
fn gpu_context_info(&self) -> Option<Box<dyn Any>> { ... }
fn gpu_device_lost(&self) -> Option<bool> { ... }
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) { ... }
fn as_test(&mut self) -> Option<&mut TestWindow> { ... }
fn render_to_image(&self, _scene: &Scene) -> Result<RgbaImage> { ... }
}Expand description
The native window that GPUI draws into, implemented by each backend.
App::open_window creates one through Platform::open_window for each
Window. Application code doesn’t call these methods directly. Window and
the Platform wrap them. Each backend implements the trait for its windowing
system. Methods with a default body are optional, and the default is the behavior
for a platform that lacks the feature.
Methods that a platform doesn’t support are commented with the platform that does.
Required Methods§
Sourcefn bounds(&self) -> Bounds<Pixels>
fn bounds(&self) -> Bounds<Pixels>
Returns the window’s frame in screen coordinates, in logical pixels.
Sourcefn is_maximized(&self) -> bool
fn is_maximized(&self) -> bool
Returns whether the window is maximized.
Sourcefn window_bounds(&self) -> WindowBounds
fn window_bounds(&self) -> WindowBounds
Returns the window’s state, and the bounds to restore when it leaves that state.
Sourcefn content_size(&self) -> Size<Pixels>
fn content_size(&self) -> Size<Pixels>
Returns the drawable size, excluding the titlebar, in logical pixels.
Sourcefn resize(&mut self, size: Size<Pixels>)
fn resize(&mut self, size: Size<Pixels>)
Resizes the window’s content area to size, in logical pixels.
Sourcefn scale_factor(&self) -> f32
fn scale_factor(&self) -> f32
Returns the number of device pixels per logical pixel.
Sourcefn appearance(&self) -> WindowAppearance
fn appearance(&self) -> WindowAppearance
Returns the window’s light or dark appearance.
Sourcefn display(&self) -> Option<Rc<dyn PlatformDisplay>>
fn display(&self) -> Option<Rc<dyn PlatformDisplay>>
Returns the display the window is on, or None if the platform can’t tell.
Sourcefn mouse_position(&self) -> Point<Pixels>
fn mouse_position(&self) -> Point<Pixels>
Returns the mouse position in window coordinates, in logical pixels.
Sourcefn set_input_handler(&mut self, input_handler: PlatformInputHandler)
fn set_input_handler(&mut self, input_handler: PlatformInputHandler)
Installs the handler that receives text input for the focused element.
Sourcefn take_input_handler(&mut self) -> Option<PlatformInputHandler>
fn take_input_handler(&mut self) -> Option<PlatformInputHandler>
Removes and returns the installed input handler.
Sourcefn prompt(
&self,
level: PromptLevel,
msg: &str,
detail: Option<&str>,
answers: &[PromptButton],
) -> Option<Receiver<usize>>
fn prompt( &self, level: PromptLevel, msg: &str, detail: Option<&str>, answers: &[PromptButton], ) -> Option<Receiver<usize>>
Shows a native alert or prompt with answers as its buttons.
The returned receiver yields the index in answers of the button the user
chose. Returns None when the platform can’t show a prompt. The web backend
always returns None.
Sourcefn activate(&self, token: Option<&str>) -> bool
fn activate(&self, token: Option<&str>) -> bool
Request activation, optionally using an externally supplied token. Returns whether a request was sent, not whether focus was granted.
Sourcefn visibility(&self) -> WindowVisibility
fn visibility(&self) -> WindowVisibility
The current WindowVisibility. Read once when the window is created;
afterwards changes arrive through Self::on_visibility_change.
Sourcefn is_hovered(&self) -> bool
fn is_hovered(&self) -> bool
Returns whether the mouse is over this window.
Sourcefn background_appearance(&self) -> WindowBackgroundAppearance
fn background_appearance(&self) -> WindowBackgroundAppearance
Returns how the window background is drawn.
Sourcefn set_background_appearance(
&self,
background_appearance: WindowBackgroundAppearance,
)
fn set_background_appearance( &self, background_appearance: WindowBackgroundAppearance, )
Sets how the window background is drawn: opaque, transparent or blurred.
Sourcefn zoom(&self)
fn zoom(&self)
Zooms the window with the platform’s zoom behavior. The web backend logs a warning and does nothing.
Sourcefn toggle_fullscreen(&self)
fn toggle_fullscreen(&self)
Enters fullscreen, or leaves it if the window is already fullscreen.
Sourcefn is_fullscreen(&self) -> bool
fn is_fullscreen(&self) -> bool
Returns whether the window is fullscreen.
Sourcefn on_request_frame(&self, callback: Box<dyn FnMut(RequestFrameOptions)>)
fn on_request_frame(&self, callback: Box<dyn FnMut(RequestFrameOptions)>)
Registers the callback that draws a frame when the platform asks for one.
Sourcefn on_input(
&self,
callback: Box<dyn FnMut(PlatformInput) -> DispatchEventResult>,
)
fn on_input( &self, callback: Box<dyn FnMut(PlatformInput) -> DispatchEventResult>, )
Registers the callback that receives input events. Its return value tells the platform whether GPUI handled the event.
Sourcefn on_active_status_change(&self, callback: Box<dyn FnMut(bool)>)
fn on_active_status_change(&self, callback: Box<dyn FnMut(bool)>)
Registers the callback run when the window gains or loses focus. It receives true when the window is active.
Sourcefn on_visibility_change(&self, callback: Box<dyn FnMut(WindowVisibility)>)
fn on_visibility_change(&self, callback: Box<dyn FnMut(WindowVisibility)>)
Registers the callback invoked when Self::visibility changes. Only
transitions are reported; the callback runs on the main thread outside
of any window update.
Sourcefn on_hover_status_change(&self, callback: Box<dyn FnMut(bool)>)
fn on_hover_status_change(&self, callback: Box<dyn FnMut(bool)>)
Registers the callback run when the mouse enters or leaves the window. It receives true on enter.
Sourcefn on_resize(&self, callback: Box<dyn FnMut(Size<Pixels>, f32)>)
fn on_resize(&self, callback: Box<dyn FnMut(Size<Pixels>, f32)>)
Registers the callback run when the content size or scale factor changes. It receives the new size and the scale factor.
Sourcefn on_moved(&self, callback: Box<dyn FnMut()>)
fn on_moved(&self, callback: Box<dyn FnMut()>)
Registers the callback run when the window moves.
Sourcefn on_display_changed(&self, callback: Box<dyn FnMut()>)
fn on_display_changed(&self, callback: Box<dyn FnMut()>)
Registers the callback invoked when the window moves to another display. Calls may be spurious. The callback runs on the main thread outside of any window update.
Sourcefn on_should_close(&self, callback: Box<dyn FnMut() -> bool>)
fn on_should_close(&self, callback: Box<dyn FnMut() -> bool>)
Registers the callback run when the user asks to close the window. Return false to keep it open.
Sourcefn on_hit_test_window_control(
&self,
callback: Box<dyn FnMut() -> Option<WindowControlArea>>,
)
fn on_hit_test_window_control( &self, callback: Box<dyn FnMut() -> Option<WindowControlArea>>, )
Registers the callback the platform calls to find out which titlebar control, if any, the mouse is over.
Sourcefn on_close(&self, callback: Box<dyn FnOnce()>)
fn on_close(&self, callback: Box<dyn FnOnce()>)
Registers the callback run once the window has closed.
Sourcefn on_appearance_changed(&self, callback: Box<dyn FnMut()>)
fn on_appearance_changed(&self, callback: Box<dyn FnMut()>)
Registers the callback run when the window’s appearance changes.
Sourcefn sprite_atlas(&self) -> Arc<dyn PlatformAtlas> ⓘ
fn sprite_atlas(&self) -> Arc<dyn PlatformAtlas> ⓘ
Returns the atlas that stores the glyph and image textures for this window.
Sourcefn is_subpixel_rendering_supported(&self) -> bool
fn is_subpixel_rendering_supported(&self) -> bool
Returns whether the renderer supports subpixel (LCD) text antialiasing. macOS returns false.
Sourcefn gpu_specs(&self) -> Option<GpuSpecs>
fn gpu_specs(&self) -> Option<GpuSpecs>
Returns the GPU’s name and driver details, or None if they’re unavailable.
Sourcefn update_ime_position(&self, _bounds: Bounds<Pixels>)
fn update_ime_position(&self, _bounds: Bounds<Pixels>)
Moves the input method’s candidate window next to bounds, in window coordinates.
Provided Methods§
Sourcefn visual_viewport_bounds(&self) -> Bounds<Pixels>
fn visual_viewport_bounds(&self) -> Bounds<Pixels>
Returns the visible viewport in logical pixels relative to the content origin.
This may be smaller or offset when a keyboard or zoom obscures content;
it must not change the full layout size returned by content_size.
Implementations should return a frame snapshot, not query platform layout here.
Sourcefn on_visual_viewport_changed(&self, _callback: Box<dyn FnMut()>)
fn on_visual_viewport_changed(&self, _callback: Box<dyn FnMut()>)
Registers a callback when visible geometry may have changed.
This requests a frame; backends can sample the new viewport and safe-area
geometry in prepare_frame rather than updating it inside the callback.
Sourcefn prepare_frame(&self) -> bool
fn prepare_frame(&self) -> bool
Samples platform geometry before a draw, returning whether view caches must be invalidated.
Geometry getters must remain consistent throughout the ensuing draw. Do not invoke callbacks here: GPUI is already updating this window.
Sourcefn set_text_input_configuration(
&mut self,
_configuration: TextInputConfiguration,
)
fn set_text_input_configuration( &mut self, _configuration: TextInputConfiguration, )
Apply the focused text region’s TextInputConfiguration to the
platform’s text input session (e.g. attributes of the hidden editable
element on web). Called only when the configuration changes, because
reconfiguring a live input session can restart the IME connection.
Sourcefn request_attention(&self)
fn request_attention(&self)
Requests that the operating system draw attention to this window.
Sourcefn set_visible(&self, _visible: bool)
fn set_visible(&self, _visible: bool)
Show or hide the window without explicitly requesting focus.
The default implementation does nothing for platforms that do not support changing window visibility at runtime.
Sourcefn frame_waker(&self) -> Option<Rc<dyn Fn()>>
fn frame_waker(&self) -> Option<Rc<dyn Fn()>>
Returns a function that wakes the event loop to draw a frame, or None if the
platform doesn’t provide one.
Registers the callback run when the titlebar button layout changes. The default does nothing.
Sourcefn schedule_frame(&self)
fn schedule_frame(&self)
Asks the platform to request another frame soon. The default does nothing.
Sourcefn get_title(&self) -> String
fn get_title(&self) -> String
Returns the window title. macOS and the Linux headless window override this. The default returns an empty string.
Sourcefn tabbed_windows(&self) -> Option<Vec<SystemWindowTab>>
fn tabbed_windows(&self) -> Option<Vec<SystemWindowTab>>
Returns the windows in this window’s native tab group, or None if the window isn’t tabbed. macOS only.
Sourcefn tab_bar_visible(&self) -> bool
fn tab_bar_visible(&self) -> bool
Returns whether the native tab bar is visible. macOS only.
Sourcefn set_edited(&mut self, _edited: bool)
fn set_edited(&mut self, _edited: bool)
Marks the window’s document as edited or unedited. macOS only.
Sourcefn set_document_path(&self, _path: Option<&Path>)
fn set_document_path(&self, _path: Option<&Path>)
Sets the document path that the titlebar shows for the window. macOS only.
Sourcefn toggle_simple_fullscreen(&self)
fn toggle_simple_fullscreen(&self)
Toggles simple fullscreen, which fills the screen without creating a new Space. macOS only.
Sourcefn is_simple_fullscreen(&self) -> bool
fn is_simple_fullscreen(&self) -> bool
Returns whether the window is in simple fullscreen. macOS only.
Sourcefn show_character_palette(&self)
fn show_character_palette(&self)
Show the platform character palette.
The default implementation logs a warning when the backend does not support showing a character palette.
Sourcefn titlebar_double_click(&self, _is_resizable: bool, _is_minimizable: bool)
fn titlebar_double_click(&self, _is_resizable: bool, _is_minimizable: bool)
Runs the titlebar double-click action. macOS only, and the default does nothing.
Sourcefn on_move_tab_to_new_window(&self, _callback: Box<dyn FnMut()>)
fn on_move_tab_to_new_window(&self, _callback: Box<dyn FnMut()>)
Registers the callback for the Move Tab to New Window action. macOS only.
Sourcefn on_merge_all_windows(&self, _callback: Box<dyn FnMut()>)
fn on_merge_all_windows(&self, _callback: Box<dyn FnMut()>)
Registers the callback for the Merge All Windows action. macOS only.
Sourcefn on_select_previous_tab(&self, _callback: Box<dyn FnMut()>)
fn on_select_previous_tab(&self, _callback: Box<dyn FnMut()>)
Registers the callback for selecting the previous tab. macOS only.
Sourcefn on_select_next_tab(&self, _callback: Box<dyn FnMut()>)
fn on_select_next_tab(&self, _callback: Box<dyn FnMut()>)
Registers the callback for selecting the next tab. macOS only.
Sourcefn on_toggle_tab_bar(&self, _callback: Box<dyn FnMut()>)
fn on_toggle_tab_bar(&self, _callback: Box<dyn FnMut()>)
Registers the callback for showing or hiding the tab bar. macOS only.
Sourcefn merge_all_windows(&self)
fn merge_all_windows(&self)
Merges all windows into one tab group. macOS only.
Sourcefn move_tab_to_new_window(&self)
fn move_tab_to_new_window(&self)
Moves this window’s tab into a new window. macOS only.
Sourcefn toggle_window_tab_overview(&self)
fn toggle_window_tab_overview(&self)
Shows or hides the tab overview. macOS only.
Sourcefn set_tabbing_identifier(&self, _identifier: Option<String>)
fn set_tabbing_identifier(&self, _identifier: Option<String>)
Sets the identifier that groups windows into one native tab group. macOS only.
Sourcefn native_window_state(&self) -> Option<Vec<u8>>
fn native_window_state(&self) -> Option<Vec<u8>>
Captures opaque, platform-specific state for restoring this native window later.
Returns None when the backend has no restorable state. The bytes are only meaningful to the backend that produced them; the default implementation returns None.
Sourcefn restore_native_window_state(&self, _state: &[u8])
fn restore_native_window_state(&self, _state: &[u8])
Restores state previously returned by PlatformWindow::native_window_state.
The default implementation does nothing on platforms without native state restoration.
Sourcefn inner_window_bounds(&self) -> WindowBounds
fn inner_window_bounds(&self) -> WindowBounds
Returns the window’s state and bounds, excluding decorations. Defaults to PlatformWindow::window_bounds.
Sourcefn request_decorations(&self, _decorations: WindowDecorations)
fn request_decorations(&self, _decorations: WindowDecorations)
Asks for server-side or client-side decorations. Linux only.
Shows the window menu at position, in logical pixels. Linux only.
Sourcefn start_window_move(&self)
fn start_window_move(&self)
Starts an interactive move, as if the user dragged the titlebar. Implemented on macOS, Windows and Linux; the web backend does nothing.
Sourcefn can_start_external_drag(&self) -> bool
fn can_start_external_drag(&self) -> bool
Returns whether this window can start a drag to another application.
Sourcefn start_external_drag(&self, _payload: &ExternalDragPayload) -> bool
fn start_external_drag(&self, _payload: &ExternalDragPayload) -> bool
Starts a drag of payload to another application. Returns true if the drag started.
Sourcefn start_window_resize(&self, _edge: ResizeEdge)
fn start_window_resize(&self, _edge: ResizeEdge)
Starts an interactive resize from edge. Linux only.
Sourcefn set_exclusive_zone(&self, _zone: Pixels)
fn set_exclusive_zone(&self, _zone: Pixels)
Reserves zone logical pixels at the screen edge for a layer-shell surface. Wayland only.
Sourcefn set_exclusive_edge(&self, _edge: Anchor)
fn set_exclusive_edge(&self, _edge: Anchor)
Sets the screen edge that a layer-shell exclusive zone uses. Wayland only.
Sourcefn set_input_region(&self, _region: Option<&[Bounds<Pixels>]>)
fn set_input_region(&self, _region: Option<&[Bounds<Pixels>]>)
Limits input to region, in logical pixels. None lets the whole window take input. Linux only.
Sourcefn window_decorations(&self) -> Decorations
fn window_decorations(&self) -> Decorations
Returns the decorations the window is using. The default is Decorations::Server.
Sourcefn set_app_id(&mut self, _app_id: &str)
fn set_app_id(&mut self, _app_id: &str)
Sets the application id that the window manager uses to group windows and find the desktop entry. Linux only.
Sourcefn map_window(&mut self) -> Result<()>
fn map_window(&mut self) -> Result<()>
Maps the window so the platform shows it. The default does nothing and returns Ok(()).
Sourcefn window_controls(&self) -> WindowControls
fn window_controls(&self) -> WindowControls
Returns which window controls the platform supports.
Sourcefn set_client_inset(&self, _inset: Pixels)
fn set_client_inset(&self, _inset: Pixels)
Sets the width of the client-side shadow that surrounds the window, in logical pixels. Linux only.
Sourcefn gpu_context(&self) -> Option<Box<dyn Any>>
fn gpu_context(&self) -> Option<Box<dyn Any>>
Returns the GPU context for this window’s renderer.
The returned Box contains (Arc<wgpu::Device>, Arc<wgpu::Queue>).
Sourcefn gpu_context_info(&self) -> Option<Box<dyn Any>>
fn gpu_context_info(&self) -> Option<Box<dyn Any>>
Returns typed backend-specific GPU context information for custom controls. The value is intentionally type-erased in this crate so the core UI crate does not depend on a rendering backend.
Sourcefn gpu_device_lost(&self) -> Option<bool>
fn gpu_device_lost(&self) -> Option<bool>
Whether this window’s GPU device has been lost (the platform renderer
recovers it on a subsequent draw). None when the backend cannot
know. Safe to call mid-recovery, unlike gpu_context. Embedders that
captured the device from gpu_context should stop submitting while
this is Some(true) and re-acquire the device once it reads
Some(false) again.
Sourcefn insets(&self) -> WindowInsets
fn insets(&self) -> WindowInsets
The regions of this window currently obscured or reserved by the system. Zero on platforms without such regions.
Sourcefn on_insets_changed(&self, _callback: Box<dyn FnMut(WindowInsets)>)
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.
Sourcefn set_back_handler(&self, _callback: Box<dyn FnMut()>)
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).
Sourcefn set_back_enabled(&self, _enabled: bool)
fn set_back_enabled(&self, _enabled: bool)
Declares whether the application would currently handle the system back action (e.g. navigation depth > 0).
Sourcefn show_soft_keyboard(&self)
fn show_soft_keyboard(&self)
Requests that the soft keyboard be shown. Mobile only.
Sourcefn hide_soft_keyboard(&self)
fn hide_soft_keyboard(&self)
Requests that the soft keyboard be hidden. Mobile only.
Sourcefn text_input_state_changed(&self, _change: TextInputStateChange)
fn text_input_state_changed(&self, _change: TextInputStateChange)
Tells the platform that the focused text input changed.
Sourcefn play_system_bell(&self)
fn play_system_bell(&self)
Plays the system alert sound.
Sourcefn a11y_init(&self, _callbacks: A11yCallbacks)
fn a11y_init(&self, _callbacks: A11yCallbacks)
Initialize the accessibility adapter with callbacks.
Sourcefn a11y_tree_update(&self, _tree_update: TreeUpdate)
fn a11y_tree_update(&self, _tree_update: TreeUpdate)
Provide a TreeUpdate to the accessibility adapter.
Sourcefn a11y_update_window_bounds(&self)
fn a11y_update_window_bounds(&self)
Inform the adapter of updated window bounds.
Sourcefn as_test(&mut self) -> Option<&mut TestWindow>
fn as_test(&mut self) -> Option<&mut TestWindow>
Returns this window as a TestWindow, if it is one. Only the test platform’s windows are.
Sourcefn render_to_image(&self, _scene: &Scene) -> Result<RgbaImage>
fn render_to_image(&self, _scene: &Scene) -> Result<RgbaImage>
Renders the given scene to a texture and returns the pixel data as an RGBA image. This does not present the frame to screen - useful for visual testing where we want to capture what would be rendered without displaying it or requiring the window to be visible.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".