autocommit 2022-04-13 21:01:32 CEST
This commit is contained in:
parent
661a28e5b0
commit
916e3644c3
30 changed files with 681 additions and 73 deletions
57
src/ifs/jay_screenshot.rs
Normal file
57
src/ifs/jay_screenshot.rs
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
use {
|
||||
crate::{
|
||||
client::Client,
|
||||
leaks::Tracker,
|
||||
object::Object,
|
||||
wire::{jay_screenshot::*, JayScreenshotId},
|
||||
},
|
||||
std::rc::Rc,
|
||||
uapi::OwnedFd,
|
||||
};
|
||||
|
||||
pub struct JayScreenshot {
|
||||
pub id: JayScreenshotId,
|
||||
pub client: Rc<Client>,
|
||||
pub tracker: Tracker<Self>,
|
||||
}
|
||||
|
||||
impl JayScreenshot {
|
||||
pub fn send_dmabuf(
|
||||
&self,
|
||||
drm_dev: &Rc<OwnedFd>,
|
||||
fd: &Rc<OwnedFd>,
|
||||
width: i32,
|
||||
height: i32,
|
||||
offset: u32,
|
||||
stride: u32,
|
||||
) {
|
||||
self.client.event(Dmabuf {
|
||||
self_id: self.id,
|
||||
drm_dev: drm_dev.clone(),
|
||||
fd: fd.clone(),
|
||||
width: width as _,
|
||||
height: height as _,
|
||||
offset,
|
||||
stride,
|
||||
});
|
||||
}
|
||||
|
||||
pub fn send_error(&self, msg: &str) {
|
||||
self.client.event(Error {
|
||||
self_id: self.id,
|
||||
msg,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
object_base2! {
|
||||
JayScreenshot;
|
||||
}
|
||||
|
||||
impl Object for JayScreenshot {
|
||||
fn num_requests(&self) -> u32 {
|
||||
0
|
||||
}
|
||||
}
|
||||
|
||||
simple_add_obj!(JayScreenshot);
|
||||
Loading…
Add table
Add a link
Reference in a new issue