libservo: Add a ClipboardDelegate and a default implementation (#35297)

Add a `ClipboardDelegate` to the `WebView` API and a default
implementation in libservo for this delegate that works on Mac, Windows,
and Linux. Support for Android will be added in the future. This means
that embedders do not need to do anything special to get clipboard
support, but can choose to override it or implement it for other
platforms.

In addition, this adds support for handling fetches of clipboard contents
and renames things to reflect that eventually other types of clipboard
content will be supported. Part of this is removing the string
argument from the `ClipboardEventType::Paste` enum because script will
need to get other types of content from the clipboard than just a
string. It now talks to the embedder to get this information directly.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
Martin Robinson 2025-02-07 11:43:46 +01:00 committed by GitHub
parent b5b69988cc
commit 19e41ab9f9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 212 additions and 127 deletions

View file

@ -105,7 +105,6 @@ serde_json = { workspace = true }
[target.'cfg(not(any(target_os = "android", target_env = "ohos")))'.dependencies]
# For optional feature servo_allocator/use-system-allocator
servo_allocator = { path = "../../components/allocator" }
arboard = { version = "3" }
dirs = "5.0"
egui = { version = "0.31.0" }
egui_glow = { version = "0.31.0", features = ["winit"] }