Skip to main content

PlatformWindow

Trait PlatformWindow 

Source
pub(crate) trait PlatformWindow {
Show 31 methods // Required methods fn id(&self) -> ServoShellWindowId; fn screen_geometry(&self) -> ScreenGeometry; fn device_hidpi_scale_factor( &self, ) -> Scale<f32, DeviceIndependentPixel, DevicePixel>; fn hidpi_scale_factor( &self, ) -> Scale<f32, DeviceIndependentPixel, DevicePixel>; fn get_fullscreen(&self) -> bool; fn request_repaint(&self, _: &ServoShellWindow); fn request_resize( &self, webview: &WebView, outer_size: DeviceIntSize, ) -> Option<DeviceIntSize>; fn new_glwindow(&self, event_loop: &ActiveEventLoop) -> Rc<dyn GlWindow>; fn rendering_context(&self) -> Rc<dyn RenderingContext>; fn window_rect(&self) -> DeviceIndependentIntRect; // Provided methods fn rebuild_user_interface(&self, _: &RunningAppState, _: &ServoShellWindow) { ... } fn update_user_interface_state( &self, _: &RunningAppState, _: &ServoShellWindow, ) -> bool { ... } fn set_position(&self, _point: DeviceIntPoint) { ... } fn set_fullscreen(&self, _state: bool) { ... } fn set_cursor(&self, _cursor: Cursor) { ... } fn theme(&self) -> Theme { ... } fn maximize(&self, _: &WebView) { ... } fn focus(&self) { ... } fn has_platform_focus(&self) -> bool { ... } fn show_embedder_control(&self, _: WebViewId, _: EmbedderControl) { ... } fn hide_embedder_control(&self, _: WebViewId, _: EmbedderControlId) { ... } fn dismiss_embedder_controls_for_webview(&self, _: WebViewId) { ... } fn show_bluetooth_device_dialog( &self, _: WebViewId, _request: BluetoothDeviceSelectionRequest, ) { ... } fn show_permission_dialog(&self, _: WebViewId, _: PermissionRequest) { ... } fn show_http_authentication_dialog( &self, _: WebViewId, _: AuthenticationRequest, ) { ... } fn notify_input_event_handled( &self, _webview: &WebView, _id: InputEventId, _result: InputEventResult, ) { ... } fn notify_media_session_event(&self, _: MediaSessionEvent) { ... } fn notify_crashed( &self, _: WebView, _reason: String, _backtrace: Option<String>, ) { ... } fn show_console_message(&self, _level: ConsoleLogLevel, _message: &str) { ... } fn as_headed_window(&self) -> Option<&HeadedWindow> { ... } fn notify_accessibility_tree_update(&self, _: WebView, _: TreeUpdate) { ... }
}
Expand description

A PlatformWindow abstracts away the differents kinds of platform windows that might be used in a servoshell execution. This currently includes headed (winit) and headless windows.

Required Methods§

Source

fn id(&self) -> ServoShellWindowId

Source

fn screen_geometry(&self) -> ScreenGeometry

Source

fn device_hidpi_scale_factor( &self, ) -> Scale<f32, DeviceIndependentPixel, DevicePixel>

Source

fn hidpi_scale_factor(&self) -> Scale<f32, DeviceIndependentPixel, DevicePixel>

Source

fn get_fullscreen(&self) -> bool

Source

fn request_repaint(&self, _: &ServoShellWindow)

Request that the window redraw itself. It is up to the window to do this once the windowing system is ready. If this is a headless window, the redraw will happen immediately.

Source

fn request_resize( &self, webview: &WebView, outer_size: DeviceIntSize, ) -> Option<DeviceIntSize>

Request a new outer size for the window, including external decorations. This should be the same as window.outerWidth and `window.outerHeight``

Source

fn new_glwindow(&self, event_loop: &ActiveEventLoop) -> Rc<dyn GlWindow>

Source

fn rendering_context(&self) -> Rc<dyn RenderingContext>

This returns RenderingContext matching the viewport.

Source

fn window_rect(&self) -> DeviceIndependentIntRect

Provided Methods§

Source

fn rebuild_user_interface(&self, _: &RunningAppState, _: &ServoShellWindow)

Request that the Window rebuild its user interface, if it has one. This should not repaint, but should prepare the user interface for painting when it is actually requested.

Source

fn update_user_interface_state( &self, _: &RunningAppState, _: &ServoShellWindow, ) -> bool

Inform the Window that the state of a WebView has changed and that it should do an incremental update of user interface state. Returns true if the user interface actually changed and a rebuild and repaint is needed, false otherwise.

Source

fn set_position(&self, _point: DeviceIntPoint)

Source

fn set_fullscreen(&self, _state: bool)

Source

fn set_cursor(&self, _cursor: Cursor)

Source

fn theme(&self) -> Theme

Source

fn maximize(&self, _: &WebView)

Source

fn focus(&self)

Source

fn has_platform_focus(&self) -> bool

Source

fn show_embedder_control(&self, _: WebViewId, _: EmbedderControl)

Source

fn hide_embedder_control(&self, _: WebViewId, _: EmbedderControlId)

Source

fn dismiss_embedder_controls_for_webview(&self, _: WebViewId)

Source

fn show_bluetooth_device_dialog( &self, _: WebViewId, _request: BluetoothDeviceSelectionRequest, )

Source

fn show_permission_dialog(&self, _: WebViewId, _: PermissionRequest)

Source

fn show_http_authentication_dialog( &self, _: WebViewId, _: AuthenticationRequest, )

Source

fn notify_input_event_handled( &self, _webview: &WebView, _id: InputEventId, _result: InputEventResult, )

Source

fn notify_media_session_event(&self, _: MediaSessionEvent)

Source

fn notify_crashed( &self, _: WebView, _reason: String, _backtrace: Option<String>, )

Source

fn show_console_message(&self, _level: ConsoleLogLevel, _message: &str)

Source

fn as_headed_window(&self) -> Option<&HeadedWindow>

If this window is a headed window, access the concrete type.

Source

fn notify_accessibility_tree_update(&self, _: WebView, _: TreeUpdate)

Implementors§