wayland: implement ext-transient-seat-v1
This commit is contained in:
parent
b924393746
commit
25f363d086
9 changed files with 178 additions and 0 deletions
48
src/ifs/wl_seat/ext_transient_seat_v1.rs
Normal file
48
src/ifs/wl_seat/ext_transient_seat_v1.rs
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
use {
|
||||
crate::{
|
||||
client::{Client, ClientError},
|
||||
leaks::Tracker,
|
||||
object::{Object, Version},
|
||||
wire::{ext_transient_seat_v1::*, ExtTransientSeatV1Id},
|
||||
},
|
||||
std::rc::Rc,
|
||||
thiserror::Error,
|
||||
};
|
||||
|
||||
pub struct ExtTransientSeatV1 {
|
||||
pub id: ExtTransientSeatV1Id,
|
||||
pub client: Rc<Client>,
|
||||
pub tracker: Tracker<Self>,
|
||||
pub version: Version,
|
||||
}
|
||||
|
||||
impl ExtTransientSeatV1 {
|
||||
pub fn send_denied(&self) {
|
||||
self.client.event(Denied { self_id: self.id });
|
||||
}
|
||||
}
|
||||
|
||||
impl ExtTransientSeatV1RequestHandler for ExtTransientSeatV1 {
|
||||
type Error = ExtTransientSeatV1Error;
|
||||
|
||||
fn destroy(&self, _req: Destroy, _slf: &Rc<Self>) -> Result<(), Self::Error> {
|
||||
self.client.remove_obj(self)?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
object_base! {
|
||||
self = ExtTransientSeatV1;
|
||||
version = self.version;
|
||||
}
|
||||
|
||||
impl Object for ExtTransientSeatV1 {}
|
||||
|
||||
simple_add_obj!(ExtTransientSeatV1);
|
||||
|
||||
#[derive(Debug, Error)]
|
||||
pub enum ExtTransientSeatV1Error {
|
||||
#[error(transparent)]
|
||||
ClientError(Box<ClientError>),
|
||||
}
|
||||
efrom!(ExtTransientSeatV1Error, ClientError);
|
||||
Loading…
Add table
Add a link
Reference in a new issue