From 6d8fb37db4845e9b0acaf8a02367613417b97724 Mon Sep 17 00:00:00 2001 From: Julian Orth Date: Sat, 20 Sep 2025 18:35:49 +0200 Subject: [PATCH 1/2] xml-to-wire: add new utility --- Cargo.lock | 28 +- Cargo.toml | 2 +- xml-to-wire/Cargo.toml | 8 + xml-to-wire/src/ast.rs | 80 +++++ xml-to-wire/src/builder.rs | 130 +++++++++ xml-to-wire/src/main.rs | 15 + xml-to-wire/src/parser.rs | 577 +++++++++++++++++++++++++++++++++++++ 7 files changed, 829 insertions(+), 11 deletions(-) create mode 100644 xml-to-wire/Cargo.toml create mode 100644 xml-to-wire/src/ast.rs create mode 100644 xml-to-wire/src/builder.rs create mode 100644 xml-to-wire/src/main.rs create mode 100644 xml-to-wire/src/parser.rs diff --git a/Cargo.lock b/Cargo.lock index 397c2b5e..300b1cc8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -106,9 +106,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.95" +version = "1.0.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" +checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61" [[package]] name = "arrayref" @@ -1007,18 +1007,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.93" +version = "1.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" +checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de" dependencies = [ "unicode-ident", ] [[package]] name = "quick-xml" -version = "0.38.0" +version = "0.38.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8927b0664f5c5a98265138b7e3f90aa19a6b21353182469ace36d4ac527b7b1b" +checksum = "42a232e7487fc2ef313d96dde7948e7a3c05101870d8985e4fd8d26aedd27b89" dependencies = [ "memchr", ] @@ -1352,18 +1352,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.11" +version = "2.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d452f284b73e6d76dd36758a0c8684b1d5be31f92b89d07fd5822175732206fc" +checksum = "3467d614147380f2e4e374161426ff399c91084acd2363eaf549172b3d5e60c0" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "2.0.11" +version = "2.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2" +checksum = "6c5e1be1c48b9172ee610da68fd9cd2770e7a4056cb3fc98710ee6906f0c7960" dependencies = [ "proc-macro2", "quote", @@ -1733,6 +1733,14 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "xml-to-wire" +version = "0.1.0" +dependencies = [ + "quick-xml", + "thiserror", +] + [[package]] name = "zerocopy" version = "0.7.35" diff --git a/Cargo.toml b/Cargo.toml index bb3a346e..05379806 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ name = "jay" path = "src/main.rs" [workspace] -members = ["jay-config", "toml-config", "algorithms", "toml-spec", "wire-to-xml"] +members = ["jay-config", "toml-config", "algorithms", "toml-spec", "wire-to-xml", "xml-to-wire"] [profile.release] panic = "abort" diff --git a/xml-to-wire/Cargo.toml b/xml-to-wire/Cargo.toml new file mode 100644 index 00000000..055ec7d1 --- /dev/null +++ b/xml-to-wire/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "xml-to-wire" +version = "0.1.0" +edition = "2024" + +[dependencies] +quick-xml = "0.38.3" +thiserror = "2.0.16" diff --git a/xml-to-wire/src/ast.rs b/xml-to-wire/src/ast.rs new file mode 100644 index 00000000..b21b94bb --- /dev/null +++ b/xml-to-wire/src/ast.rs @@ -0,0 +1,80 @@ +pub(crate) struct Protocol { + pub(crate) _name: String, + pub(crate) _copyright: Option, + pub(crate) _description: Option, + pub(crate) interfaces: Vec, +} + +pub(crate) struct Copyright { + pub(crate) _body: String, +} + +#[derive(Debug)] +pub(crate) struct Description { + pub(crate) _summary: Option, + pub(crate) _body: String, +} + +pub(crate) struct Interface { + pub(crate) name: String, + pub(crate) _version: u32, + pub(crate) _description: Option, + pub(crate) messages: Vec, + pub(crate) _enums: Vec, +} + +#[derive(Debug)] +pub(crate) struct Arg { + pub(crate) name: String, + pub(crate) ty: ArgType, + pub(crate) _summary: Option, + pub(crate) _description: Option, + pub(crate) interface: Option, + pub(crate) allow_null: bool, + pub(crate) enum_: Option, +} + +#[derive(Copy, Clone, Debug, PartialEq)] +pub(crate) enum ArgType { + NewId, + Int, + Uint, + Fixed, + String, + Object, + Array, + Fd, +} + +#[derive(Copy, Clone, Debug, PartialEq)] +pub(crate) enum MessageType { + Destructor, +} + +pub(crate) struct Entry { + pub(crate) _name: String, + pub(crate) _value: String, + pub(crate) _value_u32: u32, + pub(crate) _summary: Option, + pub(crate) _since: Option, + pub(crate) _deprecated_since: Option, + pub(crate) _description: Option, +} + +pub(crate) struct Enum { + pub(crate) _name: String, + pub(crate) _since: Option, + pub(crate) _bitfield: bool, + pub(crate) _description: Option, + pub(crate) _entries: Vec, +} + +pub(crate) struct Message { + pub(crate) name: String, + pub(crate) request: bool, + pub(crate) ty: Option, + pub(crate) since: Option, + pub(crate) _deprecated_since: Option, + pub(crate) _description: Option, + pub(crate) args: Vec, +} diff --git a/xml-to-wire/src/builder.rs b/xml-to-wire/src/builder.rs new file mode 100644 index 00000000..ec7ce457 --- /dev/null +++ b/xml-to-wire/src/builder.rs @@ -0,0 +1,130 @@ +use { + crate::{ + ast::{ArgType, Message, MessageType}, + parser::{ParserError, parse}, + }, + std::{ + fs::File, + io::{self, BufWriter, Write}, + mem, + }, + thiserror::Error, +}; + +#[derive(Debug, Error)] +pub enum BuilderError { + #[error("Could not process {0}")] + File(String, #[source] Box), + #[error("Could not read file")] + ReadFile(#[source] io::Error), + #[error("Could not parse file")] + ParseFile(#[source] ParserError), + #[error("Could not format file")] + FormatFile(#[source] io::Error), + #[error("Could not open {0} for writing")] + OpenFile(String, #[source] io::Error), +} + +pub fn handle_file(path: &str) -> Result<(), BuilderError> { + handle_file_(path).map_err(|e| BuilderError::File(path.to_string(), Box::new(e))) +} + +fn handle_file_(path: &str) -> Result<(), BuilderError> { + let data = std::fs::read(path).map_err(BuilderError::ReadFile)?; + let protocols = parse(&data).map_err(BuilderError::ParseFile)?; + for protocol in protocols { + for i in protocol.interfaces { + let path = format!("wire/{}.txt", i.name); + let mut file = + BufWriter::new(File::create(&path).map_err(|e| BuilderError::OpenFile(path, e))?); + let mut not_first = false; + let mut handle_msg = |msg: &Message| -> Result<(), io::Error> { + if not_first { + writeln!(file)?; + } + not_first = true; + let ty = match msg.request { + true => "request", + false => "event", + }; + write!(file, "{ty} {} ", msg.name)?; + if msg.ty.is_some() || msg.since.is_some() { + write!(file, "(")?; + let mut needs_comma = false; + let handle_comma = + |needs_comma: &mut bool, file: &mut BufWriter| -> io::Result<()> { + if mem::take(needs_comma) { + write!(file, ", ")?; + } + Ok(()) + }; + if let Some(ty) = msg.ty { + match ty { + MessageType::Destructor => { + handle_comma(&mut needs_comma, &mut file)?; + write!(file, "destructor")?; + needs_comma = true; + } + } + } + if let Some(s) = msg.since { + handle_comma(&mut needs_comma, &mut file)?; + write!(file, "since = {}", s)?; + needs_comma = true; + } + let _ = needs_comma; + write!(file, ") ")?; + } + writeln!(file, "{{")?; + let mut args = msg.args.iter().peekable(); + while let Some(arg) = args.next() { + if arg.ty == ArgType::Uint + && arg.enum_.is_none() + && let Some(prefix) = arg.name.strip_suffix("_hi") + && let Some(next) = args.peek() + && next.ty == ArgType::Uint + && next.enum_.is_none() + && next.name.strip_prefix(prefix) == Some("_lo") + { + writeln!(file, " {prefix}: u64,")?; + args.next(); + continue; + } + write!(file, " {}: ", arg.name)?; + 'ty: { + let ty = match arg.ty { + ArgType::NewId | ArgType::Object => { + write!( + file, + "id({})", + arg.interface.as_deref().unwrap_or("object") + )?; + if arg.ty == ArgType::NewId { + write!(file, " (new)")?; + } + break 'ty; + } + ArgType::Int => "i32", + ArgType::Uint => "u32", + ArgType::Fixed => "fixed", + ArgType::String => match arg.allow_null { + true => "optstr", + false => "str", + }, + ArgType::Array => "array(pod(u8))", + ArgType::Fd => "fd", + }; + write!(file, "{}", ty)?; + } + writeln!(file, ",")?; + } + writeln!(file, "}}")?; + Ok(()) + }; + for m in &i.messages { + handle_msg(m).map_err(BuilderError::FormatFile)?; + } + } + } + Ok(()) +} diff --git a/xml-to-wire/src/main.rs b/xml-to-wire/src/main.rs new file mode 100644 index 00000000..f4cedfa6 --- /dev/null +++ b/xml-to-wire/src/main.rs @@ -0,0 +1,15 @@ +use { + crate::builder::{BuilderError, handle_file}, + std::env::args, +}; + +mod ast; +mod builder; +mod parser; + +fn main() -> Result<(), BuilderError> { + for xml in args().skip(1) { + handle_file(&xml)?; + } + Ok(()) +} diff --git a/xml-to-wire/src/parser.rs b/xml-to-wire/src/parser.rs new file mode 100644 index 00000000..8ecf8c55 --- /dev/null +++ b/xml-to-wire/src/parser.rs @@ -0,0 +1,577 @@ +use { + crate::ast::{ + Arg, ArgType, Copyright, Description, Entry, Enum, Interface, Message, MessageType, + Protocol, + }, + quick_xml::{ + Reader, + events::{ + Event, + attributes::{AttrError, Attribute, Attributes}, + }, + }, + std::{ + borrow::Cow, + num::ParseIntError, + str::{FromStr, ParseBoolError}, + string::FromUtf8Error, + }, + thiserror::Error, +}; + +#[derive(Debug, Error)] +pub(crate) enum ParserError { + #[error("Could not parse a protocol element")] + Protocol(#[from] ProtocolError), + #[error("Could not read the next event")] + ReadEvent(#[from] quick_xml::Error), +} + +#[derive(Debug, Error)] +pub(crate) enum ProtocolError { + #[error("Could not parse an attribute")] + Attribute(#[from] AttributeError), + #[error("Protocol does not have a name")] + MissingName, + #[error("Could not read the next event")] + ReadEvent(#[from] quick_xml::Error), + #[error("Could not the copyright element")] + Copyright(#[from] CopyrightError), + #[error("Could not parse the description element")] + Description(#[from] DescriptionError), + #[error("Could not parse an interface element")] + Interface(#[from] InterfaceError), +} + +#[derive(Debug, Error)] +pub(crate) enum CopyrightError { + #[error("Could not read the next event")] + ReadEvent(#[from] quick_xml::Error), + #[error("Could not decode the body as UTF-8")] + DecodeUtf8(#[source] FromUtf8Error), +} + +#[derive(Debug, Error)] +pub(crate) enum DescriptionError { + #[error("Could not parse an attribute")] + Attribute(#[from] AttributeError), + #[error("Could not read the next event")] + ReadEvent(#[from] quick_xml::Error), + #[error("Could not decode the body as UTF-8")] + DecodeUtf8(#[source] FromUtf8Error), +} + +#[derive(Debug, Error)] +pub(crate) enum InterfaceError { + #[error("Interface has no name")] + MissingName, + #[error("Interface has no version")] + MissingVersion, + #[error("Could not parse an attribute")] + Attribute(#[from] AttributeError), + #[error("Could not read the next event")] + ReadEvent(#[from] quick_xml::Error), + #[error("Could not parse the version")] + Version(#[source] ParseIntError), + #[error("Could not parse a request element")] + Request(#[source] MessageError), + #[error("Could not parse an event element")] + Event(#[source] MessageError), + #[error("Could not parse the description element")] + Description(#[from] DescriptionError), + #[error("Could not parse an enum element")] + Enum(#[from] EnumError), +} + +#[derive(Debug, Error)] +pub(crate) enum MessageError { + #[error("Message has no name")] + MissingName, + #[error("Could not parse an attribute")] + Attribute(#[from] AttributeError), + #[error("Could not read the next event")] + ReadEvent(#[from] quick_xml::Error), + #[error("Could not parse the since attribute")] + Since(#[source] ParseIntError), + #[error("Could not parse the deprecated-since attribute")] + DeprecatedSince(#[source] ParseIntError), + #[error("Unknown message type {}", .0)] + UnknownMessageType(String), + #[error("Could not parse an argument element")] + Arg(#[from] ArgError), + #[error("Could not the description element")] + Description(#[from] DescriptionError), +} + +#[derive(Debug, Error)] +pub(crate) enum ArgError { + #[error("Argument has no name")] + MissingName, + #[error("Argument has no type")] + MissingType, + #[error("Could not parse an attribute")] + Attribute(#[from] AttributeError), + #[error("Could not read the next event")] + ReadEvent(#[from] quick_xml::Error), + #[error("Could not parse the allow-null attribute")] + AllowNull(#[source] ParseBoolError), + #[error("Unknown arg type {}", .0)] + UnknownArgType(String), + #[error("Could not the description element")] + Description(#[from] DescriptionError), +} + +#[derive(Debug, Error)] +pub(crate) enum EnumError { + #[error("Enum has no name")] + MissingName, + #[error("Could not parse an attribute")] + Attribute(#[from] AttributeError), + #[error("Could not read the next event")] + ReadEvent(#[from] quick_xml::Error), + #[error("Could not parse the allow-null attribute")] + AllowNull(#[source] ParseBoolError), + #[error("Could not the description element")] + Description(#[from] DescriptionError), + #[error("Could not parse the since attribute")] + Since(#[source] ParseIntError), + #[error("Could not an entry element")] + Entry(#[from] EntryError), +} + +#[derive(Debug, Error)] +pub(crate) enum EntryError { + #[error("Entry has no name")] + MissingName, + #[error("Entry has no value")] + MissingValue, + #[error("Value could not be parsed")] + InvalidValue(#[source] ParseIntError), + #[error("Could not parse an attribute")] + Attribute(#[from] AttributeError), + #[error("Could not read the next event")] + ReadEvent(#[from] quick_xml::Error), + #[error("Could not the description element")] + Description(#[from] DescriptionError), + #[error("Could not parse the since attribute")] + Since(#[source] ParseIntError), + #[error("Could not parse the deprecated-since attribute")] + DeprecatedSince(#[source] ParseIntError), +} + +#[derive(Debug, Error)] +pub(crate) enum AttributeError { + #[error("quick_xml returned an error")] + QuickXml(#[from] AttrError), + #[error("Could not decode the value as UTF-8")] + DecodeUtf8(#[from] quick_xml::Error), +} + +pub(crate) fn parse(input: &[u8]) -> Result, ParserError> { + let mut reader = Reader::from_reader(input); + let mut protocols = Vec::new(); + loop { + let event = reader.read_event().map_err(ParserError::ReadEvent)?; + let (start, empty) = match event { + Event::Start(s) => (s, false), + Event::Empty(s) => (s, true), + Event::Eof => break, + _ => continue, + }; + match start.local_name().as_ref() { + b"protocol" => protocols.push(parse_protocol(&mut reader, start.attributes(), empty)?), + _ => continue, + } + } + Ok(protocols) +} + +macro_rules! parse_attr { + ($attr:expr) => { + match $attr { + Ok(ref attr) => parse_attr(attr), + Err(e) => return Err(AttributeError::QuickXml(e).into()), + } + }; +} + +fn parse_attr<'a>(attr: &'a Attribute) -> Result<(&'a [u8], Cow<'a, str>), AttributeError> { + let name = attr.key.local_name().into_inner(); + let value = attr.unescape_value().map_err(AttributeError::DecodeUtf8)?; + Ok((name, value)) +} + +fn parse_protocol( + reader: &mut Reader<&[u8]>, + attributes: Attributes, + empty: bool, +) -> Result { + let mut name = None; + for attr in attributes { + let (n, value) = parse_attr!(attr)?; + match n { + b"name" => name = Some(value.into_owned()), + _ => continue, + } + } + let mut copyright = None; + let mut description = None; + let mut interfaces = vec![]; + if !empty { + loop { + let event = reader.read_event().map_err(ProtocolError::ReadEvent)?; + let (start, empty) = match event { + Event::Start(s) => (s, false), + Event::End(_) => break, + Event::Empty(s) => (s, true), + _ => continue, + }; + match start.local_name().as_ref() { + b"copyright" => { + copyright = Some(parse_copyright(reader, start.attributes(), empty)?) + } + b"description" => { + description = Some(parse_description(reader, start.attributes(), empty)?) + } + b"interface" => { + interfaces.push(parse_interface(reader, start.attributes(), empty)?) + } + _ => continue, + } + } + } + Ok(Protocol { + _name: name.ok_or(ProtocolError::MissingName)?, + _copyright: copyright, + _description: description, + interfaces, + }) +} + +fn parse_copyright( + reader: &mut Reader<&[u8]>, + _attributes: Attributes, + empty: bool, +) -> Result { + let mut body = Vec::new(); + if !empty { + loop { + let event = reader.read_event().map_err(CopyrightError::ReadEvent)?; + match event { + Event::Text(s) => body.extend_from_slice(s.as_ref()), + Event::End(_) => break, + _ => continue, + } + } + } + Ok(Copyright { + _body: String::from_utf8(body).map_err(CopyrightError::DecodeUtf8)?, + }) +} + +fn parse_description( + reader: &mut Reader<&[u8]>, + attributes: Attributes, + empty: bool, +) -> Result { + let mut summary = None; + for attr in attributes { + let (n, value) = parse_attr!(attr)?; + match n { + b"summary" => summary = Some(value.into_owned()), + _ => continue, + } + } + let mut body = Vec::new(); + if !empty { + loop { + let event = reader.read_event().map_err(DescriptionError::ReadEvent)?; + match event { + Event::Text(s) => body.extend_from_slice(s.as_ref()), + Event::End(_) => break, + _ => continue, + } + } + } + Ok(Description { + _summary: summary, + _body: String::from_utf8(body).map_err(DescriptionError::DecodeUtf8)?, + }) +} + +fn parse_interface( + reader: &mut Reader<&[u8]>, + attributes: Attributes, + empty: bool, +) -> Result { + let mut name = None; + let mut version = None; + for attr in attributes { + let (n, value) = parse_attr!(attr)?; + match n { + b"name" => name = Some(value.into_owned()), + b"version" => version = Some(value.parse().map_err(InterfaceError::Version)?), + _ => continue, + } + } + let mut description = None; + let mut messages = Vec::new(); + let mut enums = Vec::new(); + if !empty { + loop { + let event = reader.read_event().map_err(InterfaceError::ReadEvent)?; + let (start, empty) = match event { + Event::Start(s) => (s, false), + Event::End(_) => break, + Event::Empty(s) => (s, true), + _ => continue, + }; + match start.local_name().as_ref() { + b"description" => { + description = Some(parse_description(reader, start.attributes(), empty)?) + } + b"request" => messages.push( + parse_message(reader, start.attributes(), empty, true) + .map_err(InterfaceError::Request)?, + ), + b"event" => messages.push( + parse_message(reader, start.attributes(), empty, false) + .map_err(InterfaceError::Event)?, + ), + b"enum" => enums.push(parse_enum(reader, start.attributes(), empty)?), + _ => continue, + } + } + } + Ok(Interface { + name: name.ok_or(InterfaceError::MissingName)?, + _version: version.ok_or(InterfaceError::MissingVersion)?, + _description: description, + messages, + _enums: enums, + }) +} + +fn parse_message( + reader: &mut Reader<&[u8]>, + attributes: Attributes, + empty: bool, + request: bool, +) -> Result { + let mut name = None; + let mut ty = None; + let mut since = None; + let mut deprecated_since = None; + for attr in attributes { + let (n, value) = parse_attr!(attr)?; + match n { + b"name" => name = Some(value.into_owned()), + b"type" => match value.as_ref() { + "destructor" => ty = Some(MessageType::Destructor), + _ => return Err(MessageError::UnknownMessageType(value.into_owned())), + }, + b"since" => since = Some(value.parse().map_err(MessageError::Since)?), + b"deprecated-since" => { + deprecated_since = Some(value.parse().map_err(MessageError::DeprecatedSince)?) + } + _ => continue, + } + } + let mut description = None; + let mut args = Vec::new(); + if !empty { + loop { + let event = reader.read_event().map_err(MessageError::ReadEvent)?; + let (start, empty) = match event { + Event::Start(s) => (s, false), + Event::End(_) => break, + Event::Empty(s) => (s, true), + _ => continue, + }; + match start.local_name().as_ref() { + b"description" => { + description = Some(parse_description(reader, start.attributes(), empty)?) + } + b"arg" => args.push(parse_arg(reader, start.attributes(), empty)?), + _ => continue, + } + } + } + Ok(Message { + name: name.ok_or(MessageError::MissingName)?, + request, + ty, + since, + _deprecated_since: deprecated_since, + _description: description, + args, + }) +} + +fn parse_arg( + reader: &mut Reader<&[u8]>, + attributes: Attributes, + empty: bool, +) -> Result { + let mut name = None; + let mut ty = None; + let mut summary = None; + let mut interface = None; + let mut allow_null = None; + let mut enum_ = None; + for attr in attributes { + let (n, value) = parse_attr!(attr)?; + match n { + b"name" => name = Some(value.into_owned()), + b"type" => { + ty = Some(match value.as_ref() { + "int" => ArgType::Int, + "uint" => ArgType::Uint, + "fixed" => ArgType::Fixed, + "string" => ArgType::String, + "array" => ArgType::Array, + "fd" => ArgType::Fd, + "new_id" => ArgType::NewId, + "object" => ArgType::Object, + _ => return Err(ArgError::UnknownArgType(value.into_owned())), + }) + } + b"summary" => summary = Some(value.into_owned()), + b"interface" => interface = Some(value.into_owned()), + b"allow-null" => allow_null = Some(value.parse().map_err(ArgError::AllowNull)?), + b"enum" => enum_ = Some(value.into_owned()), + _ => continue, + } + } + let mut description = None; + if !empty { + loop { + let event = reader.read_event().map_err(ArgError::ReadEvent)?; + let (start, empty) = match event { + Event::Start(s) => (s, false), + Event::End(_) => break, + Event::Empty(s) => (s, true), + _ => continue, + }; + match start.local_name().as_ref() { + b"description" => { + description = Some(parse_description(reader, start.attributes(), empty)?) + } + _ => continue, + } + } + } + Ok(Arg { + name: name.ok_or(ArgError::MissingName)?, + ty: ty.ok_or(ArgError::MissingType)?, + _summary: summary, + _description: description, + interface, + allow_null: allow_null.unwrap_or_default(), + enum_, + }) +} + +fn parse_enum( + reader: &mut Reader<&[u8]>, + attributes: Attributes, + empty: bool, +) -> Result { + let mut name = None; + let mut since = None; + let mut bitfield = None; + for attr in attributes { + let (n, v) = parse_attr!(attr)?; + match n { + b"name" => name = Some(v.into_owned()), + b"since" => since = Some(v.parse().map_err(EnumError::Since)?), + b"bitfield" => bitfield = Some(v.parse().map_err(EnumError::AllowNull)?), + _ => continue, + } + } + let mut description = None; + let mut entries = Vec::new(); + if !empty { + loop { + let event = reader.read_event().map_err(EnumError::ReadEvent)?; + let (start, empty) = match event { + Event::Start(s) => (s, false), + Event::End(_) => break, + Event::Empty(s) => (s, true), + _ => continue, + }; + match start.local_name().as_ref() { + b"description" => { + description = Some(parse_description(reader, start.attributes(), empty)?) + } + b"entry" => entries.push(parse_entry(reader, start.attributes(), empty)?), + _ => continue, + } + } + } + Ok(Enum { + _name: name.ok_or(EnumError::MissingName)?, + _since: since, + _bitfield: bitfield.unwrap_or_default(), + _description: description, + _entries: entries, + }) +} + +fn parse_entry( + reader: &mut Reader<&[u8]>, + attributes: Attributes, + empty: bool, +) -> Result { + let mut name = None; + let mut value = None; + let mut summary = None; + let mut since = None; + let mut deprecated_since = None; + for attr in attributes { + let (n, v) = parse_attr!(attr)?; + match n { + b"name" => name = Some(v.into_owned()), + b"value" => value = Some(v.into_owned()), + b"summary" => summary = Some(v.into_owned()), + b"since" => since = Some(v.parse().map_err(EntryError::Since)?), + b"deprecated-since" => { + deprecated_since = Some(v.parse().map_err(EntryError::DeprecatedSince)?) + } + _ => continue, + } + } + let mut description = None; + if !empty { + loop { + let event = reader.read_event().map_err(EntryError::ReadEvent)?; + let (start, empty) = match event { + Event::Start(s) => (s, false), + Event::End(_) => break, + Event::Empty(s) => (s, true), + _ => continue, + }; + match start.local_name().as_ref() { + b"description" => { + description = Some(parse_description(reader, start.attributes(), empty)?) + } + _ => continue, + } + } + } + let value = value.ok_or(EntryError::MissingValue)?; + let value_u32 = if let Some(value) = value.strip_prefix("0x") { + u32::from_str_radix(value, 16).map_err(EntryError::InvalidValue)? + } else { + u32::from_str(&value).map_err(EntryError::InvalidValue)? + }; + Ok(Entry { + _name: name.ok_or(EntryError::MissingName)?, + _value: value, + _value_u32: value_u32, + _summary: summary, + _since: since, + _deprecated_since: deprecated_since, + _description: description, + }) +} From 60574d3a0d5c43f663df87cee736cc17fe8714df Mon Sep 17 00:00:00 2001 From: Julian Orth Date: Sat, 20 Sep 2025 18:49:44 +0200 Subject: [PATCH 2/2] wire: regenerate most files --- src/ifs/wl_seat/zwp_relative_pointer_v1.rs | 8 +++--- wire/ext_data_control_device_v1.txt | 17 +++++------- wire/ext_data_control_manager_v1.txt | 9 +++---- wire/ext_data_control_offer_v1.txt | 7 +---- wire/ext_data_control_source_v1.txt | 8 +----- wire/ext_foreign_toplevel_handle_v1.txt | 6 +---- ...plevel_image_capture_source_manager_v1.txt | 5 ++-- wire/ext_foreign_toplevel_list_v1.txt | 18 +++++-------- wire/ext_idle_notification_v1.txt | 6 +---- wire/ext_idle_notifier_v1.txt | 8 +++--- wire/ext_image_capture_source_v1.txt | 3 +-- ...t_image_copy_capture_cursor_session_v1.txt | 7 ++--- wire/ext_image_copy_capture_frame_v1.txt | 7 ++--- wire/ext_image_copy_capture_manager_v1.txt | 7 +++-- wire/ext_image_copy_capture_session_v1.txt | 17 +++++------- ...output_image_capture_source_manager_v1.txt | 5 ++-- wire/ext_session_lock_manager_v1.txt | 6 ++--- wire/ext_session_lock_surface_v1.txt | 7 +---- wire/ext_session_lock_v1.txt | 22 +++++---------- wire/ext_transient_seat_manager_v1.txt | 4 +-- wire/ext_transient_seat_v1.txt | 7 +++-- wire/ext_workspace_group_handle_v1.txt | 4 +-- wire/ext_workspace_handle_v1.txt | 7 +---- wire/ext_workspace_manager_v1.txt | 10 +++---- wire/wp_alpha_modifier_surface_v1.txt | 2 +- wire/wp_alpha_modifier_v1.txt | 4 +-- wire/wp_color_management_output_v1.txt | 4 +-- ...p_color_management_surface_feedback_v1.txt | 6 ++--- wire/wp_color_management_surface_v1.txt | 2 +- wire/wp_color_manager_v1.txt | 14 +++++----- wire/wp_commit_timer_v1.txt | 3 +-- wire/wp_commit_timing_manager_v1.txt | 5 ++-- wire/wp_content_type_manager_v1.txt | 6 ++--- wire/wp_content_type_v1.txt | 4 +-- wire/wp_cursor_shape_device_v1.txt | 4 +-- wire/wp_cursor_shape_manager_v1.txt | 8 +++--- wire/wp_drm_lease_connector_v1.txt | 9 +++---- wire/wp_drm_lease_device_v1.txt | 9 +++---- wire/wp_drm_lease_request_v1.txt | 4 +-- wire/wp_drm_lease_v1.txt | 8 +++--- wire/wp_fifo_manager_v1.txt | 5 ++-- wire/wp_fifo_v1.txt | 5 +--- wire/wp_fractional_scale_manager_v1.txt | 7 ++--- wire/wp_fractional_scale_v1.txt | 7 +---- wire/wp_image_description_creator_icc_v1.txt | 4 +-- ...wp_image_description_creator_params_v1.txt | 4 +-- wire/wp_image_description_info_v1.txt | 2 +- wire/wp_image_description_v1.txt | 4 +-- wire/wp_linux_drm_syncobj_manager_v1.txt | 9 +++---- wire/wp_linux_drm_syncobj_surface_v1.txt | 5 +--- wire/wp_linux_drm_syncobj_timeline_v1.txt | 5 +--- wire/wp_pointer_warp_v1.txt | 3 +-- wire/wp_presentation.txt | 8 ++---- wire/wp_presentation_feedback.txt | 17 +++++------- wire/wp_security_context_manager_v1.txt | 5 ++-- wire/wp_security_context_v1.txt | 4 +-- wire/wp_single_pixel_buffer_manager_v1.txt | 6 ++--- wire/wp_tearing_control_manager_v1.txt | 8 ++---- wire/wp_tearing_control_v1.txt | 5 +--- wire/wp_viewport.txt | 4 +-- wire/wp_viewporter.txt | 6 ++--- wire/xdg_activation_token_v1.txt | 12 +++------ wire/xdg_activation_v1.txt | 7 ++--- wire/xdg_dialog_v1.txt | 5 +--- wire/xdg_popup.txt | 16 +++++------ wire/xdg_positioner.txt | 6 ++--- wire/xdg_surface.txt | 11 +++----- wire/xdg_toplevel.txt | 20 +++++++------- wire/xdg_toplevel_drag_manager_v1.txt | 7 ++--- wire/xdg_toplevel_drag_v1.txt | 5 +--- wire/xdg_toplevel_tag_manager_v1.txt | 3 +-- wire/xdg_wm_base.txt | 11 +++----- wire/xdg_wm_dialog_v1.txt | 5 ++-- wire/xwayland_shell_v1.txt | 7 +++-- wire/xwayland_surface_v1.txt | 5 ++-- wire/zwp_confined_pointer_v1.txt | 9 +------ wire/zwp_idle_inhibit_manager_v1.txt | 7 +++-- wire/zwp_idle_inhibitor_v1.txt | 5 ++-- wire/zwp_linux_buffer_params_v1.txt | 24 +++++++---------- wire/zwp_linux_dmabuf_feedback_v1.txt | 11 +++----- wire/zwp_linux_dmabuf_v1.txt | 27 +++++++++---------- wire/zwp_locked_pointer_v1.txt | 6 +---- wire/zwp_pointer_constraints_v1.txt | 9 +++---- wire/zwp_pointer_gesture_hold_v1.txt | 3 +-- wire/zwp_pointer_gesture_pinch_v1.txt | 3 +-- wire/zwp_pointer_gesture_swipe_v1.txt | 3 +-- wire/zwp_pointer_gestures_v1.txt | 9 +++---- ...wp_primary_selection_device_manager_v1.txt | 11 ++++---- wire/zwp_primary_selection_device_v1.txt | 15 +++++------ wire/zwp_primary_selection_offer_v1.txt | 9 +++---- wire/zwp_primary_selection_source_v1.txt | 8 ++---- wire/zwp_relative_pointer_manager_v1.txt | 7 ++--- wire/zwp_relative_pointer_v1.txt | 11 +++----- wire/zwp_tablet_manager_v2.txt | 4 +-- wire/zwp_tablet_pad_dial_v2.txt | 2 +- wire/zwp_tablet_pad_group_v2.txt | 10 +++---- wire/zwp_tablet_pad_ring_v2.txt | 2 +- wire/zwp_tablet_pad_strip_v2.txt | 2 +- wire/zwp_tablet_pad_v2.txt | 4 +-- wire/zwp_tablet_seat_v2.txt | 8 +++--- wire/zwp_tablet_tool_v2.txt | 2 +- wire/zwp_tablet_v2.txt | 4 +-- wire/zwp_text_input_manager_v3.txt | 4 +-- wire/zwp_text_input_v3.txt | 8 +++--- wire/zxdg_decoration_manager_v1.txt | 7 +++-- wire/zxdg_output_manager_v1.txt | 7 +++-- wire/zxdg_output_v1.txt | 10 +++---- wire/zxdg_toplevel_decoration_v1.txt | 7 +---- 108 files changed, 284 insertions(+), 514 deletions(-) diff --git a/src/ifs/wl_seat/zwp_relative_pointer_v1.rs b/src/ifs/wl_seat/zwp_relative_pointer_v1.rs index 4c34667e..228291e0 100644 --- a/src/ifs/wl_seat/zwp_relative_pointer_v1.rs +++ b/src/ifs/wl_seat/zwp_relative_pointer_v1.rs @@ -25,8 +25,8 @@ impl ZwpRelativePointerV1 { time_usec: u64, mut dx: Fixed, mut dy: Fixed, - dx_unaccelerated: Fixed, - dy_unaccelerated: Fixed, + dx_unaccel: Fixed, + dy_unaccel: Fixed, ) { logical_to_client_wire_scale!(self.client, dx, dy); self.client.event(RelativeMotion { @@ -34,8 +34,8 @@ impl ZwpRelativePointerV1 { utime: time_usec, dx, dy, - dx_unaccelerated, - dy_unaccelerated, + dx_unaccel, + dy_unaccel, }); } } diff --git a/wire/ext_data_control_device_v1.txt b/wire/ext_data_control_device_v1.txt index 5652eeef..cacb9680 100644 --- a/wire/ext_data_control_device_v1.txt +++ b/wire/ext_data_control_device_v1.txt @@ -1,21 +1,12 @@ -# requests - request set_selection { source: id(ext_data_control_source_v1), } -request destroy { - +request destroy (destructor) { } -request set_primary_selection { - source: id(ext_data_control_source_v1), -} - -# events - event data_offer { - id: id(ext_data_control_offer_v1), + id: id(ext_data_control_offer_v1) (new), } event selection { @@ -28,3 +19,7 @@ event finished { event primary_selection { id: id(ext_data_control_offer_v1), } + +request set_primary_selection { + source: id(ext_data_control_source_v1), +} diff --git a/wire/ext_data_control_manager_v1.txt b/wire/ext_data_control_manager_v1.txt index 096b01fa..a7aebd68 100644 --- a/wire/ext_data_control_manager_v1.txt +++ b/wire/ext_data_control_manager_v1.txt @@ -1,14 +1,11 @@ -# requests - request create_data_source { - id: id(ext_data_control_source_v1), + id: id(ext_data_control_source_v1) (new), } request get_data_device { - id: id(ext_data_control_device_v1), + id: id(ext_data_control_device_v1) (new), seat: id(wl_seat), } -request destroy { - +request destroy (destructor) { } diff --git a/wire/ext_data_control_offer_v1.txt b/wire/ext_data_control_offer_v1.txt index e7dd04d4..3b4e54cf 100644 --- a/wire/ext_data_control_offer_v1.txt +++ b/wire/ext_data_control_offer_v1.txt @@ -1,16 +1,11 @@ -# requests - request receive { mime_type: str, fd: fd, } -request destroy { - +request destroy (destructor) { } -# events - event offer { mime_type: str, } diff --git a/wire/ext_data_control_source_v1.txt b/wire/ext_data_control_source_v1.txt index 92689834..07560e73 100644 --- a/wire/ext_data_control_source_v1.txt +++ b/wire/ext_data_control_source_v1.txt @@ -1,20 +1,14 @@ -# requests - request offer { mime_type: str, } -request destroy { - +request destroy (destructor) { } -# events - event send { mime_type: str, fd: fd, } event cancelled { - } diff --git a/wire/ext_foreign_toplevel_handle_v1.txt b/wire/ext_foreign_toplevel_handle_v1.txt index 3fd5b149..ef52cd49 100644 --- a/wire/ext_foreign_toplevel_handle_v1.txt +++ b/wire/ext_foreign_toplevel_handle_v1.txt @@ -1,10 +1,6 @@ -# requests - -request destroy { +request destroy (destructor) { } -# events - event closed { } diff --git a/wire/ext_foreign_toplevel_image_capture_source_manager_v1.txt b/wire/ext_foreign_toplevel_image_capture_source_manager_v1.txt index 314b62ae..aa852297 100644 --- a/wire/ext_foreign_toplevel_image_capture_source_manager_v1.txt +++ b/wire/ext_foreign_toplevel_image_capture_source_manager_v1.txt @@ -1,8 +1,7 @@ request create_source { - source: id(ext_image_capture_source_v1), + source: id(ext_image_capture_source_v1) (new), toplevel_handle: id(ext_foreign_toplevel_handle_v1), } -request destroy { - +request destroy (destructor) { } diff --git a/wire/ext_foreign_toplevel_list_v1.txt b/wire/ext_foreign_toplevel_list_v1.txt index 14f64a16..dbe85818 100644 --- a/wire/ext_foreign_toplevel_list_v1.txt +++ b/wire/ext_foreign_toplevel_list_v1.txt @@ -1,16 +1,12 @@ -# requests - -request stop { -} - -request destroy { -} - -# events - event toplevel { - toplevel: id(ext_foreign_toplevel_handle_v1), + toplevel: id(ext_foreign_toplevel_handle_v1) (new), } event finished { } + +request stop { +} + +request destroy (destructor) { +} diff --git a/wire/ext_idle_notification_v1.txt b/wire/ext_idle_notification_v1.txt index a6910bb9..67ade3e2 100644 --- a/wire/ext_idle_notification_v1.txt +++ b/wire/ext_idle_notification_v1.txt @@ -1,10 +1,6 @@ -# requests - -request destroy { +request destroy (destructor) { } -# events - event idled { } diff --git a/wire/ext_idle_notifier_v1.txt b/wire/ext_idle_notifier_v1.txt index fc3d2daa..314ba69e 100644 --- a/wire/ext_idle_notifier_v1.txt +++ b/wire/ext_idle_notifier_v1.txt @@ -1,16 +1,14 @@ -# requests - -request destroy { +request destroy (destructor) { } request get_idle_notification { - id: id(ext_idle_notification_v1), + id: id(ext_idle_notification_v1) (new), timeout: u32, seat: id(wl_seat), } request get_input_idle_notification (since = 2) { - id: id(ext_idle_notification_v1), + id: id(ext_idle_notification_v1) (new), timeout: u32, seat: id(wl_seat), } diff --git a/wire/ext_image_capture_source_v1.txt b/wire/ext_image_capture_source_v1.txt index c8816211..fdecd8b2 100644 --- a/wire/ext_image_capture_source_v1.txt +++ b/wire/ext_image_capture_source_v1.txt @@ -1,3 +1,2 @@ -request destroy { - +request destroy (destructor) { } diff --git a/wire/ext_image_copy_capture_cursor_session_v1.txt b/wire/ext_image_copy_capture_cursor_session_v1.txt index 0fd5e60c..13ef2b4f 100644 --- a/wire/ext_image_copy_capture_cursor_session_v1.txt +++ b/wire/ext_image_copy_capture_cursor_session_v1.txt @@ -1,17 +1,14 @@ -request destroy { - +request destroy (destructor) { } request get_capture_session { - session: id(ext_image_copy_capture_session_v1), + session: id(ext_image_copy_capture_session_v1) (new), } event enter { - } event leave { - } event position { diff --git a/wire/ext_image_copy_capture_frame_v1.txt b/wire/ext_image_copy_capture_frame_v1.txt index 4490e1d6..f2c5a2e7 100644 --- a/wire/ext_image_copy_capture_frame_v1.txt +++ b/wire/ext_image_copy_capture_frame_v1.txt @@ -1,5 +1,4 @@ -request destroy { - +request destroy (destructor) { } request attach_buffer { @@ -14,7 +13,6 @@ request damage_buffer { } request capture { - } event transform { @@ -34,9 +32,8 @@ event presentation_time { } event ready { - } event failed { - reason: i32, + reason: u32, } diff --git a/wire/ext_image_copy_capture_manager_v1.txt b/wire/ext_image_copy_capture_manager_v1.txt index 48c5d0e5..5d22da60 100644 --- a/wire/ext_image_copy_capture_manager_v1.txt +++ b/wire/ext_image_copy_capture_manager_v1.txt @@ -1,15 +1,14 @@ request create_session { - session: id(ext_image_copy_capture_session_v1), + session: id(ext_image_copy_capture_session_v1) (new), source: id(ext_image_capture_source_v1), options: u32, } request create_pointer_cursor_session { - session: id(ext_image_copy_capture_cursor_session_v1), + session: id(ext_image_copy_capture_cursor_session_v1) (new), source: id(ext_image_capture_source_v1), pointer: id(wl_pointer), } -request destroy { - +request destroy (destructor) { } diff --git a/wire/ext_image_copy_capture_session_v1.txt b/wire/ext_image_copy_capture_session_v1.txt index b7b5f88c..5a76c825 100644 --- a/wire/ext_image_copy_capture_session_v1.txt +++ b/wire/ext_image_copy_capture_session_v1.txt @@ -1,11 +1,3 @@ -request create_frame { - frame: id(ext_image_copy_capture_frame_v1), -} - -request destroy { - -} - event buffer_size { width: u32, height: u32, @@ -25,9 +17,14 @@ event dmabuf_format { } event done { - } event stopped { - +} + +request create_frame { + frame: id(ext_image_copy_capture_frame_v1) (new), +} + +request destroy (destructor) { } diff --git a/wire/ext_output_image_capture_source_manager_v1.txt b/wire/ext_output_image_capture_source_manager_v1.txt index 0664c20f..65588bf0 100644 --- a/wire/ext_output_image_capture_source_manager_v1.txt +++ b/wire/ext_output_image_capture_source_manager_v1.txt @@ -1,8 +1,7 @@ request create_source { - source: id(ext_image_capture_source_v1), + source: id(ext_image_capture_source_v1) (new), output: id(wl_output), } -request destroy { - +request destroy (destructor) { } diff --git a/wire/ext_session_lock_manager_v1.txt b/wire/ext_session_lock_manager_v1.txt index 603ab351..70726c76 100644 --- a/wire/ext_session_lock_manager_v1.txt +++ b/wire/ext_session_lock_manager_v1.txt @@ -1,8 +1,6 @@ -# requests - -request destroy { +request destroy (destructor) { } request lock { - id: id(ext_session_lock_v1), + id: id(ext_session_lock_v1) (new), } diff --git a/wire/ext_session_lock_surface_v1.txt b/wire/ext_session_lock_surface_v1.txt index 2bbebdbe..3cbdc994 100644 --- a/wire/ext_session_lock_surface_v1.txt +++ b/wire/ext_session_lock_surface_v1.txt @@ -1,15 +1,10 @@ -# request - -request destroy { - +request destroy (destructor) { } request ack_configure { serial: u32, } -# events - event configure { serial: u32, width: u32, diff --git a/wire/ext_session_lock_v1.txt b/wire/ext_session_lock_v1.txt index 7d14a5ce..6f623b79 100644 --- a/wire/ext_session_lock_v1.txt +++ b/wire/ext_session_lock_v1.txt @@ -1,25 +1,17 @@ -# requests +request destroy (destructor) { +} -request destroy { +event locked { +} +event finished { } request get_lock_surface { - id: id(ext_session_lock_surface_v1), + id: id(ext_session_lock_surface_v1) (new), surface: id(wl_surface), output: id(wl_output), } -request unlock_and_destroy { - -} - -# events - -event locked { - -} - -event finished { - +request unlock_and_destroy (destructor) { } diff --git a/wire/ext_transient_seat_manager_v1.txt b/wire/ext_transient_seat_manager_v1.txt index 2efdf29e..b834c43a 100644 --- a/wire/ext_transient_seat_manager_v1.txt +++ b/wire/ext_transient_seat_manager_v1.txt @@ -1,6 +1,6 @@ request create { - seat: id(ext_transient_seat_v1), + seat: id(ext_transient_seat_v1) (new), } -request destroy { +request destroy (destructor) { } diff --git a/wire/ext_transient_seat_v1.txt b/wire/ext_transient_seat_v1.txt index 22a4f87c..1c25e633 100644 --- a/wire/ext_transient_seat_v1.txt +++ b/wire/ext_transient_seat_v1.txt @@ -1,10 +1,9 @@ -request destroy { -} - event ready { global_name: u32, } event denied { - +} + +request destroy (destructor) { } diff --git a/wire/ext_workspace_group_handle_v1.txt b/wire/ext_workspace_group_handle_v1.txt index 64c5b5d1..ee7c1c29 100644 --- a/wire/ext_workspace_group_handle_v1.txt +++ b/wire/ext_workspace_group_handle_v1.txt @@ -19,13 +19,11 @@ event workspace_leave { } event removed { - } request create_workspace { workspace: str, } -request destroy { - +request destroy (destructor) { } diff --git a/wire/ext_workspace_handle_v1.txt b/wire/ext_workspace_handle_v1.txt index 9e5267a5..c1d6448f 100644 --- a/wire/ext_workspace_handle_v1.txt +++ b/wire/ext_workspace_handle_v1.txt @@ -19,19 +19,15 @@ event capabilities { } event removed { - } -request destroy { - +request destroy (destructor) { } request activate { - } request deactivate { - } request assign { @@ -39,5 +35,4 @@ request assign { } request remove { - } diff --git a/wire/ext_workspace_manager_v1.txt b/wire/ext_workspace_manager_v1.txt index 16a37803..445a1d09 100644 --- a/wire/ext_workspace_manager_v1.txt +++ b/wire/ext_workspace_manager_v1.txt @@ -1,23 +1,19 @@ event workspace_group { - workspace_group: id(ext_workspace_group_handle_v1), + workspace_group: id(ext_workspace_group_handle_v1) (new), } event workspace { - workspace: id(ext_workspace_handle_v1), + workspace: id(ext_workspace_handle_v1) (new), } request commit { - } event done { - } -event finished { - +event finished (destructor) { } request stop { - } diff --git a/wire/wp_alpha_modifier_surface_v1.txt b/wire/wp_alpha_modifier_surface_v1.txt index 03a5d051..7e249f3c 100644 --- a/wire/wp_alpha_modifier_surface_v1.txt +++ b/wire/wp_alpha_modifier_surface_v1.txt @@ -1,4 +1,4 @@ -request destroy { +request destroy (destructor) { } request set_multiplier { diff --git a/wire/wp_alpha_modifier_v1.txt b/wire/wp_alpha_modifier_v1.txt index 1b2e0c7f..7baf50a6 100644 --- a/wire/wp_alpha_modifier_v1.txt +++ b/wire/wp_alpha_modifier_v1.txt @@ -1,7 +1,7 @@ -request destroy { +request destroy (destructor) { } request get_surface { - id: id(wp_alpha_modifier_surface_v1), + id: id(wp_alpha_modifier_surface_v1) (new), surface: id(wl_surface), } diff --git a/wire/wp_color_management_output_v1.txt b/wire/wp_color_management_output_v1.txt index 6cfa80c4..b9794744 100644 --- a/wire/wp_color_management_output_v1.txt +++ b/wire/wp_color_management_output_v1.txt @@ -1,9 +1,9 @@ -request destroy { +request destroy (destructor) { } event image_description_changed { } request get_image_description { - image_description: id(wp_image_description_v1), + image_description: id(wp_image_description_v1) (new), } diff --git a/wire/wp_color_management_surface_feedback_v1.txt b/wire/wp_color_management_surface_feedback_v1.txt index 187345b7..573fe877 100644 --- a/wire/wp_color_management_surface_feedback_v1.txt +++ b/wire/wp_color_management_surface_feedback_v1.txt @@ -1,4 +1,4 @@ -request destroy { +request destroy (destructor) { } event preferred_changed { @@ -6,9 +6,9 @@ event preferred_changed { } request get_preferred { - image_description: id(wp_image_description_v1), + image_description: id(wp_image_description_v1) (new), } request get_preferred_parametric { - image_description: id(wp_image_description_v1), + image_description: id(wp_image_description_v1) (new), } diff --git a/wire/wp_color_management_surface_v1.txt b/wire/wp_color_management_surface_v1.txt index c7665425..b6798650 100644 --- a/wire/wp_color_management_surface_v1.txt +++ b/wire/wp_color_management_surface_v1.txt @@ -1,4 +1,4 @@ -request destroy { +request destroy (destructor) { } request set_image_description { diff --git a/wire/wp_color_manager_v1.txt b/wire/wp_color_manager_v1.txt index d683990b..86f837ab 100644 --- a/wire/wp_color_manager_v1.txt +++ b/wire/wp_color_manager_v1.txt @@ -1,31 +1,31 @@ -request destroy { +request destroy (destructor) { } request get_output { - id: id(wp_color_management_output_v1), + id: id(wp_color_management_output_v1) (new), output: id(wl_output), } request get_surface { - id: id(wp_color_management_surface_v1), + id: id(wp_color_management_surface_v1) (new), surface: id(wl_surface), } request get_surface_feedback { - id: id(wp_color_management_surface_feedback_v1), + id: id(wp_color_management_surface_feedback_v1) (new), surface: id(wl_surface), } request create_icc_creator { - obj: id(wp_image_description_creator_icc_v1), + obj: id(wp_image_description_creator_icc_v1) (new), } request create_parametric_creator { - obj: id(wp_image_description_creator_params_v1), + obj: id(wp_image_description_creator_params_v1) (new), } request create_windows_scrgb { - image_description: id(wp_image_description_v1), + image_description: id(wp_image_description_v1) (new), } event supported_intent { diff --git a/wire/wp_commit_timer_v1.txt b/wire/wp_commit_timer_v1.txt index 4b6a2305..2fef6346 100644 --- a/wire/wp_commit_timer_v1.txt +++ b/wire/wp_commit_timer_v1.txt @@ -3,6 +3,5 @@ request set_timestamp { tv_nsec: u32, } -request destroy { - +request destroy (destructor) { } diff --git a/wire/wp_commit_timing_manager_v1.txt b/wire/wp_commit_timing_manager_v1.txt index c20860b8..34c2e572 100644 --- a/wire/wp_commit_timing_manager_v1.txt +++ b/wire/wp_commit_timing_manager_v1.txt @@ -1,8 +1,7 @@ -request destroy { - +request destroy (destructor) { } request get_timer { - id: id(wp_commit_timer_v1), + id: id(wp_commit_timer_v1) (new), surface: id(wl_surface), } diff --git a/wire/wp_content_type_manager_v1.txt b/wire/wp_content_type_manager_v1.txt index c511b791..6ada37e3 100644 --- a/wire/wp_content_type_manager_v1.txt +++ b/wire/wp_content_type_manager_v1.txt @@ -1,9 +1,7 @@ -# requests - -request destroy { +request destroy (destructor) { } request get_surface_content_type { - id: id(wp_content_type_v1), + id: id(wp_content_type_v1) (new), surface: id(wl_surface), } diff --git a/wire/wp_content_type_v1.txt b/wire/wp_content_type_v1.txt index 819653a5..e5e281ec 100644 --- a/wire/wp_content_type_v1.txt +++ b/wire/wp_content_type_v1.txt @@ -1,6 +1,4 @@ -# requests - -request destroy { +request destroy (destructor) { } request set_content_type { diff --git a/wire/wp_cursor_shape_device_v1.txt b/wire/wp_cursor_shape_device_v1.txt index 83d3fcb9..1b90158e 100644 --- a/wire/wp_cursor_shape_device_v1.txt +++ b/wire/wp_cursor_shape_device_v1.txt @@ -1,6 +1,4 @@ -# requests - -request destroy { +request destroy (destructor) { } request set_shape { diff --git a/wire/wp_cursor_shape_manager_v1.txt b/wire/wp_cursor_shape_manager_v1.txt index 30061c84..2a7d06a3 100644 --- a/wire/wp_cursor_shape_manager_v1.txt +++ b/wire/wp_cursor_shape_manager_v1.txt @@ -1,14 +1,12 @@ -# requests - -request destroy { +request destroy (destructor) { } request get_pointer { - cursor_shape_device: id(wp_cursor_shape_device_v1), + cursor_shape_device: id(wp_cursor_shape_device_v1) (new), pointer: id(wl_pointer), } request get_tablet_tool_v2 { - cursor_shape_device: id(wp_cursor_shape_device_v1), + cursor_shape_device: id(wp_cursor_shape_device_v1) (new), tablet_tool: id(zwp_tablet_tool_v2), } diff --git a/wire/wp_drm_lease_connector_v1.txt b/wire/wp_drm_lease_connector_v1.txt index 853296f7..d173a3ae 100644 --- a/wire/wp_drm_lease_connector_v1.txt +++ b/wire/wp_drm_lease_connector_v1.txt @@ -1,7 +1,3 @@ -request destroy { - -} - event name { name: str, } @@ -15,9 +11,10 @@ event connector_id { } event done { - } event withdrawn { - +} + +request destroy (destructor) { } diff --git a/wire/wp_drm_lease_device_v1.txt b/wire/wp_drm_lease_device_v1.txt index c0a938b9..f6b2e0e5 100644 --- a/wire/wp_drm_lease_device_v1.txt +++ b/wire/wp_drm_lease_device_v1.txt @@ -1,9 +1,8 @@ request create_lease_request { - id: id(wp_drm_lease_request_v1), + id: id(wp_drm_lease_request_v1) (new), } request release { - } event drm_fd { @@ -11,13 +10,11 @@ event drm_fd { } event connector { - id: id(wp_drm_lease_connector_v1), + id: id(wp_drm_lease_connector_v1) (new), } event done { - } -event released { - +event released (destructor) { } diff --git a/wire/wp_drm_lease_request_v1.txt b/wire/wp_drm_lease_request_v1.txt index 527e4a14..2d575a34 100644 --- a/wire/wp_drm_lease_request_v1.txt +++ b/wire/wp_drm_lease_request_v1.txt @@ -2,6 +2,6 @@ request request_connector { connector: id(wp_drm_lease_connector_v1), } -request submit { - id: id(wp_drm_lease_v1), +request submit (destructor) { + id: id(wp_drm_lease_v1) (new), } diff --git a/wire/wp_drm_lease_v1.txt b/wire/wp_drm_lease_v1.txt index 83055426..add10e4e 100644 --- a/wire/wp_drm_lease_v1.txt +++ b/wire/wp_drm_lease_v1.txt @@ -1,11 +1,9 @@ -request destroy { - -} - event lease_fd { leased_fd: fd, } event finished { - +} + +request destroy (destructor) { } diff --git a/wire/wp_fifo_manager_v1.txt b/wire/wp_fifo_manager_v1.txt index 8d26f7a9..03503633 100644 --- a/wire/wp_fifo_manager_v1.txt +++ b/wire/wp_fifo_manager_v1.txt @@ -1,8 +1,7 @@ -request destroy { - +request destroy (destructor) { } request get_fifo { - id: id(wp_fifo_v1), + id: id(wp_fifo_v1) (new), surface: id(wl_surface), } diff --git a/wire/wp_fifo_v1.txt b/wire/wp_fifo_v1.txt index 60886232..953f8abd 100644 --- a/wire/wp_fifo_v1.txt +++ b/wire/wp_fifo_v1.txt @@ -1,11 +1,8 @@ request set_barrier { - } request wait_barrier { - } -request destroy { - +request destroy (destructor) { } diff --git a/wire/wp_fractional_scale_manager_v1.txt b/wire/wp_fractional_scale_manager_v1.txt index a663d21f..b1bac0bf 100644 --- a/wire/wp_fractional_scale_manager_v1.txt +++ b/wire/wp_fractional_scale_manager_v1.txt @@ -1,10 +1,7 @@ -# requests - -request destroy { - +request destroy (destructor) { } request get_fractional_scale { - id: id(wp_fractional_scale_v1), + id: id(wp_fractional_scale_v1) (new), surface: id(wl_surface), } diff --git a/wire/wp_fractional_scale_v1.txt b/wire/wp_fractional_scale_v1.txt index 8e3edafb..32448b53 100644 --- a/wire/wp_fractional_scale_v1.txt +++ b/wire/wp_fractional_scale_v1.txt @@ -1,11 +1,6 @@ -# requests - -request destroy { - +request destroy (destructor) { } -# events - event preferred_scale { scale: u32, } diff --git a/wire/wp_image_description_creator_icc_v1.txt b/wire/wp_image_description_creator_icc_v1.txt index cde069fe..eed48fd8 100644 --- a/wire/wp_image_description_creator_icc_v1.txt +++ b/wire/wp_image_description_creator_icc_v1.txt @@ -1,5 +1,5 @@ -request create { - image_description: id(wp_image_description_v1), +request create (destructor) { + image_description: id(wp_image_description_v1) (new), } request set_icc_file { diff --git a/wire/wp_image_description_creator_params_v1.txt b/wire/wp_image_description_creator_params_v1.txt index 83436e46..9bfaa953 100644 --- a/wire/wp_image_description_creator_params_v1.txt +++ b/wire/wp_image_description_creator_params_v1.txt @@ -1,5 +1,5 @@ -request create { - image_description: id(wp_image_description_v1), +request create (destructor) { + image_description: id(wp_image_description_v1) (new), } request set_tf_named { diff --git a/wire/wp_image_description_info_v1.txt b/wire/wp_image_description_info_v1.txt index c5bfe020..ce8689e5 100644 --- a/wire/wp_image_description_info_v1.txt +++ b/wire/wp_image_description_info_v1.txt @@ -1,4 +1,4 @@ -event done { +event done (destructor) { } event icc_file { diff --git a/wire/wp_image_description_v1.txt b/wire/wp_image_description_v1.txt index f1cab457..a99945d4 100644 --- a/wire/wp_image_description_v1.txt +++ b/wire/wp_image_description_v1.txt @@ -1,4 +1,4 @@ -request destroy { +request destroy (destructor) { } event failed { @@ -11,5 +11,5 @@ event ready { } request get_information { - information: id(wp_image_description_info_v1), + information: id(wp_image_description_info_v1) (new), } diff --git a/wire/wp_linux_drm_syncobj_manager_v1.txt b/wire/wp_linux_drm_syncobj_manager_v1.txt index d6868262..84ad254a 100644 --- a/wire/wp_linux_drm_syncobj_manager_v1.txt +++ b/wire/wp_linux_drm_syncobj_manager_v1.txt @@ -1,15 +1,12 @@ -# requests - -request destroy { - +request destroy (destructor) { } request get_surface { - id: id(wp_linux_drm_syncobj_surface_v1), + id: id(wp_linux_drm_syncobj_surface_v1) (new), surface: id(wl_surface), } request import_timeline { - id: id(wp_linux_drm_syncobj_timeline_v1), + id: id(wp_linux_drm_syncobj_timeline_v1) (new), fd: fd, } diff --git a/wire/wp_linux_drm_syncobj_surface_v1.txt b/wire/wp_linux_drm_syncobj_surface_v1.txt index a4dac48f..66719ed9 100644 --- a/wire/wp_linux_drm_syncobj_surface_v1.txt +++ b/wire/wp_linux_drm_syncobj_surface_v1.txt @@ -1,7 +1,4 @@ -# requests - -request destroy { - +request destroy (destructor) { } request set_acquire_point { diff --git a/wire/wp_linux_drm_syncobj_timeline_v1.txt b/wire/wp_linux_drm_syncobj_timeline_v1.txt index 2159f411..fdecd8b2 100644 --- a/wire/wp_linux_drm_syncobj_timeline_v1.txt +++ b/wire/wp_linux_drm_syncobj_timeline_v1.txt @@ -1,5 +1,2 @@ -# requests - -request destroy { - +request destroy (destructor) { } diff --git a/wire/wp_pointer_warp_v1.txt b/wire/wp_pointer_warp_v1.txt index 8155026c..49923b85 100644 --- a/wire/wp_pointer_warp_v1.txt +++ b/wire/wp_pointer_warp_v1.txt @@ -1,5 +1,4 @@ -request destroy { - +request destroy (destructor) { } request warp_pointer { diff --git a/wire/wp_presentation.txt b/wire/wp_presentation.txt index 0790d182..56cc8476 100644 --- a/wire/wp_presentation.txt +++ b/wire/wp_presentation.txt @@ -1,15 +1,11 @@ -# requests - -request destroy { +request destroy (destructor) { } request feedback { surface: id(wl_surface), - callback: id(wp_presentation_feedback), + callback: id(wp_presentation_feedback) (new), } -# events - event clock_id { clk_id: u32, } diff --git a/wire/wp_presentation_feedback.txt b/wire/wp_presentation_feedback.txt index 5cc70855..f237e7cd 100644 --- a/wire/wp_presentation_feedback.txt +++ b/wire/wp_presentation_feedback.txt @@ -1,17 +1,14 @@ -# events - event sync_output { output: id(wl_output), } -event presented { - tv_sec : u64, - tv_nsec : u32, - refresh : u32, - seq : u64, - flags : u32, +event presented (destructor) { + tv_sec: u64, + tv_nsec: u32, + refresh: u32, + seq: u64, + flags: u32, } -event discarded { - +event discarded (destructor) { } diff --git a/wire/wp_security_context_manager_v1.txt b/wire/wp_security_context_manager_v1.txt index 15aabdae..6d351344 100644 --- a/wire/wp_security_context_manager_v1.txt +++ b/wire/wp_security_context_manager_v1.txt @@ -1,9 +1,8 @@ -request destroy { - +request destroy (destructor) { } request create_listener { - id: id(wp_security_context_v1), + id: id(wp_security_context_v1) (new), listen_fd: fd, close_fd: fd, } diff --git a/wire/wp_security_context_v1.txt b/wire/wp_security_context_v1.txt index 1c538df5..1a037aee 100644 --- a/wire/wp_security_context_v1.txt +++ b/wire/wp_security_context_v1.txt @@ -1,5 +1,4 @@ -request destroy { - +request destroy (destructor) { } request set_sandbox_engine { @@ -15,5 +14,4 @@ request set_instance_id { } request commit { - } diff --git a/wire/wp_single_pixel_buffer_manager_v1.txt b/wire/wp_single_pixel_buffer_manager_v1.txt index 4f4d607f..8cadaba6 100644 --- a/wire/wp_single_pixel_buffer_manager_v1.txt +++ b/wire/wp_single_pixel_buffer_manager_v1.txt @@ -1,10 +1,8 @@ -# requests - -request destroy { +request destroy (destructor) { } request create_u32_rgba_buffer { - id: id(wl_buffer), + id: id(wl_buffer) (new), r: u32, g: u32, b: u32, diff --git a/wire/wp_tearing_control_manager_v1.txt b/wire/wp_tearing_control_manager_v1.txt index c9894fdb..a43cef97 100644 --- a/wire/wp_tearing_control_manager_v1.txt +++ b/wire/wp_tearing_control_manager_v1.txt @@ -1,11 +1,7 @@ -# requests - -request destroy { - +request destroy (destructor) { } request get_tearing_control { - id: id(wp_tearing_control_v1), + id: id(wp_tearing_control_v1) (new), surface: id(wl_surface), } - diff --git a/wire/wp_tearing_control_v1.txt b/wire/wp_tearing_control_v1.txt index f2c1815e..3ed7ad48 100644 --- a/wire/wp_tearing_control_v1.txt +++ b/wire/wp_tearing_control_v1.txt @@ -1,9 +1,6 @@ -# requests - request set_presentation_hint { hint: u32, } -request destroy { - +request destroy (destructor) { } diff --git a/wire/wp_viewport.txt b/wire/wp_viewport.txt index 3506bb56..9aa61522 100644 --- a/wire/wp_viewport.txt +++ b/wire/wp_viewport.txt @@ -1,6 +1,4 @@ -# requests - -request destroy { +request destroy (destructor) { } request set_source { diff --git a/wire/wp_viewporter.txt b/wire/wp_viewporter.txt index d451a9d6..a7099b76 100644 --- a/wire/wp_viewporter.txt +++ b/wire/wp_viewporter.txt @@ -1,9 +1,7 @@ -# requests - -request destroy { +request destroy (destructor) { } request get_viewport { - id: id(wp_viewport), + id: id(wp_viewport) (new), surface: id(wl_surface), } diff --git a/wire/xdg_activation_token_v1.txt b/wire/xdg_activation_token_v1.txt index 2a53b258..2845de6e 100644 --- a/wire/xdg_activation_token_v1.txt +++ b/wire/xdg_activation_token_v1.txt @@ -1,5 +1,3 @@ -# requests - request set_serial { serial: u32, seat: id(wl_seat), @@ -14,15 +12,11 @@ request set_surface { } request commit { - } -request destroy { - -} - -# events - event done { token: str, } + +request destroy (destructor) { +} diff --git a/wire/xdg_activation_v1.txt b/wire/xdg_activation_v1.txt index c57da96a..e51b32e5 100644 --- a/wire/xdg_activation_v1.txt +++ b/wire/xdg_activation_v1.txt @@ -1,11 +1,8 @@ -# requests - -request destroy { - +request destroy (destructor) { } request get_activation_token { - id: id(xdg_activation_token_v1), + id: id(xdg_activation_token_v1) (new), } request activate { diff --git a/wire/xdg_dialog_v1.txt b/wire/xdg_dialog_v1.txt index 1135d31e..f342792b 100644 --- a/wire/xdg_dialog_v1.txt +++ b/wire/xdg_dialog_v1.txt @@ -1,11 +1,8 @@ -request destroy { - +request destroy (destructor) { } request set_modal { - } request unset_modal { - } diff --git a/wire/xdg_popup.txt b/wire/xdg_popup.txt index a6506d96..f14731c7 100644 --- a/wire/xdg_popup.txt +++ b/wire/xdg_popup.txt @@ -1,19 +1,11 @@ -# requests - -request destroy { } +request destroy (destructor) { +} request grab { seat: id(wl_seat), serial: u32, } -request reposition (since = 3) { - positioner: id(xdg_positioner), - token: u32, -} - -# events - event configure { x: i32, y: i32, @@ -22,7 +14,11 @@ event configure { } event popup_done { +} +request reposition (since = 3) { + positioner: id(xdg_positioner), + token: u32, } event repositioned (since = 3) { diff --git a/wire/xdg_positioner.txt b/wire/xdg_positioner.txt index f721c963..16b1e8c4 100644 --- a/wire/xdg_positioner.txt +++ b/wire/xdg_positioner.txt @@ -1,6 +1,5 @@ -# requests - -request destroy { } +request destroy (destructor) { +} request set_size { width: i32, @@ -32,7 +31,6 @@ request set_offset { } request set_reactive (since = 3) { - } request set_parent_size (since = 3) { diff --git a/wire/xdg_surface.txt b/wire/xdg_surface.txt index d3a0514f..4db0331d 100644 --- a/wire/xdg_surface.txt +++ b/wire/xdg_surface.txt @@ -1,13 +1,12 @@ -# requests - -request destroy { } +request destroy (destructor) { +} request get_toplevel { - id: id(xdg_toplevel), + id: id(xdg_toplevel) (new), } request get_popup { - id: id(xdg_popup), + id: id(xdg_popup) (new), parent: id(xdg_surface), positioner: id(xdg_positioner), } @@ -23,8 +22,6 @@ request ack_configure { serial: u32, } -# events - event configure { serial: u32, } diff --git a/wire/xdg_toplevel.txt b/wire/xdg_toplevel.txt index d9a2ab52..d6304f5e 100644 --- a/wire/xdg_toplevel.txt +++ b/wire/xdg_toplevel.txt @@ -1,7 +1,4 @@ -# requests - -request destroy { - +request destroy (destructor) { } request set_parent { @@ -44,21 +41,21 @@ request set_min_size { height: i32, } -request set_maximized { } +request set_maximized { +} -request unset_maximized { } +request unset_maximized { +} request set_fullscreen { output: id(wl_output), } request unset_fullscreen { - } -request set_minimized { } - -# events +request set_minimized { +} event configure { width: i32, @@ -66,7 +63,8 @@ event configure { states: array(u32), } -event close { } +event close { +} event configure_bounds (since = 4) { width: i32, diff --git a/wire/xdg_toplevel_drag_manager_v1.txt b/wire/xdg_toplevel_drag_manager_v1.txt index 3f9d6acb..00bcf2e9 100644 --- a/wire/xdg_toplevel_drag_manager_v1.txt +++ b/wire/xdg_toplevel_drag_manager_v1.txt @@ -1,10 +1,7 @@ -# requests - -request destroy { - +request destroy (destructor) { } request get_xdg_toplevel_drag { - id: id(xdg_toplevel_drag_v1), + id: id(xdg_toplevel_drag_v1) (new), data_source: id(wl_data_source), } diff --git a/wire/xdg_toplevel_drag_v1.txt b/wire/xdg_toplevel_drag_v1.txt index 56899987..be423460 100644 --- a/wire/xdg_toplevel_drag_v1.txt +++ b/wire/xdg_toplevel_drag_v1.txt @@ -1,7 +1,4 @@ -# requests - -request destroy { - +request destroy (destructor) { } request attach { diff --git a/wire/xdg_toplevel_tag_manager_v1.txt b/wire/xdg_toplevel_tag_manager_v1.txt index 633c5db0..7d798c97 100644 --- a/wire/xdg_toplevel_tag_manager_v1.txt +++ b/wire/xdg_toplevel_tag_manager_v1.txt @@ -1,5 +1,4 @@ -request destroy { - +request destroy (destructor) { } request set_toplevel_tag { diff --git a/wire/xdg_wm_base.txt b/wire/xdg_wm_base.txt index d102097a..11ebda93 100644 --- a/wire/xdg_wm_base.txt +++ b/wire/xdg_wm_base.txt @@ -1,13 +1,12 @@ -# requests - -request destroy { } +request destroy (destructor) { +} request create_positioner { - id: id(xdg_positioner), + id: id(xdg_positioner) (new), } request get_xdg_surface { - id: id(xdg_surface), + id: id(xdg_surface) (new), surface: id(wl_surface), } @@ -15,8 +14,6 @@ request pong { serial: u32, } -# events - event ping { serial: u32, } diff --git a/wire/xdg_wm_dialog_v1.txt b/wire/xdg_wm_dialog_v1.txt index 1a6b73aa..364dd36a 100644 --- a/wire/xdg_wm_dialog_v1.txt +++ b/wire/xdg_wm_dialog_v1.txt @@ -1,8 +1,7 @@ -request destroy { - +request destroy (destructor) { } request get_xdg_dialog { - id: id(xdg_dialog_v1), + id: id(xdg_dialog_v1) (new), toplevel: id(xdg_toplevel), } diff --git a/wire/xwayland_shell_v1.txt b/wire/xwayland_shell_v1.txt index 840a67b5..048b5f62 100644 --- a/wire/xwayland_shell_v1.txt +++ b/wire/xwayland_shell_v1.txt @@ -1,8 +1,7 @@ -# requests - -request destroy { } +request destroy (destructor) { +} request get_xwayland_surface { - id: id(xwayland_surface_v1), + id: id(xwayland_surface_v1) (new), surface: id(wl_surface), } diff --git a/wire/xwayland_surface_v1.txt b/wire/xwayland_surface_v1.txt index 42c19019..0b697288 100644 --- a/wire/xwayland_surface_v1.txt +++ b/wire/xwayland_surface_v1.txt @@ -1,7 +1,6 @@ -# requests - request set_serial { serial: u64_rev, } -request destroy { } +request destroy (destructor) { +} diff --git a/wire/zwp_confined_pointer_v1.txt b/wire/zwp_confined_pointer_v1.txt index fa745c7a..e0adfced 100644 --- a/wire/zwp_confined_pointer_v1.txt +++ b/wire/zwp_confined_pointer_v1.txt @@ -1,19 +1,12 @@ -# requests - -request destroy { - +request destroy (destructor) { } request set_region { region: id(wl_region), } -# events - event confined { - } event unconfined { - } diff --git a/wire/zwp_idle_inhibit_manager_v1.txt b/wire/zwp_idle_inhibit_manager_v1.txt index f2d884b4..c40ec678 100644 --- a/wire/zwp_idle_inhibit_manager_v1.txt +++ b/wire/zwp_idle_inhibit_manager_v1.txt @@ -1,8 +1,7 @@ -# requests - -request destroy { } +request destroy (destructor) { +} request create_inhibitor { - id: id(zwp_idle_inhibitor_v1), + id: id(zwp_idle_inhibitor_v1) (new), surface: id(wl_surface), } diff --git a/wire/zwp_idle_inhibitor_v1.txt b/wire/zwp_idle_inhibitor_v1.txt index 26937709..fdecd8b2 100644 --- a/wire/zwp_idle_inhibitor_v1.txt +++ b/wire/zwp_idle_inhibitor_v1.txt @@ -1,3 +1,2 @@ -# requests - -request destroy { } +request destroy (destructor) { +} diff --git a/wire/zwp_linux_buffer_params_v1.txt b/wire/zwp_linux_buffer_params_v1.txt index 947362b3..472fe67c 100644 --- a/wire/zwp_linux_buffer_params_v1.txt +++ b/wire/zwp_linux_buffer_params_v1.txt @@ -1,6 +1,5 @@ -# requests - -request destroy { } +request destroy (destructor) { +} request add { fd: fd, @@ -17,20 +16,17 @@ request create { flags: u32, } +event created { + buffer: id(wl_buffer) (new), +} + +event failed { +} + request create_immed (since = 2) { - buffer_id: id(wl_buffer), + buffer_id: id(wl_buffer) (new), width: i32, height: i32, format: u32, flags: u32, } - -# events - -event created { - buffer: id(wl_buffer), -} - -event failed { - -} diff --git a/wire/zwp_linux_dmabuf_feedback_v1.txt b/wire/zwp_linux_dmabuf_feedback_v1.txt index c286434b..d315b89e 100644 --- a/wire/zwp_linux_dmabuf_feedback_v1.txt +++ b/wire/zwp_linux_dmabuf_feedback_v1.txt @@ -1,10 +1,8 @@ -# requests +request destroy (destructor) { +} -request destroy { } - -# events - -event done { } +event done { +} event format_table { fd: fd, @@ -16,7 +14,6 @@ event main_device { } event tranche_done { - } event tranche_target_device { diff --git a/wire/zwp_linux_dmabuf_v1.txt b/wire/zwp_linux_dmabuf_v1.txt index 794ff334..87b7c011 100644 --- a/wire/zwp_linux_dmabuf_v1.txt +++ b/wire/zwp_linux_dmabuf_v1.txt @@ -1,22 +1,10 @@ -# requests - -request destroy { } +request destroy (destructor) { +} request create_params { - params_id: id(zwp_linux_buffer_params_v1), + params_id: id(zwp_linux_buffer_params_v1) (new), } -request get_default_feedback (since = 4) { - id: id(zwp_linux_dmabuf_feedback_v1), -} - -request get_surface_feedback (since = 4) { - id: id(zwp_linux_dmabuf_feedback_v1), - surface: id(wl_surface), -} - -# events - event format { format: u32, } @@ -25,3 +13,12 @@ event modifier (since = 3) { format: u32, modifier: u64, } + +request get_default_feedback (since = 4) { + id: id(zwp_linux_dmabuf_feedback_v1) (new), +} + +request get_surface_feedback (since = 4) { + id: id(zwp_linux_dmabuf_feedback_v1) (new), + surface: id(wl_surface), +} diff --git a/wire/zwp_locked_pointer_v1.txt b/wire/zwp_locked_pointer_v1.txt index ec1e98fa..c1b36a93 100644 --- a/wire/zwp_locked_pointer_v1.txt +++ b/wire/zwp_locked_pointer_v1.txt @@ -1,6 +1,4 @@ -# requests - -request destroy { +request destroy (destructor) { } request set_cursor_position_hint { @@ -12,8 +10,6 @@ request set_region { region: id(wl_region), } -# events - event locked { } diff --git a/wire/zwp_pointer_constraints_v1.txt b/wire/zwp_pointer_constraints_v1.txt index d5bef6d7..7ac789fc 100644 --- a/wire/zwp_pointer_constraints_v1.txt +++ b/wire/zwp_pointer_constraints_v1.txt @@ -1,11 +1,8 @@ -# requests - -request destroy { - +request destroy (destructor) { } request lock_pointer { - id: id(zwp_locked_pointer_v1), + id: id(zwp_locked_pointer_v1) (new), surface: id(wl_surface), pointer: id(wl_pointer), region: id(wl_region), @@ -13,7 +10,7 @@ request lock_pointer { } request confine_pointer { - id: id(zwp_confined_pointer_v1), + id: id(zwp_confined_pointer_v1) (new), surface: id(wl_surface), pointer: id(wl_pointer), region: id(wl_region), diff --git a/wire/zwp_pointer_gesture_hold_v1.txt b/wire/zwp_pointer_gesture_hold_v1.txt index a8df1216..adf19fb2 100644 --- a/wire/zwp_pointer_gesture_hold_v1.txt +++ b/wire/zwp_pointer_gesture_hold_v1.txt @@ -1,5 +1,4 @@ -request destroy (since = 3) { - +request destroy (destructor, since = 3) { } event begin (since = 3) { diff --git a/wire/zwp_pointer_gesture_pinch_v1.txt b/wire/zwp_pointer_gesture_pinch_v1.txt index 2109d1fd..8d0dc792 100644 --- a/wire/zwp_pointer_gesture_pinch_v1.txt +++ b/wire/zwp_pointer_gesture_pinch_v1.txt @@ -1,5 +1,4 @@ -request destroy { - +request destroy (destructor) { } event begin { diff --git a/wire/zwp_pointer_gesture_swipe_v1.txt b/wire/zwp_pointer_gesture_swipe_v1.txt index 7519b2f3..309a191a 100644 --- a/wire/zwp_pointer_gesture_swipe_v1.txt +++ b/wire/zwp_pointer_gesture_swipe_v1.txt @@ -1,5 +1,4 @@ -request destroy { - +request destroy (destructor) { } event begin { diff --git a/wire/zwp_pointer_gestures_v1.txt b/wire/zwp_pointer_gestures_v1.txt index a1a1b905..b6f59516 100644 --- a/wire/zwp_pointer_gestures_v1.txt +++ b/wire/zwp_pointer_gestures_v1.txt @@ -1,18 +1,17 @@ request get_swipe_gesture { - id: id(zwp_pointer_gesture_swipe_v1), + id: id(zwp_pointer_gesture_swipe_v1) (new), pointer: id(wl_pointer), } request get_pinch_gesture { - id: id(zwp_pointer_gesture_pinch_v1), + id: id(zwp_pointer_gesture_pinch_v1) (new), pointer: id(wl_pointer), } -request release (since = 2) { - +request release (destructor, since = 2) { } request get_hold_gesture (since = 3) { - id: id(zwp_pointer_gesture_hold_v1), + id: id(zwp_pointer_gesture_hold_v1) (new), pointer: id(wl_pointer), } diff --git a/wire/zwp_primary_selection_device_manager_v1.txt b/wire/zwp_primary_selection_device_manager_v1.txt index d58b018c..b37bcab2 100644 --- a/wire/zwp_primary_selection_device_manager_v1.txt +++ b/wire/zwp_primary_selection_device_manager_v1.txt @@ -1,12 +1,11 @@ -# requests - request create_source { - id: id(zwp_primary_selection_source_v1), + id: id(zwp_primary_selection_source_v1) (new), } -request get_device { - id: id(zwp_primary_selection_device_v1), +request get_device { + id: id(zwp_primary_selection_device_v1) (new), seat: id(wl_seat), } -request destroy { } +request destroy (destructor) { +} diff --git a/wire/zwp_primary_selection_device_v1.txt b/wire/zwp_primary_selection_device_v1.txt index fe377b48..8ea86790 100644 --- a/wire/zwp_primary_selection_device_v1.txt +++ b/wire/zwp_primary_selection_device_v1.txt @@ -1,18 +1,15 @@ -# requests - request set_selection { source: id(zwp_primary_selection_source_v1), serial: u32, } -request destroy { } - -# events - -event data_offer { - offer: id(zwp_primary_selection_offer_v1), +event data_offer { + offer: id(zwp_primary_selection_offer_v1) (new), } -event selection { +event selection { id: id(zwp_primary_selection_offer_v1), } + +request destroy (destructor) { +} diff --git a/wire/zwp_primary_selection_offer_v1.txt b/wire/zwp_primary_selection_offer_v1.txt index 9e0cc0b3..3b4e54cf 100644 --- a/wire/zwp_primary_selection_offer_v1.txt +++ b/wire/zwp_primary_selection_offer_v1.txt @@ -1,14 +1,11 @@ -# requests - request receive { mime_type: str, fd: fd, } -request destroy { } +request destroy (destructor) { +} -# events - -event offer { +event offer { mime_type: str, } diff --git a/wire/zwp_primary_selection_source_v1.txt b/wire/zwp_primary_selection_source_v1.txt index d802b8af..07560e73 100644 --- a/wire/zwp_primary_selection_source_v1.txt +++ b/wire/zwp_primary_selection_source_v1.txt @@ -1,12 +1,9 @@ -# requests - request offer { mime_type: str, } -request destroy { } - -# events +request destroy (destructor) { +} event send { mime_type: str, @@ -14,5 +11,4 @@ event send { } event cancelled { - } diff --git a/wire/zwp_relative_pointer_manager_v1.txt b/wire/zwp_relative_pointer_manager_v1.txt index f89c7ced..4d25612e 100644 --- a/wire/zwp_relative_pointer_manager_v1.txt +++ b/wire/zwp_relative_pointer_manager_v1.txt @@ -1,10 +1,7 @@ -# requests - -request destroy { - +request destroy (destructor) { } request get_relative_pointer { - id: id(zwp_relative_pointer_v1), + id: id(zwp_relative_pointer_v1) (new), pointer: id(wl_pointer), } diff --git a/wire/zwp_relative_pointer_v1.txt b/wire/zwp_relative_pointer_v1.txt index 71fd8bf7..28465ff4 100644 --- a/wire/zwp_relative_pointer_v1.txt +++ b/wire/zwp_relative_pointer_v1.txt @@ -1,15 +1,10 @@ -# requests - -request destroy { - +request destroy (destructor) { } -# events - event relative_motion { utime: u64, dx: fixed, dy: fixed, - dx_unaccelerated: fixed, - dy_unaccelerated: fixed, + dx_unaccel: fixed, + dy_unaccel: fixed, } diff --git a/wire/zwp_tablet_manager_v2.txt b/wire/zwp_tablet_manager_v2.txt index 015a3da0..2a69468c 100644 --- a/wire/zwp_tablet_manager_v2.txt +++ b/wire/zwp_tablet_manager_v2.txt @@ -1,7 +1,7 @@ request get_tablet_seat { - tablet_seat: id(zwp_tablet_seat_v2), + tablet_seat: id(zwp_tablet_seat_v2) (new), seat: id(wl_seat), } -request destroy { +request destroy (destructor) { } diff --git a/wire/zwp_tablet_pad_dial_v2.txt b/wire/zwp_tablet_pad_dial_v2.txt index e7d99bc0..7037becb 100644 --- a/wire/zwp_tablet_pad_dial_v2.txt +++ b/wire/zwp_tablet_pad_dial_v2.txt @@ -3,7 +3,7 @@ request set_feedback { serial: u32, } -request destroy { +request destroy (destructor) { } event delta { diff --git a/wire/zwp_tablet_pad_group_v2.txt b/wire/zwp_tablet_pad_group_v2.txt index a7ec7fb1..1a6a68c3 100644 --- a/wire/zwp_tablet_pad_group_v2.txt +++ b/wire/zwp_tablet_pad_group_v2.txt @@ -1,4 +1,4 @@ -request destroy { +request destroy (destructor) { } event buttons { @@ -6,11 +6,11 @@ event buttons { } event ring { - ring: id(zwp_tablet_pad_ring_v2), + ring: id(zwp_tablet_pad_ring_v2) (new), } event strip { - strip: id(zwp_tablet_pad_strip_v2), + strip: id(zwp_tablet_pad_strip_v2) (new), } event modes { @@ -26,6 +26,6 @@ event mode_switch { mode: u32, } -event dial { - dial: id(zwp_tablet_pad_dial_v2), +event dial (since = 2) { + dial: id(zwp_tablet_pad_dial_v2) (new), } diff --git a/wire/zwp_tablet_pad_ring_v2.txt b/wire/zwp_tablet_pad_ring_v2.txt index 9013350e..aaa66732 100644 --- a/wire/zwp_tablet_pad_ring_v2.txt +++ b/wire/zwp_tablet_pad_ring_v2.txt @@ -3,7 +3,7 @@ request set_feedback { serial: u32, } -request destroy { +request destroy (destructor) { } event source { diff --git a/wire/zwp_tablet_pad_strip_v2.txt b/wire/zwp_tablet_pad_strip_v2.txt index 222efda0..0d0b2f5e 100644 --- a/wire/zwp_tablet_pad_strip_v2.txt +++ b/wire/zwp_tablet_pad_strip_v2.txt @@ -3,7 +3,7 @@ request set_feedback { serial: u32, } -request destroy { +request destroy (destructor) { } event source { diff --git a/wire/zwp_tablet_pad_v2.txt b/wire/zwp_tablet_pad_v2.txt index 08770652..9c9e648d 100644 --- a/wire/zwp_tablet_pad_v2.txt +++ b/wire/zwp_tablet_pad_v2.txt @@ -4,11 +4,11 @@ request set_feedback { serial: u32, } -request destroy { +request destroy (destructor) { } event group { - pad_group: id(zwp_tablet_pad_group_v2), + pad_group: id(zwp_tablet_pad_group_v2) (new), } event path { diff --git a/wire/zwp_tablet_seat_v2.txt b/wire/zwp_tablet_seat_v2.txt index bbc4e331..d1b32a49 100644 --- a/wire/zwp_tablet_seat_v2.txt +++ b/wire/zwp_tablet_seat_v2.txt @@ -1,14 +1,14 @@ -request destroy { +request destroy (destructor) { } event tablet_added { - id: id(zwp_tablet_v2), + id: id(zwp_tablet_v2) (new), } event tool_added { - id: id(zwp_tablet_tool_v2), + id: id(zwp_tablet_tool_v2) (new), } event pad_added { - id: id(zwp_tablet_pad_v2), + id: id(zwp_tablet_pad_v2) (new), } diff --git a/wire/zwp_tablet_tool_v2.txt b/wire/zwp_tablet_tool_v2.txt index ea611667..b0676c7c 100644 --- a/wire/zwp_tablet_tool_v2.txt +++ b/wire/zwp_tablet_tool_v2.txt @@ -5,7 +5,7 @@ request set_cursor { hotspot_y: i32, } -request destroy { +request destroy (destructor) { } event type { diff --git a/wire/zwp_tablet_v2.txt b/wire/zwp_tablet_v2.txt index 6d377f6a..3be8e2a5 100644 --- a/wire/zwp_tablet_v2.txt +++ b/wire/zwp_tablet_v2.txt @@ -1,4 +1,4 @@ -request destroy { +request destroy (destructor) { } event name { @@ -20,6 +20,6 @@ event done { event removed { } -event bustype { +event bustype (since = 2) { bustype: u32, } diff --git a/wire/zwp_text_input_manager_v3.txt b/wire/zwp_text_input_manager_v3.txt index c2e261fc..d8be4e51 100644 --- a/wire/zwp_text_input_manager_v3.txt +++ b/wire/zwp_text_input_manager_v3.txt @@ -1,7 +1,7 @@ -request destroy { +request destroy (destructor) { } request get_text_input { - id: id(zwp_text_input_v3), + id: id(zwp_text_input_v3) (new), seat: id(wl_seat), } diff --git a/wire/zwp_text_input_v3.txt b/wire/zwp_text_input_v3.txt index a104a2bc..3075e83b 100644 --- a/wire/zwp_text_input_v3.txt +++ b/wire/zwp_text_input_v3.txt @@ -1,4 +1,4 @@ -request destroy { +request destroy (destructor) { } request enable { @@ -41,9 +41,9 @@ event leave { } event preedit_string { - text: optstr, - cursor_begin: i32, - cursor_end: i32, + text: optstr, + cursor_begin: i32, + cursor_end: i32, } event commit_string { diff --git a/wire/zxdg_decoration_manager_v1.txt b/wire/zxdg_decoration_manager_v1.txt index 45a457fa..a0ebfedd 100644 --- a/wire/zxdg_decoration_manager_v1.txt +++ b/wire/zxdg_decoration_manager_v1.txt @@ -1,8 +1,7 @@ -# requests - -request destroy { } +request destroy (destructor) { +} request get_toplevel_decoration { - id: id(zxdg_toplevel_decoration_v1), + id: id(zxdg_toplevel_decoration_v1) (new), toplevel: id(xdg_toplevel), } diff --git a/wire/zxdg_output_manager_v1.txt b/wire/zxdg_output_manager_v1.txt index c0e45572..f3da7232 100644 --- a/wire/zxdg_output_manager_v1.txt +++ b/wire/zxdg_output_manager_v1.txt @@ -1,8 +1,7 @@ -# requests - -request destroy { } +request destroy (destructor) { +} request get_xdg_output { - id: id(zxdg_output_v1), + id: id(zxdg_output_v1) (new), output: id(wl_output), } diff --git a/wire/zxdg_output_v1.txt b/wire/zxdg_output_v1.txt index 5374427f..ea9deab7 100644 --- a/wire/zxdg_output_v1.txt +++ b/wire/zxdg_output_v1.txt @@ -1,8 +1,5 @@ -# requests - -request destroy { } - -# events +request destroy (destructor) { +} event logical_position { x: i32, @@ -14,7 +11,8 @@ event logical_size { height: i32, } -event done { } +event done { +} event name (since = 2) { name: str, diff --git a/wire/zxdg_toplevel_decoration_v1.txt b/wire/zxdg_toplevel_decoration_v1.txt index 3ecdbdca..9874a9aa 100644 --- a/wire/zxdg_toplevel_decoration_v1.txt +++ b/wire/zxdg_toplevel_decoration_v1.txt @@ -1,7 +1,4 @@ -# requests - -request destroy { - +request destroy (destructor) { } request set_mode { @@ -11,8 +8,6 @@ request set_mode { request unset_mode { } -# events - event configure { mode: u32, }