-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
use smithay_client_toolkit::{ | ||
delegate_image_copy_capture, | ||
image_copy_capture::{ | ||
BufferConstraints, Frame, ImageCopyCaptureHandler, ImageCopyCaptureState, | ||
ImageCopyFrameData, ImageCopyFrameDataExt, ImageCopySessionData, ImageCopySessionDataExt, | ||
}, | ||
}; | ||
use wayland_client::{Connection, QueueHandle, WEnum}; | ||
use wayland_protocols::ext::image_copy_capture::v1::client::{ | ||
ext_image_copy_capture_cursor_session_v1, ext_image_copy_capture_frame_v1, | ||
Check warning on line 10 in examples/image_copy_capture.rs GitHub Actions / test (stable)
|
||
ext_image_copy_capture_manager_v1, ext_image_copy_capture_session_v1, | ||
}; | ||
|
||
struct State { | ||
image_copy_capture_state: ImageCopyCaptureState, | ||
} | ||
|
||
struct SessionData { | ||
session_data: ImageCopySessionData, | ||
} | ||
|
||
impl ImageCopySessionDataExt for SessionData { | ||
fn image_copy_session_data(&self) -> &ImageCopySessionData { | ||
&self.session_data | ||
} | ||
} | ||
|
||
struct FrameData { | ||
frame_data: ImageCopyFrameData, | ||
} | ||
|
||
impl ImageCopyFrameDataExt for FrameData { | ||
fn image_copy_frame_data(&self) -> &ImageCopyFrameData { | ||
&self.frame_data | ||
} | ||
} | ||
|
||
struct CursorSessionData {} | ||
|
||
fn main() {} | ||
|
||
impl ImageCopyCaptureHandler for State { | ||
fn image_copy_capture_state(&mut self) -> &mut ImageCopyCaptureState { | ||
&mut self.image_copy_capture_state | ||
} | ||
|
||
fn buffer_constraints( | ||
&mut self, | ||
conn: &Connection, | ||
Check warning on line 49 in examples/image_copy_capture.rs GitHub Actions / test (stable)
|
||
qh: &QueueHandle<Self>, | ||
Check warning on line 50 in examples/image_copy_capture.rs GitHub Actions / test (stable)
|
||
session: &ext_image_copy_capture_session_v1::ExtImageCopyCaptureSessionV1, | ||
Check warning on line 51 in examples/image_copy_capture.rs GitHub Actions / test (stable)
|
||
constraints: BufferConstraints, | ||
Check warning on line 52 in examples/image_copy_capture.rs GitHub Actions / test (stable)
|
||
) { | ||
} | ||
|
||
fn stopped( | ||
&mut self, | ||
conn: &Connection, | ||
Check warning on line 58 in examples/image_copy_capture.rs GitHub Actions / test (stable)
|
||
qh: &QueueHandle<Self>, | ||
Check warning on line 59 in examples/image_copy_capture.rs GitHub Actions / test (stable)
|
||
session: &ext_image_copy_capture_session_v1::ExtImageCopyCaptureSessionV1, | ||
Check warning on line 60 in examples/image_copy_capture.rs GitHub Actions / test (stable)
|
||
) { | ||
} | ||
|
||
fn ready( | ||
&mut self, | ||
conn: &Connection, | ||
qh: &QueueHandle<Self>, | ||
image_copy_frame: &ext_image_copy_capture_frame_v1::ExtImageCopyCaptureFrameV1, | ||
frame: Frame, | ||
) { | ||
} | ||
|
||
fn failed( | ||
&mut self, | ||
conn: &Connection, | ||
qh: &QueueHandle<Self>, | ||
image_copy_frame: &ext_image_copy_capture_frame_v1::ExtImageCopyCaptureFrameV1, | ||
reason: WEnum<ext_image_copy_capture_frame_v1::FailureReason>, | ||
) { | ||
} | ||
} | ||
|
||
delegate_image_copy_capture!(State, session: [SessionData], frame: [FrameData], cursor_session: [CursorSessionData]); |