wayland: Move initialization to the Rust side
This will help make the init procedure safer, by limiting the number of Rust objects that need to be carried to the C side and may be mangled on the way there. The second benefit is that it allows outputs to become part of new state management.
This commit is contained in:
@ -10,11 +10,18 @@ type KeyCode = u32;
|
||||
pub mod c {
|
||||
use std::ffi::CStr;
|
||||
use std::os::raw::{ c_char, c_void };
|
||||
use std::ptr;
|
||||
|
||||
#[repr(transparent)]
|
||||
#[derive(Clone, Copy)]
|
||||
pub struct ZwpVirtualKeyboardV1(*const c_void);
|
||||
|
||||
impl ZwpVirtualKeyboardV1 {
|
||||
pub fn null() -> Self {
|
||||
Self(ptr::null())
|
||||
}
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
pub struct KeyMap {
|
||||
fd: u32,
|
||||
|
||||
Reference in New Issue
Block a user