screencapture: implement ext_output_image_capture_source_manager_v1
This commit is contained in:
parent
b754e37bfe
commit
40bce507a6
9 changed files with 228 additions and 49 deletions
54
src/ifs/ext_image_capture_source_v1.rs
Normal file
54
src/ifs/ext_image_capture_source_v1.rs
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
use {
|
||||
crate::{
|
||||
client::{Client, ClientError},
|
||||
ifs::wl_output::OutputGlobalOpt,
|
||||
leaks::Tracker,
|
||||
object::{Object, Version},
|
||||
wire::{ext_image_capture_source_v1::*, ExtImageCaptureSourceV1Id},
|
||||
},
|
||||
std::rc::Rc,
|
||||
thiserror::Error,
|
||||
};
|
||||
|
||||
#[expect(dead_code)]
|
||||
#[derive(Clone)]
|
||||
pub enum ImageCaptureSource {
|
||||
Output(Rc<OutputGlobalOpt>),
|
||||
}
|
||||
|
||||
pub struct ExtImageCaptureSourceV1 {
|
||||
pub id: ExtImageCaptureSourceV1Id,
|
||||
pub client: Rc<Client>,
|
||||
pub tracker: Tracker<Self>,
|
||||
#[expect(dead_code)]
|
||||
pub ty: ImageCaptureSource,
|
||||
}
|
||||
|
||||
impl ExtImageCaptureSourceV1RequestHandler for ExtImageCaptureSourceV1 {
|
||||
type Error = ExtImageCaptureSourceError;
|
||||
|
||||
fn destroy(&self, _req: Destroy, _slf: &Rc<Self>) -> Result<(), Self::Error> {
|
||||
self.client.remove_obj(self)?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
object_base! {
|
||||
self = ExtImageCaptureSourceV1;
|
||||
version = Version(1);
|
||||
}
|
||||
|
||||
impl Object for ExtImageCaptureSourceV1 {}
|
||||
|
||||
dedicated_add_obj!(
|
||||
ExtImageCaptureSourceV1,
|
||||
ExtImageCaptureSourceV1Id,
|
||||
image_capture_sources
|
||||
);
|
||||
|
||||
#[derive(Debug, Error)]
|
||||
pub enum ExtImageCaptureSourceError {
|
||||
#[error(transparent)]
|
||||
ClientError(Box<ClientError>),
|
||||
}
|
||||
efrom!(ExtImageCaptureSourceError, ClientError);
|
||||
Loading…
Add table
Add a link
Reference in a new issue