pub(crate) trait PlatformWindow {
Show 30 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 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§
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
Sourcefn request_repaint(&self, _: &ServoShellWindow)
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.
Sourcefn request_resize(
&self,
webview: &WebView,
outer_size: DeviceIntSize,
) -> Option<DeviceIntSize>
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``
fn new_glwindow(&self, event_loop: &ActiveEventLoop) -> Rc<dyn GlWindow>
Sourcefn rendering_context(&self) -> Rc<dyn RenderingContext>
fn rendering_context(&self) -> Rc<dyn RenderingContext>
This returns RenderingContext matching the viewport.
fn window_rect(&self) -> DeviceIndependentIntRect
Provided Methods§
Sourcefn update_user_interface_state(
&self,
_: &RunningAppState,
_: &ServoShellWindow,
) -> bool
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.
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)
Sourcefn as_headed_window(&self) -> Option<&HeadedWindow>
fn as_headed_window(&self) -> Option<&HeadedWindow>
If this window is a headed window, access the concrete type.