wire: generate trait for request handling
This commit is contained in:
parent
e3a1a0b30f
commit
acb391335b
102 changed files with 1632 additions and 2086 deletions
|
|
@ -4,7 +4,6 @@ use {
|
|||
ifs::wl_seat::WlSeat,
|
||||
leaks::Tracker,
|
||||
object::Object,
|
||||
utils::buffd::{MsgParser, MsgParserError},
|
||||
wire::{wl_touch::*, WlTouchId},
|
||||
},
|
||||
std::rc::Rc,
|
||||
|
|
@ -40,9 +39,12 @@ impl WlTouch {
|
|||
tracker: Default::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn release(&self, parser: MsgParser<'_, '_>) -> Result<(), WlTouchError> {
|
||||
let _req: Release = self.seat.client.parse(self, parser)?;
|
||||
impl WlTouchRequestHandler for WlTouch {
|
||||
type Error = WlTouchError;
|
||||
|
||||
fn release(&self, _req: Release, _slf: &Rc<Self>) -> Result<(), Self::Error> {
|
||||
self.seat.client.remove_obj(self)?;
|
||||
Ok(())
|
||||
}
|
||||
|
|
@ -50,8 +52,7 @@ impl WlTouch {
|
|||
|
||||
object_base! {
|
||||
self = WlTouch;
|
||||
|
||||
RELEASE => release if self.seat.version >= 3,
|
||||
version = self.seat.version;
|
||||
}
|
||||
|
||||
impl Object for WlTouch {}
|
||||
|
|
@ -62,8 +63,5 @@ simple_add_obj!(WlTouch);
|
|||
pub enum WlTouchError {
|
||||
#[error(transparent)]
|
||||
ClientError(Box<ClientError>),
|
||||
#[error("Parsing failed")]
|
||||
MsgParserError(#[source] Box<MsgParserError>),
|
||||
}
|
||||
efrom!(WlTouchError, ClientError);
|
||||
efrom!(WlTouchError, MsgParserError);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue