Struct wayland_protocols::viewporter::client::wp_viewport::WpViewport
source · pub struct WpViewport(/* private fields */);
Implementations§
source§impl WpViewport
impl WpViewport
sourcepub fn destroy(&self)
pub fn destroy(&self)
remove scaling and cropping from the surface
The associated wl_surface’s crop and scale state is removed. The change is applied on the next wl_surface.commit.
This is a destructor, you cannot send requests to this object any longer once this method is called.
sourcepub fn set_source(&self, x: f64, y: f64, width: f64, height: f64)
pub fn set_source(&self, x: f64, y: f64, width: f64, height: f64)
set the source rectangle for cropping
Set the source rectangle of the associated wl_surface. See wp_viewport for the description, and relation to the wl_buffer size.
If all of x, y, width and height are -1.0, the source rectangle is unset instead. Any other set of values where width or height are zero or negative, or x or y are negative, raise the bad_value protocol error.
The crop and scale state is double-buffered state, and will be applied on the next wl_surface.commit.
sourcepub fn set_destination(&self, width: i32, height: i32)
pub fn set_destination(&self, width: i32, height: i32)
set the surface size for scaling
Set the destination size of the associated wl_surface. See wp_viewport for the description, and relation to the wl_buffer size.
If width is -1 and height is -1, the destination size is unset instead. Any other pair of values for width and height that contains zero or negative values raises the bad_value protocol error.
The crop and scale state is double-buffered state, and will be applied on the next wl_surface.commit.
Trait Implementations§
source§impl AsRef<Proxy<WpViewport>> for WpViewport
impl AsRef<Proxy<WpViewport>> for WpViewport
source§impl Clone for WpViewport
impl Clone for WpViewport
source§fn clone(&self) -> WpViewport
fn clone(&self) -> WpViewport
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for WpViewport
impl Debug for WpViewport
source§impl From<Proxy<WpViewport>> for WpViewport
impl From<Proxy<WpViewport>> for WpViewport
source§impl From<WpViewport> for Proxy<WpViewport>
impl From<WpViewport> for Proxy<WpViewport>
source§fn from(value: WpViewport) -> Self
fn from(value: WpViewport) -> Self
source§impl Interface for WpViewport
impl Interface for WpViewport
source§fn c_interface() -> *const wl_interface
fn c_interface() -> *const wl_interface
source§impl PartialEq for WpViewport
impl PartialEq for WpViewport
source§fn eq(&self, other: &WpViewport) -> bool
fn eq(&self, other: &WpViewport) -> bool
self
and other
values to be equal, and is used
by ==
.