wayland: add a generic wayland client
This commit is contained in:
parent
163adbd893
commit
2512470231
34 changed files with 2627 additions and 1 deletions
43
src/wl_usr/usr_ifs/usr_wp_viewport.rs
Normal file
43
src/wl_usr/usr_ifs/usr_wp_viewport.rs
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
use {
|
||||
crate::{
|
||||
fixed::Fixed,
|
||||
wire::{wp_viewport::*, WpViewportId},
|
||||
wl_usr::{usr_object::UsrObject, UsrCon},
|
||||
},
|
||||
std::rc::Rc,
|
||||
};
|
||||
|
||||
pub struct UsrWpViewport {
|
||||
pub id: WpViewportId,
|
||||
pub con: Rc<UsrCon>,
|
||||
}
|
||||
|
||||
impl UsrWpViewport {
|
||||
pub fn set_source(&self, x: Fixed, y: Fixed, width: Fixed, height: Fixed) {
|
||||
self.con.request(SetSource {
|
||||
self_id: self.id,
|
||||
x,
|
||||
y,
|
||||
width,
|
||||
height,
|
||||
});
|
||||
}
|
||||
|
||||
pub fn set_destination(&self, width: i32, height: i32) {
|
||||
self.con.request(SetDestination {
|
||||
self_id: self.id,
|
||||
width,
|
||||
height,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
usr_object_base! {
|
||||
UsrWpViewport, WpViewport;
|
||||
}
|
||||
|
||||
impl UsrObject for UsrWpViewport {
|
||||
fn destroy(&self) {
|
||||
self.con.request(Destroy { self_id: self.id });
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue