pub struct ZcosmicScreencopyFrameV2 { /* private fields */ }
Expand description
screen capture frame
This object represents a screen capture frame.
The client should attach a buffer, damage the buffer, and then send a capture request.
If the screen capture is successful, the compositor will send the frame metadata (transform, damage, presentation_time in any order) followed by the ready event.
If the screen capture fails, the compositor will send the failed event.
See also the Event enum for this interface.
Implementations§
Source§impl ZcosmicScreencopyFrameV2
impl ZcosmicScreencopyFrameV2
Sourcepub fn destroy(&self)
pub fn destroy(&self)
destroy this object
Destroys the session. This request can be sent at any time by the client.
Sourcepub fn attach_buffer(&self, buffer: &WlBuffer)
pub fn attach_buffer(&self, buffer: &WlBuffer)
attach buffer to session
Attach a buffer to the session.
The wl_buffer.release request is unused.
This request must not be sent after capture, or else the already_captured protocol error is raised.
Sourcepub fn damage_buffer(&self, x: i32, y: i32, width: i32, height: i32)
pub fn damage_buffer(&self, x: i32, y: i32, width: i32, height: i32)
damage buffer
Apply damage to the buffer which is to be captured next. This request may be sent multiple times to describe a region.
The client indicates the accumulated damage since this wl_buffer was last captured. During capture, the compositor will update the buffer with at least the union of the region passed by the client and the region advertised by zcosmic_screencopy_frame_v2.damage.
When a wl_buffer is captured for the first time, or when the client doesn’t track damage, the client must damage the whole buffer.
This is for optimisation purposes. The compositor may use this information to reduce copying.
These coordinates originate from the upper left corner of the buffer.
If x or y are strictly negative, or if width or height are negative or zero, the invalid_buffer_damage protocol error is raised.
This request must not be sent after capture, or else the already_captured protocol error is raised.
Sourcepub fn capture(&self)
pub fn capture(&self)
capture a frame
Capture a frame.
Unless this is the first successful captured frame performed in this session, the compositor may wait an indefinite amount of time for the source content to change before performing the copy.
This request may only be sent once, or else the already_captured protocol error is raised. A buffer must be attached before this request is sent, or else the no_buffer protocol error is raised.
Trait Implementations§
Source§impl Borrow<ObjectId> for ZcosmicScreencopyFrameV2
impl Borrow<ObjectId> for ZcosmicScreencopyFrameV2
Source§impl Clone for ZcosmicScreencopyFrameV2
impl Clone for ZcosmicScreencopyFrameV2
Source§fn clone(&self) -> ZcosmicScreencopyFrameV2
fn clone(&self) -> ZcosmicScreencopyFrameV2
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ZcosmicScreencopyFrameV2
impl Debug for ZcosmicScreencopyFrameV2
Source§impl Hash for ZcosmicScreencopyFrameV2
impl Hash for ZcosmicScreencopyFrameV2
Source§impl PartialEq<Weak<ZcosmicScreencopyFrameV2>> for ZcosmicScreencopyFrameV2
impl PartialEq<Weak<ZcosmicScreencopyFrameV2>> for ZcosmicScreencopyFrameV2
Source§impl PartialEq for ZcosmicScreencopyFrameV2
impl PartialEq for ZcosmicScreencopyFrameV2
Source§impl Proxy for ZcosmicScreencopyFrameV2
impl Proxy for ZcosmicScreencopyFrameV2
Source§fn data<U: Send + Sync + 'static>(&self) -> Option<&U>
fn data<U: Send + Sync + 'static>(&self) -> Option<&U>
Source§fn object_data(&self) -> Option<&Arc<dyn ObjectData>>
fn object_data(&self) -> Option<&Arc<dyn ObjectData>>
Source§fn backend(&self) -> &WeakBackend
fn backend(&self) -> &WeakBackend
Source§fn send_request(&self, req: Self::Request<'_>) -> Result<(), InvalidId>
fn send_request(&self, req: Self::Request<'_>) -> Result<(), InvalidId>
Source§fn send_constructor<I: Proxy>(
&self,
req: Self::Request<'_>,
data: Arc<dyn ObjectData>,
) -> Result<I, InvalidId>
fn send_constructor<I: Proxy>( &self, req: Self::Request<'_>, data: Arc<dyn ObjectData>, ) -> Result<I, InvalidId>
Source§fn from_id(conn: &Connection, id: ObjectId) -> Result<Self, InvalidId>
fn from_id(conn: &Connection, id: ObjectId) -> Result<Self, InvalidId>
Source§fn inert(backend: WeakBackend) -> Self
fn inert(backend: WeakBackend) -> Self
Source§fn parse_event(
conn: &Connection,
msg: Message<ObjectId, OwnedFd>,
) -> Result<(Self, Self::Event), DispatchError>
fn parse_event( conn: &Connection, msg: Message<ObjectId, OwnedFd>, ) -> Result<(Self, Self::Event), DispatchError>
Source§fn write_request<'a>(
&self,
conn: &Connection,
msg: Self::Request<'a>,
) -> Result<(Message<ObjectId, BorrowedFd<'a>>, Option<(&'static Interface, u32)>), InvalidId>
fn write_request<'a>( &self, conn: &Connection, msg: Self::Request<'a>, ) -> Result<(Message<ObjectId, BorrowedFd<'a>>, Option<(&'static Interface, u32)>), InvalidId>
impl Eq for ZcosmicScreencopyFrameV2
Auto Trait Implementations§
impl Freeze for ZcosmicScreencopyFrameV2
impl !RefUnwindSafe for ZcosmicScreencopyFrameV2
impl Send for ZcosmicScreencopyFrameV2
impl Sync for ZcosmicScreencopyFrameV2
impl Unpin for ZcosmicScreencopyFrameV2
impl !UnwindSafe for ZcosmicScreencopyFrameV2
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.