[INFO] cloning repository https://github.com/crolbar/ristate [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/crolbar/ristate" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fcrolbar%2Fristate", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fcrolbar%2Fristate'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 749273a4da02308483dc35aa893fe616230aa94a [INFO] testing crolbar/ristate against try#b83b707f97d809763b7861afa7638871f3339a33 for pr-145838-1 [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fcrolbar%2Fristate" "/workspace/builds/worker-7-tc2/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-7-tc2/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/crolbar/ristate [INFO] finished tweaking git repo https://github.com/crolbar/ristate [INFO] tweaked toml for git repo https://github.com/crolbar/ristate written to /workspace/builds/worker-7-tc2/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/crolbar/ristate on toolchain b83b707f97d809763b7861afa7638871f3339a33 [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+b83b707f97d809763b7861afa7638871f3339a33" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [INFO] crate git repo https://github.com/crolbar/ristate already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+b83b707f97d809763b7861afa7638871f3339a33" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Blocking waiting for file lock on package cache [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-tc2/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-tc2/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:7ad1b28ee6f5f7f699f6cf7015098d6ccdd96d6f2d78dd06228f5b4c9faf309c" "/opt/rustwide/cargo-home/bin/cargo" "+b83b707f97d809763b7861afa7638871f3339a33" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] 3e92e2322f6170fa89361a58dd73d00654774a3ab1f5261af8b20dc00c7a8fd3 [INFO] running `Command { std: "docker" "start" "-a" "3e92e2322f6170fa89361a58dd73d00654774a3ab1f5261af8b20dc00c7a8fd3", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "3e92e2322f6170fa89361a58dd73d00654774a3ab1f5261af8b20dc00c7a8fd3", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "3e92e2322f6170fa89361a58dd73d00654774a3ab1f5261af8b20dc00c7a8fd3", kill_on_drop: false }` [INFO] [stdout] 3e92e2322f6170fa89361a58dd73d00654774a3ab1f5261af8b20dc00c7a8fd3 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-tc2/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-tc2/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:7ad1b28ee6f5f7f699f6cf7015098d6ccdd96d6f2d78dd06228f5b4c9faf309c" "/opt/rustwide/cargo-home/bin/cargo" "+b83b707f97d809763b7861afa7638871f3339a33" "build" "--frozen" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] 6949eac5c407e5f9068bde2ff9d31a6ef75026a8b9737db140c816fec45ac4f4 [INFO] running `Command { std: "docker" "start" "-a" "6949eac5c407e5f9068bde2ff9d31a6ef75026a8b9737db140c816fec45ac4f4", kill_on_drop: false }` [INFO] [stderr] Compiling smallvec v1.15.0 [INFO] [stderr] Compiling memchr v2.7.4 [INFO] [stderr] Compiling memoffset v0.6.5 [INFO] [stderr] Compiling wayland-sys v0.29.5 [INFO] [stderr] Compiling wayland-scanner v0.29.5 [INFO] [stderr] Compiling syn v2.0.101 [INFO] [stderr] Compiling nix v0.24.3 [INFO] [stderr] Compiling wayland-client v0.29.5 [INFO] [stderr] Compiling wayland-protocols v0.29.5 [INFO] [stderr] Compiling ristate v0.1.0 (/opt/rustwide/workdir) [INFO] [stderr] Compiling wayland-commons v0.29.5 [INFO] [stderr] Compiling serde_derive v1.0.219 [INFO] [stderr] Compiling serde v1.0.219 [INFO] [stderr] Compiling serde_json v1.0.140 [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:6656 [INFO] [stdout] | [INFO] [stdout] 1 | ... const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_sta... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: `#[warn(static_mut_refs)]` (part of `#[warn(rust_2024_compatibility)]`) on by default [INFO] [stdout] help: use `&raw const` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { &raw const zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:8402 [INFO] [stdout] | [INFO] [stdout] 1 | ...] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: ... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] help: use `&raw const` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { &raw const super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:8511 [INFO] [stdout] | [INFO] [stdout] 1 | ...t wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manage... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] help: use `&raw const` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { &raw const super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:8700 [INFO] [stdout] | [INFO] [stdout] 1 | ... 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] help: use `&raw const` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { &raw const super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:8805 [INFO] [stdout] | [INFO] [stdout] 1 | ...nst wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of t... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] help: use `&raw const` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { &raw const super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:9161 [INFO] [stdout] | [INFO] [stdout] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * con... [INFO] [stdout] | ^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] help: use `&raw const` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:9349 [INFO] [stdout] | [INFO] [stdout] 1 | ...types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_rive... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] help: use `&raw const` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { &raw const zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:9588 [INFO] [stdout] | [INFO] [stdout] 1 | ... types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] help: use `&raw const` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { &raw const zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:9945 [INFO] [stdout] | [INFO] [stdout] 1 | ...count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] help: use `&raw const` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { &raw const zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:17896 [INFO] [stdout] | [INFO] [stdout] 1 | ...* const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_outp... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] help: use `&raw const` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { &raw const zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:19288 [INFO] [stdout] | [INFO] [stdout] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this i... [INFO] [stdout] | ^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] help: use `&raw const` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:19613 [INFO] [stdout] | [INFO] [stdout] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * con... [INFO] [stdout] | ^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] help: use `&raw const` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:19786 [INFO] [stdout] | [INFO] [stdout] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * c... [INFO] [stdout] | ^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] help: use `&raw const` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:19962 [INFO] [stdout] | [INFO] [stdout] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * c... [INFO] [stdout] | ^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] help: use `&raw const` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:20138 [INFO] [stdout] | [INFO] [stdout] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 ... [INFO] [stdout] | ^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] help: use `&raw const` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:20319 [INFO] [stdout] | [INFO] [stdout] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for in... [INFO] [stdout] | ^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] help: use `&raw const` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:20623 [INFO] [stdout] | [INFO] [stdout] 1 | ...count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_outpu... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] help: use `&raw const` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { &raw const zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:20711 [INFO] [stdout] | [INFO] [stdout] 1 | ...nt_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface ... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] help: use `&raw const` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { &raw const zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:28551 [INFO] [stdout] | [INFO] [stdout] 1 | ... * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_st... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] help: use `&raw const` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { &raw const zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:29820 [INFO] [stdout] | [INFO] [stdout] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output... [INFO] [stdout] | ^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] help: use `&raw const` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:29959 [INFO] [stdout] | [INFO] [stdout] 1 | ..._interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] help: use `&raw const` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { &raw const super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:30138 [INFO] [stdout] | [INFO] [stdout] 1 | ..._interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] help: use `&raw const` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { &raw const super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:30501 [INFO] [stdout] | [INFO] [stdout] 1 | ...char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_outpu... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] help: use `&raw const` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { &raw const zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:30720 [INFO] [stdout] | [INFO] [stdout] 1 | ...har , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] help: use `&raw const` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { &raw const zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:30937 [INFO] [stdout] | [INFO] [stdout] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_... [INFO] [stdout] | ^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] help: use `&raw const` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:31106 [INFO] [stdout] | [INFO] [stdout] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for in... [INFO] [stdout] | ^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] help: use `&raw const` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:31406 [INFO] [stdout] | [INFO] [stdout] 1 | ..._count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_s... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] help: use `&raw const` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { &raw const zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:31492 [INFO] [stdout] | [INFO] [stdout] 1 | ...ent_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] help: use `&raw const` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { &raw const zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 17.07s [INFO] running `Command { std: "docker" "inspect" "6949eac5c407e5f9068bde2ff9d31a6ef75026a8b9737db140c816fec45ac4f4", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "6949eac5c407e5f9068bde2ff9d31a6ef75026a8b9737db140c816fec45ac4f4", kill_on_drop: false }` [INFO] [stdout] 6949eac5c407e5f9068bde2ff9d31a6ef75026a8b9737db140c816fec45ac4f4 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-tc2/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-tc2/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:7ad1b28ee6f5f7f699f6cf7015098d6ccdd96d6f2d78dd06228f5b4c9faf309c" "/opt/rustwide/cargo-home/bin/cargo" "+b83b707f97d809763b7861afa7638871f3339a33" "test" "--frozen" "--no-run" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] d9f505337d6b17f7cba80af12d206fdb7d476f119f80dfd1ad44d040f3a66677 [INFO] running `Command { std: "docker" "start" "-a" "d9f505337d6b17f7cba80af12d206fdb7d476f119f80dfd1ad44d040f3a66677", kill_on_drop: false }` [INFO] [stderr] Compiling ristate v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:6656 [INFO] [stdout] | [INFO] [stdout] 1 | ... const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_sta... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: `#[warn(static_mut_refs)]` (part of `#[warn(rust_2024_compatibility)]`) on by default [INFO] [stdout] help: use `&raw const` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { &raw const zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:8402 [INFO] [stdout] | [INFO] [stdout] 1 | ...] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: ... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] help: use `&raw const` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { &raw const super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:8511 [INFO] [stdout] | [INFO] [stdout] 1 | ...t wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manage... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] help: use `&raw const` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { &raw const super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:8700 [INFO] [stdout] | [INFO] [stdout] 1 | ... 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] help: use `&raw const` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { &raw const super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:8805 [INFO] [stdout] | [INFO] [stdout] 1 | ...nst wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of t... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] help: use `&raw const` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { &raw const super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:9161 [INFO] [stdout] | [INFO] [stdout] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * con... [INFO] [stdout] | ^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] help: use `&raw const` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:9349 [INFO] [stdout] | [INFO] [stdout] 1 | ...types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_rive... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] help: use `&raw const` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { &raw const zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:9588 [INFO] [stdout] | [INFO] [stdout] 1 | ... types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] help: use `&raw const` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { &raw const zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:9945 [INFO] [stdout] | [INFO] [stdout] 1 | ...count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] help: use `&raw const` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { &raw const zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:17896 [INFO] [stdout] | [INFO] [stdout] 1 | ...* const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_outp... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] help: use `&raw const` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { &raw const zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:19288 [INFO] [stdout] | [INFO] [stdout] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this i... [INFO] [stdout] | ^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] help: use `&raw const` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:19613 [INFO] [stdout] | [INFO] [stdout] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * con... [INFO] [stdout] | ^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] help: use `&raw const` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:19786 [INFO] [stdout] | [INFO] [stdout] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * c... [INFO] [stdout] | ^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] help: use `&raw const` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:19962 [INFO] [stdout] | [INFO] [stdout] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * c... [INFO] [stdout] | ^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] help: use `&raw const` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:20138 [INFO] [stdout] | [INFO] [stdout] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 ... [INFO] [stdout] | ^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] help: use `&raw const` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:20319 [INFO] [stdout] | [INFO] [stdout] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for in... [INFO] [stdout] | ^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] help: use `&raw const` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:20623 [INFO] [stdout] | [INFO] [stdout] 1 | ...count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_outpu... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] help: use `&raw const` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { &raw const zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:20711 [INFO] [stdout] | [INFO] [stdout] 1 | ...nt_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface ... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] help: use `&raw const` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { &raw const zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:28551 [INFO] [stdout] | [INFO] [stdout] 1 | ... * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_st... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] help: use `&raw const` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { &raw const zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:29820 [INFO] [stdout] | [INFO] [stdout] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output... [INFO] [stdout] | ^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] help: use `&raw const` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:29959 [INFO] [stdout] | [INFO] [stdout] 1 | ..._interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] help: use `&raw const` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { &raw const super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:30138 [INFO] [stdout] | [INFO] [stdout] 1 | ..._interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] help: use `&raw const` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { &raw const super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:30501 [INFO] [stdout] | [INFO] [stdout] 1 | ...char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_outpu... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] help: use `&raw const` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { &raw const zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:30720 [INFO] [stdout] | [INFO] [stdout] 1 | ...har , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] help: use `&raw const` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { &raw const zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:30937 [INFO] [stdout] | [INFO] [stdout] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_... [INFO] [stdout] | ^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] help: use `&raw const` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:31106 [INFO] [stdout] | [INFO] [stdout] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for in... [INFO] [stdout] | ^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] help: use `&raw const` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:31406 [INFO] [stdout] | [INFO] [stdout] 1 | ..._count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_s... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] help: use `&raw const` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { &raw const zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:31492 [INFO] [stdout] | [INFO] [stdout] 1 | ...ent_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] help: use `&raw const` instead to create a raw pointer [INFO] [stdout] | [INFO] [stdout] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { &raw const zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `test` profile [unoptimized + debuginfo] target(s) in 0.65s [INFO] running `Command { std: "docker" "inspect" "d9f505337d6b17f7cba80af12d206fdb7d476f119f80dfd1ad44d040f3a66677", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "d9f505337d6b17f7cba80af12d206fdb7d476f119f80dfd1ad44d040f3a66677", kill_on_drop: false }` [INFO] [stdout] d9f505337d6b17f7cba80af12d206fdb7d476f119f80dfd1ad44d040f3a66677 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-tc2/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-tc2/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:7ad1b28ee6f5f7f699f6cf7015098d6ccdd96d6f2d78dd06228f5b4c9faf309c" "/opt/rustwide/cargo-home/bin/cargo" "+b83b707f97d809763b7861afa7638871f3339a33" "test" "--frozen", kill_on_drop: false }` [INFO] [stdout] 50def093dc01bcfed776b61186f07159daad79f7ee7589997bef696a06e4448a [INFO] running `Command { std: "docker" "start" "-a" "50def093dc01bcfed776b61186f07159daad79f7ee7589997bef696a06e4448a", kill_on_drop: false }` [INFO] [stderr] warning: creating a shared reference to mutable static [INFO] [stderr] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:6656 [INFO] [stderr] | [INFO] [stderr] 1 | ... const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_sta... [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stderr] | [INFO] [stderr] = note: for more information, see [INFO] [stderr] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stderr] = note: `#[warn(static_mut_refs)]` (part of `#[warn(rust_2024_compatibility)]`) on by default [INFO] [stderr] help: use `&raw const` instead to create a raw pointer [INFO] [stderr] | [INFO] [stderr] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { &raw const zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stderr] | +++++++++ [INFO] [stderr] [INFO] [stderr] warning: creating a shared reference to mutable static [INFO] [stderr] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:8402 [INFO] [stderr] | [INFO] [stderr] 1 | ...] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: ... [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stderr] | [INFO] [stderr] = note: for more information, see [INFO] [stderr] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stderr] help: use `&raw const` instead to create a raw pointer [INFO] [stderr] | [INFO] [stderr] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { &raw const super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stderr] | +++++++++ [INFO] [stderr] [INFO] [stderr] warning: creating a shared reference to mutable static [INFO] [stderr] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:8511 [INFO] [stderr] | [INFO] [stderr] 1 | ...t wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manage... [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stderr] | [INFO] [stderr] = note: for more information, see [INFO] [stderr] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stderr] help: use `&raw const` instead to create a raw pointer [INFO] [stderr] | [INFO] [stderr] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { &raw const super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stderr] | +++++++++ [INFO] [stderr] [INFO] [stderr] warning: creating a shared reference to mutable static [INFO] [stderr] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:8700 [INFO] [stderr] | [INFO] [stderr] 1 | ... 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl... [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stderr] | [INFO] [stderr] = note: for more information, see [INFO] [stderr] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stderr] help: use `&raw const` instead to create a raw pointer [INFO] [stderr] | [INFO] [stderr] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { &raw const super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stderr] | +++++++++ [INFO] [stderr] [INFO] [stderr] warning: creating a shared reference to mutable static [INFO] [stderr] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:8805 [INFO] [stderr] | [INFO] [stderr] 1 | ...nst wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of t... [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stderr] | [INFO] [stderr] = note: for more information, see [INFO] [stderr] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stderr] help: use `&raw const` instead to create a raw pointer [INFO] [stderr] | [INFO] [stderr] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { &raw const super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stderr] | +++++++++ [INFO] [stderr] [INFO] [stderr] warning: creating a shared reference to mutable static [INFO] [stderr] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:9161 [INFO] [stderr] | [INFO] [stderr] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * con... [INFO] [stderr] | ^^^^^^^^^^^^ shared reference to mutable static [INFO] [stderr] | [INFO] [stderr] = note: for more information, see [INFO] [stderr] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stderr] help: use `&raw const` instead to create a raw pointer [INFO] [stderr] | [INFO] [stderr] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stderr] | +++++++++ [INFO] [stderr] [INFO] [stderr] warning: creating a shared reference to mutable static [INFO] [stderr] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:9349 [INFO] [stderr] | [INFO] [stderr] 1 | ...types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_rive... [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stderr] | [INFO] [stderr] = note: for more information, see [INFO] [stderr] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stderr] help: use `&raw const` instead to create a raw pointer [INFO] [stderr] | [INFO] [stderr] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { &raw const zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stderr] | +++++++++ [INFO] [stderr] [INFO] [stderr] warning: creating a shared reference to mutable static [INFO] [stderr] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:9588 [INFO] [stderr] | [INFO] [stderr] 1 | ... types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation... [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stderr] | [INFO] [stderr] = note: for more information, see [INFO] [stderr] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stderr] help: use `&raw const` instead to create a raw pointer [INFO] [stderr] | [INFO] [stderr] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { &raw const zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stderr] | +++++++++ [INFO] [stderr] [INFO] [stderr] warning: creating a shared reference to mutable static [INFO] [stderr] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:9945 [INFO] [stderr] | [INFO] [stderr] 1 | ...count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_... [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stderr] | [INFO] [stderr] = note: for more information, see [INFO] [stderr] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stderr] help: use `&raw const` instead to create a raw pointer [INFO] [stderr] | [INFO] [stderr] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { &raw const zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stderr] | +++++++++ [INFO] [stderr] [INFO] [stderr] warning: creating a shared reference to mutable static [INFO] [stderr] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:17896 [INFO] [stderr] | [INFO] [stderr] 1 | ...* const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_outp... [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stderr] | [INFO] [stderr] = note: for more information, see [INFO] [stderr] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stderr] help: use `&raw const` instead to create a raw pointer [INFO] [stderr] | [INFO] [stderr] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { &raw const zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stderr] | +++++++++ [INFO] [stderr] [INFO] [stderr] warning: creating a shared reference to mutable static [INFO] [stderr] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:19288 [INFO] [stderr] | [INFO] [stderr] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this i... [INFO] [stderr] | ^^^^^^^^^^^^ shared reference to mutable static [INFO] [stderr] | [INFO] [stderr] = note: for more information, see [INFO] [stderr] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stderr] help: use `&raw const` instead to create a raw pointer [INFO] [stderr] | [INFO] [stderr] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stderr] | +++++++++ [INFO] [stderr] [INFO] [stderr] warning: creating a shared reference to mutable static [INFO] [stderr] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:19613 [INFO] [stderr] | [INFO] [stderr] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * con... [INFO] [stderr] | ^^^^^^^^^^^^ shared reference to mutable static [INFO] [stderr] | [INFO] [stderr] = note: for more information, see [INFO] [stderr] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stderr] help: use `&raw const` instead to create a raw pointer [INFO] [stderr] | [INFO] [stderr] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stderr] | +++++++++ [INFO] [stderr] [INFO] [stderr] warning: creating a shared reference to mutable static [INFO] [stderr] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:19786 [INFO] [stderr] | [INFO] [stderr] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * c... [INFO] [stderr] | ^^^^^^^^^^^^ shared reference to mutable static [INFO] [stderr] | [INFO] [stderr] = note: for more information, see [INFO] [stderr] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stderr] help: use `&raw const` instead to create a raw pointer [INFO] [stderr] | [INFO] [stderr] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stderr] | +++++++++ [INFO] [stderr] [INFO] [stderr] warning: creating a shared reference to mutable static [INFO] [stderr] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:19962 [INFO] [stderr] | [INFO] [stderr] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * c... [INFO] [stderr] | ^^^^^^^^^^^^ shared reference to mutable static [INFO] [stderr] | [INFO] [stderr] = note: for more information, see [INFO] [stderr] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stderr] help: use `&raw const` instead to create a raw pointer [INFO] [stderr] | [INFO] [stderr] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stderr] | +++++++++ [INFO] [stderr] [INFO] [stderr] warning: creating a shared reference to mutable static [INFO] [stderr] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:20138 [INFO] [stderr] | [INFO] [stderr] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 ... [INFO] [stderr] | ^^^^^^^^^^^^ shared reference to mutable static [INFO] [stderr] | [INFO] [stderr] = note: for more information, see [INFO] [stderr] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stderr] help: use `&raw const` instead to create a raw pointer [INFO] [stderr] | [INFO] [stderr] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stderr] | +++++++++ [INFO] [stderr] [INFO] [stderr] warning: creating a shared reference to mutable static [INFO] [stderr] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:20319 [INFO] [stderr] | [INFO] [stderr] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for in... [INFO] [stderr] | ^^^^^^^^^^^^ shared reference to mutable static [INFO] [stderr] | [INFO] [stderr] = note: for more information, see [INFO] [stderr] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stderr] help: use `&raw const` instead to create a raw pointer [INFO] [stderr] | [INFO] [stderr] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stderr] | +++++++++ [INFO] [stderr] [INFO] [stderr] warning: creating a shared reference to mutable static [INFO] [stderr] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:20623 [INFO] [stderr] | [INFO] [stderr] 1 | ...count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_outpu... [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stderr] | [INFO] [stderr] = note: for more information, see [INFO] [stderr] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stderr] help: use `&raw const` instead to create a raw pointer [INFO] [stderr] | [INFO] [stderr] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { &raw const zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stderr] | +++++++++ [INFO] [stderr] [INFO] [stderr] warning: creating a shared reference to mutable static [INFO] [stderr] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:20711 [INFO] [stderr] | [INFO] [stderr] 1 | ...nt_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface ... [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stderr] | [INFO] [stderr] = note: for more information, see [INFO] [stderr] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stderr] help: use `&raw const` instead to create a raw pointer [INFO] [stderr] | [INFO] [stderr] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { &raw const zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stderr] | +++++++++ [INFO] [stderr] [INFO] [stderr] warning: creating a shared reference to mutable static [INFO] [stderr] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:28551 [INFO] [stderr] | [INFO] [stderr] 1 | ... * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_st... [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stderr] | [INFO] [stderr] = note: for more information, see [INFO] [stderr] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stderr] help: use `&raw const` instead to create a raw pointer [INFO] [stderr] | [INFO] [stderr] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { &raw const zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stderr] | +++++++++ [INFO] [stderr] [INFO] [stderr] warning: creating a shared reference to mutable static [INFO] [stderr] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:29820 [INFO] [stderr] | [INFO] [stderr] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output... [INFO] [stderr] | ^^^^^^^^^^^^ shared reference to mutable static [INFO] [stderr] | [INFO] [stderr] = note: for more information, see [INFO] [stderr] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stderr] help: use `&raw const` instead to create a raw pointer [INFO] [stderr] | [INFO] [stderr] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stderr] | +++++++++ [INFO] [stderr] [INFO] [stderr] warning: creating a shared reference to mutable static [INFO] [stderr] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:29959 [INFO] [stderr] | [INFO] [stderr] 1 | ..._interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v... [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stderr] | [INFO] [stderr] = note: for more information, see [INFO] [stderr] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stderr] help: use `&raw const` instead to create a raw pointer [INFO] [stderr] | [INFO] [stderr] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { &raw const super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stderr] | +++++++++ [INFO] [stderr] [INFO] [stderr] warning: creating a shared reference to mutable static [INFO] [stderr] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:30138 [INFO] [stderr] | [INFO] [stderr] 1 | ..._interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of... [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stderr] | [INFO] [stderr] = note: for more information, see [INFO] [stderr] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stderr] help: use `&raw const` instead to create a raw pointer [INFO] [stderr] | [INFO] [stderr] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { &raw const super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stderr] | +++++++++ [INFO] [stderr] [INFO] [stderr] warning: creating a shared reference to mutable static [INFO] [stderr] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:30501 [INFO] [stderr] | [INFO] [stderr] 1 | ...char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_outpu... [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stderr] | [INFO] [stderr] = note: for more information, see [INFO] [stderr] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stderr] help: use `&raw const` instead to create a raw pointer [INFO] [stderr] | [INFO] [stderr] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { &raw const zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stderr] | +++++++++ [INFO] [stderr] [INFO] [stderr] warning: creating a shared reference to mutable static [INFO] [stderr] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:30720 [INFO] [stderr] | [INFO] [stderr] 1 | ...har , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0... [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stderr] | [INFO] [stderr] = note: for more information, see [INFO] [stderr] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stderr] help: use `&raw const` instead to create a raw pointer [INFO] [stderr] | [INFO] [stderr] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { &raw const zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stderr] | +++++++++ [INFO] [stderr] [INFO] [stderr] warning: creating a shared reference to mutable static [INFO] [stderr] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:30937 [INFO] [stderr] | [INFO] [stderr] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_... [INFO] [stderr] | ^^^^^^^^^^^^ shared reference to mutable static [INFO] [stderr] | [INFO] [stderr] = note: for more information, see [INFO] [stderr] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stderr] help: use `&raw const` instead to create a raw pointer [INFO] [stderr] | [INFO] [stderr] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stderr] | +++++++++ [INFO] [stderr] [INFO] [stderr] warning: creating a shared reference to mutable static [INFO] [stderr] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:31106 [INFO] [stderr] | [INFO] [stderr] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for in... [INFO] [stderr] | ^^^^^^^^^^^^ shared reference to mutable static [INFO] [stderr] | [INFO] [stderr] = note: for more information, see [INFO] [stderr] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stderr] help: use `&raw const` instead to create a raw pointer [INFO] [stderr] | [INFO] [stderr] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stderr] | +++++++++ [INFO] [stderr] [INFO] [stderr] warning: creating a shared reference to mutable static [INFO] [stderr] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:31406 [INFO] [stderr] | [INFO] [stderr] 1 | ..._count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_s... [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stderr] | [INFO] [stderr] = note: for more information, see [INFO] [stderr] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stderr] help: use `&raw const` instead to create a raw pointer [INFO] [stderr] | [INFO] [stderr] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { &raw const zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stderr] | +++++++++ [INFO] [stdout] [INFO] [stderr] [INFO] [stdout] running 0 tests [INFO] [stderr] warning: creating a shared reference to mutable static [INFO] [stdout] [INFO] [stderr] --> /opt/rustwide/target/debug/build/ristate-f3ff8b97e2e4b115/out/river-status-unstable-v1.rs:1:31492 [INFO] [stdout] test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s [INFO] [stderr] | [INFO] [stdout] [INFO] [stderr] 1 | ...ent_count : 4 , events : unsafe { & zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stderr] | [INFO] [stderr] = note: for more information, see [INFO] [stderr] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stderr] help: use `&raw const` instead to create a raw pointer [INFO] [stderr] | [INFO] [stderr] 1 | use std :: os :: raw :: { c_char , c_void } ; const NULLPTR : * const c_void = 0 as * const c_void ; static mut types_null : [* const sys :: common :: wl_interface ; 1] = [NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "manage river status objects\n\nA global factory for objects that receive status information specific\nto river. It could be used to implement, for example, a status bar."] pub mod zriver_status_manager_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] GetRiverOutputStatus { output : super :: wl_output :: WlOutput , } , # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] GetRiverSeatStatus { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } , super :: MessageDesc { name : "get_river_output_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "get_river_seat_status" , since : 1 , signature : & [super :: ArgumentType :: NewId , super :: ArgumentType :: Object ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 2 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , Request :: GetRiverOutputStatus { .. } => 1 , Request :: GetRiverSeatStatus { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 1 => Some (Object :: from_interface :: < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > (version , meta . child () ,)) , 2 => Some (Object :: from_interface :: < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > (version , meta . child () ,)) , _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , Request :: GetRiverOutputStatus { output } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (output . as_ref () . id ()) ,] , } , Request :: GetRiverSeatStatus { seat } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: NewId (0) , Argument :: Object (seat . as_ref () . id ()) ,] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , Request :: GetRiverOutputStatus { output } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = output . as_ref () . c_ptr () as * mut _ ; f (1 , & mut _args_array) } , Request :: GetRiverSeatStatus { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = :: std :: ptr :: null_mut () as * mut _ ; _args_array [1] . o = seat . as_ref () . c_ptr () as * mut _ ; f (2 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { } } fn opcode (& self) -> u16 { match * self { } } fn since (& self) -> u32 { match * self { } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverStatusManagerV1 (Proxy < ZriverStatusManagerV1 >) ; impl AsRef < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverStatusManagerV1 >> for ZriverStatusManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverStatusManagerV1 (value) } } impl From < ZriverStatusManagerV1 > for Proxy < ZriverStatusManagerV1 > { # [inline] fn from (value : ZriverStatusManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverStatusManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverStatusManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_status_manager_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_status_manager_v1_interface } } } impl ZriverStatusManagerV1 { # [doc = "destroy the river_status_manager object\n\nThis request indicates that the client will not use the\nriver_status_manager object any more. Objects that have been created\nthrough this instance are not affected.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "create an output status object\n\nThis creates a new river_output_status object for the given wl_output."] pub fn get_river_output_status (& self , output : & super :: wl_output :: WlOutput) -> Main < super :: zriver_output_status_v1 :: ZriverOutputStatusV1 > { let msg = Request :: GetRiverOutputStatus { output : output . clone () } ; self . 0 . send (msg , None) . unwrap () } # [doc = "create a seat status object\n\nThis creates a new river_seat_status object for the given wl_seat."] pub fn get_river_seat_status (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zriver_seat_status_v1 :: ZriverSeatStatusV1 > { let msg = Request :: GetRiverSeatStatus { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_OUTPUT_STATUS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_GET_RIVER_SEAT_STATUS_SINCE : u32 = 1u32 ; static mut zriver_status_manager_v1_requests_get_river_output_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_output_status_v1 :: zriver_output_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_status_manager_v1_requests_get_river_seat_status_types : [* const wl_interface ; 2] = [unsafe { & super :: zriver_seat_status_v1 :: zriver_seat_status_v1_interface as * const wl_interface } , unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_status_manager_v1_requests : [wl_message ; 3] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"get_river_output_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_output_status_types as * const _ } , } , wl_message { name : b"get_river_seat_status\0" as * const u8 as * const c_char , signature : b"no\0" as * const u8 as * const c_char , types : unsafe { & zriver_status_manager_v1_requests_get_river_seat_status_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_status_manager_v1_interface : wl_interface = wl_interface { name : b"zriver_status_manager_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 3 , requests : unsafe { & zriver_status_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "track output tags and focus\n\nThis interface allows clients to receive information about the current\nwindowing state of an output."] pub mod zriver_output_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "focused tags of the output\n\nSent once binding the interface and again whenever the tag focus of\nthe output changes."] FocusedTags { tags : u32 , } , # [doc = "tag state of an output's views\n\nSent once on binding the interface and again whenever the tag state\nof the output changes."] ViewTags { tags : Vec < u8 > , } , # [doc = "tags of the output with an urgent view\n\nSent once on binding the interface and again whenever the set of\ntags with at least one urgent view changes.\n\nOnly available since version 2 of the interface"] UrgentTags { tags : u32 , } , # [doc = "name of the layout\n\nSent once on binding the interface should a layout name exist and again\nwhenever the name changes.\n\nOnly available since version 4 of the interface"] LayoutName { name : String , } , # [doc = "name of the layout\n\nSent when the current layout name has been removed without a new one\nbeing set, for example when the active layout generator disconnects.\n\nOnly available since version 4 of the interface"] LayoutNameClear , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_tags" , since : 1 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "view_tags" , since : 1 , signature : & [super :: ArgumentType :: Array ,] , destructor : false , } , super :: MessageDesc { name : "urgent_tags" , since : 2 , signature : & [super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "layout_name" , since : 4 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "layout_name_clear" , since : 4 , signature : & [] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedTags { .. } => 0 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 3 , Event :: LayoutNameClear => 4 , } } fn since (& self) -> u32 { match * self { Event :: FocusedTags { .. } => 1 , Event :: ViewTags { .. } => 1 , Event :: UrgentTags { .. } => 2 , Event :: LayoutName { .. } => 4 , Event :: LayoutNameClear => 4 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: ViewTags { tags : { if let Some (Argument :: Array (val)) = args . next () { * val } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: UrgentTags { tags : { if let Some (Argument :: Uint (val)) = args . next () { val } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: LayoutName { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 4 => Ok (Event :: LayoutNameClear) , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedTags { tags : _args [0] . u , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: ViewTags { tags : { let array = & * _args [0] . a ; :: std :: slice :: from_raw_parts (array . data as * const u8 , array . size) . to_owned () } , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UrgentTags { tags : _args [0] . u , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: LayoutName { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 4 => { Ok (Event :: LayoutNameClear) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverOutputStatusV1 (Proxy < ZriverOutputStatusV1 >) ; impl AsRef < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverOutputStatusV1 >> for ZriverOutputStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverOutputStatusV1 (value) } } impl From < ZriverOutputStatusV1 > for Proxy < ZriverOutputStatusV1 > { # [inline] fn from (value : ZriverOutputStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverOutputStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverOutputStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_output_status_v1" ; const VERSION : u32 = 4 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_output_status_v1_interface } } } impl ZriverOutputStatusV1 { # [doc = "destroy the river_output_status object\n\nThis request indicates that the client will not use the\nriver_output_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_VIEW_TAGS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_URGENT_TAGS_SINCE : u32 = 2u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_SINCE : u32 = 4u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_LAYOUT_NAME_CLEAR_SINCE : u32 = 4u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_output_status_v1_events : [wl_message ; 5] = [wl_message { name : b"focused_tags\0" as * const u8 as * const c_char , signature : b"u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"view_tags\0" as * const u8 as * const c_char , signature : b"a\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"urgent_tags\0" as * const u8 as * const c_char , signature : b"2u\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name\0" as * const u8 as * const c_char , signature : b"4s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"layout_name_clear\0" as * const u8 as * const c_char , signature : b"4\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_output_status_v1_interface : wl_interface = wl_interface { name : b"zriver_output_status_v1\0" as * const u8 as * const c_char , version : 4 , request_count : 1 , requests : unsafe { & zriver_output_status_v1_requests as * const _ } , event_count : 5 , events : unsafe { & zriver_output_status_v1_events as * const _ } , } ; } # [doc = "track seat focus\n\nThis interface allows clients to receive information about the current\nfocus of a seat. Note that (un)focused_output events will only be sent\nif the client has bound the relevant wl_output globals."] pub mod zriver_seat_status_v1 { use std :: os :: raw :: c_char ; use super :: { Proxy , AnonymousObject , Interface , MessageGroup , MessageDesc , ArgumentType , Object , Message , Argument , ObjectMetadata , types_null , NULLPTR , Main , smallvec , } ; use super :: sys :: common :: { wl_interface , wl_array , wl_argument , wl_message } ; use super :: sys :: client :: * ; # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, once sent this object cannot be used any longer."] Destroy , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , } } fn opcode (& self) -> u16 { match * self { Request :: Destroy => 0 , } } fn since (& self) -> u32 { match * self { Request :: Destroy => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { panic ! ("Request::from_raw can not be used Client-side.") } fn into_raw (self , sender_id : u32) -> Message { match self { Request :: Destroy => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [] , } , } } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Request , () > { panic ! ("Request::from_raw_c can not be used Client-side.") } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { match self { Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (0 , & mut _args_array) } , } } } # [derive (Debug)] # [non_exhaustive] pub enum Event { # [doc = "the seat focused an output\n\nSent on binding the interface and again whenever an output gains focus."] FocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "the seat unfocused an output\n\nSent whenever an output loses focus."] UnfocusedOutput { output : super :: wl_output :: WlOutput , } , # [doc = "information on the focused view\n\nSent once on binding the interface and again whenever the focused\nview or a property thereof changes. The title may be an empty string\nif no view is focused or the focused view did not set a title."] FocusedView { title : String , } , # [doc = "the active mode changed\n\nSent once on binding the interface and again whenever a new mode\nis entered (e.g. with riverctl enter-mode foobar).\n\nOnly available since version 3 of the interface"] Mode { name : String , } , } impl super :: MessageGroup for Event { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "focused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "unfocused_output" , since : 1 , signature : & [super :: ArgumentType :: Object ,] , destructor : false , } , super :: MessageDesc { name : "focused_view" , since : 1 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } , super :: MessageDesc { name : "mode" , since : 3 , signature : & [super :: ArgumentType :: Str ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Event :: FocusedOutput { .. } => 0 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 2 , Event :: Mode { .. } => 3 , } } fn since (& self) -> u32 { match * self { Event :: FocusedOutput { .. } => 1 , Event :: UnfocusedOutput { .. } => 1 , Event :: FocusedView { .. } => 1 , Event :: Mode { .. } => 3 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { _ => None , } } fn from_raw (msg : Message , map : & mut Self :: Map) -> Result < Self , () > { match msg . opcode { 0 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 1 => { let mut args = msg . args . into_iter () ; Ok (Event :: UnfocusedOutput { output : { if let Some (Argument :: Object (val)) = args . next () { map . get_or_dead (val) . into () } else { return Err (()) ; } } , }) } , 2 => { let mut args = msg . args . into_iter () ; Ok (Event :: FocusedView { title : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , 3 => { let mut args = msg . args . into_iter () ; Ok (Event :: Mode { name : { if let Some (Argument :: Str (val)) = args . next () { let s = String :: from_utf8 (val . into_bytes ()) . unwrap_or_else (| e | String :: from_utf8_lossy (& e . into_bytes ()) . into ()) ; s } else { return Err (()) ; } } , }) } , _ => Err (()) , } } fn into_raw (self , sender_id : u32) -> Message { panic ! ("Event::into_raw can not be used Client-side.") } unsafe fn from_raw_c (obj : * mut :: std :: os :: raw :: c_void , opcode : u32 , args : * const wl_argument ,) -> Result < Event , () > { match opcode { 0 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 1 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: UnfocusedOutput { output : Proxy :: < super :: wl_output :: WlOutput > :: from_c_ptr (_args [0] . o as * mut _ ,) . into () , }) } , 2 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: FocusedView { title : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , 3 => { let _args = :: std :: slice :: from_raw_parts (args , 1) ; Ok (Event :: Mode { name : :: std :: ffi :: CStr :: from_ptr (_args [0] . s) . to_string_lossy () . into_owned () , }) } , _ => return Err (()) , } } fn as_raw_c_in < F , T > (self , f : F) -> T where F : FnOnce (u32 , & mut [wl_argument]) -> T { panic ! ("Event::as_raw_c_in can not be used Client-side.") } } # [derive (Clone , Eq , PartialEq)] pub struct ZriverSeatStatusV1 (Proxy < ZriverSeatStatusV1 >) ; impl AsRef < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZriverSeatStatusV1 >> for ZriverSeatStatusV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZriverSeatStatusV1 (value) } } impl From < ZriverSeatStatusV1 > for Proxy < ZriverSeatStatusV1 > { # [inline] fn from (value : ZriverSeatStatusV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZriverSeatStatusV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZriverSeatStatusV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zriver_seat_status_v1" ; const VERSION : u32 = 3 ; fn c_interface () -> * const wl_interface { unsafe { & zriver_seat_status_v1_interface } } } impl ZriverSeatStatusV1 { # [doc = "destroy the river_seat_status object\n\nThis request indicates that the client will not use the\nriver_seat_status object any more.\n\nThis is a destructor, you cannot send requests to this object any longer once this method is called."] pub fn destroy (& self ,) -> () { let msg = Request :: Destroy ; self . 0 . send :: < AnonymousObject > (msg , None) ; } } # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_UNFOCUSED_OUTPUT_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_FOCUSED_VIEW_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this event"] pub const EVT_MODE_SINCE : u32 = 3u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_requests : [wl_message ; 1] = [wl_message { name : b"destroy\0" as * const u8 as * const c_char , signature : b"\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; static mut zriver_seat_status_v1_events_focused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; static mut zriver_seat_status_v1_events_unfocused_output_types : [* const wl_interface ; 1] = [unsafe { & super :: wl_output :: wl_output_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zriver_seat_status_v1_events : [wl_message ; 4] = [wl_message { name : b"focused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_focused_output_types as * const _ } , } , wl_message { name : b"unfocused_output\0" as * const u8 as * const c_char , signature : b"o\0" as * const u8 as * const c_char , types : unsafe { & zriver_seat_status_v1_events_unfocused_output_types as * const _ } , } , wl_message { name : b"focused_view\0" as * const u8 as * const c_char , signature : b"s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"mode\0" as * const u8 as * const c_char , signature : b"3s\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zriver_seat_status_v1_interface : wl_interface = wl_interface { name : b"zriver_seat_status_v1\0" as * const u8 as * const c_char , version : 3 , request_count : 1 , requests : unsafe { & zriver_seat_status_v1_requests as * const _ } , event_count : 4 , events : unsafe { &raw const zriver_seat_status_v1_events as * const _ } , } ; } [INFO] [stderr] | +++++++++ [INFO] [stderr] [INFO] [stderr] warning: `ristate` (bin "ristate" test) generated 28 warnings [INFO] [stderr] Finished `test` profile [unoptimized + debuginfo] target(s) in 0.13s [INFO] [stderr] Running unittests src/main.rs (/opt/rustwide/target/debug/deps/ristate-266100784315872b) [INFO] running `Command { std: "docker" "inspect" "50def093dc01bcfed776b61186f07159daad79f7ee7589997bef696a06e4448a", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "50def093dc01bcfed776b61186f07159daad79f7ee7589997bef696a06e4448a", kill_on_drop: false }` [INFO] [stdout] 50def093dc01bcfed776b61186f07159daad79f7ee7589997bef696a06e4448a