PlatformWindow

Trait PlatformWindow 

Source
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; fn focused(&self) -> bool; // Provided methods fn rebuild_user_interface(&self, _: &RunningAppState, _: &ServoShellWindow) { ... } fn update_user_interface_state( &self, _: &RunningAppState, _: &ServoShellWindow, ) -> bool { ... } fn handle_winit_window_event( &self, _: Rc<RunningAppState>, _: &ServoShellWindow, _: WindowEvent, ) { ... } fn handle_winit_app_event(&self, _: AppEvent) { ... } fn take_user_interface_commands(&self) -> Vec<UserInterfaceCommand> { ... } 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 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, _devices: Vec<String>, _: GenericSender<Option<String>>, ) { ... } 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>, ) { ... }
}
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

Source

fn focused(&self) -> bool

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 handle_winit_window_event( &self, _: Rc<RunningAppState>, _: &ServoShellWindow, _: WindowEvent, )

Handle a winit [WindowEvent]. Returns true if the event loop should continue and false otherwise.

TODO: This should be handled internally in the winit window if possible so that it makes more sense when we are mixing headed and headless windows.

Source

fn handle_winit_app_event(&self, _: AppEvent)

Handle a winit [AppEvent]. Returns true if the event loop should continue and false otherwise.

TODO: This should be handled internally in the winit window if possible so that it makes more sense when we are mixing headed and headless windows.

Source

fn take_user_interface_commands(&self) -> Vec<UserInterfaceCommand>

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 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, _devices: Vec<String>, _: GenericSender<Option<String>>, )

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>, )

Implementors§

Source§

impl PlatformWindow for servoshell::desktop::headed_window::Window

Source§

impl PlatformWindow for servoshell::desktop::headless_window::Window