1
0
Fork 0
forked from wry/wry

autocommit 2022-02-05 18:14:24 CET

This commit is contained in:
Julian Orth 2022-02-05 18:14:24 +01:00
parent 2d8b3a200e
commit 3a4ae99b9a
71 changed files with 1626 additions and 1306 deletions

View file

@ -1,9 +1,9 @@
mod types;
use crate::client::DynEventFormatter;
use crate::ifs::wl_seat::WlSeatObj;
use crate::ifs::wl_seat::WlSeat;
use crate::ifs::wl_surface::WlSurfaceId;
use crate::object::{Interface, Object, ObjectId};
use crate::object::Object;
use crate::utils::buffd::MsgParser;
use std::rc::Rc;
pub use types::*;
@ -33,11 +33,11 @@ id!(WlKeyboardId);
pub struct WlKeyboard {
id: WlKeyboardId,
seat: Rc<WlSeatObj>,
seat: Rc<WlSeat>,
}
impl WlKeyboard {
pub fn new(id: WlKeyboardId, seat: &Rc<WlSeatObj>) -> Self {
pub fn new(id: WlKeyboardId, seat: &Rc<WlSeat>) -> Self {
Self {
id,
seat: seat.clone(),
@ -152,32 +152,18 @@ impl WlKeyboard {
self.seat.client.remove_obj(self)?;
Ok(())
}
fn handle_request_(
&self,
request: u32,
parser: MsgParser<'_, '_>,
) -> Result<(), WlKeyboardError> {
match request {
RELEASE => self.release(parser)?,
_ => unreachable!(),
}
Ok(())
}
}
handle_request!(WlKeyboard);
object_base! {
WlKeyboard, WlKeyboardError;
RELEASE => release,
}
impl Object for WlKeyboard {
fn id(&self) -> ObjectId {
self.id.into()
}
fn interface(&self) -> Interface {
Interface::WlKeyboard
}
fn num_requests(&self) -> u32 {
RELEASE + 1
}
}
simple_add_obj!(WlKeyboard);