1
0
Fork 0
forked from wry/wry

wayland: use code generation for wl_usr event handlers

This commit is contained in:
Julian Orth 2024-07-24 15:56:18 +02:00
parent b359b2648d
commit 084fe50259
49 changed files with 554 additions and 524 deletions

View file

@ -1,5 +1,6 @@
use {
crate::{
object::Version,
wire::{wp_viewporter::*, WpViewporterId},
wl_usr::{
usr_ifs::{usr_wl_surface::UsrWlSurface, usr_wp_viewport::UsrWpViewport},
@ -7,12 +8,13 @@ use {
UsrCon,
},
},
std::rc::Rc,
std::{convert::Infallible, rc::Rc},
};
pub struct UsrWpViewporter {
pub id: WpViewporterId,
pub con: Rc<UsrCon>,
pub version: Version,
}
impl UsrWpViewporter {
@ -20,6 +22,7 @@ impl UsrWpViewporter {
let wv = Rc::new(UsrWpViewport {
id: self.con.id(),
con: self.con.clone(),
version: self.version,
});
self.con.add_object(wv.clone());
self.con.request(GetViewport {
@ -31,8 +34,13 @@ impl UsrWpViewporter {
}
}
impl WpViewporterEventHandler for UsrWpViewporter {
type Error = Infallible;
}
usr_object_base! {
UsrWpViewporter, WpViewporter;
self = UsrWpViewporter = WpViewporter;
version = self.version;
}
impl UsrObject for UsrWpViewporter {