diff --git a/Cargo.lock b/Cargo.lock index 08e74ca..0faf03a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -462,6 +462,16 @@ version = "0.1.0" name = "ferese-malformed-client" version = "0.1.0" +[[package]] +name = "ferese-protocols" +version = "0.1.0" +dependencies = [ + "wayland-backend", + "wayland-client", + "wayland-scanner", + "wayland-server", +] + [[package]] name = "feresectl" version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml index 5e7d86c..9dade15 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,6 +6,7 @@ members = [ "crates/ferese-core", "crates/ferese-ipc", "crates/ferese-layout", + "crates/ferese-protocols", "tools/ferese-malformed-client", ] resolver = "3" @@ -36,3 +37,7 @@ serde = { version = "1.0.228", features = ["derive"] } serde_json = "1.0.145" toml = "0.9.7" xcursor = "0.3.11" +wayland-backend = "0.3.17" +wayland-client = "0.31.15" +wayland-scanner = "0.31.11" +wayland-server = "0.31.14" diff --git a/crates/ferese-protocols/Cargo.toml b/crates/ferese-protocols/Cargo.toml new file mode 100644 index 0000000..cf577df --- /dev/null +++ b/crates/ferese-protocols/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "ferese-protocols" +version.workspace = true +edition.workspace = true +license.workspace = true +rust-version.workspace = true + +[features] +default = ["client", "server"] +client = ["dep:wayland-client"] +server = ["dep:wayland-server"] + +[dependencies] +wayland-backend.workspace = true +wayland-client = { workspace = true, optional = true } +wayland-scanner.workspace = true +wayland-server = { workspace = true, optional = true } diff --git a/crates/ferese-protocols/src/lib.rs b/crates/ferese-protocols/src/lib.rs new file mode 100644 index 0000000..3cde75d --- /dev/null +++ b/crates/ferese-protocols/src/lib.rs @@ -0,0 +1,57 @@ +//! Generated bindings for Ferese-private Wayland protocols. + +#![forbid(unsafe_code)] + +/// Semantic surface effects protocol. +pub mod effects { + /// Version 1 of the semantic surface effects protocol. + pub mod v1 { + #[cfg(feature = "client")] + pub use generated::client; + #[cfg(feature = "server")] + pub use generated::server; + + mod generated { + #![allow( + dead_code, + non_camel_case_types, + non_upper_case_globals, + non_snake_case, + unused_imports, + unused_unsafe, + unused_variables, + clippy::all + )] + + #[cfg(feature = "client")] + pub mod client { + use wayland_client; + use wayland_client::protocol::*; + + pub mod __interfaces { + use wayland_client::protocol::__interfaces::*; + + wayland_scanner::generate_interfaces!("../../protocols/ferese-effects-v1.xml"); + } + use self::__interfaces::*; + + wayland_scanner::generate_client_code!("../../protocols/ferese-effects-v1.xml"); + } + + #[cfg(feature = "server")] + pub mod server { + use wayland_server; + use wayland_server::protocol::*; + + pub mod __interfaces { + use wayland_server::protocol::__interfaces::*; + + wayland_scanner::generate_interfaces!("../../protocols/ferese-effects-v1.xml"); + } + use self::__interfaces::*; + + wayland_scanner::generate_server_code!("../../protocols/ferese-effects-v1.xml"); + } + } + } +} diff --git a/protocols/ferese-effects-v1.xml b/protocols/ferese-effects-v1.xml new file mode 100644 index 0000000..2b566dd --- /dev/null +++ b/protocols/ferese-effects-v1.xml @@ -0,0 +1,82 @@ + + + + Copyright 2026 Ferese contributors + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + + + + + This private global is visible only to clients granted the Ferese effects + capability. Roles describe compositor-owned appearance policy and do not + expose shader parameters or backdrop content to the client. + + + + + + + + + A wl_surface can have at most one live surface-effects object. Creating + another object for the same surface is a protocol error. + + + + + + + + + + + + + The role affects only compositor rendering. It does not change surface + geometry, input, focus, stacking, or the surface's Wayland role. + + + + + + + + + The most recent valid role replaces the previous role atomically. + + + + + + + + + + + + + + + + + + +