servoshell: Port desktop servoshell to use delegate API (#35284)

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Delan Azabani <dazabani@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
This commit is contained in:
Martin Robinson 2025-02-06 08:33:31 +01:00 committed by GitHub
parent 6b12499077
commit 5f08e4fa76
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 1109 additions and 1258 deletions

View file

@ -7,14 +7,13 @@
use std::rc::Rc;
use arboard::Clipboard;
use euclid::{Length, Scale};
use servo::compositing::windowing::WindowMethods;
use servo::servo_geometry::DeviceIndependentPixel;
use servo::webrender_api::units::{DeviceIntPoint, DeviceIntSize, DevicePixel};
use servo::{Cursor, Servo};
use servo::{Cursor, WebView};
use super::webview::{WebView, WebViewManager};
use super::app_state::RunningAppState;
// This should vary by zoom level and maybe actual text size (focused or under cursor)
pub const LINE_HEIGHT: f32 = 38.0;
@ -31,13 +30,7 @@ pub trait WindowPortsMethods: WindowMethods {
) -> Option<Scale<f32, DeviceIndependentPixel, DevicePixel>>;
fn page_height(&self) -> f32;
fn get_fullscreen(&self) -> bool;
fn handle_winit_event(
&self,
servo: &Servo,
clipboard: &mut Option<Clipboard>,
webviews: &mut WebViewManager,
event: winit::event::WindowEvent,
);
fn handle_winit_event(&self, state: Rc<RunningAppState>, event: winit::event::WindowEvent);
fn is_animating(&self) -> bool;
fn set_title(&self, _title: &str) {}
/// Request a new inner size for the window, not including external decorations.