autocommit 2022-01-08 18:38:24 CET
This commit is contained in:
parent
33549184d4
commit
d061a5c313
38 changed files with 179 additions and 371 deletions
|
|
@ -36,14 +36,14 @@ const NAME: u32 = 1;
|
|||
|
||||
const POINTER: u32 = 1;
|
||||
const KEYBOARD: u32 = 2;
|
||||
const TOUCH: u32 = 4;
|
||||
#[allow(dead_code)] const TOUCH: u32 = 4;
|
||||
|
||||
const MISSING_CAPABILITY: u32 = 0;
|
||||
#[allow(dead_code)] const MISSING_CAPABILITY: u32 = 0;
|
||||
|
||||
pub struct WlSeatGlobal {
|
||||
name: GlobalName,
|
||||
state: Rc<State>,
|
||||
seat: Rc<dyn Seat>,
|
||||
_seat: Rc<dyn Seat>,
|
||||
move_: Cell<bool>,
|
||||
move_start_pos: Cell<(Fixed, Fixed)>,
|
||||
extents_start_pos: Cell<(i32, i32)>,
|
||||
|
|
@ -75,7 +75,7 @@ impl WlSeatGlobal {
|
|||
Self {
|
||||
name,
|
||||
state: state.clone(),
|
||||
seat: seat.clone(),
|
||||
_seat: seat.clone(),
|
||||
move_: Cell::new(false),
|
||||
move_start_pos: Cell::new((Fixed(0), Fixed(0))),
|
||||
extents_start_pos: Cell::new((0, 0)),
|
||||
|
|
@ -217,7 +217,7 @@ impl WlSeatGlobal {
|
|||
}
|
||||
}
|
||||
|
||||
async fn key_event(&self, key: u32, state: KeyState) {}
|
||||
async fn key_event(&self, _key: u32, _state: KeyState) {}
|
||||
|
||||
async fn bind_(
|
||||
self: Rc<Self>,
|
||||
|
|
@ -231,6 +231,7 @@ impl WlSeatGlobal {
|
|||
client: client.clone(),
|
||||
pointers: Default::default(),
|
||||
keyboards: Default::default(),
|
||||
version,
|
||||
});
|
||||
client.add_client_obj(&obj)?;
|
||||
client.event(obj.capabilities()).await?;
|
||||
|
|
@ -261,11 +262,7 @@ impl Global for WlSeatGlobal {
|
|||
}
|
||||
|
||||
fn version(&self) -> u32 {
|
||||
3
|
||||
}
|
||||
|
||||
fn pre_remove(&self) {
|
||||
//
|
||||
7
|
||||
}
|
||||
|
||||
fn break_loops(&self) {
|
||||
|
|
@ -279,6 +276,7 @@ pub struct WlSeatObj {
|
|||
client: Rc<Client>,
|
||||
pointers: CopyHashMap<WlPointerId, Rc<WlPointer>>,
|
||||
keyboards: CopyHashMap<WlKeyboardId, Rc<WlKeyboard>>,
|
||||
version: u32,
|
||||
}
|
||||
|
||||
impl WlSeatObj {
|
||||
|
|
@ -369,7 +367,11 @@ impl Object for WlSeatObj {
|
|||
}
|
||||
|
||||
fn num_requests(&self) -> u32 {
|
||||
RELEASE + 1
|
||||
if self.version < 5 {
|
||||
GET_TOUCH + 1
|
||||
} else {
|
||||
RELEASE + 1
|
||||
}
|
||||
}
|
||||
|
||||
fn break_loops(&self) {
|
||||
|
|
|
|||
|
|
@ -18,11 +18,11 @@ const KEY: u32 = 3;
|
|||
const MODIFIERS: u32 = 4;
|
||||
const REPEAT_INFO: u32 = 5;
|
||||
|
||||
const NO_KEYMAP: u32 = 0;
|
||||
#[allow(dead_code)] const NO_KEYMAP: u32 = 0;
|
||||
pub(super) const XKB_V1: u32 = 1;
|
||||
|
||||
const RELEASED: u32 = 0;
|
||||
const PRESSED: u32 = 1;
|
||||
#[allow(dead_code)] const RELEASED: u32 = 0;
|
||||
#[allow(dead_code)] const PRESSED: u32 = 1;
|
||||
|
||||
id!(WlKeyboardId);
|
||||
|
||||
|
|
@ -48,6 +48,7 @@ impl WlKeyboard {
|
|||
})
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub fn enter(
|
||||
self: &Rc<Self>,
|
||||
serial: u32,
|
||||
|
|
@ -62,6 +63,7 @@ impl WlKeyboard {
|
|||
})
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub fn leave(self: &Rc<Self>, serial: u32, surface: WlSurfaceId) -> DynEventFormatter {
|
||||
Box::new(Leave {
|
||||
obj: self.clone(),
|
||||
|
|
@ -70,6 +72,7 @@ impl WlKeyboard {
|
|||
})
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub fn key(self: &Rc<Self>, serial: u32, time: u32, key: u32, state: u32) -> DynEventFormatter {
|
||||
Box::new(Key {
|
||||
obj: self.clone(),
|
||||
|
|
@ -80,6 +83,7 @@ impl WlKeyboard {
|
|||
})
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub fn modifiers(
|
||||
self: &Rc<Self>,
|
||||
serial: u32,
|
||||
|
|
@ -98,6 +102,7 @@ impl WlKeyboard {
|
|||
})
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub fn repeat_info(self: &Rc<Self>, rate: i32, delay: i32) -> DynEventFormatter {
|
||||
Box::new(RepeatInfo {
|
||||
obj: self.clone(),
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ const AXIS_SOURCE: u32 = 6;
|
|||
const AXIS_STOP: u32 = 7;
|
||||
const AXIS_DISCRETE: u32 = 8;
|
||||
|
||||
const ROLE: u32 = 0;
|
||||
#[allow(dead_code)] const ROLE: u32 = 0;
|
||||
|
||||
pub(super) const RELEASED: u32 = 0;
|
||||
pub(super) const PRESSED: u32 = 1;
|
||||
|
|
@ -30,10 +30,10 @@ pub(super) const PRESSED: u32 = 1;
|
|||
pub(super) const VERTICAL_SCROLL: u32 = 0;
|
||||
pub(super) const HORIZONTAL_SCROLL: u32 = 1;
|
||||
|
||||
const WHEEL: u32 = 0;
|
||||
const FINGER: u32 = 1;
|
||||
const CONTINUOUS: u32 = 2;
|
||||
const WHEEL_TILT: u32 = 3;
|
||||
#[allow(dead_code)] const WHEEL: u32 = 0;
|
||||
#[allow(dead_code)] const FINGER: u32 = 1;
|
||||
#[allow(dead_code)] const CONTINUOUS: u32 = 2;
|
||||
#[allow(dead_code)] const WHEEL_TILT: u32 = 3;
|
||||
|
||||
id!(WlPointerId);
|
||||
|
||||
|
|
@ -108,10 +108,12 @@ impl WlPointer {
|
|||
})
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub fn frame(self: &Rc<Self>) -> DynEventFormatter {
|
||||
Box::new(Frame { obj: self.clone() })
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub fn axis_source(self: &Rc<Self>, axis_source: u32) -> DynEventFormatter {
|
||||
Box::new(AxisSource {
|
||||
obj: self.clone(),
|
||||
|
|
@ -119,6 +121,7 @@ impl WlPointer {
|
|||
})
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub fn axis_stop(self: &Rc<Self>, time: u32, axis: u32) -> DynEventFormatter {
|
||||
Box::new(AxisStop {
|
||||
obj: self.clone(),
|
||||
|
|
@ -127,6 +130,7 @@ impl WlPointer {
|
|||
})
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub fn axis_discrete(self: &Rc<Self>, axis: u32, discrete: i32) -> DynEventFormatter {
|
||||
Box::new(AxisDiscrete {
|
||||
obj: self.clone(),
|
||||
|
|
|
|||
|
|
@ -9,13 +9,13 @@ pub use types::*;
|
|||
|
||||
const RELEASE: u32 = 0;
|
||||
|
||||
const DOWN: u32 = 0;
|
||||
const UP: u32 = 1;
|
||||
const MOTION: u32 = 2;
|
||||
const FRAME: u32 = 3;
|
||||
const CANCEL: u32 = 4;
|
||||
const SHAPE: u32 = 5;
|
||||
const ORIENTATION: u32 = 6;
|
||||
#[allow(dead_code)] const DOWN: u32 = 0;
|
||||
#[allow(dead_code)] const UP: u32 = 1;
|
||||
#[allow(dead_code)] const MOTION: u32 = 2;
|
||||
#[allow(dead_code)] const FRAME: u32 = 3;
|
||||
#[allow(dead_code)] const CANCEL: u32 = 4;
|
||||
#[allow(dead_code)] const SHAPE: u32 = 5;
|
||||
#[allow(dead_code)] const ORIENTATION: u32 = 6;
|
||||
|
||||
id!(WlTouchId);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue