feat(servo-shell): add weft-shell-protocol client-side binding

Generate client-side protocol types from weft-shell-unstable-v1.xml
using wayland-scanner, following the same module structure as the
compositor server side.

- crates/weft-servo-shell/src/protocols/mod.rs: generate_interfaces!
  inside __interfaces submodule, generate_client_code! at client module
  level, with use wayland_client in scope. Re-exports
  ZweftShellManagerV1 and ZweftShellWindowV1 for use by embed_servo
  once the Wayland connection is established.

- New deps: wayland-client, wayland-backend, wayland-scanner, bitflags
  (version-matched to existing workspace resolution).

The binding compiles but is not yet wired into embed_servo(); that
connection is deferred until the Servo embedder contract is ready.
This commit is contained in:
Marco Allegretti 2026-03-11 08:05:03 +01:00
parent 18f92cc341
commit 2bb657e8fc
4 changed files with 30 additions and 0 deletions

4
Cargo.lock generated
View file

@ -2274,8 +2274,12 @@ name = "weft-servo-shell"
version = "0.1.0"
dependencies = [
"anyhow",
"bitflags 2.11.0",
"tracing",
"tracing-subscriber",
"wayland-backend",
"wayland-client",
"wayland-scanner",
]
[[package]]

View file

@ -12,3 +12,7 @@ path = "src/main.rs"
anyhow = "1.0"
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
wayland-client = "0.31"
wayland-backend = "0.3"
wayland-scanner = "0.31"
bitflags = "2"

View file

@ -2,6 +2,8 @@ use std::path::PathBuf;
use anyhow::Context;
mod protocols;
fn main() -> anyhow::Result<()> {
tracing_subscriber::fmt()
.with_env_filter(

View file

@ -0,0 +1,20 @@
#[allow(dead_code, non_camel_case_types, unused_unsafe, unused_variables)]
#[allow(non_upper_case_globals, non_snake_case, unused_imports)]
#[allow(missing_docs, clippy::all)]
pub mod client {
use wayland_client;
use wayland_client::protocol::*;
pub mod __interfaces {
use wayland_client::protocol::__interfaces::*;
wayland_scanner::generate_interfaces!("../../protocol/weft-shell-unstable-v1.xml");
}
use self::__interfaces::*;
wayland_scanner::generate_client_code!("../../protocol/weft-shell-unstable-v1.xml");
}
#[allow(unused_imports)]
pub use client::zweft_shell_manager_v1::ZweftShellManagerV1;
#[allow(unused_imports)]
pub use client::zweft_shell_window_v1::ZweftShellWindowV1;