[INFO] fetching crate zwp-virtual-keyboard 0.2.7... [INFO] testing zwp-virtual-keyboard-0.2.7 against 1.90.0 for beta-1.91-3 [INFO] extracting crate zwp-virtual-keyboard 0.2.7 into /workspace/builds/worker-3-tc1/source [INFO] started tweaking crates.io crate zwp-virtual-keyboard 0.2.7 [INFO] finished tweaking crates.io crate zwp-virtual-keyboard 0.2.7 [INFO] tweaked toml for crates.io crate zwp-virtual-keyboard 0.2.7 written to /workspace/builds/worker-3-tc1/source/Cargo.toml [INFO] validating manifest of crates.io crate zwp-virtual-keyboard 0.2.7 on toolchain 1.90.0 [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+1.90.0" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [INFO] crate crates.io crate zwp-virtual-keyboard 0.2.7 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" "+1.90.0" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Updating crates.io index [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded once_cell v1.15.0 [INFO] [stderr] Downloaded quote v1.0.21 [INFO] [stderr] Downloaded downcast-rs v1.2.0 [INFO] [stderr] Downloaded input-event-codes v5.16.8 [INFO] [stderr] Downloaded memmap2 v0.5.7 [INFO] [stderr] Downloaded xml-rs v0.8.4 [INFO] [stderr] Downloaded wayland-sys v0.29.5 [INFO] [stderr] Downloaded wayland-commons v0.29.5 [INFO] [stderr] Downloaded wayland-client v0.29.5 [INFO] [stderr] Downloaded proc-macro2 v1.0.46 [INFO] [stderr] Downloaded wayland-scanner v0.29.5 [INFO] [stderr] Downloaded nix v0.24.2 [INFO] [stderr] Downloaded libc v0.2.134 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc1/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:e90291280db7d1fac5b66fc6dad9f9662629e7365a55743daf9bdf73ebc4ea79" "/opt/rustwide/cargo-home/bin/cargo" "+1.90.0" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] dbdd02ffb7885be7d7954ed733771154f4a373a2b54df9d2415217b6502a7651 [INFO] running `Command { std: "docker" "start" "-a" "dbdd02ffb7885be7d7954ed733771154f4a373a2b54df9d2415217b6502a7651", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "dbdd02ffb7885be7d7954ed733771154f4a373a2b54df9d2415217b6502a7651", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "dbdd02ffb7885be7d7954ed733771154f4a373a2b54df9d2415217b6502a7651", kill_on_drop: false }` [INFO] [stdout] dbdd02ffb7885be7d7954ed733771154f4a373a2b54df9d2415217b6502a7651 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc1/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=warn" "-e" "RUSTDOCFLAGS=--cap-lints=warn" "-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:e90291280db7d1fac5b66fc6dad9f9662629e7365a55743daf9bdf73ebc4ea79" "/opt/rustwide/cargo-home/bin/cargo" "+1.90.0" "build" "--frozen" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] 563dd006e0611e7352dad57e512b4ce711443e782f90a3dc42f27374610b3d00 [INFO] running `Command { std: "docker" "start" "-a" "563dd006e0611e7352dad57e512b4ce711443e782f90a3dc42f27374610b3d00", kill_on_drop: false }` [INFO] [stderr] Compiling proc-macro2 v1.0.46 [INFO] [stderr] Compiling quote v1.0.21 [INFO] [stderr] Compiling xml-rs v0.8.4 [INFO] [stderr] Compiling libc v0.2.134 [INFO] [stderr] Compiling once_cell v1.15.0 [INFO] [stderr] Compiling wayland-sys v0.29.5 [INFO] [stderr] Compiling wayland-scanner v0.29.5 [INFO] [stderr] Compiling nix v0.24.2 [INFO] [stderr] Compiling wayland-client v0.29.5 [INFO] [stderr] Compiling zwp-virtual-keyboard v0.2.7 (/opt/rustwide/workdir) [INFO] [stderr] Compiling wayland-commons v0.29.5 [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/zwp-virtual-keyboard-0d32ffd994ee6290/out/virtual_keyboard_api.rs:1:8281 [INFO] [stdout] | [INFO] [stdout] 1 | ...* const wl_interface { unsafe { & zwp_virtual_keyboard_v1_interface } } } impl ZwpVirtualKeyboardV1 { # [doc = "keyboard mapping\n\nPr... [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)]` 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 ; 4] = [NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "virtual keyboard\n\nThe virtual keyboard provides an application with requests which emulate\nthe behaviour of a physical keyboard.\n\nThis interface can be used by clients on its own to provide raw input\nevents, or it can accompany the input method protocol."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "No keymap was set"] NoKeymap = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: NoKeymap) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] Keymap { format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32 , } , # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] Key { time : u32 , key : u32 , state : u32 , } , # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] Modifiers { mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32 , } , # [doc = "destroy the virtual keyboard keyboard object\n\n\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 : "keymap" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Fd , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "key" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "modifiers" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Keymap { .. } => 0 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 2 , Request :: Destroy => 3 , } } fn since (& self) -> u32 { match * self { Request :: Keymap { .. } => 1 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 1 , 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 :: Keymap { format , fd , size } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Uint (format) , Argument :: Fd (fd) , Argument :: Uint (size) ,] , } , Request :: Key { time , key , state } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (time) , Argument :: Uint (key) , Argument :: Uint (state) ,] , } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: Uint (mods_depressed) , Argument :: Uint (mods_latched) , Argument :: Uint (mods_locked) , Argument :: Uint (group) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 3 , 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 :: Keymap { format , fd , size } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; _args_array [1] . h = fd ; _args_array [2] . u = size ; f (0 , & mut _args_array) } , Request :: Key { time , key , state } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = time ; _args_array [1] . u = key ; _args_array [2] . u = state ; f (1 , & mut _args_array) } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => { let mut _args_array : [wl_argument ; 4] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = mods_depressed ; _args_array [1] . u = mods_latched ; _args_array [2] . u = mods_locked ; _args_array [3] . u = group ; f (2 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & 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 ZwpVirtualKeyboardV1 (Proxy < ZwpVirtualKeyboardV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardV1 (value) } } impl From < ZwpVirtualKeyboardV1 > for Proxy < ZwpVirtualKeyboardV1 > { # [inline] fn from (value : ZwpVirtualKeyboardV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { &raw const zwp_virtual_keyboard_v1_interface } } } impl ZwpVirtualKeyboardV1 { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] pub fn keymap (& self , format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32) -> () { let msg = Request :: Keymap { format : format , fd : fd , size : size } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] pub fn key (& self , time : u32 , key : u32 , state : u32) -> () { let msg = Request :: Key { time : time , key : key , state : state } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] pub fn modifiers (& self , mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32) -> () { let msg = Request :: Modifiers { mods_depressed : mods_depressed , mods_latched : mods_latched , mods_locked : mods_locked , group : group } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the virtual keyboard keyboard object\n\n\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_KEYMAP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_KEY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_MODIFIERS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_requests : [wl_message ; 4] = [wl_message { name : b"keymap\0" as * const u8 as * const c_char , signature : b"uhu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"key\0" as * const u8 as * const c_char , signature : b"uuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"modifiers\0" as * const u8 as * const c_char , signature : b"uuuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , 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 this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 4 , requests : unsafe { & zwp_virtual_keyboard_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "virtual keyboard manager\n\nA virtual keyboard manager allows an application to provide keyboard\ninput events as if they came from a physical keyboard."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "client not authorized to use the interface"] Unauthorized = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: Unauthorized) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] CreateVirtualKeyboard { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_virtual_keyboard" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: NewId ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateVirtualKeyboard { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: CreateVirtualKeyboard { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > (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 :: CreateVirtualKeyboard { seat } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) , Argument :: NewId (0) ,] , } , } } 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 :: CreateVirtualKeyboard { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [1] . o = :: std :: ptr :: null_mut () as * mut _ ; f (0 , & 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 ZwpVirtualKeyboardManagerV1 (Proxy < ZwpVirtualKeyboardManagerV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardManagerV1 (value) } } impl From < ZwpVirtualKeyboardManagerV1 > for Proxy < ZwpVirtualKeyboardManagerV1 > { # [inline] fn from (value : ZwpVirtualKeyboardManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_manager_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_manager_v1_interface } } } impl ZwpVirtualKeyboardManagerV1 { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] pub fn create_virtual_keyboard (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > { let msg = Request :: CreateVirtualKeyboard { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_VIRTUAL_KEYBOARD_SINCE : u32 = 1u32 ; static mut zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , unsafe { & super :: zwp_virtual_keyboard_v1 :: zwp_virtual_keyboard_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"create_virtual_keyboard\0" as * const u8 as * const c_char , signature : b"on\0" as * const u8 as * const c_char , types : unsafe { & zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_manager_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & zwp_virtual_keyboard_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/zwp-virtual-keyboard-0d32ffd994ee6290/out/virtual_keyboard_api.rs:1:10919 [INFO] [stdout] | [INFO] [stdout] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"key\0" as * const u8 as * const c_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 ; 4] = [NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "virtual keyboard\n\nThe virtual keyboard provides an application with requests which emulate\nthe behaviour of a physical keyboard.\n\nThis interface can be used by clients on its own to provide raw input\nevents, or it can accompany the input method protocol."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "No keymap was set"] NoKeymap = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: NoKeymap) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] Keymap { format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32 , } , # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] Key { time : u32 , key : u32 , state : u32 , } , # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] Modifiers { mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32 , } , # [doc = "destroy the virtual keyboard keyboard object\n\n\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 : "keymap" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Fd , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "key" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "modifiers" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Keymap { .. } => 0 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 2 , Request :: Destroy => 3 , } } fn since (& self) -> u32 { match * self { Request :: Keymap { .. } => 1 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 1 , 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 :: Keymap { format , fd , size } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Uint (format) , Argument :: Fd (fd) , Argument :: Uint (size) ,] , } , Request :: Key { time , key , state } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (time) , Argument :: Uint (key) , Argument :: Uint (state) ,] , } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: Uint (mods_depressed) , Argument :: Uint (mods_latched) , Argument :: Uint (mods_locked) , Argument :: Uint (group) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 3 , 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 :: Keymap { format , fd , size } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; _args_array [1] . h = fd ; _args_array [2] . u = size ; f (0 , & mut _args_array) } , Request :: Key { time , key , state } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = time ; _args_array [1] . u = key ; _args_array [2] . u = state ; f (1 , & mut _args_array) } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => { let mut _args_array : [wl_argument ; 4] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = mods_depressed ; _args_array [1] . u = mods_latched ; _args_array [2] . u = mods_locked ; _args_array [3] . u = group ; f (2 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & 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 ZwpVirtualKeyboardV1 (Proxy < ZwpVirtualKeyboardV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardV1 (value) } } impl From < ZwpVirtualKeyboardV1 > for Proxy < ZwpVirtualKeyboardV1 > { # [inline] fn from (value : ZwpVirtualKeyboardV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_v1_interface } } } impl ZwpVirtualKeyboardV1 { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] pub fn keymap (& self , format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32) -> () { let msg = Request :: Keymap { format : format , fd : fd , size : size } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] pub fn key (& self , time : u32 , key : u32 , state : u32) -> () { let msg = Request :: Key { time : time , key : key , state : state } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] pub fn modifiers (& self , mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32) -> () { let msg = Request :: Modifiers { mods_depressed : mods_depressed , mods_latched : mods_latched , mods_locked : mods_locked , group : group } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the virtual keyboard keyboard object\n\n\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_KEYMAP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_KEY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_MODIFIERS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_requests : [wl_message ; 4] = [wl_message { name : b"keymap\0" as * const u8 as * const c_char , signature : b"uhu\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } , wl_message { name : b"key\0" as * const u8 as * const c_char , signature : b"uuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"modifiers\0" as * const u8 as * const c_char , signature : b"uuuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , 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 this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 4 , requests : unsafe { & zwp_virtual_keyboard_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "virtual keyboard manager\n\nA virtual keyboard manager allows an application to provide keyboard\ninput events as if they came from a physical keyboard."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "client not authorized to use the interface"] Unauthorized = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: Unauthorized) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] CreateVirtualKeyboard { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_virtual_keyboard" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: NewId ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateVirtualKeyboard { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: CreateVirtualKeyboard { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > (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 :: CreateVirtualKeyboard { seat } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) , Argument :: NewId (0) ,] , } , } } 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 :: CreateVirtualKeyboard { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [1] . o = :: std :: ptr :: null_mut () as * mut _ ; f (0 , & 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 ZwpVirtualKeyboardManagerV1 (Proxy < ZwpVirtualKeyboardManagerV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardManagerV1 (value) } } impl From < ZwpVirtualKeyboardManagerV1 > for Proxy < ZwpVirtualKeyboardManagerV1 > { # [inline] fn from (value : ZwpVirtualKeyboardManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_manager_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_manager_v1_interface } } } impl ZwpVirtualKeyboardManagerV1 { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] pub fn create_virtual_keyboard (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > { let msg = Request :: CreateVirtualKeyboard { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_VIRTUAL_KEYBOARD_SINCE : u32 = 1u32 ; static mut zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , unsafe { & super :: zwp_virtual_keyboard_v1 :: zwp_virtual_keyboard_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"create_virtual_keyboard\0" as * const u8 as * const c_char , signature : b"on\0" as * const u8 as * const c_char , types : unsafe { & zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_manager_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & zwp_virtual_keyboard_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/zwp-virtual-keyboard-0d32ffd994ee6290/out/virtual_keyboard_api.rs:1:11088 [INFO] [stdout] | [INFO] [stdout] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"modifiers\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 ; 4] = [NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "virtual keyboard\n\nThe virtual keyboard provides an application with requests which emulate\nthe behaviour of a physical keyboard.\n\nThis interface can be used by clients on its own to provide raw input\nevents, or it can accompany the input method protocol."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "No keymap was set"] NoKeymap = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: NoKeymap) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] Keymap { format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32 , } , # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] Key { time : u32 , key : u32 , state : u32 , } , # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] Modifiers { mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32 , } , # [doc = "destroy the virtual keyboard keyboard object\n\n\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 : "keymap" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Fd , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "key" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "modifiers" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Keymap { .. } => 0 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 2 , Request :: Destroy => 3 , } } fn since (& self) -> u32 { match * self { Request :: Keymap { .. } => 1 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 1 , 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 :: Keymap { format , fd , size } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Uint (format) , Argument :: Fd (fd) , Argument :: Uint (size) ,] , } , Request :: Key { time , key , state } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (time) , Argument :: Uint (key) , Argument :: Uint (state) ,] , } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: Uint (mods_depressed) , Argument :: Uint (mods_latched) , Argument :: Uint (mods_locked) , Argument :: Uint (group) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 3 , 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 :: Keymap { format , fd , size } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; _args_array [1] . h = fd ; _args_array [2] . u = size ; f (0 , & mut _args_array) } , Request :: Key { time , key , state } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = time ; _args_array [1] . u = key ; _args_array [2] . u = state ; f (1 , & mut _args_array) } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => { let mut _args_array : [wl_argument ; 4] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = mods_depressed ; _args_array [1] . u = mods_latched ; _args_array [2] . u = mods_locked ; _args_array [3] . u = group ; f (2 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & 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 ZwpVirtualKeyboardV1 (Proxy < ZwpVirtualKeyboardV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardV1 (value) } } impl From < ZwpVirtualKeyboardV1 > for Proxy < ZwpVirtualKeyboardV1 > { # [inline] fn from (value : ZwpVirtualKeyboardV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_v1_interface } } } impl ZwpVirtualKeyboardV1 { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] pub fn keymap (& self , format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32) -> () { let msg = Request :: Keymap { format : format , fd : fd , size : size } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] pub fn key (& self , time : u32 , key : u32 , state : u32) -> () { let msg = Request :: Key { time : time , key : key , state : state } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] pub fn modifiers (& self , mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32) -> () { let msg = Request :: Modifiers { mods_depressed : mods_depressed , mods_latched : mods_latched , mods_locked : mods_locked , group : group } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the virtual keyboard keyboard object\n\n\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_KEYMAP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_KEY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_MODIFIERS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_requests : [wl_message ; 4] = [wl_message { name : b"keymap\0" as * const u8 as * const c_char , signature : b"uhu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"key\0" as * const u8 as * const c_char , signature : b"uuu\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } , wl_message { name : b"modifiers\0" as * const u8 as * const c_char , signature : b"uuuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , 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 this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 4 , requests : unsafe { & zwp_virtual_keyboard_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "virtual keyboard manager\n\nA virtual keyboard manager allows an application to provide keyboard\ninput events as if they came from a physical keyboard."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "client not authorized to use the interface"] Unauthorized = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: Unauthorized) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] CreateVirtualKeyboard { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_virtual_keyboard" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: NewId ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateVirtualKeyboard { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: CreateVirtualKeyboard { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > (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 :: CreateVirtualKeyboard { seat } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) , Argument :: NewId (0) ,] , } , } } 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 :: CreateVirtualKeyboard { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [1] . o = :: std :: ptr :: null_mut () as * mut _ ; f (0 , & 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 ZwpVirtualKeyboardManagerV1 (Proxy < ZwpVirtualKeyboardManagerV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardManagerV1 (value) } } impl From < ZwpVirtualKeyboardManagerV1 > for Proxy < ZwpVirtualKeyboardManagerV1 > { # [inline] fn from (value : ZwpVirtualKeyboardManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_manager_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_manager_v1_interface } } } impl ZwpVirtualKeyboardManagerV1 { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] pub fn create_virtual_keyboard (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > { let msg = Request :: CreateVirtualKeyboard { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_VIRTUAL_KEYBOARD_SINCE : u32 = 1u32 ; static mut zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , unsafe { & super :: zwp_virtual_keyboard_v1 :: zwp_virtual_keyboard_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"create_virtual_keyboard\0" as * const u8 as * const c_char , signature : b"on\0" as * const u8 as * const c_char , types : unsafe { & zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_manager_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & zwp_virtual_keyboard_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/zwp-virtual-keyboard-0d32ffd994ee6290/out/virtual_keyboard_api.rs:1:11264 [INFO] [stdout] | [INFO] [stdout] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 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 ; 4] = [NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "virtual keyboard\n\nThe virtual keyboard provides an application with requests which emulate\nthe behaviour of a physical keyboard.\n\nThis interface can be used by clients on its own to provide raw input\nevents, or it can accompany the input method protocol."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "No keymap was set"] NoKeymap = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: NoKeymap) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] Keymap { format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32 , } , # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] Key { time : u32 , key : u32 , state : u32 , } , # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] Modifiers { mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32 , } , # [doc = "destroy the virtual keyboard keyboard object\n\n\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 : "keymap" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Fd , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "key" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "modifiers" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Keymap { .. } => 0 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 2 , Request :: Destroy => 3 , } } fn since (& self) -> u32 { match * self { Request :: Keymap { .. } => 1 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 1 , 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 :: Keymap { format , fd , size } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Uint (format) , Argument :: Fd (fd) , Argument :: Uint (size) ,] , } , Request :: Key { time , key , state } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (time) , Argument :: Uint (key) , Argument :: Uint (state) ,] , } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: Uint (mods_depressed) , Argument :: Uint (mods_latched) , Argument :: Uint (mods_locked) , Argument :: Uint (group) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 3 , 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 :: Keymap { format , fd , size } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; _args_array [1] . h = fd ; _args_array [2] . u = size ; f (0 , & mut _args_array) } , Request :: Key { time , key , state } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = time ; _args_array [1] . u = key ; _args_array [2] . u = state ; f (1 , & mut _args_array) } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => { let mut _args_array : [wl_argument ; 4] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = mods_depressed ; _args_array [1] . u = mods_latched ; _args_array [2] . u = mods_locked ; _args_array [3] . u = group ; f (2 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & 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 ZwpVirtualKeyboardV1 (Proxy < ZwpVirtualKeyboardV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardV1 (value) } } impl From < ZwpVirtualKeyboardV1 > for Proxy < ZwpVirtualKeyboardV1 > { # [inline] fn from (value : ZwpVirtualKeyboardV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_v1_interface } } } impl ZwpVirtualKeyboardV1 { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] pub fn keymap (& self , format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32) -> () { let msg = Request :: Keymap { format : format , fd : fd , size : size } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] pub fn key (& self , time : u32 , key : u32 , state : u32) -> () { let msg = Request :: Key { time : time , key : key , state : state } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] pub fn modifiers (& self , mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32) -> () { let msg = Request :: Modifiers { mods_depressed : mods_depressed , mods_latched : mods_latched , mods_locked : mods_locked , group : group } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the virtual keyboard keyboard object\n\n\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_KEYMAP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_KEY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_MODIFIERS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_requests : [wl_message ; 4] = [wl_message { name : b"keymap\0" as * const u8 as * const c_char , signature : b"uhu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"key\0" as * const u8 as * const c_char , signature : b"uuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"modifiers\0" as * const u8 as * const c_char , signature : b"uuuu\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } , 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 this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 4 , requests : unsafe { & zwp_virtual_keyboard_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "virtual keyboard manager\n\nA virtual keyboard manager allows an application to provide keyboard\ninput events as if they came from a physical keyboard."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "client not authorized to use the interface"] Unauthorized = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: Unauthorized) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] CreateVirtualKeyboard { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_virtual_keyboard" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: NewId ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateVirtualKeyboard { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: CreateVirtualKeyboard { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > (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 :: CreateVirtualKeyboard { seat } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) , Argument :: NewId (0) ,] , } , } } 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 :: CreateVirtualKeyboard { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [1] . o = :: std :: ptr :: null_mut () as * mut _ ; f (0 , & 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 ZwpVirtualKeyboardManagerV1 (Proxy < ZwpVirtualKeyboardManagerV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardManagerV1 (value) } } impl From < ZwpVirtualKeyboardManagerV1 > for Proxy < ZwpVirtualKeyboardManagerV1 > { # [inline] fn from (value : ZwpVirtualKeyboardManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_manager_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_manager_v1_interface } } } impl ZwpVirtualKeyboardManagerV1 { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] pub fn create_virtual_keyboard (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > { let msg = Request :: CreateVirtualKeyboard { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_VIRTUAL_KEYBOARD_SINCE : u32 = 1u32 ; static mut zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , unsafe { & super :: zwp_virtual_keyboard_v1 :: zwp_virtual_keyboard_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"create_virtual_keyboard\0" as * const u8 as * const c_char , signature : b"on\0" as * const u8 as * const c_char , types : unsafe { & zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_manager_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & zwp_virtual_keyboard_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/zwp-virtual-keyboard-0d32ffd994ee6290/out/virtual_keyboard_api.rs:1:11434 [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 ; 4] = [NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "virtual keyboard\n\nThe virtual keyboard provides an application with requests which emulate\nthe behaviour of a physical keyboard.\n\nThis interface can be used by clients on its own to provide raw input\nevents, or it can accompany the input method protocol."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "No keymap was set"] NoKeymap = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: NoKeymap) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] Keymap { format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32 , } , # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] Key { time : u32 , key : u32 , state : u32 , } , # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] Modifiers { mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32 , } , # [doc = "destroy the virtual keyboard keyboard object\n\n\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 : "keymap" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Fd , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "key" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "modifiers" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Keymap { .. } => 0 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 2 , Request :: Destroy => 3 , } } fn since (& self) -> u32 { match * self { Request :: Keymap { .. } => 1 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 1 , 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 :: Keymap { format , fd , size } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Uint (format) , Argument :: Fd (fd) , Argument :: Uint (size) ,] , } , Request :: Key { time , key , state } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (time) , Argument :: Uint (key) , Argument :: Uint (state) ,] , } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: Uint (mods_depressed) , Argument :: Uint (mods_latched) , Argument :: Uint (mods_locked) , Argument :: Uint (group) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 3 , 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 :: Keymap { format , fd , size } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; _args_array [1] . h = fd ; _args_array [2] . u = size ; f (0 , & mut _args_array) } , Request :: Key { time , key , state } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = time ; _args_array [1] . u = key ; _args_array [2] . u = state ; f (1 , & mut _args_array) } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => { let mut _args_array : [wl_argument ; 4] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = mods_depressed ; _args_array [1] . u = mods_latched ; _args_array [2] . u = mods_locked ; _args_array [3] . u = group ; f (2 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & 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 ZwpVirtualKeyboardV1 (Proxy < ZwpVirtualKeyboardV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardV1 (value) } } impl From < ZwpVirtualKeyboardV1 > for Proxy < ZwpVirtualKeyboardV1 > { # [inline] fn from (value : ZwpVirtualKeyboardV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_v1_interface } } } impl ZwpVirtualKeyboardV1 { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] pub fn keymap (& self , format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32) -> () { let msg = Request :: Keymap { format : format , fd : fd , size : size } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] pub fn key (& self , time : u32 , key : u32 , state : u32) -> () { let msg = Request :: Key { time : time , key : key , state : state } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] pub fn modifiers (& self , mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32) -> () { let msg = Request :: Modifiers { mods_depressed : mods_depressed , mods_latched : mods_latched , mods_locked : mods_locked , group : group } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the virtual keyboard keyboard object\n\n\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_KEYMAP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_KEY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_MODIFIERS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_requests : [wl_message ; 4] = [wl_message { name : b"keymap\0" as * const u8 as * const c_char , signature : b"uhu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"key\0" as * const u8 as * const c_char , signature : b"uuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"modifiers\0" as * const u8 as * const c_char , signature : b"uuuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , 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 this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 4 , requests : unsafe { & zwp_virtual_keyboard_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "virtual keyboard manager\n\nA virtual keyboard manager allows an application to provide keyboard\ninput events as if they came from a physical keyboard."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "client not authorized to use the interface"] Unauthorized = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: Unauthorized) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] CreateVirtualKeyboard { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_virtual_keyboard" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: NewId ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateVirtualKeyboard { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: CreateVirtualKeyboard { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > (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 :: CreateVirtualKeyboard { seat } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) , Argument :: NewId (0) ,] , } , } } 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 :: CreateVirtualKeyboard { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [1] . o = :: std :: ptr :: null_mut () as * mut _ ; f (0 , & 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 ZwpVirtualKeyboardManagerV1 (Proxy < ZwpVirtualKeyboardManagerV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardManagerV1 (value) } } impl From < ZwpVirtualKeyboardManagerV1 > for Proxy < ZwpVirtualKeyboardManagerV1 > { # [inline] fn from (value : ZwpVirtualKeyboardManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_manager_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_manager_v1_interface } } } impl ZwpVirtualKeyboardManagerV1 { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] pub fn create_virtual_keyboard (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > { let msg = Request :: CreateVirtualKeyboard { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_VIRTUAL_KEYBOARD_SINCE : u32 = 1u32 ; static mut zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , unsafe { & super :: zwp_virtual_keyboard_v1 :: zwp_virtual_keyboard_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"create_virtual_keyboard\0" as * const u8 as * const c_char , signature : b"on\0" as * const u8 as * const c_char , types : unsafe { & zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_manager_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & zwp_virtual_keyboard_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/zwp-virtual-keyboard-0d32ffd994ee6290/out/virtual_keyboard_api.rs:1:11738 [INFO] [stdout] | [INFO] [stdout] 1 | ...count : 4 , requests : unsafe { & zwp_virtual_keyboard_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_m... [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 ; 4] = [NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "virtual keyboard\n\nThe virtual keyboard provides an application with requests which emulate\nthe behaviour of a physical keyboard.\n\nThis interface can be used by clients on its own to provide raw input\nevents, or it can accompany the input method protocol."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "No keymap was set"] NoKeymap = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: NoKeymap) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] Keymap { format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32 , } , # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] Key { time : u32 , key : u32 , state : u32 , } , # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] Modifiers { mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32 , } , # [doc = "destroy the virtual keyboard keyboard object\n\n\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 : "keymap" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Fd , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "key" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "modifiers" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Keymap { .. } => 0 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 2 , Request :: Destroy => 3 , } } fn since (& self) -> u32 { match * self { Request :: Keymap { .. } => 1 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 1 , 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 :: Keymap { format , fd , size } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Uint (format) , Argument :: Fd (fd) , Argument :: Uint (size) ,] , } , Request :: Key { time , key , state } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (time) , Argument :: Uint (key) , Argument :: Uint (state) ,] , } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: Uint (mods_depressed) , Argument :: Uint (mods_latched) , Argument :: Uint (mods_locked) , Argument :: Uint (group) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 3 , 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 :: Keymap { format , fd , size } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; _args_array [1] . h = fd ; _args_array [2] . u = size ; f (0 , & mut _args_array) } , Request :: Key { time , key , state } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = time ; _args_array [1] . u = key ; _args_array [2] . u = state ; f (1 , & mut _args_array) } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => { let mut _args_array : [wl_argument ; 4] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = mods_depressed ; _args_array [1] . u = mods_latched ; _args_array [2] . u = mods_locked ; _args_array [3] . u = group ; f (2 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & 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 ZwpVirtualKeyboardV1 (Proxy < ZwpVirtualKeyboardV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardV1 (value) } } impl From < ZwpVirtualKeyboardV1 > for Proxy < ZwpVirtualKeyboardV1 > { # [inline] fn from (value : ZwpVirtualKeyboardV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_v1_interface } } } impl ZwpVirtualKeyboardV1 { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] pub fn keymap (& self , format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32) -> () { let msg = Request :: Keymap { format : format , fd : fd , size : size } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] pub fn key (& self , time : u32 , key : u32 , state : u32) -> () { let msg = Request :: Key { time : time , key : key , state : state } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] pub fn modifiers (& self , mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32) -> () { let msg = Request :: Modifiers { mods_depressed : mods_depressed , mods_latched : mods_latched , mods_locked : mods_locked , group : group } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the virtual keyboard keyboard object\n\n\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_KEYMAP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_KEY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_MODIFIERS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_requests : [wl_message ; 4] = [wl_message { name : b"keymap\0" as * const u8 as * const c_char , signature : b"uhu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"key\0" as * const u8 as * const c_char , signature : b"uuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"modifiers\0" as * const u8 as * const c_char , signature : b"uuuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , 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 this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 4 , requests : unsafe { &raw const zwp_virtual_keyboard_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "virtual keyboard manager\n\nA virtual keyboard manager allows an application to provide keyboard\ninput events as if they came from a physical keyboard."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "client not authorized to use the interface"] Unauthorized = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: Unauthorized) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] CreateVirtualKeyboard { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_virtual_keyboard" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: NewId ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateVirtualKeyboard { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: CreateVirtualKeyboard { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > (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 :: CreateVirtualKeyboard { seat } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) , Argument :: NewId (0) ,] , } , } } 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 :: CreateVirtualKeyboard { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [1] . o = :: std :: ptr :: null_mut () as * mut _ ; f (0 , & 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 ZwpVirtualKeyboardManagerV1 (Proxy < ZwpVirtualKeyboardManagerV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardManagerV1 (value) } } impl From < ZwpVirtualKeyboardManagerV1 > for Proxy < ZwpVirtualKeyboardManagerV1 > { # [inline] fn from (value : ZwpVirtualKeyboardManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_manager_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_manager_v1_interface } } } impl ZwpVirtualKeyboardManagerV1 { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] pub fn create_virtual_keyboard (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > { let msg = Request :: CreateVirtualKeyboard { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_VIRTUAL_KEYBOARD_SINCE : u32 = 1u32 ; static mut zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , unsafe { & super :: zwp_virtual_keyboard_v1 :: zwp_virtual_keyboard_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"create_virtual_keyboard\0" as * const u8 as * const c_char , signature : b"on\0" as * const u8 as * const c_char , types : unsafe { & zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_manager_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & zwp_virtual_keyboard_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/zwp-virtual-keyboard-0d32ffd994ee6290/out/virtual_keyboard_api.rs:1:17076 [INFO] [stdout] | [INFO] [stdout] 1 | ...nst wl_interface { unsafe { & zwp_virtual_keyboard_manager_v1_interface } } } impl ZwpVirtualKeyboardManagerV1 { # [doc = "Create a ne... [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 ; 4] = [NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "virtual keyboard\n\nThe virtual keyboard provides an application with requests which emulate\nthe behaviour of a physical keyboard.\n\nThis interface can be used by clients on its own to provide raw input\nevents, or it can accompany the input method protocol."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "No keymap was set"] NoKeymap = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: NoKeymap) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] Keymap { format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32 , } , # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] Key { time : u32 , key : u32 , state : u32 , } , # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] Modifiers { mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32 , } , # [doc = "destroy the virtual keyboard keyboard object\n\n\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 : "keymap" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Fd , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "key" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "modifiers" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Keymap { .. } => 0 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 2 , Request :: Destroy => 3 , } } fn since (& self) -> u32 { match * self { Request :: Keymap { .. } => 1 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 1 , 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 :: Keymap { format , fd , size } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Uint (format) , Argument :: Fd (fd) , Argument :: Uint (size) ,] , } , Request :: Key { time , key , state } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (time) , Argument :: Uint (key) , Argument :: Uint (state) ,] , } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: Uint (mods_depressed) , Argument :: Uint (mods_latched) , Argument :: Uint (mods_locked) , Argument :: Uint (group) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 3 , 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 :: Keymap { format , fd , size } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; _args_array [1] . h = fd ; _args_array [2] . u = size ; f (0 , & mut _args_array) } , Request :: Key { time , key , state } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = time ; _args_array [1] . u = key ; _args_array [2] . u = state ; f (1 , & mut _args_array) } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => { let mut _args_array : [wl_argument ; 4] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = mods_depressed ; _args_array [1] . u = mods_latched ; _args_array [2] . u = mods_locked ; _args_array [3] . u = group ; f (2 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & 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 ZwpVirtualKeyboardV1 (Proxy < ZwpVirtualKeyboardV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardV1 (value) } } impl From < ZwpVirtualKeyboardV1 > for Proxy < ZwpVirtualKeyboardV1 > { # [inline] fn from (value : ZwpVirtualKeyboardV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_v1_interface } } } impl ZwpVirtualKeyboardV1 { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] pub fn keymap (& self , format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32) -> () { let msg = Request :: Keymap { format : format , fd : fd , size : size } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] pub fn key (& self , time : u32 , key : u32 , state : u32) -> () { let msg = Request :: Key { time : time , key : key , state : state } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] pub fn modifiers (& self , mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32) -> () { let msg = Request :: Modifiers { mods_depressed : mods_depressed , mods_latched : mods_latched , mods_locked : mods_locked , group : group } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the virtual keyboard keyboard object\n\n\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_KEYMAP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_KEY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_MODIFIERS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_requests : [wl_message ; 4] = [wl_message { name : b"keymap\0" as * const u8 as * const c_char , signature : b"uhu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"key\0" as * const u8 as * const c_char , signature : b"uuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"modifiers\0" as * const u8 as * const c_char , signature : b"uuuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , 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 this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 4 , requests : unsafe { & zwp_virtual_keyboard_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "virtual keyboard manager\n\nA virtual keyboard manager allows an application to provide keyboard\ninput events as if they came from a physical keyboard."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "client not authorized to use the interface"] Unauthorized = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: Unauthorized) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] CreateVirtualKeyboard { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_virtual_keyboard" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: NewId ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateVirtualKeyboard { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: CreateVirtualKeyboard { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > (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 :: CreateVirtualKeyboard { seat } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) , Argument :: NewId (0) ,] , } , } } 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 :: CreateVirtualKeyboard { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [1] . o = :: std :: ptr :: null_mut () as * mut _ ; f (0 , & 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 ZwpVirtualKeyboardManagerV1 (Proxy < ZwpVirtualKeyboardManagerV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardManagerV1 (value) } } impl From < ZwpVirtualKeyboardManagerV1 > for Proxy < ZwpVirtualKeyboardManagerV1 > { # [inline] fn from (value : ZwpVirtualKeyboardManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_manager_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { &raw const zwp_virtual_keyboard_manager_v1_interface } } } impl ZwpVirtualKeyboardManagerV1 { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] pub fn create_virtual_keyboard (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > { let msg = Request :: CreateVirtualKeyboard { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_VIRTUAL_KEYBOARD_SINCE : u32 = 1u32 ; static mut zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , unsafe { & super :: zwp_virtual_keyboard_v1 :: zwp_virtual_keyboard_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"create_virtual_keyboard\0" as * const u8 as * const c_char , signature : b"on\0" as * const u8 as * const c_char , types : unsafe { & zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_manager_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & zwp_virtual_keyboard_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/zwp-virtual-keyboard-0d32ffd994ee6290/out/virtual_keyboard_api.rs:1:17921 [INFO] [stdout] | [INFO] [stdout] 1 | ...wl_interface ; 2] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , unsafe { & super :: zwp_virtual_keyb... [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 ; 4] = [NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "virtual keyboard\n\nThe virtual keyboard provides an application with requests which emulate\nthe behaviour of a physical keyboard.\n\nThis interface can be used by clients on its own to provide raw input\nevents, or it can accompany the input method protocol."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "No keymap was set"] NoKeymap = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: NoKeymap) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] Keymap { format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32 , } , # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] Key { time : u32 , key : u32 , state : u32 , } , # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] Modifiers { mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32 , } , # [doc = "destroy the virtual keyboard keyboard object\n\n\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 : "keymap" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Fd , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "key" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "modifiers" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Keymap { .. } => 0 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 2 , Request :: Destroy => 3 , } } fn since (& self) -> u32 { match * self { Request :: Keymap { .. } => 1 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 1 , 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 :: Keymap { format , fd , size } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Uint (format) , Argument :: Fd (fd) , Argument :: Uint (size) ,] , } , Request :: Key { time , key , state } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (time) , Argument :: Uint (key) , Argument :: Uint (state) ,] , } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: Uint (mods_depressed) , Argument :: Uint (mods_latched) , Argument :: Uint (mods_locked) , Argument :: Uint (group) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 3 , 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 :: Keymap { format , fd , size } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; _args_array [1] . h = fd ; _args_array [2] . u = size ; f (0 , & mut _args_array) } , Request :: Key { time , key , state } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = time ; _args_array [1] . u = key ; _args_array [2] . u = state ; f (1 , & mut _args_array) } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => { let mut _args_array : [wl_argument ; 4] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = mods_depressed ; _args_array [1] . u = mods_latched ; _args_array [2] . u = mods_locked ; _args_array [3] . u = group ; f (2 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & 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 ZwpVirtualKeyboardV1 (Proxy < ZwpVirtualKeyboardV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardV1 (value) } } impl From < ZwpVirtualKeyboardV1 > for Proxy < ZwpVirtualKeyboardV1 > { # [inline] fn from (value : ZwpVirtualKeyboardV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_v1_interface } } } impl ZwpVirtualKeyboardV1 { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] pub fn keymap (& self , format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32) -> () { let msg = Request :: Keymap { format : format , fd : fd , size : size } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] pub fn key (& self , time : u32 , key : u32 , state : u32) -> () { let msg = Request :: Key { time : time , key : key , state : state } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] pub fn modifiers (& self , mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32) -> () { let msg = Request :: Modifiers { mods_depressed : mods_depressed , mods_latched : mods_latched , mods_locked : mods_locked , group : group } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the virtual keyboard keyboard object\n\n\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_KEYMAP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_KEY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_MODIFIERS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_requests : [wl_message ; 4] = [wl_message { name : b"keymap\0" as * const u8 as * const c_char , signature : b"uhu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"key\0" as * const u8 as * const c_char , signature : b"uuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"modifiers\0" as * const u8 as * const c_char , signature : b"uuuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , 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 this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 4 , requests : unsafe { & zwp_virtual_keyboard_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "virtual keyboard manager\n\nA virtual keyboard manager allows an application to provide keyboard\ninput events as if they came from a physical keyboard."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "client not authorized to use the interface"] Unauthorized = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: Unauthorized) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] CreateVirtualKeyboard { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_virtual_keyboard" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: NewId ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateVirtualKeyboard { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: CreateVirtualKeyboard { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > (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 :: CreateVirtualKeyboard { seat } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) , Argument :: NewId (0) ,] , } , } } 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 :: CreateVirtualKeyboard { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [1] . o = :: std :: ptr :: null_mut () as * mut _ ; f (0 , & 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 ZwpVirtualKeyboardManagerV1 (Proxy < ZwpVirtualKeyboardManagerV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardManagerV1 (value) } } impl From < ZwpVirtualKeyboardManagerV1 > for Proxy < ZwpVirtualKeyboardManagerV1 > { # [inline] fn from (value : ZwpVirtualKeyboardManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_manager_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_manager_v1_interface } } } impl ZwpVirtualKeyboardManagerV1 { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] pub fn create_virtual_keyboard (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > { let msg = Request :: CreateVirtualKeyboard { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_VIRTUAL_KEYBOARD_SINCE : u32 = 1u32 ; static mut zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types : [* const wl_interface ; 2] = [unsafe { &raw const super :: wl_seat :: wl_seat_interface as * const wl_interface } , unsafe { & super :: zwp_virtual_keyboard_v1 :: zwp_virtual_keyboard_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"create_virtual_keyboard\0" as * const u8 as * const c_char , signature : b"on\0" as * const u8 as * const c_char , types : unsafe { & zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_manager_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & zwp_virtual_keyboard_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/zwp-virtual-keyboard-0d32ffd994ee6290/out/virtual_keyboard_api.rs:1:17998 [INFO] [stdout] | [INFO] [stdout] 1 | ... } , unsafe { & super :: zwp_virtual_keyboard_v1 :: zwp_virtual_keyboard_v1_interface as * const wl_interface } ,] ; # [doc = r" C-rep... [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 ; 4] = [NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "virtual keyboard\n\nThe virtual keyboard provides an application with requests which emulate\nthe behaviour of a physical keyboard.\n\nThis interface can be used by clients on its own to provide raw input\nevents, or it can accompany the input method protocol."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "No keymap was set"] NoKeymap = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: NoKeymap) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] Keymap { format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32 , } , # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] Key { time : u32 , key : u32 , state : u32 , } , # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] Modifiers { mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32 , } , # [doc = "destroy the virtual keyboard keyboard object\n\n\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 : "keymap" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Fd , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "key" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "modifiers" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Keymap { .. } => 0 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 2 , Request :: Destroy => 3 , } } fn since (& self) -> u32 { match * self { Request :: Keymap { .. } => 1 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 1 , 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 :: Keymap { format , fd , size } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Uint (format) , Argument :: Fd (fd) , Argument :: Uint (size) ,] , } , Request :: Key { time , key , state } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (time) , Argument :: Uint (key) , Argument :: Uint (state) ,] , } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: Uint (mods_depressed) , Argument :: Uint (mods_latched) , Argument :: Uint (mods_locked) , Argument :: Uint (group) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 3 , 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 :: Keymap { format , fd , size } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; _args_array [1] . h = fd ; _args_array [2] . u = size ; f (0 , & mut _args_array) } , Request :: Key { time , key , state } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = time ; _args_array [1] . u = key ; _args_array [2] . u = state ; f (1 , & mut _args_array) } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => { let mut _args_array : [wl_argument ; 4] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = mods_depressed ; _args_array [1] . u = mods_latched ; _args_array [2] . u = mods_locked ; _args_array [3] . u = group ; f (2 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & 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 ZwpVirtualKeyboardV1 (Proxy < ZwpVirtualKeyboardV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardV1 (value) } } impl From < ZwpVirtualKeyboardV1 > for Proxy < ZwpVirtualKeyboardV1 > { # [inline] fn from (value : ZwpVirtualKeyboardV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_v1_interface } } } impl ZwpVirtualKeyboardV1 { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] pub fn keymap (& self , format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32) -> () { let msg = Request :: Keymap { format : format , fd : fd , size : size } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] pub fn key (& self , time : u32 , key : u32 , state : u32) -> () { let msg = Request :: Key { time : time , key : key , state : state } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] pub fn modifiers (& self , mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32) -> () { let msg = Request :: Modifiers { mods_depressed : mods_depressed , mods_latched : mods_latched , mods_locked : mods_locked , group : group } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the virtual keyboard keyboard object\n\n\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_KEYMAP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_KEY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_MODIFIERS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_requests : [wl_message ; 4] = [wl_message { name : b"keymap\0" as * const u8 as * const c_char , signature : b"uhu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"key\0" as * const u8 as * const c_char , signature : b"uuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"modifiers\0" as * const u8 as * const c_char , signature : b"uuuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , 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 this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 4 , requests : unsafe { & zwp_virtual_keyboard_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "virtual keyboard manager\n\nA virtual keyboard manager allows an application to provide keyboard\ninput events as if they came from a physical keyboard."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "client not authorized to use the interface"] Unauthorized = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: Unauthorized) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] CreateVirtualKeyboard { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_virtual_keyboard" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: NewId ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateVirtualKeyboard { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: CreateVirtualKeyboard { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > (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 :: CreateVirtualKeyboard { seat } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) , Argument :: NewId (0) ,] , } , } } 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 :: CreateVirtualKeyboard { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [1] . o = :: std :: ptr :: null_mut () as * mut _ ; f (0 , & 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 ZwpVirtualKeyboardManagerV1 (Proxy < ZwpVirtualKeyboardManagerV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardManagerV1 (value) } } impl From < ZwpVirtualKeyboardManagerV1 > for Proxy < ZwpVirtualKeyboardManagerV1 > { # [inline] fn from (value : ZwpVirtualKeyboardManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_manager_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_manager_v1_interface } } } impl ZwpVirtualKeyboardManagerV1 { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] pub fn create_virtual_keyboard (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > { let msg = Request :: CreateVirtualKeyboard { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_VIRTUAL_KEYBOARD_SINCE : u32 = 1u32 ; static mut zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , unsafe { &raw const super :: zwp_virtual_keyboard_v1 :: zwp_virtual_keyboard_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"create_virtual_keyboard\0" as * const u8 as * const c_char , signature : b"on\0" as * const u8 as * const c_char , types : unsafe { & zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_manager_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & zwp_virtual_keyboard_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/zwp-virtual-keyboard-0d32ffd994ee6290/out/virtual_keyboard_api.rs:1:18411 [INFO] [stdout] | [INFO] [stdout] 1 | ...s : unsafe { & zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types as * const _ } , } ,] ; # [doc = r" C representa... [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 ; 4] = [NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "virtual keyboard\n\nThe virtual keyboard provides an application with requests which emulate\nthe behaviour of a physical keyboard.\n\nThis interface can be used by clients on its own to provide raw input\nevents, or it can accompany the input method protocol."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "No keymap was set"] NoKeymap = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: NoKeymap) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] Keymap { format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32 , } , # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] Key { time : u32 , key : u32 , state : u32 , } , # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] Modifiers { mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32 , } , # [doc = "destroy the virtual keyboard keyboard object\n\n\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 : "keymap" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Fd , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "key" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "modifiers" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Keymap { .. } => 0 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 2 , Request :: Destroy => 3 , } } fn since (& self) -> u32 { match * self { Request :: Keymap { .. } => 1 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 1 , 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 :: Keymap { format , fd , size } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Uint (format) , Argument :: Fd (fd) , Argument :: Uint (size) ,] , } , Request :: Key { time , key , state } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (time) , Argument :: Uint (key) , Argument :: Uint (state) ,] , } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: Uint (mods_depressed) , Argument :: Uint (mods_latched) , Argument :: Uint (mods_locked) , Argument :: Uint (group) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 3 , 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 :: Keymap { format , fd , size } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; _args_array [1] . h = fd ; _args_array [2] . u = size ; f (0 , & mut _args_array) } , Request :: Key { time , key , state } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = time ; _args_array [1] . u = key ; _args_array [2] . u = state ; f (1 , & mut _args_array) } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => { let mut _args_array : [wl_argument ; 4] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = mods_depressed ; _args_array [1] . u = mods_latched ; _args_array [2] . u = mods_locked ; _args_array [3] . u = group ; f (2 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & 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 ZwpVirtualKeyboardV1 (Proxy < ZwpVirtualKeyboardV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardV1 (value) } } impl From < ZwpVirtualKeyboardV1 > for Proxy < ZwpVirtualKeyboardV1 > { # [inline] fn from (value : ZwpVirtualKeyboardV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_v1_interface } } } impl ZwpVirtualKeyboardV1 { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] pub fn keymap (& self , format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32) -> () { let msg = Request :: Keymap { format : format , fd : fd , size : size } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] pub fn key (& self , time : u32 , key : u32 , state : u32) -> () { let msg = Request :: Key { time : time , key : key , state : state } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] pub fn modifiers (& self , mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32) -> () { let msg = Request :: Modifiers { mods_depressed : mods_depressed , mods_latched : mods_latched , mods_locked : mods_locked , group : group } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the virtual keyboard keyboard object\n\n\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_KEYMAP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_KEY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_MODIFIERS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_requests : [wl_message ; 4] = [wl_message { name : b"keymap\0" as * const u8 as * const c_char , signature : b"uhu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"key\0" as * const u8 as * const c_char , signature : b"uuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"modifiers\0" as * const u8 as * const c_char , signature : b"uuuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , 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 this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 4 , requests : unsafe { & zwp_virtual_keyboard_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "virtual keyboard manager\n\nA virtual keyboard manager allows an application to provide keyboard\ninput events as if they came from a physical keyboard."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "client not authorized to use the interface"] Unauthorized = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: Unauthorized) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] CreateVirtualKeyboard { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_virtual_keyboard" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: NewId ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateVirtualKeyboard { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: CreateVirtualKeyboard { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > (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 :: CreateVirtualKeyboard { seat } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) , Argument :: NewId (0) ,] , } , } } 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 :: CreateVirtualKeyboard { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [1] . o = :: std :: ptr :: null_mut () as * mut _ ; f (0 , & 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 ZwpVirtualKeyboardManagerV1 (Proxy < ZwpVirtualKeyboardManagerV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardManagerV1 (value) } } impl From < ZwpVirtualKeyboardManagerV1 > for Proxy < ZwpVirtualKeyboardManagerV1 > { # [inline] fn from (value : ZwpVirtualKeyboardManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_manager_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_manager_v1_interface } } } impl ZwpVirtualKeyboardManagerV1 { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] pub fn create_virtual_keyboard (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > { let msg = Request :: CreateVirtualKeyboard { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_VIRTUAL_KEYBOARD_SINCE : u32 = 1u32 ; static mut zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , unsafe { & super :: zwp_virtual_keyboard_v1 :: zwp_virtual_keyboard_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"create_virtual_keyboard\0" as * const u8 as * const c_char , signature : b"on\0" as * const u8 as * const c_char , types : unsafe { &raw const zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_manager_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & zwp_virtual_keyboard_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/zwp-virtual-keyboard-0d32ffd994ee6290/out/virtual_keyboard_api.rs:1:18791 [INFO] [stdout] | [INFO] [stdout] 1 | ...t : 1 , requests : unsafe { & zwp_virtual_keyboard_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR 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 ; 4] = [NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "virtual keyboard\n\nThe virtual keyboard provides an application with requests which emulate\nthe behaviour of a physical keyboard.\n\nThis interface can be used by clients on its own to provide raw input\nevents, or it can accompany the input method protocol."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "No keymap was set"] NoKeymap = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: NoKeymap) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] Keymap { format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32 , } , # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] Key { time : u32 , key : u32 , state : u32 , } , # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] Modifiers { mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32 , } , # [doc = "destroy the virtual keyboard keyboard object\n\n\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 : "keymap" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Fd , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "key" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "modifiers" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Keymap { .. } => 0 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 2 , Request :: Destroy => 3 , } } fn since (& self) -> u32 { match * self { Request :: Keymap { .. } => 1 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 1 , 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 :: Keymap { format , fd , size } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Uint (format) , Argument :: Fd (fd) , Argument :: Uint (size) ,] , } , Request :: Key { time , key , state } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (time) , Argument :: Uint (key) , Argument :: Uint (state) ,] , } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: Uint (mods_depressed) , Argument :: Uint (mods_latched) , Argument :: Uint (mods_locked) , Argument :: Uint (group) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 3 , 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 :: Keymap { format , fd , size } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; _args_array [1] . h = fd ; _args_array [2] . u = size ; f (0 , & mut _args_array) } , Request :: Key { time , key , state } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = time ; _args_array [1] . u = key ; _args_array [2] . u = state ; f (1 , & mut _args_array) } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => { let mut _args_array : [wl_argument ; 4] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = mods_depressed ; _args_array [1] . u = mods_latched ; _args_array [2] . u = mods_locked ; _args_array [3] . u = group ; f (2 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & 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 ZwpVirtualKeyboardV1 (Proxy < ZwpVirtualKeyboardV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardV1 (value) } } impl From < ZwpVirtualKeyboardV1 > for Proxy < ZwpVirtualKeyboardV1 > { # [inline] fn from (value : ZwpVirtualKeyboardV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_v1_interface } } } impl ZwpVirtualKeyboardV1 { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] pub fn keymap (& self , format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32) -> () { let msg = Request :: Keymap { format : format , fd : fd , size : size } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] pub fn key (& self , time : u32 , key : u32 , state : u32) -> () { let msg = Request :: Key { time : time , key : key , state : state } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] pub fn modifiers (& self , mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32) -> () { let msg = Request :: Modifiers { mods_depressed : mods_depressed , mods_latched : mods_latched , mods_locked : mods_locked , group : group } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the virtual keyboard keyboard object\n\n\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_KEYMAP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_KEY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_MODIFIERS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_requests : [wl_message ; 4] = [wl_message { name : b"keymap\0" as * const u8 as * const c_char , signature : b"uhu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"key\0" as * const u8 as * const c_char , signature : b"uuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"modifiers\0" as * const u8 as * const c_char , signature : b"uuuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , 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 this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 4 , requests : unsafe { & zwp_virtual_keyboard_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "virtual keyboard manager\n\nA virtual keyboard manager allows an application to provide keyboard\ninput events as if they came from a physical keyboard."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "client not authorized to use the interface"] Unauthorized = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: Unauthorized) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] CreateVirtualKeyboard { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_virtual_keyboard" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: NewId ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateVirtualKeyboard { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: CreateVirtualKeyboard { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > (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 :: CreateVirtualKeyboard { seat } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) , Argument :: NewId (0) ,] , } , } } 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 :: CreateVirtualKeyboard { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [1] . o = :: std :: ptr :: null_mut () as * mut _ ; f (0 , & 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 ZwpVirtualKeyboardManagerV1 (Proxy < ZwpVirtualKeyboardManagerV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardManagerV1 (value) } } impl From < ZwpVirtualKeyboardManagerV1 > for Proxy < ZwpVirtualKeyboardManagerV1 > { # [inline] fn from (value : ZwpVirtualKeyboardManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_manager_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_manager_v1_interface } } } impl ZwpVirtualKeyboardManagerV1 { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] pub fn create_virtual_keyboard (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > { let msg = Request :: CreateVirtualKeyboard { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_VIRTUAL_KEYBOARD_SINCE : u32 = 1u32 ; static mut zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , unsafe { & super :: zwp_virtual_keyboard_v1 :: zwp_virtual_keyboard_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"create_virtual_keyboard\0" as * const u8 as * const c_char , signature : b"on\0" as * const u8 as * const c_char , types : unsafe { & zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_manager_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { &raw const zwp_virtual_keyboard_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 14.34s [INFO] running `Command { std: "docker" "inspect" "563dd006e0611e7352dad57e512b4ce711443e782f90a3dc42f27374610b3d00", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "563dd006e0611e7352dad57e512b4ce711443e782f90a3dc42f27374610b3d00", kill_on_drop: false }` [INFO] [stdout] 563dd006e0611e7352dad57e512b4ce711443e782f90a3dc42f27374610b3d00 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc1/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=warn" "-e" "RUSTDOCFLAGS=--cap-lints=warn" "-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:e90291280db7d1fac5b66fc6dad9f9662629e7365a55743daf9bdf73ebc4ea79" "/opt/rustwide/cargo-home/bin/cargo" "+1.90.0" "test" "--frozen" "--no-run" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] 18dce711f4afcb30fbbd8089a2d08f99af793d2d5689991c594a0595ea1bd48f [INFO] running `Command { std: "docker" "start" "-a" "18dce711f4afcb30fbbd8089a2d08f99af793d2d5689991c594a0595ea1bd48f", kill_on_drop: false }` [INFO] [stderr] Compiling input-event-codes v5.16.8 [INFO] [stderr] Compiling tempfile v3.3.0 [INFO] [stderr] Compiling memmap2 v0.5.7 [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/zwp-virtual-keyboard-0d32ffd994ee6290/out/virtual_keyboard_api.rs:1:8281 [INFO] [stdout] | [INFO] [stdout] 1 | ...* const wl_interface { unsafe { & zwp_virtual_keyboard_v1_interface } } } impl ZwpVirtualKeyboardV1 { # [doc = "keyboard mapping\n\nPr... [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)]` 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 ; 4] = [NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "virtual keyboard\n\nThe virtual keyboard provides an application with requests which emulate\nthe behaviour of a physical keyboard.\n\nThis interface can be used by clients on its own to provide raw input\nevents, or it can accompany the input method protocol."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "No keymap was set"] NoKeymap = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: NoKeymap) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] Keymap { format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32 , } , # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] Key { time : u32 , key : u32 , state : u32 , } , # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] Modifiers { mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32 , } , # [doc = "destroy the virtual keyboard keyboard object\n\n\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 : "keymap" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Fd , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "key" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "modifiers" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Keymap { .. } => 0 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 2 , Request :: Destroy => 3 , } } fn since (& self) -> u32 { match * self { Request :: Keymap { .. } => 1 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 1 , 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 :: Keymap { format , fd , size } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Uint (format) , Argument :: Fd (fd) , Argument :: Uint (size) ,] , } , Request :: Key { time , key , state } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (time) , Argument :: Uint (key) , Argument :: Uint (state) ,] , } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: Uint (mods_depressed) , Argument :: Uint (mods_latched) , Argument :: Uint (mods_locked) , Argument :: Uint (group) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 3 , 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 :: Keymap { format , fd , size } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; _args_array [1] . h = fd ; _args_array [2] . u = size ; f (0 , & mut _args_array) } , Request :: Key { time , key , state } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = time ; _args_array [1] . u = key ; _args_array [2] . u = state ; f (1 , & mut _args_array) } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => { let mut _args_array : [wl_argument ; 4] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = mods_depressed ; _args_array [1] . u = mods_latched ; _args_array [2] . u = mods_locked ; _args_array [3] . u = group ; f (2 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & 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 ZwpVirtualKeyboardV1 (Proxy < ZwpVirtualKeyboardV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardV1 (value) } } impl From < ZwpVirtualKeyboardV1 > for Proxy < ZwpVirtualKeyboardV1 > { # [inline] fn from (value : ZwpVirtualKeyboardV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { &raw const zwp_virtual_keyboard_v1_interface } } } impl ZwpVirtualKeyboardV1 { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] pub fn keymap (& self , format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32) -> () { let msg = Request :: Keymap { format : format , fd : fd , size : size } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] pub fn key (& self , time : u32 , key : u32 , state : u32) -> () { let msg = Request :: Key { time : time , key : key , state : state } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] pub fn modifiers (& self , mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32) -> () { let msg = Request :: Modifiers { mods_depressed : mods_depressed , mods_latched : mods_latched , mods_locked : mods_locked , group : group } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the virtual keyboard keyboard object\n\n\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_KEYMAP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_KEY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_MODIFIERS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_requests : [wl_message ; 4] = [wl_message { name : b"keymap\0" as * const u8 as * const c_char , signature : b"uhu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"key\0" as * const u8 as * const c_char , signature : b"uuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"modifiers\0" as * const u8 as * const c_char , signature : b"uuuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , 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 this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 4 , requests : unsafe { & zwp_virtual_keyboard_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "virtual keyboard manager\n\nA virtual keyboard manager allows an application to provide keyboard\ninput events as if they came from a physical keyboard."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "client not authorized to use the interface"] Unauthorized = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: Unauthorized) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] CreateVirtualKeyboard { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_virtual_keyboard" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: NewId ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateVirtualKeyboard { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: CreateVirtualKeyboard { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > (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 :: CreateVirtualKeyboard { seat } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) , Argument :: NewId (0) ,] , } , } } 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 :: CreateVirtualKeyboard { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [1] . o = :: std :: ptr :: null_mut () as * mut _ ; f (0 , & 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 ZwpVirtualKeyboardManagerV1 (Proxy < ZwpVirtualKeyboardManagerV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardManagerV1 (value) } } impl From < ZwpVirtualKeyboardManagerV1 > for Proxy < ZwpVirtualKeyboardManagerV1 > { # [inline] fn from (value : ZwpVirtualKeyboardManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_manager_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_manager_v1_interface } } } impl ZwpVirtualKeyboardManagerV1 { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] pub fn create_virtual_keyboard (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > { let msg = Request :: CreateVirtualKeyboard { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_VIRTUAL_KEYBOARD_SINCE : u32 = 1u32 ; static mut zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , unsafe { & super :: zwp_virtual_keyboard_v1 :: zwp_virtual_keyboard_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"create_virtual_keyboard\0" as * const u8 as * const c_char , signature : b"on\0" as * const u8 as * const c_char , types : unsafe { & zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_manager_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & zwp_virtual_keyboard_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/zwp-virtual-keyboard-0d32ffd994ee6290/out/virtual_keyboard_api.rs:1:10919 [INFO] [stdout] | [INFO] [stdout] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"key\0" as * const u8 as * const c_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 ; 4] = [NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "virtual keyboard\n\nThe virtual keyboard provides an application with requests which emulate\nthe behaviour of a physical keyboard.\n\nThis interface can be used by clients on its own to provide raw input\nevents, or it can accompany the input method protocol."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "No keymap was set"] NoKeymap = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: NoKeymap) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] Keymap { format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32 , } , # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] Key { time : u32 , key : u32 , state : u32 , } , # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] Modifiers { mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32 , } , # [doc = "destroy the virtual keyboard keyboard object\n\n\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 : "keymap" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Fd , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "key" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "modifiers" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Keymap { .. } => 0 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 2 , Request :: Destroy => 3 , } } fn since (& self) -> u32 { match * self { Request :: Keymap { .. } => 1 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 1 , 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 :: Keymap { format , fd , size } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Uint (format) , Argument :: Fd (fd) , Argument :: Uint (size) ,] , } , Request :: Key { time , key , state } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (time) , Argument :: Uint (key) , Argument :: Uint (state) ,] , } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: Uint (mods_depressed) , Argument :: Uint (mods_latched) , Argument :: Uint (mods_locked) , Argument :: Uint (group) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 3 , 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 :: Keymap { format , fd , size } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; _args_array [1] . h = fd ; _args_array [2] . u = size ; f (0 , & mut _args_array) } , Request :: Key { time , key , state } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = time ; _args_array [1] . u = key ; _args_array [2] . u = state ; f (1 , & mut _args_array) } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => { let mut _args_array : [wl_argument ; 4] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = mods_depressed ; _args_array [1] . u = mods_latched ; _args_array [2] . u = mods_locked ; _args_array [3] . u = group ; f (2 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & 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 ZwpVirtualKeyboardV1 (Proxy < ZwpVirtualKeyboardV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardV1 (value) } } impl From < ZwpVirtualKeyboardV1 > for Proxy < ZwpVirtualKeyboardV1 > { # [inline] fn from (value : ZwpVirtualKeyboardV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_v1_interface } } } impl ZwpVirtualKeyboardV1 { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] pub fn keymap (& self , format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32) -> () { let msg = Request :: Keymap { format : format , fd : fd , size : size } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] pub fn key (& self , time : u32 , key : u32 , state : u32) -> () { let msg = Request :: Key { time : time , key : key , state : state } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] pub fn modifiers (& self , mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32) -> () { let msg = Request :: Modifiers { mods_depressed : mods_depressed , mods_latched : mods_latched , mods_locked : mods_locked , group : group } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the virtual keyboard keyboard object\n\n\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_KEYMAP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_KEY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_MODIFIERS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_requests : [wl_message ; 4] = [wl_message { name : b"keymap\0" as * const u8 as * const c_char , signature : b"uhu\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } , wl_message { name : b"key\0" as * const u8 as * const c_char , signature : b"uuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"modifiers\0" as * const u8 as * const c_char , signature : b"uuuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , 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 this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 4 , requests : unsafe { & zwp_virtual_keyboard_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "virtual keyboard manager\n\nA virtual keyboard manager allows an application to provide keyboard\ninput events as if they came from a physical keyboard."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "client not authorized to use the interface"] Unauthorized = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: Unauthorized) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] CreateVirtualKeyboard { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_virtual_keyboard" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: NewId ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateVirtualKeyboard { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: CreateVirtualKeyboard { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > (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 :: CreateVirtualKeyboard { seat } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) , Argument :: NewId (0) ,] , } , } } 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 :: CreateVirtualKeyboard { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [1] . o = :: std :: ptr :: null_mut () as * mut _ ; f (0 , & 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 ZwpVirtualKeyboardManagerV1 (Proxy < ZwpVirtualKeyboardManagerV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardManagerV1 (value) } } impl From < ZwpVirtualKeyboardManagerV1 > for Proxy < ZwpVirtualKeyboardManagerV1 > { # [inline] fn from (value : ZwpVirtualKeyboardManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_manager_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_manager_v1_interface } } } impl ZwpVirtualKeyboardManagerV1 { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] pub fn create_virtual_keyboard (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > { let msg = Request :: CreateVirtualKeyboard { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_VIRTUAL_KEYBOARD_SINCE : u32 = 1u32 ; static mut zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , unsafe { & super :: zwp_virtual_keyboard_v1 :: zwp_virtual_keyboard_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"create_virtual_keyboard\0" as * const u8 as * const c_char , signature : b"on\0" as * const u8 as * const c_char , types : unsafe { & zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_manager_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & zwp_virtual_keyboard_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/zwp-virtual-keyboard-0d32ffd994ee6290/out/virtual_keyboard_api.rs:1:11088 [INFO] [stdout] | [INFO] [stdout] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"modifiers\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 ; 4] = [NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "virtual keyboard\n\nThe virtual keyboard provides an application with requests which emulate\nthe behaviour of a physical keyboard.\n\nThis interface can be used by clients on its own to provide raw input\nevents, or it can accompany the input method protocol."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "No keymap was set"] NoKeymap = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: NoKeymap) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] Keymap { format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32 , } , # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] Key { time : u32 , key : u32 , state : u32 , } , # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] Modifiers { mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32 , } , # [doc = "destroy the virtual keyboard keyboard object\n\n\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 : "keymap" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Fd , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "key" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "modifiers" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Keymap { .. } => 0 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 2 , Request :: Destroy => 3 , } } fn since (& self) -> u32 { match * self { Request :: Keymap { .. } => 1 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 1 , 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 :: Keymap { format , fd , size } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Uint (format) , Argument :: Fd (fd) , Argument :: Uint (size) ,] , } , Request :: Key { time , key , state } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (time) , Argument :: Uint (key) , Argument :: Uint (state) ,] , } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: Uint (mods_depressed) , Argument :: Uint (mods_latched) , Argument :: Uint (mods_locked) , Argument :: Uint (group) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 3 , 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 :: Keymap { format , fd , size } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; _args_array [1] . h = fd ; _args_array [2] . u = size ; f (0 , & mut _args_array) } , Request :: Key { time , key , state } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = time ; _args_array [1] . u = key ; _args_array [2] . u = state ; f (1 , & mut _args_array) } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => { let mut _args_array : [wl_argument ; 4] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = mods_depressed ; _args_array [1] . u = mods_latched ; _args_array [2] . u = mods_locked ; _args_array [3] . u = group ; f (2 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & 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 ZwpVirtualKeyboardV1 (Proxy < ZwpVirtualKeyboardV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardV1 (value) } } impl From < ZwpVirtualKeyboardV1 > for Proxy < ZwpVirtualKeyboardV1 > { # [inline] fn from (value : ZwpVirtualKeyboardV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_v1_interface } } } impl ZwpVirtualKeyboardV1 { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] pub fn keymap (& self , format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32) -> () { let msg = Request :: Keymap { format : format , fd : fd , size : size } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] pub fn key (& self , time : u32 , key : u32 , state : u32) -> () { let msg = Request :: Key { time : time , key : key , state : state } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] pub fn modifiers (& self , mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32) -> () { let msg = Request :: Modifiers { mods_depressed : mods_depressed , mods_latched : mods_latched , mods_locked : mods_locked , group : group } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the virtual keyboard keyboard object\n\n\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_KEYMAP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_KEY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_MODIFIERS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_requests : [wl_message ; 4] = [wl_message { name : b"keymap\0" as * const u8 as * const c_char , signature : b"uhu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"key\0" as * const u8 as * const c_char , signature : b"uuu\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } , wl_message { name : b"modifiers\0" as * const u8 as * const c_char , signature : b"uuuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , 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 this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 4 , requests : unsafe { & zwp_virtual_keyboard_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "virtual keyboard manager\n\nA virtual keyboard manager allows an application to provide keyboard\ninput events as if they came from a physical keyboard."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "client not authorized to use the interface"] Unauthorized = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: Unauthorized) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] CreateVirtualKeyboard { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_virtual_keyboard" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: NewId ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateVirtualKeyboard { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: CreateVirtualKeyboard { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > (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 :: CreateVirtualKeyboard { seat } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) , Argument :: NewId (0) ,] , } , } } 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 :: CreateVirtualKeyboard { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [1] . o = :: std :: ptr :: null_mut () as * mut _ ; f (0 , & 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 ZwpVirtualKeyboardManagerV1 (Proxy < ZwpVirtualKeyboardManagerV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardManagerV1 (value) } } impl From < ZwpVirtualKeyboardManagerV1 > for Proxy < ZwpVirtualKeyboardManagerV1 > { # [inline] fn from (value : ZwpVirtualKeyboardManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_manager_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_manager_v1_interface } } } impl ZwpVirtualKeyboardManagerV1 { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] pub fn create_virtual_keyboard (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > { let msg = Request :: CreateVirtualKeyboard { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_VIRTUAL_KEYBOARD_SINCE : u32 = 1u32 ; static mut zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , unsafe { & super :: zwp_virtual_keyboard_v1 :: zwp_virtual_keyboard_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"create_virtual_keyboard\0" as * const u8 as * const c_char , signature : b"on\0" as * const u8 as * const c_char , types : unsafe { & zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_manager_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & zwp_virtual_keyboard_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/zwp-virtual-keyboard-0d32ffd994ee6290/out/virtual_keyboard_api.rs:1:11264 [INFO] [stdout] | [INFO] [stdout] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 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 ; 4] = [NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "virtual keyboard\n\nThe virtual keyboard provides an application with requests which emulate\nthe behaviour of a physical keyboard.\n\nThis interface can be used by clients on its own to provide raw input\nevents, or it can accompany the input method protocol."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "No keymap was set"] NoKeymap = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: NoKeymap) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] Keymap { format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32 , } , # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] Key { time : u32 , key : u32 , state : u32 , } , # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] Modifiers { mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32 , } , # [doc = "destroy the virtual keyboard keyboard object\n\n\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 : "keymap" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Fd , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "key" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "modifiers" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Keymap { .. } => 0 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 2 , Request :: Destroy => 3 , } } fn since (& self) -> u32 { match * self { Request :: Keymap { .. } => 1 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 1 , 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 :: Keymap { format , fd , size } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Uint (format) , Argument :: Fd (fd) , Argument :: Uint (size) ,] , } , Request :: Key { time , key , state } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (time) , Argument :: Uint (key) , Argument :: Uint (state) ,] , } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: Uint (mods_depressed) , Argument :: Uint (mods_latched) , Argument :: Uint (mods_locked) , Argument :: Uint (group) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 3 , 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 :: Keymap { format , fd , size } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; _args_array [1] . h = fd ; _args_array [2] . u = size ; f (0 , & mut _args_array) } , Request :: Key { time , key , state } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = time ; _args_array [1] . u = key ; _args_array [2] . u = state ; f (1 , & mut _args_array) } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => { let mut _args_array : [wl_argument ; 4] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = mods_depressed ; _args_array [1] . u = mods_latched ; _args_array [2] . u = mods_locked ; _args_array [3] . u = group ; f (2 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & 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 ZwpVirtualKeyboardV1 (Proxy < ZwpVirtualKeyboardV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardV1 (value) } } impl From < ZwpVirtualKeyboardV1 > for Proxy < ZwpVirtualKeyboardV1 > { # [inline] fn from (value : ZwpVirtualKeyboardV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_v1_interface } } } impl ZwpVirtualKeyboardV1 { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] pub fn keymap (& self , format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32) -> () { let msg = Request :: Keymap { format : format , fd : fd , size : size } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] pub fn key (& self , time : u32 , key : u32 , state : u32) -> () { let msg = Request :: Key { time : time , key : key , state : state } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] pub fn modifiers (& self , mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32) -> () { let msg = Request :: Modifiers { mods_depressed : mods_depressed , mods_latched : mods_latched , mods_locked : mods_locked , group : group } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the virtual keyboard keyboard object\n\n\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_KEYMAP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_KEY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_MODIFIERS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_requests : [wl_message ; 4] = [wl_message { name : b"keymap\0" as * const u8 as * const c_char , signature : b"uhu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"key\0" as * const u8 as * const c_char , signature : b"uuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"modifiers\0" as * const u8 as * const c_char , signature : b"uuuu\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } , 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 this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 4 , requests : unsafe { & zwp_virtual_keyboard_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "virtual keyboard manager\n\nA virtual keyboard manager allows an application to provide keyboard\ninput events as if they came from a physical keyboard."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "client not authorized to use the interface"] Unauthorized = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: Unauthorized) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] CreateVirtualKeyboard { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_virtual_keyboard" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: NewId ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateVirtualKeyboard { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: CreateVirtualKeyboard { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > (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 :: CreateVirtualKeyboard { seat } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) , Argument :: NewId (0) ,] , } , } } 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 :: CreateVirtualKeyboard { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [1] . o = :: std :: ptr :: null_mut () as * mut _ ; f (0 , & 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 ZwpVirtualKeyboardManagerV1 (Proxy < ZwpVirtualKeyboardManagerV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardManagerV1 (value) } } impl From < ZwpVirtualKeyboardManagerV1 > for Proxy < ZwpVirtualKeyboardManagerV1 > { # [inline] fn from (value : ZwpVirtualKeyboardManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_manager_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_manager_v1_interface } } } impl ZwpVirtualKeyboardManagerV1 { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] pub fn create_virtual_keyboard (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > { let msg = Request :: CreateVirtualKeyboard { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_VIRTUAL_KEYBOARD_SINCE : u32 = 1u32 ; static mut zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , unsafe { & super :: zwp_virtual_keyboard_v1 :: zwp_virtual_keyboard_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"create_virtual_keyboard\0" as * const u8 as * const c_char , signature : b"on\0" as * const u8 as * const c_char , types : unsafe { & zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_manager_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & zwp_virtual_keyboard_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/zwp-virtual-keyboard-0d32ffd994ee6290/out/virtual_keyboard_api.rs:1:11434 [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 ; 4] = [NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "virtual keyboard\n\nThe virtual keyboard provides an application with requests which emulate\nthe behaviour of a physical keyboard.\n\nThis interface can be used by clients on its own to provide raw input\nevents, or it can accompany the input method protocol."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "No keymap was set"] NoKeymap = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: NoKeymap) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] Keymap { format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32 , } , # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] Key { time : u32 , key : u32 , state : u32 , } , # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] Modifiers { mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32 , } , # [doc = "destroy the virtual keyboard keyboard object\n\n\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 : "keymap" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Fd , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "key" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "modifiers" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Keymap { .. } => 0 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 2 , Request :: Destroy => 3 , } } fn since (& self) -> u32 { match * self { Request :: Keymap { .. } => 1 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 1 , 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 :: Keymap { format , fd , size } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Uint (format) , Argument :: Fd (fd) , Argument :: Uint (size) ,] , } , Request :: Key { time , key , state } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (time) , Argument :: Uint (key) , Argument :: Uint (state) ,] , } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: Uint (mods_depressed) , Argument :: Uint (mods_latched) , Argument :: Uint (mods_locked) , Argument :: Uint (group) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 3 , 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 :: Keymap { format , fd , size } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; _args_array [1] . h = fd ; _args_array [2] . u = size ; f (0 , & mut _args_array) } , Request :: Key { time , key , state } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = time ; _args_array [1] . u = key ; _args_array [2] . u = state ; f (1 , & mut _args_array) } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => { let mut _args_array : [wl_argument ; 4] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = mods_depressed ; _args_array [1] . u = mods_latched ; _args_array [2] . u = mods_locked ; _args_array [3] . u = group ; f (2 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & 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 ZwpVirtualKeyboardV1 (Proxy < ZwpVirtualKeyboardV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardV1 (value) } } impl From < ZwpVirtualKeyboardV1 > for Proxy < ZwpVirtualKeyboardV1 > { # [inline] fn from (value : ZwpVirtualKeyboardV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_v1_interface } } } impl ZwpVirtualKeyboardV1 { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] pub fn keymap (& self , format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32) -> () { let msg = Request :: Keymap { format : format , fd : fd , size : size } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] pub fn key (& self , time : u32 , key : u32 , state : u32) -> () { let msg = Request :: Key { time : time , key : key , state : state } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] pub fn modifiers (& self , mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32) -> () { let msg = Request :: Modifiers { mods_depressed : mods_depressed , mods_latched : mods_latched , mods_locked : mods_locked , group : group } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the virtual keyboard keyboard object\n\n\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_KEYMAP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_KEY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_MODIFIERS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_requests : [wl_message ; 4] = [wl_message { name : b"keymap\0" as * const u8 as * const c_char , signature : b"uhu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"key\0" as * const u8 as * const c_char , signature : b"uuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"modifiers\0" as * const u8 as * const c_char , signature : b"uuuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , 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 this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 4 , requests : unsafe { & zwp_virtual_keyboard_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "virtual keyboard manager\n\nA virtual keyboard manager allows an application to provide keyboard\ninput events as if they came from a physical keyboard."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "client not authorized to use the interface"] Unauthorized = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: Unauthorized) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] CreateVirtualKeyboard { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_virtual_keyboard" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: NewId ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateVirtualKeyboard { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: CreateVirtualKeyboard { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > (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 :: CreateVirtualKeyboard { seat } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) , Argument :: NewId (0) ,] , } , } } 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 :: CreateVirtualKeyboard { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [1] . o = :: std :: ptr :: null_mut () as * mut _ ; f (0 , & 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 ZwpVirtualKeyboardManagerV1 (Proxy < ZwpVirtualKeyboardManagerV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardManagerV1 (value) } } impl From < ZwpVirtualKeyboardManagerV1 > for Proxy < ZwpVirtualKeyboardManagerV1 > { # [inline] fn from (value : ZwpVirtualKeyboardManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_manager_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_manager_v1_interface } } } impl ZwpVirtualKeyboardManagerV1 { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] pub fn create_virtual_keyboard (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > { let msg = Request :: CreateVirtualKeyboard { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_VIRTUAL_KEYBOARD_SINCE : u32 = 1u32 ; static mut zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , unsafe { & super :: zwp_virtual_keyboard_v1 :: zwp_virtual_keyboard_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"create_virtual_keyboard\0" as * const u8 as * const c_char , signature : b"on\0" as * const u8 as * const c_char , types : unsafe { & zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_manager_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & zwp_virtual_keyboard_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/zwp-virtual-keyboard-0d32ffd994ee6290/out/virtual_keyboard_api.rs:1:11738 [INFO] [stdout] | [INFO] [stdout] 1 | ...count : 4 , requests : unsafe { & zwp_virtual_keyboard_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_m... [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 ; 4] = [NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "virtual keyboard\n\nThe virtual keyboard provides an application with requests which emulate\nthe behaviour of a physical keyboard.\n\nThis interface can be used by clients on its own to provide raw input\nevents, or it can accompany the input method protocol."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "No keymap was set"] NoKeymap = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: NoKeymap) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] Keymap { format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32 , } , # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] Key { time : u32 , key : u32 , state : u32 , } , # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] Modifiers { mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32 , } , # [doc = "destroy the virtual keyboard keyboard object\n\n\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 : "keymap" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Fd , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "key" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "modifiers" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Keymap { .. } => 0 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 2 , Request :: Destroy => 3 , } } fn since (& self) -> u32 { match * self { Request :: Keymap { .. } => 1 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 1 , 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 :: Keymap { format , fd , size } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Uint (format) , Argument :: Fd (fd) , Argument :: Uint (size) ,] , } , Request :: Key { time , key , state } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (time) , Argument :: Uint (key) , Argument :: Uint (state) ,] , } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: Uint (mods_depressed) , Argument :: Uint (mods_latched) , Argument :: Uint (mods_locked) , Argument :: Uint (group) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 3 , 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 :: Keymap { format , fd , size } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; _args_array [1] . h = fd ; _args_array [2] . u = size ; f (0 , & mut _args_array) } , Request :: Key { time , key , state } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = time ; _args_array [1] . u = key ; _args_array [2] . u = state ; f (1 , & mut _args_array) } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => { let mut _args_array : [wl_argument ; 4] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = mods_depressed ; _args_array [1] . u = mods_latched ; _args_array [2] . u = mods_locked ; _args_array [3] . u = group ; f (2 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & 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 ZwpVirtualKeyboardV1 (Proxy < ZwpVirtualKeyboardV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardV1 (value) } } impl From < ZwpVirtualKeyboardV1 > for Proxy < ZwpVirtualKeyboardV1 > { # [inline] fn from (value : ZwpVirtualKeyboardV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_v1_interface } } } impl ZwpVirtualKeyboardV1 { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] pub fn keymap (& self , format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32) -> () { let msg = Request :: Keymap { format : format , fd : fd , size : size } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] pub fn key (& self , time : u32 , key : u32 , state : u32) -> () { let msg = Request :: Key { time : time , key : key , state : state } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] pub fn modifiers (& self , mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32) -> () { let msg = Request :: Modifiers { mods_depressed : mods_depressed , mods_latched : mods_latched , mods_locked : mods_locked , group : group } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the virtual keyboard keyboard object\n\n\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_KEYMAP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_KEY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_MODIFIERS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_requests : [wl_message ; 4] = [wl_message { name : b"keymap\0" as * const u8 as * const c_char , signature : b"uhu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"key\0" as * const u8 as * const c_char , signature : b"uuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"modifiers\0" as * const u8 as * const c_char , signature : b"uuuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , 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 this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 4 , requests : unsafe { &raw const zwp_virtual_keyboard_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "virtual keyboard manager\n\nA virtual keyboard manager allows an application to provide keyboard\ninput events as if they came from a physical keyboard."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "client not authorized to use the interface"] Unauthorized = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: Unauthorized) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] CreateVirtualKeyboard { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_virtual_keyboard" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: NewId ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateVirtualKeyboard { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: CreateVirtualKeyboard { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > (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 :: CreateVirtualKeyboard { seat } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) , Argument :: NewId (0) ,] , } , } } 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 :: CreateVirtualKeyboard { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [1] . o = :: std :: ptr :: null_mut () as * mut _ ; f (0 , & 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 ZwpVirtualKeyboardManagerV1 (Proxy < ZwpVirtualKeyboardManagerV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardManagerV1 (value) } } impl From < ZwpVirtualKeyboardManagerV1 > for Proxy < ZwpVirtualKeyboardManagerV1 > { # [inline] fn from (value : ZwpVirtualKeyboardManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_manager_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_manager_v1_interface } } } impl ZwpVirtualKeyboardManagerV1 { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] pub fn create_virtual_keyboard (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > { let msg = Request :: CreateVirtualKeyboard { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_VIRTUAL_KEYBOARD_SINCE : u32 = 1u32 ; static mut zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , unsafe { & super :: zwp_virtual_keyboard_v1 :: zwp_virtual_keyboard_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"create_virtual_keyboard\0" as * const u8 as * const c_char , signature : b"on\0" as * const u8 as * const c_char , types : unsafe { & zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_manager_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & zwp_virtual_keyboard_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/zwp-virtual-keyboard-0d32ffd994ee6290/out/virtual_keyboard_api.rs:1:17076 [INFO] [stdout] | [INFO] [stdout] 1 | ...nst wl_interface { unsafe { & zwp_virtual_keyboard_manager_v1_interface } } } impl ZwpVirtualKeyboardManagerV1 { # [doc = "Create a ne... [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 ; 4] = [NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "virtual keyboard\n\nThe virtual keyboard provides an application with requests which emulate\nthe behaviour of a physical keyboard.\n\nThis interface can be used by clients on its own to provide raw input\nevents, or it can accompany the input method protocol."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "No keymap was set"] NoKeymap = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: NoKeymap) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] Keymap { format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32 , } , # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] Key { time : u32 , key : u32 , state : u32 , } , # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] Modifiers { mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32 , } , # [doc = "destroy the virtual keyboard keyboard object\n\n\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 : "keymap" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Fd , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "key" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "modifiers" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Keymap { .. } => 0 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 2 , Request :: Destroy => 3 , } } fn since (& self) -> u32 { match * self { Request :: Keymap { .. } => 1 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 1 , 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 :: Keymap { format , fd , size } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Uint (format) , Argument :: Fd (fd) , Argument :: Uint (size) ,] , } , Request :: Key { time , key , state } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (time) , Argument :: Uint (key) , Argument :: Uint (state) ,] , } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: Uint (mods_depressed) , Argument :: Uint (mods_latched) , Argument :: Uint (mods_locked) , Argument :: Uint (group) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 3 , 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 :: Keymap { format , fd , size } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; _args_array [1] . h = fd ; _args_array [2] . u = size ; f (0 , & mut _args_array) } , Request :: Key { time , key , state } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = time ; _args_array [1] . u = key ; _args_array [2] . u = state ; f (1 , & mut _args_array) } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => { let mut _args_array : [wl_argument ; 4] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = mods_depressed ; _args_array [1] . u = mods_latched ; _args_array [2] . u = mods_locked ; _args_array [3] . u = group ; f (2 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & 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 ZwpVirtualKeyboardV1 (Proxy < ZwpVirtualKeyboardV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardV1 (value) } } impl From < ZwpVirtualKeyboardV1 > for Proxy < ZwpVirtualKeyboardV1 > { # [inline] fn from (value : ZwpVirtualKeyboardV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_v1_interface } } } impl ZwpVirtualKeyboardV1 { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] pub fn keymap (& self , format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32) -> () { let msg = Request :: Keymap { format : format , fd : fd , size : size } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] pub fn key (& self , time : u32 , key : u32 , state : u32) -> () { let msg = Request :: Key { time : time , key : key , state : state } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] pub fn modifiers (& self , mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32) -> () { let msg = Request :: Modifiers { mods_depressed : mods_depressed , mods_latched : mods_latched , mods_locked : mods_locked , group : group } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the virtual keyboard keyboard object\n\n\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_KEYMAP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_KEY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_MODIFIERS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_requests : [wl_message ; 4] = [wl_message { name : b"keymap\0" as * const u8 as * const c_char , signature : b"uhu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"key\0" as * const u8 as * const c_char , signature : b"uuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"modifiers\0" as * const u8 as * const c_char , signature : b"uuuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , 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 this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 4 , requests : unsafe { & zwp_virtual_keyboard_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "virtual keyboard manager\n\nA virtual keyboard manager allows an application to provide keyboard\ninput events as if they came from a physical keyboard."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "client not authorized to use the interface"] Unauthorized = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: Unauthorized) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] CreateVirtualKeyboard { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_virtual_keyboard" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: NewId ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateVirtualKeyboard { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: CreateVirtualKeyboard { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > (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 :: CreateVirtualKeyboard { seat } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) , Argument :: NewId (0) ,] , } , } } 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 :: CreateVirtualKeyboard { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [1] . o = :: std :: ptr :: null_mut () as * mut _ ; f (0 , & 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 ZwpVirtualKeyboardManagerV1 (Proxy < ZwpVirtualKeyboardManagerV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardManagerV1 (value) } } impl From < ZwpVirtualKeyboardManagerV1 > for Proxy < ZwpVirtualKeyboardManagerV1 > { # [inline] fn from (value : ZwpVirtualKeyboardManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_manager_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { &raw const zwp_virtual_keyboard_manager_v1_interface } } } impl ZwpVirtualKeyboardManagerV1 { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] pub fn create_virtual_keyboard (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > { let msg = Request :: CreateVirtualKeyboard { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_VIRTUAL_KEYBOARD_SINCE : u32 = 1u32 ; static mut zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , unsafe { & super :: zwp_virtual_keyboard_v1 :: zwp_virtual_keyboard_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"create_virtual_keyboard\0" as * const u8 as * const c_char , signature : b"on\0" as * const u8 as * const c_char , types : unsafe { & zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_manager_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & zwp_virtual_keyboard_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/zwp-virtual-keyboard-0d32ffd994ee6290/out/virtual_keyboard_api.rs:1:17921 [INFO] [stdout] | [INFO] [stdout] 1 | ...wl_interface ; 2] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , unsafe { & super :: zwp_virtual_keyb... [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 ; 4] = [NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "virtual keyboard\n\nThe virtual keyboard provides an application with requests which emulate\nthe behaviour of a physical keyboard.\n\nThis interface can be used by clients on its own to provide raw input\nevents, or it can accompany the input method protocol."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "No keymap was set"] NoKeymap = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: NoKeymap) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] Keymap { format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32 , } , # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] Key { time : u32 , key : u32 , state : u32 , } , # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] Modifiers { mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32 , } , # [doc = "destroy the virtual keyboard keyboard object\n\n\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 : "keymap" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Fd , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "key" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "modifiers" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Keymap { .. } => 0 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 2 , Request :: Destroy => 3 , } } fn since (& self) -> u32 { match * self { Request :: Keymap { .. } => 1 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 1 , 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 :: Keymap { format , fd , size } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Uint (format) , Argument :: Fd (fd) , Argument :: Uint (size) ,] , } , Request :: Key { time , key , state } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (time) , Argument :: Uint (key) , Argument :: Uint (state) ,] , } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: Uint (mods_depressed) , Argument :: Uint (mods_latched) , Argument :: Uint (mods_locked) , Argument :: Uint (group) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 3 , 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 :: Keymap { format , fd , size } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; _args_array [1] . h = fd ; _args_array [2] . u = size ; f (0 , & mut _args_array) } , Request :: Key { time , key , state } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = time ; _args_array [1] . u = key ; _args_array [2] . u = state ; f (1 , & mut _args_array) } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => { let mut _args_array : [wl_argument ; 4] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = mods_depressed ; _args_array [1] . u = mods_latched ; _args_array [2] . u = mods_locked ; _args_array [3] . u = group ; f (2 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & 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 ZwpVirtualKeyboardV1 (Proxy < ZwpVirtualKeyboardV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardV1 (value) } } impl From < ZwpVirtualKeyboardV1 > for Proxy < ZwpVirtualKeyboardV1 > { # [inline] fn from (value : ZwpVirtualKeyboardV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_v1_interface } } } impl ZwpVirtualKeyboardV1 { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] pub fn keymap (& self , format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32) -> () { let msg = Request :: Keymap { format : format , fd : fd , size : size } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] pub fn key (& self , time : u32 , key : u32 , state : u32) -> () { let msg = Request :: Key { time : time , key : key , state : state } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] pub fn modifiers (& self , mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32) -> () { let msg = Request :: Modifiers { mods_depressed : mods_depressed , mods_latched : mods_latched , mods_locked : mods_locked , group : group } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the virtual keyboard keyboard object\n\n\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_KEYMAP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_KEY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_MODIFIERS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_requests : [wl_message ; 4] = [wl_message { name : b"keymap\0" as * const u8 as * const c_char , signature : b"uhu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"key\0" as * const u8 as * const c_char , signature : b"uuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"modifiers\0" as * const u8 as * const c_char , signature : b"uuuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , 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 this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 4 , requests : unsafe { & zwp_virtual_keyboard_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "virtual keyboard manager\n\nA virtual keyboard manager allows an application to provide keyboard\ninput events as if they came from a physical keyboard."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "client not authorized to use the interface"] Unauthorized = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: Unauthorized) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] CreateVirtualKeyboard { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_virtual_keyboard" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: NewId ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateVirtualKeyboard { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: CreateVirtualKeyboard { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > (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 :: CreateVirtualKeyboard { seat } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) , Argument :: NewId (0) ,] , } , } } 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 :: CreateVirtualKeyboard { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [1] . o = :: std :: ptr :: null_mut () as * mut _ ; f (0 , & 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 ZwpVirtualKeyboardManagerV1 (Proxy < ZwpVirtualKeyboardManagerV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardManagerV1 (value) } } impl From < ZwpVirtualKeyboardManagerV1 > for Proxy < ZwpVirtualKeyboardManagerV1 > { # [inline] fn from (value : ZwpVirtualKeyboardManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_manager_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_manager_v1_interface } } } impl ZwpVirtualKeyboardManagerV1 { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] pub fn create_virtual_keyboard (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > { let msg = Request :: CreateVirtualKeyboard { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_VIRTUAL_KEYBOARD_SINCE : u32 = 1u32 ; static mut zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types : [* const wl_interface ; 2] = [unsafe { &raw const super :: wl_seat :: wl_seat_interface as * const wl_interface } , unsafe { & super :: zwp_virtual_keyboard_v1 :: zwp_virtual_keyboard_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"create_virtual_keyboard\0" as * const u8 as * const c_char , signature : b"on\0" as * const u8 as * const c_char , types : unsafe { & zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_manager_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & zwp_virtual_keyboard_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/zwp-virtual-keyboard-0d32ffd994ee6290/out/virtual_keyboard_api.rs:1:17998 [INFO] [stdout] | [INFO] [stdout] 1 | ... } , unsafe { & super :: zwp_virtual_keyboard_v1 :: zwp_virtual_keyboard_v1_interface as * const wl_interface } ,] ; # [doc = r" C-rep... [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 ; 4] = [NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "virtual keyboard\n\nThe virtual keyboard provides an application with requests which emulate\nthe behaviour of a physical keyboard.\n\nThis interface can be used by clients on its own to provide raw input\nevents, or it can accompany the input method protocol."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "No keymap was set"] NoKeymap = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: NoKeymap) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] Keymap { format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32 , } , # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] Key { time : u32 , key : u32 , state : u32 , } , # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] Modifiers { mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32 , } , # [doc = "destroy the virtual keyboard keyboard object\n\n\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 : "keymap" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Fd , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "key" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "modifiers" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Keymap { .. } => 0 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 2 , Request :: Destroy => 3 , } } fn since (& self) -> u32 { match * self { Request :: Keymap { .. } => 1 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 1 , 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 :: Keymap { format , fd , size } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Uint (format) , Argument :: Fd (fd) , Argument :: Uint (size) ,] , } , Request :: Key { time , key , state } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (time) , Argument :: Uint (key) , Argument :: Uint (state) ,] , } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: Uint (mods_depressed) , Argument :: Uint (mods_latched) , Argument :: Uint (mods_locked) , Argument :: Uint (group) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 3 , 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 :: Keymap { format , fd , size } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; _args_array [1] . h = fd ; _args_array [2] . u = size ; f (0 , & mut _args_array) } , Request :: Key { time , key , state } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = time ; _args_array [1] . u = key ; _args_array [2] . u = state ; f (1 , & mut _args_array) } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => { let mut _args_array : [wl_argument ; 4] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = mods_depressed ; _args_array [1] . u = mods_latched ; _args_array [2] . u = mods_locked ; _args_array [3] . u = group ; f (2 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & 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 ZwpVirtualKeyboardV1 (Proxy < ZwpVirtualKeyboardV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardV1 (value) } } impl From < ZwpVirtualKeyboardV1 > for Proxy < ZwpVirtualKeyboardV1 > { # [inline] fn from (value : ZwpVirtualKeyboardV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_v1_interface } } } impl ZwpVirtualKeyboardV1 { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] pub fn keymap (& self , format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32) -> () { let msg = Request :: Keymap { format : format , fd : fd , size : size } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] pub fn key (& self , time : u32 , key : u32 , state : u32) -> () { let msg = Request :: Key { time : time , key : key , state : state } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] pub fn modifiers (& self , mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32) -> () { let msg = Request :: Modifiers { mods_depressed : mods_depressed , mods_latched : mods_latched , mods_locked : mods_locked , group : group } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the virtual keyboard keyboard object\n\n\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_KEYMAP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_KEY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_MODIFIERS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_requests : [wl_message ; 4] = [wl_message { name : b"keymap\0" as * const u8 as * const c_char , signature : b"uhu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"key\0" as * const u8 as * const c_char , signature : b"uuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"modifiers\0" as * const u8 as * const c_char , signature : b"uuuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , 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 this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 4 , requests : unsafe { & zwp_virtual_keyboard_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "virtual keyboard manager\n\nA virtual keyboard manager allows an application to provide keyboard\ninput events as if they came from a physical keyboard."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "client not authorized to use the interface"] Unauthorized = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: Unauthorized) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] CreateVirtualKeyboard { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_virtual_keyboard" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: NewId ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateVirtualKeyboard { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: CreateVirtualKeyboard { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > (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 :: CreateVirtualKeyboard { seat } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) , Argument :: NewId (0) ,] , } , } } 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 :: CreateVirtualKeyboard { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [1] . o = :: std :: ptr :: null_mut () as * mut _ ; f (0 , & 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 ZwpVirtualKeyboardManagerV1 (Proxy < ZwpVirtualKeyboardManagerV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardManagerV1 (value) } } impl From < ZwpVirtualKeyboardManagerV1 > for Proxy < ZwpVirtualKeyboardManagerV1 > { # [inline] fn from (value : ZwpVirtualKeyboardManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_manager_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_manager_v1_interface } } } impl ZwpVirtualKeyboardManagerV1 { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] pub fn create_virtual_keyboard (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > { let msg = Request :: CreateVirtualKeyboard { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_VIRTUAL_KEYBOARD_SINCE : u32 = 1u32 ; static mut zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , unsafe { &raw const super :: zwp_virtual_keyboard_v1 :: zwp_virtual_keyboard_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"create_virtual_keyboard\0" as * const u8 as * const c_char , signature : b"on\0" as * const u8 as * const c_char , types : unsafe { & zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_manager_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & zwp_virtual_keyboard_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/zwp-virtual-keyboard-0d32ffd994ee6290/out/virtual_keyboard_api.rs:1:18411 [INFO] [stdout] | [INFO] [stdout] 1 | ...s : unsafe { & zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types as * const _ } , } ,] ; # [doc = r" C representa... [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 ; 4] = [NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "virtual keyboard\n\nThe virtual keyboard provides an application with requests which emulate\nthe behaviour of a physical keyboard.\n\nThis interface can be used by clients on its own to provide raw input\nevents, or it can accompany the input method protocol."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "No keymap was set"] NoKeymap = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: NoKeymap) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] Keymap { format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32 , } , # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] Key { time : u32 , key : u32 , state : u32 , } , # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] Modifiers { mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32 , } , # [doc = "destroy the virtual keyboard keyboard object\n\n\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 : "keymap" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Fd , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "key" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "modifiers" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Keymap { .. } => 0 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 2 , Request :: Destroy => 3 , } } fn since (& self) -> u32 { match * self { Request :: Keymap { .. } => 1 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 1 , 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 :: Keymap { format , fd , size } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Uint (format) , Argument :: Fd (fd) , Argument :: Uint (size) ,] , } , Request :: Key { time , key , state } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (time) , Argument :: Uint (key) , Argument :: Uint (state) ,] , } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: Uint (mods_depressed) , Argument :: Uint (mods_latched) , Argument :: Uint (mods_locked) , Argument :: Uint (group) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 3 , 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 :: Keymap { format , fd , size } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; _args_array [1] . h = fd ; _args_array [2] . u = size ; f (0 , & mut _args_array) } , Request :: Key { time , key , state } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = time ; _args_array [1] . u = key ; _args_array [2] . u = state ; f (1 , & mut _args_array) } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => { let mut _args_array : [wl_argument ; 4] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = mods_depressed ; _args_array [1] . u = mods_latched ; _args_array [2] . u = mods_locked ; _args_array [3] . u = group ; f (2 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & 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 ZwpVirtualKeyboardV1 (Proxy < ZwpVirtualKeyboardV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardV1 (value) } } impl From < ZwpVirtualKeyboardV1 > for Proxy < ZwpVirtualKeyboardV1 > { # [inline] fn from (value : ZwpVirtualKeyboardV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_v1_interface } } } impl ZwpVirtualKeyboardV1 { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] pub fn keymap (& self , format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32) -> () { let msg = Request :: Keymap { format : format , fd : fd , size : size } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] pub fn key (& self , time : u32 , key : u32 , state : u32) -> () { let msg = Request :: Key { time : time , key : key , state : state } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] pub fn modifiers (& self , mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32) -> () { let msg = Request :: Modifiers { mods_depressed : mods_depressed , mods_latched : mods_latched , mods_locked : mods_locked , group : group } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the virtual keyboard keyboard object\n\n\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_KEYMAP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_KEY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_MODIFIERS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_requests : [wl_message ; 4] = [wl_message { name : b"keymap\0" as * const u8 as * const c_char , signature : b"uhu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"key\0" as * const u8 as * const c_char , signature : b"uuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"modifiers\0" as * const u8 as * const c_char , signature : b"uuuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , 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 this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 4 , requests : unsafe { & zwp_virtual_keyboard_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "virtual keyboard manager\n\nA virtual keyboard manager allows an application to provide keyboard\ninput events as if they came from a physical keyboard."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "client not authorized to use the interface"] Unauthorized = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: Unauthorized) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] CreateVirtualKeyboard { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_virtual_keyboard" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: NewId ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateVirtualKeyboard { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: CreateVirtualKeyboard { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > (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 :: CreateVirtualKeyboard { seat } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) , Argument :: NewId (0) ,] , } , } } 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 :: CreateVirtualKeyboard { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [1] . o = :: std :: ptr :: null_mut () as * mut _ ; f (0 , & 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 ZwpVirtualKeyboardManagerV1 (Proxy < ZwpVirtualKeyboardManagerV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardManagerV1 (value) } } impl From < ZwpVirtualKeyboardManagerV1 > for Proxy < ZwpVirtualKeyboardManagerV1 > { # [inline] fn from (value : ZwpVirtualKeyboardManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_manager_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_manager_v1_interface } } } impl ZwpVirtualKeyboardManagerV1 { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] pub fn create_virtual_keyboard (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > { let msg = Request :: CreateVirtualKeyboard { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_VIRTUAL_KEYBOARD_SINCE : u32 = 1u32 ; static mut zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , unsafe { & super :: zwp_virtual_keyboard_v1 :: zwp_virtual_keyboard_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"create_virtual_keyboard\0" as * const u8 as * const c_char , signature : b"on\0" as * const u8 as * const c_char , types : unsafe { &raw const zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_manager_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & zwp_virtual_keyboard_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/zwp-virtual-keyboard-0d32ffd994ee6290/out/virtual_keyboard_api.rs:1:18791 [INFO] [stdout] | [INFO] [stdout] 1 | ...t : 1 , requests : unsafe { & zwp_virtual_keyboard_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR 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 ; 4] = [NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "virtual keyboard\n\nThe virtual keyboard provides an application with requests which emulate\nthe behaviour of a physical keyboard.\n\nThis interface can be used by clients on its own to provide raw input\nevents, or it can accompany the input method protocol."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "No keymap was set"] NoKeymap = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: NoKeymap) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] Keymap { format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32 , } , # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] Key { time : u32 , key : u32 , state : u32 , } , # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] Modifiers { mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32 , } , # [doc = "destroy the virtual keyboard keyboard object\n\n\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 : "keymap" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Fd , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "key" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "modifiers" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Keymap { .. } => 0 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 2 , Request :: Destroy => 3 , } } fn since (& self) -> u32 { match * self { Request :: Keymap { .. } => 1 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 1 , 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 :: Keymap { format , fd , size } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Uint (format) , Argument :: Fd (fd) , Argument :: Uint (size) ,] , } , Request :: Key { time , key , state } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (time) , Argument :: Uint (key) , Argument :: Uint (state) ,] , } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: Uint (mods_depressed) , Argument :: Uint (mods_latched) , Argument :: Uint (mods_locked) , Argument :: Uint (group) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 3 , 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 :: Keymap { format , fd , size } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; _args_array [1] . h = fd ; _args_array [2] . u = size ; f (0 , & mut _args_array) } , Request :: Key { time , key , state } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = time ; _args_array [1] . u = key ; _args_array [2] . u = state ; f (1 , & mut _args_array) } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => { let mut _args_array : [wl_argument ; 4] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = mods_depressed ; _args_array [1] . u = mods_latched ; _args_array [2] . u = mods_locked ; _args_array [3] . u = group ; f (2 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & 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 ZwpVirtualKeyboardV1 (Proxy < ZwpVirtualKeyboardV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardV1 (value) } } impl From < ZwpVirtualKeyboardV1 > for Proxy < ZwpVirtualKeyboardV1 > { # [inline] fn from (value : ZwpVirtualKeyboardV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_v1_interface } } } impl ZwpVirtualKeyboardV1 { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] pub fn keymap (& self , format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32) -> () { let msg = Request :: Keymap { format : format , fd : fd , size : size } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] pub fn key (& self , time : u32 , key : u32 , state : u32) -> () { let msg = Request :: Key { time : time , key : key , state : state } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] pub fn modifiers (& self , mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32) -> () { let msg = Request :: Modifiers { mods_depressed : mods_depressed , mods_latched : mods_latched , mods_locked : mods_locked , group : group } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the virtual keyboard keyboard object\n\n\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_KEYMAP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_KEY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_MODIFIERS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_requests : [wl_message ; 4] = [wl_message { name : b"keymap\0" as * const u8 as * const c_char , signature : b"uhu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"key\0" as * const u8 as * const c_char , signature : b"uuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"modifiers\0" as * const u8 as * const c_char , signature : b"uuuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , 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 this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 4 , requests : unsafe { & zwp_virtual_keyboard_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "virtual keyboard manager\n\nA virtual keyboard manager allows an application to provide keyboard\ninput events as if they came from a physical keyboard."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "client not authorized to use the interface"] Unauthorized = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: Unauthorized) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] CreateVirtualKeyboard { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_virtual_keyboard" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: NewId ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateVirtualKeyboard { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: CreateVirtualKeyboard { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > (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 :: CreateVirtualKeyboard { seat } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) , Argument :: NewId (0) ,] , } , } } 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 :: CreateVirtualKeyboard { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [1] . o = :: std :: ptr :: null_mut () as * mut _ ; f (0 , & 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 ZwpVirtualKeyboardManagerV1 (Proxy < ZwpVirtualKeyboardManagerV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardManagerV1 (value) } } impl From < ZwpVirtualKeyboardManagerV1 > for Proxy < ZwpVirtualKeyboardManagerV1 > { # [inline] fn from (value : ZwpVirtualKeyboardManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_manager_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_manager_v1_interface } } } impl ZwpVirtualKeyboardManagerV1 { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] pub fn create_virtual_keyboard (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > { let msg = Request :: CreateVirtualKeyboard { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_VIRTUAL_KEYBOARD_SINCE : u32 = 1u32 ; static mut zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , unsafe { & super :: zwp_virtual_keyboard_v1 :: zwp_virtual_keyboard_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"create_virtual_keyboard\0" as * const u8 as * const c_char , signature : b"on\0" as * const u8 as * const c_char , types : unsafe { & zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_manager_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { &raw const zwp_virtual_keyboard_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Compiling zwp-virtual-keyboard v0.2.7 (/opt/rustwide/workdir) [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/zwp-virtual-keyboard-0d32ffd994ee6290/out/virtual_keyboard_api.rs:1:8281 [INFO] [stdout] | [INFO] [stdout] 1 | ...* const wl_interface { unsafe { & zwp_virtual_keyboard_v1_interface } } } impl ZwpVirtualKeyboardV1 { # [doc = "keyboard mapping\n\nPr... [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)]` 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 ; 4] = [NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "virtual keyboard\n\nThe virtual keyboard provides an application with requests which emulate\nthe behaviour of a physical keyboard.\n\nThis interface can be used by clients on its own to provide raw input\nevents, or it can accompany the input method protocol."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "No keymap was set"] NoKeymap = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: NoKeymap) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] Keymap { format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32 , } , # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] Key { time : u32 , key : u32 , state : u32 , } , # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] Modifiers { mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32 , } , # [doc = "destroy the virtual keyboard keyboard object\n\n\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 : "keymap" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Fd , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "key" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "modifiers" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Keymap { .. } => 0 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 2 , Request :: Destroy => 3 , } } fn since (& self) -> u32 { match * self { Request :: Keymap { .. } => 1 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 1 , 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 :: Keymap { format , fd , size } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Uint (format) , Argument :: Fd (fd) , Argument :: Uint (size) ,] , } , Request :: Key { time , key , state } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (time) , Argument :: Uint (key) , Argument :: Uint (state) ,] , } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: Uint (mods_depressed) , Argument :: Uint (mods_latched) , Argument :: Uint (mods_locked) , Argument :: Uint (group) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 3 , 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 :: Keymap { format , fd , size } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; _args_array [1] . h = fd ; _args_array [2] . u = size ; f (0 , & mut _args_array) } , Request :: Key { time , key , state } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = time ; _args_array [1] . u = key ; _args_array [2] . u = state ; f (1 , & mut _args_array) } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => { let mut _args_array : [wl_argument ; 4] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = mods_depressed ; _args_array [1] . u = mods_latched ; _args_array [2] . u = mods_locked ; _args_array [3] . u = group ; f (2 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & 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 ZwpVirtualKeyboardV1 (Proxy < ZwpVirtualKeyboardV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardV1 (value) } } impl From < ZwpVirtualKeyboardV1 > for Proxy < ZwpVirtualKeyboardV1 > { # [inline] fn from (value : ZwpVirtualKeyboardV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { &raw const zwp_virtual_keyboard_v1_interface } } } impl ZwpVirtualKeyboardV1 { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] pub fn keymap (& self , format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32) -> () { let msg = Request :: Keymap { format : format , fd : fd , size : size } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] pub fn key (& self , time : u32 , key : u32 , state : u32) -> () { let msg = Request :: Key { time : time , key : key , state : state } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] pub fn modifiers (& self , mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32) -> () { let msg = Request :: Modifiers { mods_depressed : mods_depressed , mods_latched : mods_latched , mods_locked : mods_locked , group : group } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the virtual keyboard keyboard object\n\n\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_KEYMAP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_KEY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_MODIFIERS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_requests : [wl_message ; 4] = [wl_message { name : b"keymap\0" as * const u8 as * const c_char , signature : b"uhu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"key\0" as * const u8 as * const c_char , signature : b"uuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"modifiers\0" as * const u8 as * const c_char , signature : b"uuuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , 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 this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 4 , requests : unsafe { & zwp_virtual_keyboard_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "virtual keyboard manager\n\nA virtual keyboard manager allows an application to provide keyboard\ninput events as if they came from a physical keyboard."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "client not authorized to use the interface"] Unauthorized = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: Unauthorized) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] CreateVirtualKeyboard { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_virtual_keyboard" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: NewId ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateVirtualKeyboard { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: CreateVirtualKeyboard { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > (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 :: CreateVirtualKeyboard { seat } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) , Argument :: NewId (0) ,] , } , } } 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 :: CreateVirtualKeyboard { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [1] . o = :: std :: ptr :: null_mut () as * mut _ ; f (0 , & 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 ZwpVirtualKeyboardManagerV1 (Proxy < ZwpVirtualKeyboardManagerV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardManagerV1 (value) } } impl From < ZwpVirtualKeyboardManagerV1 > for Proxy < ZwpVirtualKeyboardManagerV1 > { # [inline] fn from (value : ZwpVirtualKeyboardManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_manager_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_manager_v1_interface } } } impl ZwpVirtualKeyboardManagerV1 { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] pub fn create_virtual_keyboard (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > { let msg = Request :: CreateVirtualKeyboard { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_VIRTUAL_KEYBOARD_SINCE : u32 = 1u32 ; static mut zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , unsafe { & super :: zwp_virtual_keyboard_v1 :: zwp_virtual_keyboard_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"create_virtual_keyboard\0" as * const u8 as * const c_char , signature : b"on\0" as * const u8 as * const c_char , types : unsafe { & zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_manager_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & zwp_virtual_keyboard_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/zwp-virtual-keyboard-0d32ffd994ee6290/out/virtual_keyboard_api.rs:1:10919 [INFO] [stdout] | [INFO] [stdout] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"key\0" as * const u8 as * const c_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 ; 4] = [NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "virtual keyboard\n\nThe virtual keyboard provides an application with requests which emulate\nthe behaviour of a physical keyboard.\n\nThis interface can be used by clients on its own to provide raw input\nevents, or it can accompany the input method protocol."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "No keymap was set"] NoKeymap = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: NoKeymap) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] Keymap { format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32 , } , # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] Key { time : u32 , key : u32 , state : u32 , } , # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] Modifiers { mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32 , } , # [doc = "destroy the virtual keyboard keyboard object\n\n\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 : "keymap" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Fd , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "key" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "modifiers" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Keymap { .. } => 0 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 2 , Request :: Destroy => 3 , } } fn since (& self) -> u32 { match * self { Request :: Keymap { .. } => 1 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 1 , 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 :: Keymap { format , fd , size } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Uint (format) , Argument :: Fd (fd) , Argument :: Uint (size) ,] , } , Request :: Key { time , key , state } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (time) , Argument :: Uint (key) , Argument :: Uint (state) ,] , } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: Uint (mods_depressed) , Argument :: Uint (mods_latched) , Argument :: Uint (mods_locked) , Argument :: Uint (group) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 3 , 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 :: Keymap { format , fd , size } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; _args_array [1] . h = fd ; _args_array [2] . u = size ; f (0 , & mut _args_array) } , Request :: Key { time , key , state } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = time ; _args_array [1] . u = key ; _args_array [2] . u = state ; f (1 , & mut _args_array) } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => { let mut _args_array : [wl_argument ; 4] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = mods_depressed ; _args_array [1] . u = mods_latched ; _args_array [2] . u = mods_locked ; _args_array [3] . u = group ; f (2 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & 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 ZwpVirtualKeyboardV1 (Proxy < ZwpVirtualKeyboardV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardV1 (value) } } impl From < ZwpVirtualKeyboardV1 > for Proxy < ZwpVirtualKeyboardV1 > { # [inline] fn from (value : ZwpVirtualKeyboardV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_v1_interface } } } impl ZwpVirtualKeyboardV1 { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] pub fn keymap (& self , format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32) -> () { let msg = Request :: Keymap { format : format , fd : fd , size : size } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] pub fn key (& self , time : u32 , key : u32 , state : u32) -> () { let msg = Request :: Key { time : time , key : key , state : state } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] pub fn modifiers (& self , mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32) -> () { let msg = Request :: Modifiers { mods_depressed : mods_depressed , mods_latched : mods_latched , mods_locked : mods_locked , group : group } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the virtual keyboard keyboard object\n\n\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_KEYMAP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_KEY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_MODIFIERS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_requests : [wl_message ; 4] = [wl_message { name : b"keymap\0" as * const u8 as * const c_char , signature : b"uhu\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } , wl_message { name : b"key\0" as * const u8 as * const c_char , signature : b"uuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"modifiers\0" as * const u8 as * const c_char , signature : b"uuuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , 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 this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 4 , requests : unsafe { & zwp_virtual_keyboard_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "virtual keyboard manager\n\nA virtual keyboard manager allows an application to provide keyboard\ninput events as if they came from a physical keyboard."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "client not authorized to use the interface"] Unauthorized = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: Unauthorized) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] CreateVirtualKeyboard { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_virtual_keyboard" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: NewId ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateVirtualKeyboard { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: CreateVirtualKeyboard { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > (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 :: CreateVirtualKeyboard { seat } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) , Argument :: NewId (0) ,] , } , } } 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 :: CreateVirtualKeyboard { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [1] . o = :: std :: ptr :: null_mut () as * mut _ ; f (0 , & 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 ZwpVirtualKeyboardManagerV1 (Proxy < ZwpVirtualKeyboardManagerV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardManagerV1 (value) } } impl From < ZwpVirtualKeyboardManagerV1 > for Proxy < ZwpVirtualKeyboardManagerV1 > { # [inline] fn from (value : ZwpVirtualKeyboardManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_manager_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_manager_v1_interface } } } impl ZwpVirtualKeyboardManagerV1 { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] pub fn create_virtual_keyboard (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > { let msg = Request :: CreateVirtualKeyboard { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_VIRTUAL_KEYBOARD_SINCE : u32 = 1u32 ; static mut zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , unsafe { & super :: zwp_virtual_keyboard_v1 :: zwp_virtual_keyboard_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"create_virtual_keyboard\0" as * const u8 as * const c_char , signature : b"on\0" as * const u8 as * const c_char , types : unsafe { & zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_manager_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & zwp_virtual_keyboard_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/zwp-virtual-keyboard-0d32ffd994ee6290/out/virtual_keyboard_api.rs:1:11088 [INFO] [stdout] | [INFO] [stdout] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"modifiers\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 ; 4] = [NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "virtual keyboard\n\nThe virtual keyboard provides an application with requests which emulate\nthe behaviour of a physical keyboard.\n\nThis interface can be used by clients on its own to provide raw input\nevents, or it can accompany the input method protocol."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "No keymap was set"] NoKeymap = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: NoKeymap) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] Keymap { format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32 , } , # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] Key { time : u32 , key : u32 , state : u32 , } , # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] Modifiers { mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32 , } , # [doc = "destroy the virtual keyboard keyboard object\n\n\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 : "keymap" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Fd , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "key" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "modifiers" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Keymap { .. } => 0 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 2 , Request :: Destroy => 3 , } } fn since (& self) -> u32 { match * self { Request :: Keymap { .. } => 1 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 1 , 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 :: Keymap { format , fd , size } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Uint (format) , Argument :: Fd (fd) , Argument :: Uint (size) ,] , } , Request :: Key { time , key , state } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (time) , Argument :: Uint (key) , Argument :: Uint (state) ,] , } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: Uint (mods_depressed) , Argument :: Uint (mods_latched) , Argument :: Uint (mods_locked) , Argument :: Uint (group) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 3 , 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 :: Keymap { format , fd , size } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; _args_array [1] . h = fd ; _args_array [2] . u = size ; f (0 , & mut _args_array) } , Request :: Key { time , key , state } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = time ; _args_array [1] . u = key ; _args_array [2] . u = state ; f (1 , & mut _args_array) } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => { let mut _args_array : [wl_argument ; 4] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = mods_depressed ; _args_array [1] . u = mods_latched ; _args_array [2] . u = mods_locked ; _args_array [3] . u = group ; f (2 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & 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 ZwpVirtualKeyboardV1 (Proxy < ZwpVirtualKeyboardV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardV1 (value) } } impl From < ZwpVirtualKeyboardV1 > for Proxy < ZwpVirtualKeyboardV1 > { # [inline] fn from (value : ZwpVirtualKeyboardV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_v1_interface } } } impl ZwpVirtualKeyboardV1 { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] pub fn keymap (& self , format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32) -> () { let msg = Request :: Keymap { format : format , fd : fd , size : size } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] pub fn key (& self , time : u32 , key : u32 , state : u32) -> () { let msg = Request :: Key { time : time , key : key , state : state } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] pub fn modifiers (& self , mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32) -> () { let msg = Request :: Modifiers { mods_depressed : mods_depressed , mods_latched : mods_latched , mods_locked : mods_locked , group : group } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the virtual keyboard keyboard object\n\n\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_KEYMAP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_KEY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_MODIFIERS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_requests : [wl_message ; 4] = [wl_message { name : b"keymap\0" as * const u8 as * const c_char , signature : b"uhu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"key\0" as * const u8 as * const c_char , signature : b"uuu\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } , wl_message { name : b"modifiers\0" as * const u8 as * const c_char , signature : b"uuuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , 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 this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 4 , requests : unsafe { & zwp_virtual_keyboard_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "virtual keyboard manager\n\nA virtual keyboard manager allows an application to provide keyboard\ninput events as if they came from a physical keyboard."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "client not authorized to use the interface"] Unauthorized = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: Unauthorized) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] CreateVirtualKeyboard { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_virtual_keyboard" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: NewId ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateVirtualKeyboard { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: CreateVirtualKeyboard { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > (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 :: CreateVirtualKeyboard { seat } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) , Argument :: NewId (0) ,] , } , } } 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 :: CreateVirtualKeyboard { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [1] . o = :: std :: ptr :: null_mut () as * mut _ ; f (0 , & 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 ZwpVirtualKeyboardManagerV1 (Proxy < ZwpVirtualKeyboardManagerV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardManagerV1 (value) } } impl From < ZwpVirtualKeyboardManagerV1 > for Proxy < ZwpVirtualKeyboardManagerV1 > { # [inline] fn from (value : ZwpVirtualKeyboardManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_manager_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_manager_v1_interface } } } impl ZwpVirtualKeyboardManagerV1 { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] pub fn create_virtual_keyboard (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > { let msg = Request :: CreateVirtualKeyboard { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_VIRTUAL_KEYBOARD_SINCE : u32 = 1u32 ; static mut zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , unsafe { & super :: zwp_virtual_keyboard_v1 :: zwp_virtual_keyboard_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"create_virtual_keyboard\0" as * const u8 as * const c_char , signature : b"on\0" as * const u8 as * const c_char , types : unsafe { & zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_manager_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & zwp_virtual_keyboard_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/zwp-virtual-keyboard-0d32ffd994ee6290/out/virtual_keyboard_api.rs:1:11264 [INFO] [stdout] | [INFO] [stdout] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 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 ; 4] = [NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "virtual keyboard\n\nThe virtual keyboard provides an application with requests which emulate\nthe behaviour of a physical keyboard.\n\nThis interface can be used by clients on its own to provide raw input\nevents, or it can accompany the input method protocol."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "No keymap was set"] NoKeymap = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: NoKeymap) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] Keymap { format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32 , } , # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] Key { time : u32 , key : u32 , state : u32 , } , # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] Modifiers { mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32 , } , # [doc = "destroy the virtual keyboard keyboard object\n\n\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 : "keymap" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Fd , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "key" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "modifiers" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Keymap { .. } => 0 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 2 , Request :: Destroy => 3 , } } fn since (& self) -> u32 { match * self { Request :: Keymap { .. } => 1 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 1 , 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 :: Keymap { format , fd , size } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Uint (format) , Argument :: Fd (fd) , Argument :: Uint (size) ,] , } , Request :: Key { time , key , state } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (time) , Argument :: Uint (key) , Argument :: Uint (state) ,] , } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: Uint (mods_depressed) , Argument :: Uint (mods_latched) , Argument :: Uint (mods_locked) , Argument :: Uint (group) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 3 , 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 :: Keymap { format , fd , size } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; _args_array [1] . h = fd ; _args_array [2] . u = size ; f (0 , & mut _args_array) } , Request :: Key { time , key , state } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = time ; _args_array [1] . u = key ; _args_array [2] . u = state ; f (1 , & mut _args_array) } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => { let mut _args_array : [wl_argument ; 4] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = mods_depressed ; _args_array [1] . u = mods_latched ; _args_array [2] . u = mods_locked ; _args_array [3] . u = group ; f (2 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & 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 ZwpVirtualKeyboardV1 (Proxy < ZwpVirtualKeyboardV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardV1 (value) } } impl From < ZwpVirtualKeyboardV1 > for Proxy < ZwpVirtualKeyboardV1 > { # [inline] fn from (value : ZwpVirtualKeyboardV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_v1_interface } } } impl ZwpVirtualKeyboardV1 { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] pub fn keymap (& self , format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32) -> () { let msg = Request :: Keymap { format : format , fd : fd , size : size } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] pub fn key (& self , time : u32 , key : u32 , state : u32) -> () { let msg = Request :: Key { time : time , key : key , state : state } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] pub fn modifiers (& self , mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32) -> () { let msg = Request :: Modifiers { mods_depressed : mods_depressed , mods_latched : mods_latched , mods_locked : mods_locked , group : group } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the virtual keyboard keyboard object\n\n\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_KEYMAP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_KEY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_MODIFIERS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_requests : [wl_message ; 4] = [wl_message { name : b"keymap\0" as * const u8 as * const c_char , signature : b"uhu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"key\0" as * const u8 as * const c_char , signature : b"uuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"modifiers\0" as * const u8 as * const c_char , signature : b"uuuu\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } , 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 this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 4 , requests : unsafe { & zwp_virtual_keyboard_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "virtual keyboard manager\n\nA virtual keyboard manager allows an application to provide keyboard\ninput events as if they came from a physical keyboard."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "client not authorized to use the interface"] Unauthorized = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: Unauthorized) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] CreateVirtualKeyboard { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_virtual_keyboard" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: NewId ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateVirtualKeyboard { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: CreateVirtualKeyboard { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > (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 :: CreateVirtualKeyboard { seat } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) , Argument :: NewId (0) ,] , } , } } 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 :: CreateVirtualKeyboard { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [1] . o = :: std :: ptr :: null_mut () as * mut _ ; f (0 , & 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 ZwpVirtualKeyboardManagerV1 (Proxy < ZwpVirtualKeyboardManagerV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardManagerV1 (value) } } impl From < ZwpVirtualKeyboardManagerV1 > for Proxy < ZwpVirtualKeyboardManagerV1 > { # [inline] fn from (value : ZwpVirtualKeyboardManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_manager_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_manager_v1_interface } } } impl ZwpVirtualKeyboardManagerV1 { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] pub fn create_virtual_keyboard (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > { let msg = Request :: CreateVirtualKeyboard { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_VIRTUAL_KEYBOARD_SINCE : u32 = 1u32 ; static mut zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , unsafe { & super :: zwp_virtual_keyboard_v1 :: zwp_virtual_keyboard_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"create_virtual_keyboard\0" as * const u8 as * const c_char , signature : b"on\0" as * const u8 as * const c_char , types : unsafe { & zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_manager_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & zwp_virtual_keyboard_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/zwp-virtual-keyboard-0d32ffd994ee6290/out/virtual_keyboard_api.rs:1:11434 [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 ; 4] = [NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "virtual keyboard\n\nThe virtual keyboard provides an application with requests which emulate\nthe behaviour of a physical keyboard.\n\nThis interface can be used by clients on its own to provide raw input\nevents, or it can accompany the input method protocol."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "No keymap was set"] NoKeymap = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: NoKeymap) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] Keymap { format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32 , } , # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] Key { time : u32 , key : u32 , state : u32 , } , # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] Modifiers { mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32 , } , # [doc = "destroy the virtual keyboard keyboard object\n\n\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 : "keymap" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Fd , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "key" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "modifiers" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Keymap { .. } => 0 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 2 , Request :: Destroy => 3 , } } fn since (& self) -> u32 { match * self { Request :: Keymap { .. } => 1 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 1 , 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 :: Keymap { format , fd , size } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Uint (format) , Argument :: Fd (fd) , Argument :: Uint (size) ,] , } , Request :: Key { time , key , state } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (time) , Argument :: Uint (key) , Argument :: Uint (state) ,] , } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: Uint (mods_depressed) , Argument :: Uint (mods_latched) , Argument :: Uint (mods_locked) , Argument :: Uint (group) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 3 , 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 :: Keymap { format , fd , size } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; _args_array [1] . h = fd ; _args_array [2] . u = size ; f (0 , & mut _args_array) } , Request :: Key { time , key , state } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = time ; _args_array [1] . u = key ; _args_array [2] . u = state ; f (1 , & mut _args_array) } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => { let mut _args_array : [wl_argument ; 4] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = mods_depressed ; _args_array [1] . u = mods_latched ; _args_array [2] . u = mods_locked ; _args_array [3] . u = group ; f (2 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & 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 ZwpVirtualKeyboardV1 (Proxy < ZwpVirtualKeyboardV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardV1 (value) } } impl From < ZwpVirtualKeyboardV1 > for Proxy < ZwpVirtualKeyboardV1 > { # [inline] fn from (value : ZwpVirtualKeyboardV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_v1_interface } } } impl ZwpVirtualKeyboardV1 { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] pub fn keymap (& self , format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32) -> () { let msg = Request :: Keymap { format : format , fd : fd , size : size } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] pub fn key (& self , time : u32 , key : u32 , state : u32) -> () { let msg = Request :: Key { time : time , key : key , state : state } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] pub fn modifiers (& self , mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32) -> () { let msg = Request :: Modifiers { mods_depressed : mods_depressed , mods_latched : mods_latched , mods_locked : mods_locked , group : group } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the virtual keyboard keyboard object\n\n\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_KEYMAP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_KEY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_MODIFIERS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_requests : [wl_message ; 4] = [wl_message { name : b"keymap\0" as * const u8 as * const c_char , signature : b"uhu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"key\0" as * const u8 as * const c_char , signature : b"uuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"modifiers\0" as * const u8 as * const c_char , signature : b"uuuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , 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 this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 4 , requests : unsafe { & zwp_virtual_keyboard_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "virtual keyboard manager\n\nA virtual keyboard manager allows an application to provide keyboard\ninput events as if they came from a physical keyboard."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "client not authorized to use the interface"] Unauthorized = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: Unauthorized) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] CreateVirtualKeyboard { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_virtual_keyboard" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: NewId ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateVirtualKeyboard { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: CreateVirtualKeyboard { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > (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 :: CreateVirtualKeyboard { seat } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) , Argument :: NewId (0) ,] , } , } } 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 :: CreateVirtualKeyboard { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [1] . o = :: std :: ptr :: null_mut () as * mut _ ; f (0 , & 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 ZwpVirtualKeyboardManagerV1 (Proxy < ZwpVirtualKeyboardManagerV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardManagerV1 (value) } } impl From < ZwpVirtualKeyboardManagerV1 > for Proxy < ZwpVirtualKeyboardManagerV1 > { # [inline] fn from (value : ZwpVirtualKeyboardManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_manager_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_manager_v1_interface } } } impl ZwpVirtualKeyboardManagerV1 { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] pub fn create_virtual_keyboard (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > { let msg = Request :: CreateVirtualKeyboard { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_VIRTUAL_KEYBOARD_SINCE : u32 = 1u32 ; static mut zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , unsafe { & super :: zwp_virtual_keyboard_v1 :: zwp_virtual_keyboard_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"create_virtual_keyboard\0" as * const u8 as * const c_char , signature : b"on\0" as * const u8 as * const c_char , types : unsafe { & zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_manager_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & zwp_virtual_keyboard_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/zwp-virtual-keyboard-0d32ffd994ee6290/out/virtual_keyboard_api.rs:1:11738 [INFO] [stdout] | [INFO] [stdout] 1 | ...count : 4 , requests : unsafe { & zwp_virtual_keyboard_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_m... [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 ; 4] = [NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "virtual keyboard\n\nThe virtual keyboard provides an application with requests which emulate\nthe behaviour of a physical keyboard.\n\nThis interface can be used by clients on its own to provide raw input\nevents, or it can accompany the input method protocol."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "No keymap was set"] NoKeymap = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: NoKeymap) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] Keymap { format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32 , } , # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] Key { time : u32 , key : u32 , state : u32 , } , # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] Modifiers { mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32 , } , # [doc = "destroy the virtual keyboard keyboard object\n\n\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 : "keymap" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Fd , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "key" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "modifiers" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Keymap { .. } => 0 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 2 , Request :: Destroy => 3 , } } fn since (& self) -> u32 { match * self { Request :: Keymap { .. } => 1 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 1 , 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 :: Keymap { format , fd , size } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Uint (format) , Argument :: Fd (fd) , Argument :: Uint (size) ,] , } , Request :: Key { time , key , state } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (time) , Argument :: Uint (key) , Argument :: Uint (state) ,] , } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: Uint (mods_depressed) , Argument :: Uint (mods_latched) , Argument :: Uint (mods_locked) , Argument :: Uint (group) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 3 , 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 :: Keymap { format , fd , size } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; _args_array [1] . h = fd ; _args_array [2] . u = size ; f (0 , & mut _args_array) } , Request :: Key { time , key , state } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = time ; _args_array [1] . u = key ; _args_array [2] . u = state ; f (1 , & mut _args_array) } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => { let mut _args_array : [wl_argument ; 4] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = mods_depressed ; _args_array [1] . u = mods_latched ; _args_array [2] . u = mods_locked ; _args_array [3] . u = group ; f (2 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & 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 ZwpVirtualKeyboardV1 (Proxy < ZwpVirtualKeyboardV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardV1 (value) } } impl From < ZwpVirtualKeyboardV1 > for Proxy < ZwpVirtualKeyboardV1 > { # [inline] fn from (value : ZwpVirtualKeyboardV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_v1_interface } } } impl ZwpVirtualKeyboardV1 { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] pub fn keymap (& self , format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32) -> () { let msg = Request :: Keymap { format : format , fd : fd , size : size } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] pub fn key (& self , time : u32 , key : u32 , state : u32) -> () { let msg = Request :: Key { time : time , key : key , state : state } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] pub fn modifiers (& self , mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32) -> () { let msg = Request :: Modifiers { mods_depressed : mods_depressed , mods_latched : mods_latched , mods_locked : mods_locked , group : group } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the virtual keyboard keyboard object\n\n\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_KEYMAP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_KEY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_MODIFIERS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_requests : [wl_message ; 4] = [wl_message { name : b"keymap\0" as * const u8 as * const c_char , signature : b"uhu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"key\0" as * const u8 as * const c_char , signature : b"uuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"modifiers\0" as * const u8 as * const c_char , signature : b"uuuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , 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 this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 4 , requests : unsafe { &raw const zwp_virtual_keyboard_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "virtual keyboard manager\n\nA virtual keyboard manager allows an application to provide keyboard\ninput events as if they came from a physical keyboard."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "client not authorized to use the interface"] Unauthorized = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: Unauthorized) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] CreateVirtualKeyboard { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_virtual_keyboard" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: NewId ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateVirtualKeyboard { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: CreateVirtualKeyboard { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > (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 :: CreateVirtualKeyboard { seat } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) , Argument :: NewId (0) ,] , } , } } 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 :: CreateVirtualKeyboard { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [1] . o = :: std :: ptr :: null_mut () as * mut _ ; f (0 , & 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 ZwpVirtualKeyboardManagerV1 (Proxy < ZwpVirtualKeyboardManagerV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardManagerV1 (value) } } impl From < ZwpVirtualKeyboardManagerV1 > for Proxy < ZwpVirtualKeyboardManagerV1 > { # [inline] fn from (value : ZwpVirtualKeyboardManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_manager_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_manager_v1_interface } } } impl ZwpVirtualKeyboardManagerV1 { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] pub fn create_virtual_keyboard (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > { let msg = Request :: CreateVirtualKeyboard { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_VIRTUAL_KEYBOARD_SINCE : u32 = 1u32 ; static mut zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , unsafe { & super :: zwp_virtual_keyboard_v1 :: zwp_virtual_keyboard_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"create_virtual_keyboard\0" as * const u8 as * const c_char , signature : b"on\0" as * const u8 as * const c_char , types : unsafe { & zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_manager_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & zwp_virtual_keyboard_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/zwp-virtual-keyboard-0d32ffd994ee6290/out/virtual_keyboard_api.rs:1:17076 [INFO] [stdout] | [INFO] [stdout] 1 | ...nst wl_interface { unsafe { & zwp_virtual_keyboard_manager_v1_interface } } } impl ZwpVirtualKeyboardManagerV1 { # [doc = "Create a ne... [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 ; 4] = [NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "virtual keyboard\n\nThe virtual keyboard provides an application with requests which emulate\nthe behaviour of a physical keyboard.\n\nThis interface can be used by clients on its own to provide raw input\nevents, or it can accompany the input method protocol."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "No keymap was set"] NoKeymap = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: NoKeymap) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] Keymap { format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32 , } , # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] Key { time : u32 , key : u32 , state : u32 , } , # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] Modifiers { mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32 , } , # [doc = "destroy the virtual keyboard keyboard object\n\n\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 : "keymap" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Fd , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "key" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "modifiers" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Keymap { .. } => 0 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 2 , Request :: Destroy => 3 , } } fn since (& self) -> u32 { match * self { Request :: Keymap { .. } => 1 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 1 , 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 :: Keymap { format , fd , size } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Uint (format) , Argument :: Fd (fd) , Argument :: Uint (size) ,] , } , Request :: Key { time , key , state } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (time) , Argument :: Uint (key) , Argument :: Uint (state) ,] , } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: Uint (mods_depressed) , Argument :: Uint (mods_latched) , Argument :: Uint (mods_locked) , Argument :: Uint (group) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 3 , 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 :: Keymap { format , fd , size } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; _args_array [1] . h = fd ; _args_array [2] . u = size ; f (0 , & mut _args_array) } , Request :: Key { time , key , state } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = time ; _args_array [1] . u = key ; _args_array [2] . u = state ; f (1 , & mut _args_array) } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => { let mut _args_array : [wl_argument ; 4] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = mods_depressed ; _args_array [1] . u = mods_latched ; _args_array [2] . u = mods_locked ; _args_array [3] . u = group ; f (2 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & 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 ZwpVirtualKeyboardV1 (Proxy < ZwpVirtualKeyboardV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardV1 (value) } } impl From < ZwpVirtualKeyboardV1 > for Proxy < ZwpVirtualKeyboardV1 > { # [inline] fn from (value : ZwpVirtualKeyboardV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_v1_interface } } } impl ZwpVirtualKeyboardV1 { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] pub fn keymap (& self , format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32) -> () { let msg = Request :: Keymap { format : format , fd : fd , size : size } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] pub fn key (& self , time : u32 , key : u32 , state : u32) -> () { let msg = Request :: Key { time : time , key : key , state : state } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] pub fn modifiers (& self , mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32) -> () { let msg = Request :: Modifiers { mods_depressed : mods_depressed , mods_latched : mods_latched , mods_locked : mods_locked , group : group } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the virtual keyboard keyboard object\n\n\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_KEYMAP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_KEY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_MODIFIERS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_requests : [wl_message ; 4] = [wl_message { name : b"keymap\0" as * const u8 as * const c_char , signature : b"uhu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"key\0" as * const u8 as * const c_char , signature : b"uuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"modifiers\0" as * const u8 as * const c_char , signature : b"uuuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , 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 this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 4 , requests : unsafe { & zwp_virtual_keyboard_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "virtual keyboard manager\n\nA virtual keyboard manager allows an application to provide keyboard\ninput events as if they came from a physical keyboard."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "client not authorized to use the interface"] Unauthorized = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: Unauthorized) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] CreateVirtualKeyboard { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_virtual_keyboard" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: NewId ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateVirtualKeyboard { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: CreateVirtualKeyboard { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > (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 :: CreateVirtualKeyboard { seat } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) , Argument :: NewId (0) ,] , } , } } 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 :: CreateVirtualKeyboard { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [1] . o = :: std :: ptr :: null_mut () as * mut _ ; f (0 , & 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 ZwpVirtualKeyboardManagerV1 (Proxy < ZwpVirtualKeyboardManagerV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardManagerV1 (value) } } impl From < ZwpVirtualKeyboardManagerV1 > for Proxy < ZwpVirtualKeyboardManagerV1 > { # [inline] fn from (value : ZwpVirtualKeyboardManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_manager_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { &raw const zwp_virtual_keyboard_manager_v1_interface } } } impl ZwpVirtualKeyboardManagerV1 { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] pub fn create_virtual_keyboard (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > { let msg = Request :: CreateVirtualKeyboard { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_VIRTUAL_KEYBOARD_SINCE : u32 = 1u32 ; static mut zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , unsafe { & super :: zwp_virtual_keyboard_v1 :: zwp_virtual_keyboard_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"create_virtual_keyboard\0" as * const u8 as * const c_char , signature : b"on\0" as * const u8 as * const c_char , types : unsafe { & zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_manager_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & zwp_virtual_keyboard_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/zwp-virtual-keyboard-0d32ffd994ee6290/out/virtual_keyboard_api.rs:1:17921 [INFO] [stdout] | [INFO] [stdout] 1 | ...wl_interface ; 2] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , unsafe { & super :: zwp_virtual_keyb... [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 ; 4] = [NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "virtual keyboard\n\nThe virtual keyboard provides an application with requests which emulate\nthe behaviour of a physical keyboard.\n\nThis interface can be used by clients on its own to provide raw input\nevents, or it can accompany the input method protocol."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "No keymap was set"] NoKeymap = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: NoKeymap) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] Keymap { format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32 , } , # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] Key { time : u32 , key : u32 , state : u32 , } , # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] Modifiers { mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32 , } , # [doc = "destroy the virtual keyboard keyboard object\n\n\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 : "keymap" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Fd , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "key" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "modifiers" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Keymap { .. } => 0 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 2 , Request :: Destroy => 3 , } } fn since (& self) -> u32 { match * self { Request :: Keymap { .. } => 1 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 1 , 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 :: Keymap { format , fd , size } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Uint (format) , Argument :: Fd (fd) , Argument :: Uint (size) ,] , } , Request :: Key { time , key , state } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (time) , Argument :: Uint (key) , Argument :: Uint (state) ,] , } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: Uint (mods_depressed) , Argument :: Uint (mods_latched) , Argument :: Uint (mods_locked) , Argument :: Uint (group) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 3 , 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 :: Keymap { format , fd , size } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; _args_array [1] . h = fd ; _args_array [2] . u = size ; f (0 , & mut _args_array) } , Request :: Key { time , key , state } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = time ; _args_array [1] . u = key ; _args_array [2] . u = state ; f (1 , & mut _args_array) } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => { let mut _args_array : [wl_argument ; 4] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = mods_depressed ; _args_array [1] . u = mods_latched ; _args_array [2] . u = mods_locked ; _args_array [3] . u = group ; f (2 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & 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 ZwpVirtualKeyboardV1 (Proxy < ZwpVirtualKeyboardV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardV1 (value) } } impl From < ZwpVirtualKeyboardV1 > for Proxy < ZwpVirtualKeyboardV1 > { # [inline] fn from (value : ZwpVirtualKeyboardV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_v1_interface } } } impl ZwpVirtualKeyboardV1 { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] pub fn keymap (& self , format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32) -> () { let msg = Request :: Keymap { format : format , fd : fd , size : size } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] pub fn key (& self , time : u32 , key : u32 , state : u32) -> () { let msg = Request :: Key { time : time , key : key , state : state } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] pub fn modifiers (& self , mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32) -> () { let msg = Request :: Modifiers { mods_depressed : mods_depressed , mods_latched : mods_latched , mods_locked : mods_locked , group : group } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the virtual keyboard keyboard object\n\n\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_KEYMAP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_KEY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_MODIFIERS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_requests : [wl_message ; 4] = [wl_message { name : b"keymap\0" as * const u8 as * const c_char , signature : b"uhu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"key\0" as * const u8 as * const c_char , signature : b"uuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"modifiers\0" as * const u8 as * const c_char , signature : b"uuuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , 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 this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 4 , requests : unsafe { & zwp_virtual_keyboard_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "virtual keyboard manager\n\nA virtual keyboard manager allows an application to provide keyboard\ninput events as if they came from a physical keyboard."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "client not authorized to use the interface"] Unauthorized = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: Unauthorized) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] CreateVirtualKeyboard { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_virtual_keyboard" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: NewId ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateVirtualKeyboard { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: CreateVirtualKeyboard { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > (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 :: CreateVirtualKeyboard { seat } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) , Argument :: NewId (0) ,] , } , } } 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 :: CreateVirtualKeyboard { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [1] . o = :: std :: ptr :: null_mut () as * mut _ ; f (0 , & 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 ZwpVirtualKeyboardManagerV1 (Proxy < ZwpVirtualKeyboardManagerV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardManagerV1 (value) } } impl From < ZwpVirtualKeyboardManagerV1 > for Proxy < ZwpVirtualKeyboardManagerV1 > { # [inline] fn from (value : ZwpVirtualKeyboardManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_manager_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_manager_v1_interface } } } impl ZwpVirtualKeyboardManagerV1 { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] pub fn create_virtual_keyboard (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > { let msg = Request :: CreateVirtualKeyboard { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_VIRTUAL_KEYBOARD_SINCE : u32 = 1u32 ; static mut zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types : [* const wl_interface ; 2] = [unsafe { &raw const super :: wl_seat :: wl_seat_interface as * const wl_interface } , unsafe { & super :: zwp_virtual_keyboard_v1 :: zwp_virtual_keyboard_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"create_virtual_keyboard\0" as * const u8 as * const c_char , signature : b"on\0" as * const u8 as * const c_char , types : unsafe { & zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_manager_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & zwp_virtual_keyboard_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/zwp-virtual-keyboard-0d32ffd994ee6290/out/virtual_keyboard_api.rs:1:17998 [INFO] [stdout] | [INFO] [stdout] 1 | ... } , unsafe { & super :: zwp_virtual_keyboard_v1 :: zwp_virtual_keyboard_v1_interface as * const wl_interface } ,] ; # [doc = r" C-rep... [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 ; 4] = [NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "virtual keyboard\n\nThe virtual keyboard provides an application with requests which emulate\nthe behaviour of a physical keyboard.\n\nThis interface can be used by clients on its own to provide raw input\nevents, or it can accompany the input method protocol."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "No keymap was set"] NoKeymap = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: NoKeymap) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] Keymap { format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32 , } , # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] Key { time : u32 , key : u32 , state : u32 , } , # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] Modifiers { mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32 , } , # [doc = "destroy the virtual keyboard keyboard object\n\n\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 : "keymap" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Fd , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "key" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "modifiers" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Keymap { .. } => 0 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 2 , Request :: Destroy => 3 , } } fn since (& self) -> u32 { match * self { Request :: Keymap { .. } => 1 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 1 , 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 :: Keymap { format , fd , size } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Uint (format) , Argument :: Fd (fd) , Argument :: Uint (size) ,] , } , Request :: Key { time , key , state } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (time) , Argument :: Uint (key) , Argument :: Uint (state) ,] , } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: Uint (mods_depressed) , Argument :: Uint (mods_latched) , Argument :: Uint (mods_locked) , Argument :: Uint (group) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 3 , 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 :: Keymap { format , fd , size } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; _args_array [1] . h = fd ; _args_array [2] . u = size ; f (0 , & mut _args_array) } , Request :: Key { time , key , state } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = time ; _args_array [1] . u = key ; _args_array [2] . u = state ; f (1 , & mut _args_array) } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => { let mut _args_array : [wl_argument ; 4] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = mods_depressed ; _args_array [1] . u = mods_latched ; _args_array [2] . u = mods_locked ; _args_array [3] . u = group ; f (2 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & 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 ZwpVirtualKeyboardV1 (Proxy < ZwpVirtualKeyboardV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardV1 (value) } } impl From < ZwpVirtualKeyboardV1 > for Proxy < ZwpVirtualKeyboardV1 > { # [inline] fn from (value : ZwpVirtualKeyboardV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_v1_interface } } } impl ZwpVirtualKeyboardV1 { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] pub fn keymap (& self , format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32) -> () { let msg = Request :: Keymap { format : format , fd : fd , size : size } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] pub fn key (& self , time : u32 , key : u32 , state : u32) -> () { let msg = Request :: Key { time : time , key : key , state : state } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] pub fn modifiers (& self , mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32) -> () { let msg = Request :: Modifiers { mods_depressed : mods_depressed , mods_latched : mods_latched , mods_locked : mods_locked , group : group } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the virtual keyboard keyboard object\n\n\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_KEYMAP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_KEY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_MODIFIERS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_requests : [wl_message ; 4] = [wl_message { name : b"keymap\0" as * const u8 as * const c_char , signature : b"uhu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"key\0" as * const u8 as * const c_char , signature : b"uuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"modifiers\0" as * const u8 as * const c_char , signature : b"uuuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , 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 this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 4 , requests : unsafe { & zwp_virtual_keyboard_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "virtual keyboard manager\n\nA virtual keyboard manager allows an application to provide keyboard\ninput events as if they came from a physical keyboard."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "client not authorized to use the interface"] Unauthorized = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: Unauthorized) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] CreateVirtualKeyboard { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_virtual_keyboard" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: NewId ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateVirtualKeyboard { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: CreateVirtualKeyboard { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > (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 :: CreateVirtualKeyboard { seat } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) , Argument :: NewId (0) ,] , } , } } 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 :: CreateVirtualKeyboard { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [1] . o = :: std :: ptr :: null_mut () as * mut _ ; f (0 , & 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 ZwpVirtualKeyboardManagerV1 (Proxy < ZwpVirtualKeyboardManagerV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardManagerV1 (value) } } impl From < ZwpVirtualKeyboardManagerV1 > for Proxy < ZwpVirtualKeyboardManagerV1 > { # [inline] fn from (value : ZwpVirtualKeyboardManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_manager_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_manager_v1_interface } } } impl ZwpVirtualKeyboardManagerV1 { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] pub fn create_virtual_keyboard (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > { let msg = Request :: CreateVirtualKeyboard { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_VIRTUAL_KEYBOARD_SINCE : u32 = 1u32 ; static mut zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , unsafe { &raw const super :: zwp_virtual_keyboard_v1 :: zwp_virtual_keyboard_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"create_virtual_keyboard\0" as * const u8 as * const c_char , signature : b"on\0" as * const u8 as * const c_char , types : unsafe { & zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_manager_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & zwp_virtual_keyboard_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/zwp-virtual-keyboard-0d32ffd994ee6290/out/virtual_keyboard_api.rs:1:18411 [INFO] [stdout] | [INFO] [stdout] 1 | ...s : unsafe { & zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types as * const _ } , } ,] ; # [doc = r" C representa... [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 ; 4] = [NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "virtual keyboard\n\nThe virtual keyboard provides an application with requests which emulate\nthe behaviour of a physical keyboard.\n\nThis interface can be used by clients on its own to provide raw input\nevents, or it can accompany the input method protocol."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "No keymap was set"] NoKeymap = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: NoKeymap) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] Keymap { format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32 , } , # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] Key { time : u32 , key : u32 , state : u32 , } , # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] Modifiers { mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32 , } , # [doc = "destroy the virtual keyboard keyboard object\n\n\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 : "keymap" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Fd , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "key" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "modifiers" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Keymap { .. } => 0 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 2 , Request :: Destroy => 3 , } } fn since (& self) -> u32 { match * self { Request :: Keymap { .. } => 1 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 1 , 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 :: Keymap { format , fd , size } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Uint (format) , Argument :: Fd (fd) , Argument :: Uint (size) ,] , } , Request :: Key { time , key , state } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (time) , Argument :: Uint (key) , Argument :: Uint (state) ,] , } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: Uint (mods_depressed) , Argument :: Uint (mods_latched) , Argument :: Uint (mods_locked) , Argument :: Uint (group) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 3 , 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 :: Keymap { format , fd , size } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; _args_array [1] . h = fd ; _args_array [2] . u = size ; f (0 , & mut _args_array) } , Request :: Key { time , key , state } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = time ; _args_array [1] . u = key ; _args_array [2] . u = state ; f (1 , & mut _args_array) } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => { let mut _args_array : [wl_argument ; 4] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = mods_depressed ; _args_array [1] . u = mods_latched ; _args_array [2] . u = mods_locked ; _args_array [3] . u = group ; f (2 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & 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 ZwpVirtualKeyboardV1 (Proxy < ZwpVirtualKeyboardV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardV1 (value) } } impl From < ZwpVirtualKeyboardV1 > for Proxy < ZwpVirtualKeyboardV1 > { # [inline] fn from (value : ZwpVirtualKeyboardV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_v1_interface } } } impl ZwpVirtualKeyboardV1 { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] pub fn keymap (& self , format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32) -> () { let msg = Request :: Keymap { format : format , fd : fd , size : size } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] pub fn key (& self , time : u32 , key : u32 , state : u32) -> () { let msg = Request :: Key { time : time , key : key , state : state } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] pub fn modifiers (& self , mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32) -> () { let msg = Request :: Modifiers { mods_depressed : mods_depressed , mods_latched : mods_latched , mods_locked : mods_locked , group : group } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the virtual keyboard keyboard object\n\n\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_KEYMAP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_KEY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_MODIFIERS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_requests : [wl_message ; 4] = [wl_message { name : b"keymap\0" as * const u8 as * const c_char , signature : b"uhu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"key\0" as * const u8 as * const c_char , signature : b"uuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"modifiers\0" as * const u8 as * const c_char , signature : b"uuuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , 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 this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 4 , requests : unsafe { & zwp_virtual_keyboard_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "virtual keyboard manager\n\nA virtual keyboard manager allows an application to provide keyboard\ninput events as if they came from a physical keyboard."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "client not authorized to use the interface"] Unauthorized = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: Unauthorized) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] CreateVirtualKeyboard { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_virtual_keyboard" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: NewId ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateVirtualKeyboard { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: CreateVirtualKeyboard { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > (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 :: CreateVirtualKeyboard { seat } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) , Argument :: NewId (0) ,] , } , } } 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 :: CreateVirtualKeyboard { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [1] . o = :: std :: ptr :: null_mut () as * mut _ ; f (0 , & 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 ZwpVirtualKeyboardManagerV1 (Proxy < ZwpVirtualKeyboardManagerV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardManagerV1 (value) } } impl From < ZwpVirtualKeyboardManagerV1 > for Proxy < ZwpVirtualKeyboardManagerV1 > { # [inline] fn from (value : ZwpVirtualKeyboardManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_manager_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_manager_v1_interface } } } impl ZwpVirtualKeyboardManagerV1 { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] pub fn create_virtual_keyboard (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > { let msg = Request :: CreateVirtualKeyboard { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_VIRTUAL_KEYBOARD_SINCE : u32 = 1u32 ; static mut zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , unsafe { & super :: zwp_virtual_keyboard_v1 :: zwp_virtual_keyboard_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"create_virtual_keyboard\0" as * const u8 as * const c_char , signature : b"on\0" as * const u8 as * const c_char , types : unsafe { &raw const zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_manager_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & zwp_virtual_keyboard_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> /opt/rustwide/target/debug/build/zwp-virtual-keyboard-0d32ffd994ee6290/out/virtual_keyboard_api.rs:1:18791 [INFO] [stdout] | [INFO] [stdout] 1 | ...t : 1 , requests : unsafe { & zwp_virtual_keyboard_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR 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 ; 4] = [NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "virtual keyboard\n\nThe virtual keyboard provides an application with requests which emulate\nthe behaviour of a physical keyboard.\n\nThis interface can be used by clients on its own to provide raw input\nevents, or it can accompany the input method protocol."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "No keymap was set"] NoKeymap = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: NoKeymap) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] Keymap { format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32 , } , # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] Key { time : u32 , key : u32 , state : u32 , } , # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] Modifiers { mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32 , } , # [doc = "destroy the virtual keyboard keyboard object\n\n\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 : "keymap" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Fd , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "key" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "modifiers" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Keymap { .. } => 0 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 2 , Request :: Destroy => 3 , } } fn since (& self) -> u32 { match * self { Request :: Keymap { .. } => 1 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 1 , 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 :: Keymap { format , fd , size } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Uint (format) , Argument :: Fd (fd) , Argument :: Uint (size) ,] , } , Request :: Key { time , key , state } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (time) , Argument :: Uint (key) , Argument :: Uint (state) ,] , } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: Uint (mods_depressed) , Argument :: Uint (mods_latched) , Argument :: Uint (mods_locked) , Argument :: Uint (group) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 3 , 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 :: Keymap { format , fd , size } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; _args_array [1] . h = fd ; _args_array [2] . u = size ; f (0 , & mut _args_array) } , Request :: Key { time , key , state } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = time ; _args_array [1] . u = key ; _args_array [2] . u = state ; f (1 , & mut _args_array) } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => { let mut _args_array : [wl_argument ; 4] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = mods_depressed ; _args_array [1] . u = mods_latched ; _args_array [2] . u = mods_locked ; _args_array [3] . u = group ; f (2 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & 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 ZwpVirtualKeyboardV1 (Proxy < ZwpVirtualKeyboardV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardV1 (value) } } impl From < ZwpVirtualKeyboardV1 > for Proxy < ZwpVirtualKeyboardV1 > { # [inline] fn from (value : ZwpVirtualKeyboardV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_v1_interface } } } impl ZwpVirtualKeyboardV1 { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] pub fn keymap (& self , format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32) -> () { let msg = Request :: Keymap { format : format , fd : fd , size : size } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] pub fn key (& self , time : u32 , key : u32 , state : u32) -> () { let msg = Request :: Key { time : time , key : key , state : state } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] pub fn modifiers (& self , mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32) -> () { let msg = Request :: Modifiers { mods_depressed : mods_depressed , mods_latched : mods_latched , mods_locked : mods_locked , group : group } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the virtual keyboard keyboard object\n\n\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_KEYMAP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_KEY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_MODIFIERS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_requests : [wl_message ; 4] = [wl_message { name : b"keymap\0" as * const u8 as * const c_char , signature : b"uhu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"key\0" as * const u8 as * const c_char , signature : b"uuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"modifiers\0" as * const u8 as * const c_char , signature : b"uuuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , 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 this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 4 , requests : unsafe { & zwp_virtual_keyboard_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "virtual keyboard manager\n\nA virtual keyboard manager allows an application to provide keyboard\ninput events as if they came from a physical keyboard."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "client not authorized to use the interface"] Unauthorized = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: Unauthorized) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] CreateVirtualKeyboard { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_virtual_keyboard" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: NewId ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateVirtualKeyboard { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: CreateVirtualKeyboard { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > (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 :: CreateVirtualKeyboard { seat } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) , Argument :: NewId (0) ,] , } , } } 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 :: CreateVirtualKeyboard { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [1] . o = :: std :: ptr :: null_mut () as * mut _ ; f (0 , & 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 ZwpVirtualKeyboardManagerV1 (Proxy < ZwpVirtualKeyboardManagerV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardManagerV1 (value) } } impl From < ZwpVirtualKeyboardManagerV1 > for Proxy < ZwpVirtualKeyboardManagerV1 > { # [inline] fn from (value : ZwpVirtualKeyboardManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_manager_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_manager_v1_interface } } } impl ZwpVirtualKeyboardManagerV1 { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] pub fn create_virtual_keyboard (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > { let msg = Request :: CreateVirtualKeyboard { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_VIRTUAL_KEYBOARD_SINCE : u32 = 1u32 ; static mut zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , unsafe { & super :: zwp_virtual_keyboard_v1 :: zwp_virtual_keyboard_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"create_virtual_keyboard\0" as * const u8 as * const c_char , signature : b"on\0" as * const u8 as * const c_char , types : unsafe { & zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_manager_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { &raw const zwp_virtual_keyboard_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `test` profile [unoptimized + debuginfo] target(s) in 1.35s [INFO] running `Command { std: "docker" "inspect" "18dce711f4afcb30fbbd8089a2d08f99af793d2d5689991c594a0595ea1bd48f", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "18dce711f4afcb30fbbd8089a2d08f99af793d2d5689991c594a0595ea1bd48f", kill_on_drop: false }` [INFO] [stdout] 18dce711f4afcb30fbbd8089a2d08f99af793d2d5689991c594a0595ea1bd48f [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc1/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=warn" "-e" "RUSTDOCFLAGS=--cap-lints=warn" "-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:e90291280db7d1fac5b66fc6dad9f9662629e7365a55743daf9bdf73ebc4ea79" "/opt/rustwide/cargo-home/bin/cargo" "+1.90.0" "test" "--frozen", kill_on_drop: false }` [INFO] [stdout] 7e24dae16f71a3c230423912fab7c3d4014ac16b0d6557c46bedc86dd7198a7d [INFO] running `Command { std: "docker" "start" "-a" "7e24dae16f71a3c230423912fab7c3d4014ac16b0d6557c46bedc86dd7198a7d", kill_on_drop: false }` [INFO] [stderr] warning: creating a shared reference to mutable static [INFO] [stderr] --> /opt/rustwide/target/debug/build/zwp-virtual-keyboard-0d32ffd994ee6290/out/virtual_keyboard_api.rs:1:8281 [INFO] [stderr] | [INFO] [stderr] 1 | ...* const wl_interface { unsafe { & zwp_virtual_keyboard_v1_interface } } } impl ZwpVirtualKeyboardV1 { # [doc = "keyboard mapping\n\nPr... [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)]` 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 ; 4] = [NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "virtual keyboard\n\nThe virtual keyboard provides an application with requests which emulate\nthe behaviour of a physical keyboard.\n\nThis interface can be used by clients on its own to provide raw input\nevents, or it can accompany the input method protocol."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "No keymap was set"] NoKeymap = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: NoKeymap) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] Keymap { format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32 , } , # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] Key { time : u32 , key : u32 , state : u32 , } , # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] Modifiers { mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32 , } , # [doc = "destroy the virtual keyboard keyboard object\n\n\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 : "keymap" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Fd , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "key" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "modifiers" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Keymap { .. } => 0 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 2 , Request :: Destroy => 3 , } } fn since (& self) -> u32 { match * self { Request :: Keymap { .. } => 1 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 1 , 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 :: Keymap { format , fd , size } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Uint (format) , Argument :: Fd (fd) , Argument :: Uint (size) ,] , } , Request :: Key { time , key , state } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (time) , Argument :: Uint (key) , Argument :: Uint (state) ,] , } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: Uint (mods_depressed) , Argument :: Uint (mods_latched) , Argument :: Uint (mods_locked) , Argument :: Uint (group) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 3 , 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 :: Keymap { format , fd , size } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; _args_array [1] . h = fd ; _args_array [2] . u = size ; f (0 , & mut _args_array) } , Request :: Key { time , key , state } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = time ; _args_array [1] . u = key ; _args_array [2] . u = state ; f (1 , & mut _args_array) } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => { let mut _args_array : [wl_argument ; 4] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = mods_depressed ; _args_array [1] . u = mods_latched ; _args_array [2] . u = mods_locked ; _args_array [3] . u = group ; f (2 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & 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 ZwpVirtualKeyboardV1 (Proxy < ZwpVirtualKeyboardV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardV1 (value) } } impl From < ZwpVirtualKeyboardV1 > for Proxy < ZwpVirtualKeyboardV1 > { # [inline] fn from (value : ZwpVirtualKeyboardV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { &raw const zwp_virtual_keyboard_v1_interface } } } impl ZwpVirtualKeyboardV1 { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] pub fn keymap (& self , format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32) -> () { let msg = Request :: Keymap { format : format , fd : fd , size : size } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] pub fn key (& self , time : u32 , key : u32 , state : u32) -> () { let msg = Request :: Key { time : time , key : key , state : state } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] pub fn modifiers (& self , mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32) -> () { let msg = Request :: Modifiers { mods_depressed : mods_depressed , mods_latched : mods_latched , mods_locked : mods_locked , group : group } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the virtual keyboard keyboard object\n\n\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_KEYMAP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_KEY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_MODIFIERS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_requests : [wl_message ; 4] = [wl_message { name : b"keymap\0" as * const u8 as * const c_char , signature : b"uhu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"key\0" as * const u8 as * const c_char , signature : b"uuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"modifiers\0" as * const u8 as * const c_char , signature : b"uuuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , 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 this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 4 , requests : unsafe { & zwp_virtual_keyboard_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "virtual keyboard manager\n\nA virtual keyboard manager allows an application to provide keyboard\ninput events as if they came from a physical keyboard."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "client not authorized to use the interface"] Unauthorized = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: Unauthorized) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] CreateVirtualKeyboard { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_virtual_keyboard" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: NewId ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateVirtualKeyboard { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: CreateVirtualKeyboard { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > (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 :: CreateVirtualKeyboard { seat } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) , Argument :: NewId (0) ,] , } , } } 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 :: CreateVirtualKeyboard { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [1] . o = :: std :: ptr :: null_mut () as * mut _ ; f (0 , & 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 ZwpVirtualKeyboardManagerV1 (Proxy < ZwpVirtualKeyboardManagerV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardManagerV1 (value) } } impl From < ZwpVirtualKeyboardManagerV1 > for Proxy < ZwpVirtualKeyboardManagerV1 > { # [inline] fn from (value : ZwpVirtualKeyboardManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_manager_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_manager_v1_interface } } } impl ZwpVirtualKeyboardManagerV1 { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] pub fn create_virtual_keyboard (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > { let msg = Request :: CreateVirtualKeyboard { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_VIRTUAL_KEYBOARD_SINCE : u32 = 1u32 ; static mut zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , unsafe { & super :: zwp_virtual_keyboard_v1 :: zwp_virtual_keyboard_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"create_virtual_keyboard\0" as * const u8 as * const c_char , signature : b"on\0" as * const u8 as * const c_char , types : unsafe { & zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_manager_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & zwp_virtual_keyboard_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [INFO] [stderr] | +++++++++ [INFO] [stderr] [INFO] [stderr] warning: creating a shared reference to mutable static [INFO] [stderr] --> /opt/rustwide/target/debug/build/zwp-virtual-keyboard-0d32ffd994ee6290/out/virtual_keyboard_api.rs:1:10919 [INFO] [stderr] | [INFO] [stderr] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"key\0" as * const u8 as * const c_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 ; 4] = [NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "virtual keyboard\n\nThe virtual keyboard provides an application with requests which emulate\nthe behaviour of a physical keyboard.\n\nThis interface can be used by clients on its own to provide raw input\nevents, or it can accompany the input method protocol."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "No keymap was set"] NoKeymap = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: NoKeymap) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] Keymap { format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32 , } , # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] Key { time : u32 , key : u32 , state : u32 , } , # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] Modifiers { mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32 , } , # [doc = "destroy the virtual keyboard keyboard object\n\n\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 : "keymap" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Fd , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "key" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "modifiers" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Keymap { .. } => 0 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 2 , Request :: Destroy => 3 , } } fn since (& self) -> u32 { match * self { Request :: Keymap { .. } => 1 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 1 , 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 :: Keymap { format , fd , size } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Uint (format) , Argument :: Fd (fd) , Argument :: Uint (size) ,] , } , Request :: Key { time , key , state } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (time) , Argument :: Uint (key) , Argument :: Uint (state) ,] , } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: Uint (mods_depressed) , Argument :: Uint (mods_latched) , Argument :: Uint (mods_locked) , Argument :: Uint (group) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 3 , 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 :: Keymap { format , fd , size } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; _args_array [1] . h = fd ; _args_array [2] . u = size ; f (0 , & mut _args_array) } , Request :: Key { time , key , state } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = time ; _args_array [1] . u = key ; _args_array [2] . u = state ; f (1 , & mut _args_array) } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => { let mut _args_array : [wl_argument ; 4] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = mods_depressed ; _args_array [1] . u = mods_latched ; _args_array [2] . u = mods_locked ; _args_array [3] . u = group ; f (2 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & 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 ZwpVirtualKeyboardV1 (Proxy < ZwpVirtualKeyboardV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardV1 (value) } } impl From < ZwpVirtualKeyboardV1 > for Proxy < ZwpVirtualKeyboardV1 > { # [inline] fn from (value : ZwpVirtualKeyboardV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_v1_interface } } } impl ZwpVirtualKeyboardV1 { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] pub fn keymap (& self , format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32) -> () { let msg = Request :: Keymap { format : format , fd : fd , size : size } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] pub fn key (& self , time : u32 , key : u32 , state : u32) -> () { let msg = Request :: Key { time : time , key : key , state : state } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] pub fn modifiers (& self , mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32) -> () { let msg = Request :: Modifiers { mods_depressed : mods_depressed , mods_latched : mods_latched , mods_locked : mods_locked , group : group } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the virtual keyboard keyboard object\n\n\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_KEYMAP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_KEY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_MODIFIERS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_requests : [wl_message ; 4] = [wl_message { name : b"keymap\0" as * const u8 as * const c_char , signature : b"uhu\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } , wl_message { name : b"key\0" as * const u8 as * const c_char , signature : b"uuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"modifiers\0" as * const u8 as * const c_char , signature : b"uuuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , 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 this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 4 , requests : unsafe { & zwp_virtual_keyboard_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "virtual keyboard manager\n\nA virtual keyboard manager allows an application to provide keyboard\ninput events as if they came from a physical keyboard."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "client not authorized to use the interface"] Unauthorized = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: Unauthorized) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] CreateVirtualKeyboard { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_virtual_keyboard" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: NewId ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateVirtualKeyboard { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: CreateVirtualKeyboard { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > (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 :: CreateVirtualKeyboard { seat } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) , Argument :: NewId (0) ,] , } , } } 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 :: CreateVirtualKeyboard { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [1] . o = :: std :: ptr :: null_mut () as * mut _ ; f (0 , & 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 ZwpVirtualKeyboardManagerV1 (Proxy < ZwpVirtualKeyboardManagerV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardManagerV1 (value) } } impl From < ZwpVirtualKeyboardManagerV1 > for Proxy < ZwpVirtualKeyboardManagerV1 > { # [inline] fn from (value : ZwpVirtualKeyboardManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_manager_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_manager_v1_interface } } } impl ZwpVirtualKeyboardManagerV1 { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] pub fn create_virtual_keyboard (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > { let msg = Request :: CreateVirtualKeyboard { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_VIRTUAL_KEYBOARD_SINCE : u32 = 1u32 ; static mut zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , unsafe { & super :: zwp_virtual_keyboard_v1 :: zwp_virtual_keyboard_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"create_virtual_keyboard\0" as * const u8 as * const c_char , signature : b"on\0" as * const u8 as * const c_char , types : unsafe { & zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_manager_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & zwp_virtual_keyboard_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [INFO] [stderr] | +++++++++ [INFO] [stderr] [INFO] [stderr] warning: creating a shared reference to mutable static [INFO] [stderr] --> /opt/rustwide/target/debug/build/zwp-virtual-keyboard-0d32ffd994ee6290/out/virtual_keyboard_api.rs:1:11088 [INFO] [stderr] | [INFO] [stderr] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"modifiers\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 ; 4] = [NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "virtual keyboard\n\nThe virtual keyboard provides an application with requests which emulate\nthe behaviour of a physical keyboard.\n\nThis interface can be used by clients on its own to provide raw input\nevents, or it can accompany the input method protocol."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "No keymap was set"] NoKeymap = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: NoKeymap) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] Keymap { format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32 , } , # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] Key { time : u32 , key : u32 , state : u32 , } , # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] Modifiers { mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32 , } , # [doc = "destroy the virtual keyboard keyboard object\n\n\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 : "keymap" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Fd , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "key" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "modifiers" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Keymap { .. } => 0 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 2 , Request :: Destroy => 3 , } } fn since (& self) -> u32 { match * self { Request :: Keymap { .. } => 1 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 1 , 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 :: Keymap { format , fd , size } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Uint (format) , Argument :: Fd (fd) , Argument :: Uint (size) ,] , } , Request :: Key { time , key , state } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (time) , Argument :: Uint (key) , Argument :: Uint (state) ,] , } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: Uint (mods_depressed) , Argument :: Uint (mods_latched) , Argument :: Uint (mods_locked) , Argument :: Uint (group) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 3 , 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 :: Keymap { format , fd , size } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; _args_array [1] . h = fd ; _args_array [2] . u = size ; f (0 , & mut _args_array) } , Request :: Key { time , key , state } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = time ; _args_array [1] . u = key ; _args_array [2] . u = state ; f (1 , & mut _args_array) } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => { let mut _args_array : [wl_argument ; 4] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = mods_depressed ; _args_array [1] . u = mods_latched ; _args_array [2] . u = mods_locked ; _args_array [3] . u = group ; f (2 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & 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 ZwpVirtualKeyboardV1 (Proxy < ZwpVirtualKeyboardV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardV1 (value) } } impl From < ZwpVirtualKeyboardV1 > for Proxy < ZwpVirtualKeyboardV1 > { # [inline] fn from (value : ZwpVirtualKeyboardV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_v1_interface } } } impl ZwpVirtualKeyboardV1 { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] pub fn keymap (& self , format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32) -> () { let msg = Request :: Keymap { format : format , fd : fd , size : size } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] pub fn key (& self , time : u32 , key : u32 , state : u32) -> () { let msg = Request :: Key { time : time , key : key , state : state } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] pub fn modifiers (& self , mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32) -> () { let msg = Request :: Modifiers { mods_depressed : mods_depressed , mods_latched : mods_latched , mods_locked : mods_locked , group : group } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the virtual keyboard keyboard object\n\n\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_KEYMAP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_KEY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_MODIFIERS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_requests : [wl_message ; 4] = [wl_message { name : b"keymap\0" as * const u8 as * const c_char , signature : b"uhu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"key\0" as * const u8 as * const c_char , signature : b"uuu\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } , wl_message { name : b"modifiers\0" as * const u8 as * const c_char , signature : b"uuuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , 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 this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 4 , requests : unsafe { & zwp_virtual_keyboard_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "virtual keyboard manager\n\nA virtual keyboard manager allows an application to provide keyboard\ninput events as if they came from a physical keyboard."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "client not authorized to use the interface"] Unauthorized = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: Unauthorized) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] CreateVirtualKeyboard { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_virtual_keyboard" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: NewId ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateVirtualKeyboard { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: CreateVirtualKeyboard { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > (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 :: CreateVirtualKeyboard { seat } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) , Argument :: NewId (0) ,] , } , } } 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 :: CreateVirtualKeyboard { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [1] . o = :: std :: ptr :: null_mut () as * mut _ ; f (0 , & 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 ZwpVirtualKeyboardManagerV1 (Proxy < ZwpVirtualKeyboardManagerV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardManagerV1 (value) } } impl From < ZwpVirtualKeyboardManagerV1 > for Proxy < ZwpVirtualKeyboardManagerV1 > { # [inline] fn from (value : ZwpVirtualKeyboardManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_manager_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_manager_v1_interface } } } impl ZwpVirtualKeyboardManagerV1 { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] pub fn create_virtual_keyboard (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > { let msg = Request :: CreateVirtualKeyboard { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_VIRTUAL_KEYBOARD_SINCE : u32 = 1u32 ; static mut zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , unsafe { & super :: zwp_virtual_keyboard_v1 :: zwp_virtual_keyboard_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"create_virtual_keyboard\0" as * const u8 as * const c_char , signature : b"on\0" as * const u8 as * const c_char , types : unsafe { & zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_manager_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & zwp_virtual_keyboard_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [INFO] [stderr] | +++++++++ [INFO] [stderr] [INFO] [stderr] warning: creating a shared reference to mutable static [INFO] [stderr] --> /opt/rustwide/target/debug/build/zwp-virtual-keyboard-0d32ffd994ee6290/out/virtual_keyboard_api.rs:1:11264 [INFO] [stderr] | [INFO] [stderr] 1 | ...st u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"destroy\0" as * const u8 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 ; 4] = [NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "virtual keyboard\n\nThe virtual keyboard provides an application with requests which emulate\nthe behaviour of a physical keyboard.\n\nThis interface can be used by clients on its own to provide raw input\nevents, or it can accompany the input method protocol."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "No keymap was set"] NoKeymap = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: NoKeymap) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] Keymap { format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32 , } , # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] Key { time : u32 , key : u32 , state : u32 , } , # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] Modifiers { mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32 , } , # [doc = "destroy the virtual keyboard keyboard object\n\n\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 : "keymap" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Fd , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "key" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "modifiers" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Keymap { .. } => 0 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 2 , Request :: Destroy => 3 , } } fn since (& self) -> u32 { match * self { Request :: Keymap { .. } => 1 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 1 , 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 :: Keymap { format , fd , size } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Uint (format) , Argument :: Fd (fd) , Argument :: Uint (size) ,] , } , Request :: Key { time , key , state } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (time) , Argument :: Uint (key) , Argument :: Uint (state) ,] , } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: Uint (mods_depressed) , Argument :: Uint (mods_latched) , Argument :: Uint (mods_locked) , Argument :: Uint (group) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 3 , 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 :: Keymap { format , fd , size } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; _args_array [1] . h = fd ; _args_array [2] . u = size ; f (0 , & mut _args_array) } , Request :: Key { time , key , state } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = time ; _args_array [1] . u = key ; _args_array [2] . u = state ; f (1 , & mut _args_array) } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => { let mut _args_array : [wl_argument ; 4] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = mods_depressed ; _args_array [1] . u = mods_latched ; _args_array [2] . u = mods_locked ; _args_array [3] . u = group ; f (2 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & 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 ZwpVirtualKeyboardV1 (Proxy < ZwpVirtualKeyboardV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardV1 (value) } } impl From < ZwpVirtualKeyboardV1 > for Proxy < ZwpVirtualKeyboardV1 > { # [inline] fn from (value : ZwpVirtualKeyboardV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_v1_interface } } } impl ZwpVirtualKeyboardV1 { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] pub fn keymap (& self , format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32) -> () { let msg = Request :: Keymap { format : format , fd : fd , size : size } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] pub fn key (& self , time : u32 , key : u32 , state : u32) -> () { let msg = Request :: Key { time : time , key : key , state : state } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] pub fn modifiers (& self , mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32) -> () { let msg = Request :: Modifiers { mods_depressed : mods_depressed , mods_latched : mods_latched , mods_locked : mods_locked , group : group } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the virtual keyboard keyboard object\n\n\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_KEYMAP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_KEY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_MODIFIERS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_requests : [wl_message ; 4] = [wl_message { name : b"keymap\0" as * const u8 as * const c_char , signature : b"uhu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"key\0" as * const u8 as * const c_char , signature : b"uuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"modifiers\0" as * const u8 as * const c_char , signature : b"uuuu\0" as * const u8 as * const c_char , types : unsafe { &raw const types_null as * const _ } , } , 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 this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 4 , requests : unsafe { & zwp_virtual_keyboard_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "virtual keyboard manager\n\nA virtual keyboard manager allows an application to provide keyboard\ninput events as if they came from a physical keyboard."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "client not authorized to use the interface"] Unauthorized = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: Unauthorized) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] CreateVirtualKeyboard { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_virtual_keyboard" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: NewId ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateVirtualKeyboard { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: CreateVirtualKeyboard { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > (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 :: CreateVirtualKeyboard { seat } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) , Argument :: NewId (0) ,] , } , } } 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 :: CreateVirtualKeyboard { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [1] . o = :: std :: ptr :: null_mut () as * mut _ ; f (0 , & 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 ZwpVirtualKeyboardManagerV1 (Proxy < ZwpVirtualKeyboardManagerV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardManagerV1 (value) } } impl From < ZwpVirtualKeyboardManagerV1 > for Proxy < ZwpVirtualKeyboardManagerV1 > { # [inline] fn from (value : ZwpVirtualKeyboardManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_manager_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_manager_v1_interface } } } impl ZwpVirtualKeyboardManagerV1 { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] pub fn create_virtual_keyboard (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > { let msg = Request :: CreateVirtualKeyboard { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_VIRTUAL_KEYBOARD_SINCE : u32 = 1u32 ; static mut zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , unsafe { & super :: zwp_virtual_keyboard_v1 :: zwp_virtual_keyboard_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"create_virtual_keyboard\0" as * const u8 as * const c_char , signature : b"on\0" as * const u8 as * const c_char , types : unsafe { & zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_manager_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & zwp_virtual_keyboard_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [INFO] [stderr] | +++++++++ [INFO] [stderr] [INFO] [stderr] warning: creating a shared reference to mutable static [INFO] [stderr] --> /opt/rustwide/target/debug/build/zwp-virtual-keyboard-0d32ffd994ee6290/out/virtual_keyboard_api.rs:1:11434 [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 ; 4] = [NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "virtual keyboard\n\nThe virtual keyboard provides an application with requests which emulate\nthe behaviour of a physical keyboard.\n\nThis interface can be used by clients on its own to provide raw input\nevents, or it can accompany the input method protocol."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "No keymap was set"] NoKeymap = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: NoKeymap) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] Keymap { format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32 , } , # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] Key { time : u32 , key : u32 , state : u32 , } , # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] Modifiers { mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32 , } , # [doc = "destroy the virtual keyboard keyboard object\n\n\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 : "keymap" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Fd , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "key" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "modifiers" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Keymap { .. } => 0 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 2 , Request :: Destroy => 3 , } } fn since (& self) -> u32 { match * self { Request :: Keymap { .. } => 1 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 1 , 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 :: Keymap { format , fd , size } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Uint (format) , Argument :: Fd (fd) , Argument :: Uint (size) ,] , } , Request :: Key { time , key , state } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (time) , Argument :: Uint (key) , Argument :: Uint (state) ,] , } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: Uint (mods_depressed) , Argument :: Uint (mods_latched) , Argument :: Uint (mods_locked) , Argument :: Uint (group) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 3 , 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 :: Keymap { format , fd , size } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; _args_array [1] . h = fd ; _args_array [2] . u = size ; f (0 , & mut _args_array) } , Request :: Key { time , key , state } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = time ; _args_array [1] . u = key ; _args_array [2] . u = state ; f (1 , & mut _args_array) } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => { let mut _args_array : [wl_argument ; 4] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = mods_depressed ; _args_array [1] . u = mods_latched ; _args_array [2] . u = mods_locked ; _args_array [3] . u = group ; f (2 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & 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 ZwpVirtualKeyboardV1 (Proxy < ZwpVirtualKeyboardV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardV1 (value) } } impl From < ZwpVirtualKeyboardV1 > for Proxy < ZwpVirtualKeyboardV1 > { # [inline] fn from (value : ZwpVirtualKeyboardV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_v1_interface } } } impl ZwpVirtualKeyboardV1 { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] pub fn keymap (& self , format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32) -> () { let msg = Request :: Keymap { format : format , fd : fd , size : size } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] pub fn key (& self , time : u32 , key : u32 , state : u32) -> () { let msg = Request :: Key { time : time , key : key , state : state } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] pub fn modifiers (& self , mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32) -> () { let msg = Request :: Modifiers { mods_depressed : mods_depressed , mods_latched : mods_latched , mods_locked : mods_locked , group : group } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the virtual keyboard keyboard object\n\n\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_KEYMAP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_KEY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_MODIFIERS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_requests : [wl_message ; 4] = [wl_message { name : b"keymap\0" as * const u8 as * const c_char , signature : b"uhu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"key\0" as * const u8 as * const c_char , signature : b"uuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"modifiers\0" as * const u8 as * const c_char , signature : b"uuuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , 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 this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 4 , requests : unsafe { & zwp_virtual_keyboard_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "virtual keyboard manager\n\nA virtual keyboard manager allows an application to provide keyboard\ninput events as if they came from a physical keyboard."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "client not authorized to use the interface"] Unauthorized = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: Unauthorized) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] CreateVirtualKeyboard { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_virtual_keyboard" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: NewId ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateVirtualKeyboard { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: CreateVirtualKeyboard { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > (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 :: CreateVirtualKeyboard { seat } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) , Argument :: NewId (0) ,] , } , } } 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 :: CreateVirtualKeyboard { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [1] . o = :: std :: ptr :: null_mut () as * mut _ ; f (0 , & 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 ZwpVirtualKeyboardManagerV1 (Proxy < ZwpVirtualKeyboardManagerV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardManagerV1 (value) } } impl From < ZwpVirtualKeyboardManagerV1 > for Proxy < ZwpVirtualKeyboardManagerV1 > { # [inline] fn from (value : ZwpVirtualKeyboardManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_manager_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_manager_v1_interface } } } impl ZwpVirtualKeyboardManagerV1 { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] pub fn create_virtual_keyboard (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > { let msg = Request :: CreateVirtualKeyboard { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_VIRTUAL_KEYBOARD_SINCE : u32 = 1u32 ; static mut zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , unsafe { & super :: zwp_virtual_keyboard_v1 :: zwp_virtual_keyboard_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"create_virtual_keyboard\0" as * const u8 as * const c_char , signature : b"on\0" as * const u8 as * const c_char , types : unsafe { & zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_manager_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & zwp_virtual_keyboard_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [INFO] [stderr] | +++++++++ [INFO] [stderr] [INFO] [stderr] warning: creating a shared reference to mutable static [INFO] [stderr] --> /opt/rustwide/target/debug/build/zwp-virtual-keyboard-0d32ffd994ee6290/out/virtual_keyboard_api.rs:1:11738 [INFO] [stderr] | [INFO] [stderr] 1 | ...count : 4 , requests : unsafe { & zwp_virtual_keyboard_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_m... [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 ; 4] = [NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "virtual keyboard\n\nThe virtual keyboard provides an application with requests which emulate\nthe behaviour of a physical keyboard.\n\nThis interface can be used by clients on its own to provide raw input\nevents, or it can accompany the input method protocol."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "No keymap was set"] NoKeymap = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: NoKeymap) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] Keymap { format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32 , } , # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] Key { time : u32 , key : u32 , state : u32 , } , # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] Modifiers { mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32 , } , # [doc = "destroy the virtual keyboard keyboard object\n\n\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 : "keymap" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Fd , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "key" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "modifiers" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Keymap { .. } => 0 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 2 , Request :: Destroy => 3 , } } fn since (& self) -> u32 { match * self { Request :: Keymap { .. } => 1 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 1 , 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 :: Keymap { format , fd , size } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Uint (format) , Argument :: Fd (fd) , Argument :: Uint (size) ,] , } , Request :: Key { time , key , state } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (time) , Argument :: Uint (key) , Argument :: Uint (state) ,] , } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: Uint (mods_depressed) , Argument :: Uint (mods_latched) , Argument :: Uint (mods_locked) , Argument :: Uint (group) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 3 , 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 :: Keymap { format , fd , size } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; _args_array [1] . h = fd ; _args_array [2] . u = size ; f (0 , & mut _args_array) } , Request :: Key { time , key , state } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = time ; _args_array [1] . u = key ; _args_array [2] . u = state ; f (1 , & mut _args_array) } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => { let mut _args_array : [wl_argument ; 4] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = mods_depressed ; _args_array [1] . u = mods_latched ; _args_array [2] . u = mods_locked ; _args_array [3] . u = group ; f (2 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & 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 ZwpVirtualKeyboardV1 (Proxy < ZwpVirtualKeyboardV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardV1 (value) } } impl From < ZwpVirtualKeyboardV1 > for Proxy < ZwpVirtualKeyboardV1 > { # [inline] fn from (value : ZwpVirtualKeyboardV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_v1_interface } } } impl ZwpVirtualKeyboardV1 { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] pub fn keymap (& self , format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32) -> () { let msg = Request :: Keymap { format : format , fd : fd , size : size } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] pub fn key (& self , time : u32 , key : u32 , state : u32) -> () { let msg = Request :: Key { time : time , key : key , state : state } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] pub fn modifiers (& self , mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32) -> () { let msg = Request :: Modifiers { mods_depressed : mods_depressed , mods_latched : mods_latched , mods_locked : mods_locked , group : group } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the virtual keyboard keyboard object\n\n\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_KEYMAP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_KEY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_MODIFIERS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_requests : [wl_message ; 4] = [wl_message { name : b"keymap\0" as * const u8 as * const c_char , signature : b"uhu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"key\0" as * const u8 as * const c_char , signature : b"uuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"modifiers\0" as * const u8 as * const c_char , signature : b"uuuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , 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 this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 4 , requests : unsafe { &raw const zwp_virtual_keyboard_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "virtual keyboard manager\n\nA virtual keyboard manager allows an application to provide keyboard\ninput events as if they came from a physical keyboard."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "client not authorized to use the interface"] Unauthorized = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: Unauthorized) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] CreateVirtualKeyboard { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_virtual_keyboard" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: NewId ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateVirtualKeyboard { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: CreateVirtualKeyboard { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > (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 :: CreateVirtualKeyboard { seat } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) , Argument :: NewId (0) ,] , } , } } 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 :: CreateVirtualKeyboard { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [1] . o = :: std :: ptr :: null_mut () as * mut _ ; f (0 , & 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 ZwpVirtualKeyboardManagerV1 (Proxy < ZwpVirtualKeyboardManagerV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardManagerV1 (value) } } impl From < ZwpVirtualKeyboardManagerV1 > for Proxy < ZwpVirtualKeyboardManagerV1 > { # [inline] fn from (value : ZwpVirtualKeyboardManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_manager_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_manager_v1_interface } } } impl ZwpVirtualKeyboardManagerV1 { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] pub fn create_virtual_keyboard (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > { let msg = Request :: CreateVirtualKeyboard { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_VIRTUAL_KEYBOARD_SINCE : u32 = 1u32 ; static mut zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , unsafe { & super :: zwp_virtual_keyboard_v1 :: zwp_virtual_keyboard_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"create_virtual_keyboard\0" as * const u8 as * const c_char , signature : b"on\0" as * const u8 as * const c_char , types : unsafe { & zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_manager_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & zwp_virtual_keyboard_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [INFO] [stderr] | +++++++++ [INFO] [stderr] [INFO] [stderr] warning: creating a shared reference to mutable static [INFO] [stderr] --> /opt/rustwide/target/debug/build/zwp-virtual-keyboard-0d32ffd994ee6290/out/virtual_keyboard_api.rs:1:17076 [INFO] [stderr] | [INFO] [stderr] 1 | ...nst wl_interface { unsafe { & zwp_virtual_keyboard_manager_v1_interface } } } impl ZwpVirtualKeyboardManagerV1 { # [doc = "Create a ne... [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 ; 4] = [NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "virtual keyboard\n\nThe virtual keyboard provides an application with requests which emulate\nthe behaviour of a physical keyboard.\n\nThis interface can be used by clients on its own to provide raw input\nevents, or it can accompany the input method protocol."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "No keymap was set"] NoKeymap = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: NoKeymap) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] Keymap { format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32 , } , # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] Key { time : u32 , key : u32 , state : u32 , } , # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] Modifiers { mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32 , } , # [doc = "destroy the virtual keyboard keyboard object\n\n\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 : "keymap" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Fd , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "key" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "modifiers" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Keymap { .. } => 0 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 2 , Request :: Destroy => 3 , } } fn since (& self) -> u32 { match * self { Request :: Keymap { .. } => 1 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 1 , 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 :: Keymap { format , fd , size } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Uint (format) , Argument :: Fd (fd) , Argument :: Uint (size) ,] , } , Request :: Key { time , key , state } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (time) , Argument :: Uint (key) , Argument :: Uint (state) ,] , } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: Uint (mods_depressed) , Argument :: Uint (mods_latched) , Argument :: Uint (mods_locked) , Argument :: Uint (group) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 3 , 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 :: Keymap { format , fd , size } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; _args_array [1] . h = fd ; _args_array [2] . u = size ; f (0 , & mut _args_array) } , Request :: Key { time , key , state } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = time ; _args_array [1] . u = key ; _args_array [2] . u = state ; f (1 , & mut _args_array) } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => { let mut _args_array : [wl_argument ; 4] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = mods_depressed ; _args_array [1] . u = mods_latched ; _args_array [2] . u = mods_locked ; _args_array [3] . u = group ; f (2 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & 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 ZwpVirtualKeyboardV1 (Proxy < ZwpVirtualKeyboardV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardV1 (value) } } impl From < ZwpVirtualKeyboardV1 > for Proxy < ZwpVirtualKeyboardV1 > { # [inline] fn from (value : ZwpVirtualKeyboardV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_v1_interface } } } impl ZwpVirtualKeyboardV1 { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] pub fn keymap (& self , format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32) -> () { let msg = Request :: Keymap { format : format , fd : fd , size : size } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] pub fn key (& self , time : u32 , key : u32 , state : u32) -> () { let msg = Request :: Key { time : time , key : key , state : state } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] pub fn modifiers (& self , mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32) -> () { let msg = Request :: Modifiers { mods_depressed : mods_depressed , mods_latched : mods_latched , mods_locked : mods_locked , group : group } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the virtual keyboard keyboard object\n\n\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_KEYMAP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_KEY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_MODIFIERS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_requests : [wl_message ; 4] = [wl_message { name : b"keymap\0" as * const u8 as * const c_char , signature : b"uhu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"key\0" as * const u8 as * const c_char , signature : b"uuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"modifiers\0" as * const u8 as * const c_char , signature : b"uuuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , 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 this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 4 , requests : unsafe { & zwp_virtual_keyboard_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "virtual keyboard manager\n\nA virtual keyboard manager allows an application to provide keyboard\ninput events as if they came from a physical keyboard."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "client not authorized to use the interface"] Unauthorized = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: Unauthorized) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] CreateVirtualKeyboard { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_virtual_keyboard" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: NewId ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateVirtualKeyboard { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: CreateVirtualKeyboard { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > (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 :: CreateVirtualKeyboard { seat } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) , Argument :: NewId (0) ,] , } , } } 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 :: CreateVirtualKeyboard { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [1] . o = :: std :: ptr :: null_mut () as * mut _ ; f (0 , & 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 ZwpVirtualKeyboardManagerV1 (Proxy < ZwpVirtualKeyboardManagerV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardManagerV1 (value) } } impl From < ZwpVirtualKeyboardManagerV1 > for Proxy < ZwpVirtualKeyboardManagerV1 > { # [inline] fn from (value : ZwpVirtualKeyboardManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_manager_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { &raw const zwp_virtual_keyboard_manager_v1_interface } } } impl ZwpVirtualKeyboardManagerV1 { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] pub fn create_virtual_keyboard (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > { let msg = Request :: CreateVirtualKeyboard { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_VIRTUAL_KEYBOARD_SINCE : u32 = 1u32 ; static mut zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , unsafe { & super :: zwp_virtual_keyboard_v1 :: zwp_virtual_keyboard_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"create_virtual_keyboard\0" as * const u8 as * const c_char , signature : b"on\0" as * const u8 as * const c_char , types : unsafe { & zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_manager_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & zwp_virtual_keyboard_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [INFO] [stderr] | +++++++++ [INFO] [stderr] [INFO] [stderr] warning: creating a shared reference to mutable static [INFO] [stderr] --> /opt/rustwide/target/debug/build/zwp-virtual-keyboard-0d32ffd994ee6290/out/virtual_keyboard_api.rs:1:17921 [INFO] [stderr] | [INFO] [stderr] 1 | ...wl_interface ; 2] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , unsafe { & super :: zwp_virtual_keyb... [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 ; 4] = [NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "virtual keyboard\n\nThe virtual keyboard provides an application with requests which emulate\nthe behaviour of a physical keyboard.\n\nThis interface can be used by clients on its own to provide raw input\nevents, or it can accompany the input method protocol."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "No keymap was set"] NoKeymap = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: NoKeymap) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] Keymap { format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32 , } , # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] Key { time : u32 , key : u32 , state : u32 , } , # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] Modifiers { mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32 , } , # [doc = "destroy the virtual keyboard keyboard object\n\n\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 : "keymap" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Fd , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "key" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "modifiers" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Keymap { .. } => 0 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 2 , Request :: Destroy => 3 , } } fn since (& self) -> u32 { match * self { Request :: Keymap { .. } => 1 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 1 , 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 :: Keymap { format , fd , size } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Uint (format) , Argument :: Fd (fd) , Argument :: Uint (size) ,] , } , Request :: Key { time , key , state } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (time) , Argument :: Uint (key) , Argument :: Uint (state) ,] , } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: Uint (mods_depressed) , Argument :: Uint (mods_latched) , Argument :: Uint (mods_locked) , Argument :: Uint (group) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 3 , 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 :: Keymap { format , fd , size } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; _args_array [1] . h = fd ; _args_array [2] . u = size ; f (0 , & mut _args_array) } , Request :: Key { time , key , state } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = time ; _args_array [1] . u = key ; _args_array [2] . u = state ; f (1 , & mut _args_array) } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => { let mut _args_array : [wl_argument ; 4] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = mods_depressed ; _args_array [1] . u = mods_latched ; _args_array [2] . u = mods_locked ; _args_array [3] . u = group ; f (2 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & 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 ZwpVirtualKeyboardV1 (Proxy < ZwpVirtualKeyboardV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardV1 (value) } } impl From < ZwpVirtualKeyboardV1 > for Proxy < ZwpVirtualKeyboardV1 > { # [inline] fn from (value : ZwpVirtualKeyboardV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_v1_interface } } } impl ZwpVirtualKeyboardV1 { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] pub fn keymap (& self , format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32) -> () { let msg = Request :: Keymap { format : format , fd : fd , size : size } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] pub fn key (& self , time : u32 , key : u32 , state : u32) -> () { let msg = Request :: Key { time : time , key : key , state : state } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] pub fn modifiers (& self , mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32) -> () { let msg = Request :: Modifiers { mods_depressed : mods_depressed , mods_latched : mods_latched , mods_locked : mods_locked , group : group } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the virtual keyboard keyboard object\n\n\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_KEYMAP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_KEY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_MODIFIERS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_requests : [wl_message ; 4] = [wl_message { name : b"keymap\0" as * const u8 as * const c_char , signature : b"uhu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"key\0" as * const u8 as * const c_char , signature : b"uuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"modifiers\0" as * const u8 as * const c_char , signature : b"uuuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , 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 this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 4 , requests : unsafe { & zwp_virtual_keyboard_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "virtual keyboard manager\n\nA virtual keyboard manager allows an application to provide keyboard\ninput events as if they came from a physical keyboard."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "client not authorized to use the interface"] Unauthorized = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: Unauthorized) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] CreateVirtualKeyboard { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_virtual_keyboard" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: NewId ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateVirtualKeyboard { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: CreateVirtualKeyboard { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > (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 :: CreateVirtualKeyboard { seat } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) , Argument :: NewId (0) ,] , } , } } 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 :: CreateVirtualKeyboard { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [1] . o = :: std :: ptr :: null_mut () as * mut _ ; f (0 , & 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 ZwpVirtualKeyboardManagerV1 (Proxy < ZwpVirtualKeyboardManagerV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardManagerV1 (value) } } impl From < ZwpVirtualKeyboardManagerV1 > for Proxy < ZwpVirtualKeyboardManagerV1 > { # [inline] fn from (value : ZwpVirtualKeyboardManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_manager_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_manager_v1_interface } } } impl ZwpVirtualKeyboardManagerV1 { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] pub fn create_virtual_keyboard (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > { let msg = Request :: CreateVirtualKeyboard { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_VIRTUAL_KEYBOARD_SINCE : u32 = 1u32 ; static mut zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types : [* const wl_interface ; 2] = [unsafe { &raw const super :: wl_seat :: wl_seat_interface as * const wl_interface } , unsafe { & super :: zwp_virtual_keyboard_v1 :: zwp_virtual_keyboard_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"create_virtual_keyboard\0" as * const u8 as * const c_char , signature : b"on\0" as * const u8 as * const c_char , types : unsafe { & zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_manager_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & zwp_virtual_keyboard_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [INFO] [stderr] | +++++++++ [INFO] [stderr] [INFO] [stderr] warning: creating a shared reference to mutable static [INFO] [stderr] --> /opt/rustwide/target/debug/build/zwp-virtual-keyboard-0d32ffd994ee6290/out/virtual_keyboard_api.rs:1:17998 [INFO] [stderr] | [INFO] [stderr] 1 | ... } , unsafe { & super :: zwp_virtual_keyboard_v1 :: zwp_virtual_keyboard_v1_interface as * const wl_interface } ,] ; # [doc = r" C-rep... [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 ; 4] = [NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "virtual keyboard\n\nThe virtual keyboard provides an application with requests which emulate\nthe behaviour of a physical keyboard.\n\nThis interface can be used by clients on its own to provide raw input\nevents, or it can accompany the input method protocol."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "No keymap was set"] NoKeymap = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: NoKeymap) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] Keymap { format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32 , } , # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] Key { time : u32 , key : u32 , state : u32 , } , # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] Modifiers { mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32 , } , # [doc = "destroy the virtual keyboard keyboard object\n\n\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 : "keymap" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Fd , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "key" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "modifiers" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Keymap { .. } => 0 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 2 , Request :: Destroy => 3 , } } fn since (& self) -> u32 { match * self { Request :: Keymap { .. } => 1 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 1 , 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 :: Keymap { format , fd , size } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Uint (format) , Argument :: Fd (fd) , Argument :: Uint (size) ,] , } , Request :: Key { time , key , state } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (time) , Argument :: Uint (key) , Argument :: Uint (state) ,] , } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: Uint (mods_depressed) , Argument :: Uint (mods_latched) , Argument :: Uint (mods_locked) , Argument :: Uint (group) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 3 , 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 :: Keymap { format , fd , size } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; _args_array [1] . h = fd ; _args_array [2] . u = size ; f (0 , & mut _args_array) } , Request :: Key { time , key , state } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = time ; _args_array [1] . u = key ; _args_array [2] . u = state ; f (1 , & mut _args_array) } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => { let mut _args_array : [wl_argument ; 4] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = mods_depressed ; _args_array [1] . u = mods_latched ; _args_array [2] . u = mods_locked ; _args_array [3] . u = group ; f (2 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & 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 ZwpVirtualKeyboardV1 (Proxy < ZwpVirtualKeyboardV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardV1 (value) } } impl From < ZwpVirtualKeyboardV1 > for Proxy < ZwpVirtualKeyboardV1 > { # [inline] fn from (value : ZwpVirtualKeyboardV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_v1_interface } } } impl ZwpVirtualKeyboardV1 { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] pub fn keymap (& self , format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32) -> () { let msg = Request :: Keymap { format : format , fd : fd , size : size } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] pub fn key (& self , time : u32 , key : u32 , state : u32) -> () { let msg = Request :: Key { time : time , key : key , state : state } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] pub fn modifiers (& self , mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32) -> () { let msg = Request :: Modifiers { mods_depressed : mods_depressed , mods_latched : mods_latched , mods_locked : mods_locked , group : group } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the virtual keyboard keyboard object\n\n\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_KEYMAP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_KEY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_MODIFIERS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_requests : [wl_message ; 4] = [wl_message { name : b"keymap\0" as * const u8 as * const c_char , signature : b"uhu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"key\0" as * const u8 as * const c_char , signature : b"uuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"modifiers\0" as * const u8 as * const c_char , signature : b"uuuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , 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 this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 4 , requests : unsafe { & zwp_virtual_keyboard_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "virtual keyboard manager\n\nA virtual keyboard manager allows an application to provide keyboard\ninput events as if they came from a physical keyboard."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "client not authorized to use the interface"] Unauthorized = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: Unauthorized) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] CreateVirtualKeyboard { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_virtual_keyboard" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: NewId ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateVirtualKeyboard { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: CreateVirtualKeyboard { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > (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 :: CreateVirtualKeyboard { seat } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) , Argument :: NewId (0) ,] , } , } } 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 :: CreateVirtualKeyboard { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [1] . o = :: std :: ptr :: null_mut () as * mut _ ; f (0 , & 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 ZwpVirtualKeyboardManagerV1 (Proxy < ZwpVirtualKeyboardManagerV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardManagerV1 (value) } } impl From < ZwpVirtualKeyboardManagerV1 > for Proxy < ZwpVirtualKeyboardManagerV1 > { # [inline] fn from (value : ZwpVirtualKeyboardManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_manager_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_manager_v1_interface } } } impl ZwpVirtualKeyboardManagerV1 { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] pub fn create_virtual_keyboard (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > { let msg = Request :: CreateVirtualKeyboard { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_VIRTUAL_KEYBOARD_SINCE : u32 = 1u32 ; static mut zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , unsafe { &raw const super :: zwp_virtual_keyboard_v1 :: zwp_virtual_keyboard_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"create_virtual_keyboard\0" as * const u8 as * const c_char , signature : b"on\0" as * const u8 as * const c_char , types : unsafe { & zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_manager_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & zwp_virtual_keyboard_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [INFO] [stderr] | +++++++++ [INFO] [stderr] [INFO] [stderr] warning: creating a shared reference to mutable static [INFO] [stderr] --> /opt/rustwide/target/debug/build/zwp-virtual-keyboard-0d32ffd994ee6290/out/virtual_keyboard_api.rs:1:18411 [INFO] [stderr] | [INFO] [stderr] 1 | ...s : unsafe { & zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types as * const _ } , } ,] ; # [doc = r" C representa... [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 ; 4] = [NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "virtual keyboard\n\nThe virtual keyboard provides an application with requests which emulate\nthe behaviour of a physical keyboard.\n\nThis interface can be used by clients on its own to provide raw input\nevents, or it can accompany the input method protocol."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "No keymap was set"] NoKeymap = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: NoKeymap) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] Keymap { format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32 , } , # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] Key { time : u32 , key : u32 , state : u32 , } , # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] Modifiers { mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32 , } , # [doc = "destroy the virtual keyboard keyboard object\n\n\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 : "keymap" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Fd , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "key" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "modifiers" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Keymap { .. } => 0 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 2 , Request :: Destroy => 3 , } } fn since (& self) -> u32 { match * self { Request :: Keymap { .. } => 1 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 1 , 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 :: Keymap { format , fd , size } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Uint (format) , Argument :: Fd (fd) , Argument :: Uint (size) ,] , } , Request :: Key { time , key , state } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (time) , Argument :: Uint (key) , Argument :: Uint (state) ,] , } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: Uint (mods_depressed) , Argument :: Uint (mods_latched) , Argument :: Uint (mods_locked) , Argument :: Uint (group) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 3 , 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 :: Keymap { format , fd , size } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; _args_array [1] . h = fd ; _args_array [2] . u = size ; f (0 , & mut _args_array) } , Request :: Key { time , key , state } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = time ; _args_array [1] . u = key ; _args_array [2] . u = state ; f (1 , & mut _args_array) } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => { let mut _args_array : [wl_argument ; 4] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = mods_depressed ; _args_array [1] . u = mods_latched ; _args_array [2] . u = mods_locked ; _args_array [3] . u = group ; f (2 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & 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 ZwpVirtualKeyboardV1 (Proxy < ZwpVirtualKeyboardV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardV1 (value) } } impl From < ZwpVirtualKeyboardV1 > for Proxy < ZwpVirtualKeyboardV1 > { # [inline] fn from (value : ZwpVirtualKeyboardV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_v1_interface } } } impl ZwpVirtualKeyboardV1 { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] pub fn keymap (& self , format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32) -> () { let msg = Request :: Keymap { format : format , fd : fd , size : size } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] pub fn key (& self , time : u32 , key : u32 , state : u32) -> () { let msg = Request :: Key { time : time , key : key , state : state } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] pub fn modifiers (& self , mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32) -> () { let msg = Request :: Modifiers { mods_depressed : mods_depressed , mods_latched : mods_latched , mods_locked : mods_locked , group : group } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the virtual keyboard keyboard object\n\n\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_KEYMAP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_KEY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_MODIFIERS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_requests : [wl_message ; 4] = [wl_message { name : b"keymap\0" as * const u8 as * const c_char , signature : b"uhu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"key\0" as * const u8 as * const c_char , signature : b"uuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"modifiers\0" as * const u8 as * const c_char , signature : b"uuuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , 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 this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 4 , requests : unsafe { & zwp_virtual_keyboard_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "virtual keyboard manager\n\nA virtual keyboard manager allows an application to provide keyboard\ninput events as if they came from a physical keyboard."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "client not authorized to use the interface"] Unauthorized = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: Unauthorized) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] CreateVirtualKeyboard { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_virtual_keyboard" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: NewId ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateVirtualKeyboard { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: CreateVirtualKeyboard { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > (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 :: CreateVirtualKeyboard { seat } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) , Argument :: NewId (0) ,] , } , } } 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 :: CreateVirtualKeyboard { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [1] . o = :: std :: ptr :: null_mut () as * mut _ ; f (0 , & 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 ZwpVirtualKeyboardManagerV1 (Proxy < ZwpVirtualKeyboardManagerV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardManagerV1 (value) } } impl From < ZwpVirtualKeyboardManagerV1 > for Proxy < ZwpVirtualKeyboardManagerV1 > { # [inline] fn from (value : ZwpVirtualKeyboardManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_manager_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_manager_v1_interface } } } impl ZwpVirtualKeyboardManagerV1 { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] pub fn create_virtual_keyboard (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > { let msg = Request :: CreateVirtualKeyboard { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_VIRTUAL_KEYBOARD_SINCE : u32 = 1u32 ; static mut zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , unsafe { & super :: zwp_virtual_keyboard_v1 :: zwp_virtual_keyboard_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"create_virtual_keyboard\0" as * const u8 as * const c_char , signature : b"on\0" as * const u8 as * const c_char , types : unsafe { &raw const zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_manager_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { & zwp_virtual_keyboard_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [INFO] [stderr] | +++++++++ [INFO] [stderr] [INFO] [stderr] warning: creating a shared reference to mutable static [INFO] [stderr] --> /opt/rustwide/target/debug/build/zwp-virtual-keyboard-0d32ffd994ee6290/out/virtual_keyboard_api.rs:1:18791 [INFO] [stderr] | [INFO] [stderr] 1 | ...t : 1 , requests : unsafe { & zwp_virtual_keyboard_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR 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 ; 4] = [NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface , NULLPTR as * const sys :: common :: wl_interface ,] ; # [doc = "virtual keyboard\n\nThe virtual keyboard provides an application with requests which emulate\nthe behaviour of a physical keyboard.\n\nThis interface can be used by clients on its own to provide raw input\nevents, or it can accompany the input method protocol."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "No keymap was set"] NoKeymap = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: NoKeymap) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] Keymap { format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32 , } , # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] Key { time : u32 , key : u32 , state : u32 , } , # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] Modifiers { mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32 , } , # [doc = "destroy the virtual keyboard keyboard object\n\n\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 : "keymap" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Fd , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "key" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "modifiers" , since : 1 , signature : & [super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint , super :: ArgumentType :: Uint ,] , destructor : false , } , super :: MessageDesc { name : "destroy" , since : 1 , signature : & [] , destructor : true , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { Request :: Destroy => true , _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: Keymap { .. } => 0 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 2 , Request :: Destroy => 3 , } } fn since (& self) -> u32 { match * self { Request :: Keymap { .. } => 1 , Request :: Key { .. } => 1 , Request :: Modifiers { .. } => 1 , 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 :: Keymap { format , fd , size } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Uint (format) , Argument :: Fd (fd) , Argument :: Uint (size) ,] , } , Request :: Key { time , key , state } => Message { sender_id : sender_id , opcode : 1 , args : smallvec ! [Argument :: Uint (time) , Argument :: Uint (key) , Argument :: Uint (state) ,] , } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => Message { sender_id : sender_id , opcode : 2 , args : smallvec ! [Argument :: Uint (mods_depressed) , Argument :: Uint (mods_latched) , Argument :: Uint (mods_locked) , Argument :: Uint (group) ,] , } , Request :: Destroy => Message { sender_id : sender_id , opcode : 3 , 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 :: Keymap { format , fd , size } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = format ; _args_array [1] . h = fd ; _args_array [2] . u = size ; f (0 , & mut _args_array) } , Request :: Key { time , key , state } => { let mut _args_array : [wl_argument ; 3] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = time ; _args_array [1] . u = key ; _args_array [2] . u = state ; f (1 , & mut _args_array) } , Request :: Modifiers { mods_depressed , mods_latched , mods_locked , group } => { let mut _args_array : [wl_argument ; 4] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . u = mods_depressed ; _args_array [1] . u = mods_latched ; _args_array [2] . u = mods_locked ; _args_array [3] . u = group ; f (2 , & mut _args_array) } , Request :: Destroy => { let mut _args_array : [wl_argument ; 0] = unsafe { :: std :: mem :: zeroed () } ; f (3 , & 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 ZwpVirtualKeyboardV1 (Proxy < ZwpVirtualKeyboardV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardV1 >> for ZwpVirtualKeyboardV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardV1 (value) } } impl From < ZwpVirtualKeyboardV1 > for Proxy < ZwpVirtualKeyboardV1 > { # [inline] fn from (value : ZwpVirtualKeyboardV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_v1_interface } } } impl ZwpVirtualKeyboardV1 { # [doc = "keyboard mapping\n\nProvide a file descriptor to the compositor which can be\nmemory-mapped to provide a keyboard mapping description.\n\nFormat carries a value from the keymap_format enumeration."] pub fn keymap (& self , format : u32 , fd : :: std :: os :: unix :: io :: RawFd , size : u32) -> () { let msg = Request :: Keymap { format : format , fd : fd , size : size } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "key event\n\nA key was pressed or released.\nThe time argument is a timestamp with millisecond granularity, with an\nundefined base. All requests regarding a single object must share the\nsame clock.\n\nKeymap must be set before issuing this request.\n\nState carries a value from the key_state enumeration."] pub fn key (& self , time : u32 , key : u32 , state : u32) -> () { let msg = Request :: Key { time : time , key : key , state : state } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "modifier and group state\n\nNotifies the compositor that the modifier and/or group state has\nchanged, and it should update state.\n\nThe client should use wl_keyboard.modifiers event to synchronize its\ninternal state with seat state.\n\nKeymap must be set before issuing this request."] pub fn modifiers (& self , mods_depressed : u32 , mods_latched : u32 , mods_locked : u32 , group : u32) -> () { let msg = Request :: Modifiers { mods_depressed : mods_depressed , mods_latched : mods_latched , mods_locked : mods_locked , group : group } ; self . 0 . send :: < AnonymousObject > (msg , None) ; } # [doc = "destroy the virtual keyboard keyboard object\n\n\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_KEYMAP_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_KEY_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_MODIFIERS_SINCE : u32 = 1u32 ; # [doc = r" The minimal object version supporting this request"] pub const REQ_DESTROY_SINCE : u32 = 1u32 ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_requests : [wl_message ; 4] = [wl_message { name : b"keymap\0" as * const u8 as * const c_char , signature : b"uhu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"key\0" as * const u8 as * const c_char , signature : b"uuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , wl_message { name : b"modifiers\0" as * const u8 as * const c_char , signature : b"uuuu\0" as * const u8 as * const c_char , types : unsafe { & types_null as * const _ } , } , 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 this interface, for interop"] pub static mut zwp_virtual_keyboard_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 4 , requests : unsafe { & zwp_virtual_keyboard_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } # [doc = "virtual keyboard manager\n\nA virtual keyboard manager allows an application to provide keyboard\ninput events as if they came from a physical keyboard."] pub mod zwp_virtual_keyboard_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 :: * ; # [repr (u32)] # [derive (Copy , Clone , Debug , PartialEq)] # [non_exhaustive] pub enum Error { # [doc = "client not authorized to use the interface"] Unauthorized = 0 , } impl Error { pub fn from_raw (n : u32) -> Option < Error > { match n { 0 => Some (Error :: Unauthorized) , _ => Option :: None } } pub fn to_raw (& self) -> u32 { * self as u32 } } # [derive (Debug)] # [non_exhaustive] pub enum Request { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] CreateVirtualKeyboard { seat : super :: wl_seat :: WlSeat , } , } impl super :: MessageGroup for Request { const MESSAGES : & 'static [super :: MessageDesc] = & [super :: MessageDesc { name : "create_virtual_keyboard" , since : 1 , signature : & [super :: ArgumentType :: Object , super :: ArgumentType :: NewId ,] , destructor : false , } ,] ; type Map = super :: ProxyMap ; fn is_destructor (& self) -> bool { match * self { _ => false , } } fn opcode (& self) -> u16 { match * self { Request :: CreateVirtualKeyboard { .. } => 0 , } } fn since (& self) -> u32 { match * self { Request :: CreateVirtualKeyboard { .. } => 1 , } } fn child < Meta : ObjectMetadata > (opcode : u16 , version : u32 , meta : & Meta) -> Option < Object < Meta >> { match opcode { 0 => Some (Object :: from_interface :: < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > (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 :: CreateVirtualKeyboard { seat } => Message { sender_id : sender_id , opcode : 0 , args : smallvec ! [Argument :: Object (seat . as_ref () . id ()) , Argument :: NewId (0) ,] , } , } } 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 :: CreateVirtualKeyboard { seat } => { let mut _args_array : [wl_argument ; 2] = unsafe { :: std :: mem :: zeroed () } ; _args_array [0] . o = seat . as_ref () . c_ptr () as * mut _ ; _args_array [1] . o = :: std :: ptr :: null_mut () as * mut _ ; f (0 , & 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 ZwpVirtualKeyboardManagerV1 (Proxy < ZwpVirtualKeyboardManagerV1 >) ; impl AsRef < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn as_ref (& self) -> & Proxy < Self > { & self . 0 } } impl From < Proxy < ZwpVirtualKeyboardManagerV1 >> for ZwpVirtualKeyboardManagerV1 { # [inline] fn from (value : Proxy < Self >) -> Self { ZwpVirtualKeyboardManagerV1 (value) } } impl From < ZwpVirtualKeyboardManagerV1 > for Proxy < ZwpVirtualKeyboardManagerV1 > { # [inline] fn from (value : ZwpVirtualKeyboardManagerV1) -> Self { value . 0 } } impl std :: fmt :: Debug for ZwpVirtualKeyboardManagerV1 { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { f . write_fmt (format_args ! ("{:?}" , self . 0)) } } impl Interface for ZwpVirtualKeyboardManagerV1 { type Request = Request ; type Event = Event ; const NAME : & 'static str = "zwp_virtual_keyboard_manager_v1" ; const VERSION : u32 = 1 ; fn c_interface () -> * const wl_interface { unsafe { & zwp_virtual_keyboard_manager_v1_interface } } } impl ZwpVirtualKeyboardManagerV1 { # [doc = "Create a new virtual keyboard\n\nCreates a new virtual keyboard associated to a seat.\n\nIf the compositor enables a keyboard to perform arbitrary actions, it\nshould present an error when an untrusted client requests a new\nkeyboard."] pub fn create_virtual_keyboard (& self , seat : & super :: wl_seat :: WlSeat) -> Main < super :: zwp_virtual_keyboard_v1 :: ZwpVirtualKeyboardV1 > { let msg = Request :: CreateVirtualKeyboard { seat : seat . clone () } ; self . 0 . send (msg , None) . unwrap () } } # [doc = r" The minimal object version supporting this request"] pub const REQ_CREATE_VIRTUAL_KEYBOARD_SINCE : u32 = 1u32 ; static mut zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types : [* const wl_interface ; 2] = [unsafe { & super :: wl_seat :: wl_seat_interface as * const wl_interface } , unsafe { & super :: zwp_virtual_keyboard_v1 :: zwp_virtual_keyboard_v1_interface as * const wl_interface } ,] ; # [doc = r" C-representation of the messages of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_requests : [wl_message ; 1] = [wl_message { name : b"create_virtual_keyboard\0" as * const u8 as * const c_char , signature : b"on\0" as * const u8 as * const c_char , types : unsafe { & zwp_virtual_keyboard_manager_v1_requests_create_virtual_keyboard_types as * const _ } , } ,] ; # [doc = r" C representation of this interface, for interop"] pub static mut zwp_virtual_keyboard_manager_v1_interface : wl_interface = wl_interface { name : b"zwp_virtual_keyboard_manager_v1\0" as * const u8 as * const c_char , version : 1 , request_count : 1 , requests : unsafe { &raw const zwp_virtual_keyboard_manager_v1_requests as * const _ } , event_count : 0 , events : NULLPTR as * const wl_message , } ; } [INFO] [stderr] | +++++++++ [INFO] [stderr] [INFO] [stderr] warning: `zwp-virtual-keyboard` (lib) generated 11 warnings [INFO] [stderr] warning: `zwp-virtual-keyboard` (lib test) generated 11 warnings (11 duplicates) [INFO] [stderr] Finished `test` profile [unoptimized + debuginfo] target(s) in 0.11s [INFO] [stderr] Running unittests src/lib.rs (/opt/rustwide/target/debug/deps/zwp_virtual_keyboard-801a06e374d2d394) [INFO] [stdout] [INFO] [stdout] running 0 tests [INFO] [stdout] [INFO] [stdout] test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s [INFO] [stdout] [INFO] [stderr] Doc-tests zwp_virtual_keyboard [INFO] [stdout] [INFO] [stdout] running 0 tests [INFO] [stdout] [INFO] [stdout] test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s [INFO] [stdout] [INFO] running `Command { std: "docker" "inspect" "7e24dae16f71a3c230423912fab7c3d4014ac16b0d6557c46bedc86dd7198a7d", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "7e24dae16f71a3c230423912fab7c3d4014ac16b0d6557c46bedc86dd7198a7d", kill_on_drop: false }` [INFO] [stdout] 7e24dae16f71a3c230423912fab7c3d4014ac16b0d6557c46bedc86dd7198a7d