WlSubsurface

Struct WlSubsurface 

Source
pub struct WlSubsurface { /* private fields */ }
Expand description

A wl_subsurface object.

See the documentation of the module for the interface description.

Implementations§

Source§

impl WlSubsurface

Source

pub fn set_handler(&self, handler: impl WlSubsurfaceHandler)

Sets a new handler.

Source

pub fn set_boxed_handler(&self, handler: Box<dyn WlSubsurfaceHandler>)

Sets a new, already boxed handler.

Source§

impl WlSubsurface

Source

pub const MSG__DESTROY__SINCE: u32 = 1u32

Since when the destroy message is available.

Source

pub const MSG__SET_POSITION__SINCE: u32 = 1u32

Since when the set_position message is available.

Source

pub const MSG__PLACE_ABOVE__SINCE: u32 = 1u32

Since when the place_above message is available.

Source

pub const MSG__PLACE_BELOW__SINCE: u32 = 1u32

Since when the place_below message is available.

Source

pub const MSG__SET_SYNC__SINCE: u32 = 1u32

Since when the set_sync message is available.

Source

pub const MSG__SET_DESYNC__SINCE: u32 = 1u32

Since when the set_desync message is available.

Source

pub fn try_send_destroy(&self) -> Result<(), ObjectError>

remove sub-surface interface

The sub-surface interface is removed from the wl_surface object that was turned into a sub-surface with a wl_subcompositor.get_subsurface request. The wl_surface’s association to the parent is deleted. The wl_surface is unmapped immediately.

Source

pub fn send_destroy(&self)

remove sub-surface interface

The sub-surface interface is removed from the wl_surface object that was turned into a sub-surface with a wl_subcompositor.get_subsurface request. The wl_surface’s association to the parent is deleted. The wl_surface is unmapped immediately.

Source

pub fn try_send_set_position(&self, x: i32, y: i32) -> Result<(), ObjectError>

reposition the sub-surface

This schedules a sub-surface position change. The sub-surface will be moved so that its origin (top left corner pixel) will be at the location x, y of the parent surface coordinate system. The coordinates are not restricted to the parent surface area. Negative values are allowed.

The scheduled coordinates will take effect whenever the state of the parent surface is applied.

If more than one set_position request is invoked by the client before the commit of the parent surface, the position of a new request always replaces the scheduled position from any previous request.

The initial position is 0, 0.

§Arguments
  • x: x coordinate in the parent surface
  • y: y coordinate in the parent surface
Source

pub fn send_set_position(&self, x: i32, y: i32)

reposition the sub-surface

This schedules a sub-surface position change. The sub-surface will be moved so that its origin (top left corner pixel) will be at the location x, y of the parent surface coordinate system. The coordinates are not restricted to the parent surface area. Negative values are allowed.

The scheduled coordinates will take effect whenever the state of the parent surface is applied.

If more than one set_position request is invoked by the client before the commit of the parent surface, the position of a new request always replaces the scheduled position from any previous request.

The initial position is 0, 0.

§Arguments
  • x: x coordinate in the parent surface
  • y: y coordinate in the parent surface
Source

pub fn try_send_place_above( &self, sibling: &Rc<WlSurface>, ) -> Result<(), ObjectError>

restack the sub-surface

This sub-surface is taken from the stack, and put back just above the reference surface, changing the z-order of the sub-surfaces. The reference surface must be one of the sibling surfaces, or the parent surface. Using any other surface, including this sub-surface, will cause a protocol error.

The z-order is double-buffered. Requests are handled in order and applied immediately to a pending state. The final pending state is copied to the active state the next time the state of the parent surface is applied.

A new sub-surface is initially added as the top-most in the stack of its siblings and parent.

§Arguments
  • sibling: the reference surface
Source

pub fn send_place_above(&self, sibling: &Rc<WlSurface>)

restack the sub-surface

This sub-surface is taken from the stack, and put back just above the reference surface, changing the z-order of the sub-surfaces. The reference surface must be one of the sibling surfaces, or the parent surface. Using any other surface, including this sub-surface, will cause a protocol error.

The z-order is double-buffered. Requests are handled in order and applied immediately to a pending state. The final pending state is copied to the active state the next time the state of the parent surface is applied.

A new sub-surface is initially added as the top-most in the stack of its siblings and parent.

§Arguments
  • sibling: the reference surface
Source

pub fn try_send_place_below( &self, sibling: &Rc<WlSurface>, ) -> Result<(), ObjectError>

restack the sub-surface

The sub-surface is placed just below the reference surface. See wl_subsurface.place_above.

§Arguments
  • sibling: the reference surface
Source

pub fn send_place_below(&self, sibling: &Rc<WlSurface>)

restack the sub-surface

The sub-surface is placed just below the reference surface. See wl_subsurface.place_above.

§Arguments
  • sibling: the reference surface
Source

pub fn try_send_set_sync(&self) -> Result<(), ObjectError>

set sub-surface to synchronized mode

Change the commit behaviour of the sub-surface to synchronized mode, also described as the parent dependent mode.

In synchronized mode, wl_surface.commit on a sub-surface will accumulate the committed state in a cache, but the state will not be applied and hence will not change the compositor output. The cached state is applied to the sub-surface immediately after the parent surface’s state is applied. This ensures atomic updates of the parent and all its synchronized sub-surfaces. Applying the cached state will invalidate the cache, so further parent surface commits do not (re-)apply old state.

See wl_subsurface for the recursive effect of this mode.

Source

pub fn send_set_sync(&self)

set sub-surface to synchronized mode

Change the commit behaviour of the sub-surface to synchronized mode, also described as the parent dependent mode.

In synchronized mode, wl_surface.commit on a sub-surface will accumulate the committed state in a cache, but the state will not be applied and hence will not change the compositor output. The cached state is applied to the sub-surface immediately after the parent surface’s state is applied. This ensures atomic updates of the parent and all its synchronized sub-surfaces. Applying the cached state will invalidate the cache, so further parent surface commits do not (re-)apply old state.

See wl_subsurface for the recursive effect of this mode.

Source

pub fn try_send_set_desync(&self) -> Result<(), ObjectError>

set sub-surface to desynchronized mode

Change the commit behaviour of the sub-surface to desynchronized mode, also described as independent or freely running mode.

In desynchronized mode, wl_surface.commit on a sub-surface will apply the pending state directly, without caching, as happens normally with a wl_surface. Calling wl_surface.commit on the parent surface has no effect on the sub-surface’s wl_surface state. This mode allows a sub-surface to be updated on its own.

If cached state exists when wl_surface.commit is called in desynchronized mode, the pending state is added to the cached state, and applied as a whole. This invalidates the cache.

Note: even if a sub-surface is set to desynchronized, a parent sub-surface may override it to behave as synchronized. For details, see wl_subsurface.

If a surface’s parent surface behaves as desynchronized, then the cached state is applied on set_desync.

Source

pub fn send_set_desync(&self)

set sub-surface to desynchronized mode

Change the commit behaviour of the sub-surface to desynchronized mode, also described as independent or freely running mode.

In desynchronized mode, wl_surface.commit on a sub-surface will apply the pending state directly, without caching, as happens normally with a wl_surface. Calling wl_surface.commit on the parent surface has no effect on the sub-surface’s wl_surface state. This mode allows a sub-surface to be updated on its own.

If cached state exists when wl_surface.commit is called in desynchronized mode, the pending state is added to the cached state, and applied as a whole. This invalidates the cache.

Note: even if a sub-surface is set to desynchronized, a parent sub-surface may override it to behave as synchronized. For details, see wl_subsurface.

If a surface’s parent surface behaves as desynchronized, then the cached state is applied on set_desync.

Source§

impl WlSubsurface

Source

pub const ENM__ERROR_BAD_SURFACE__SINCE: u32 = 1u32

Since when the error.bad_surface enum variant is available.

Trait Implementations§

Source§

impl ConcreteObject for WlSubsurface

Source§

const XML_VERSION: u32 = 1u32

The interface version from the XML file that the interface was generated from.
Source§

const INTERFACE: ObjectInterface = ObjectInterface::WlSubsurface

The interface of the object.
Source§

const INTERFACE_NAME: &str = "wl_subsurface"

The interface of the object as a string.
Source§

impl Debug for WlSubsurface

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Object for WlSubsurface

Source§

fn core(&self) -> &ObjectCore

Returns the ObjectCore of this object.
Source§

fn unset_handler(&self)

Unsets the handler of this object. Read more
Source§

fn get_handler_any_ref( &self, ) -> Result<HandlerRef<'_, dyn Any>, HandlerAccessError>

Returns a shared reference to the handler.
Source§

fn get_handler_any_mut( &self, ) -> Result<HandlerMut<'_, dyn Any>, HandlerAccessError>

Returns a mutable reference to the handler.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ObjectCoreApi for T
where T: Object + ?Sized,

Source§

fn state(&self) -> &Rc<State>

Returns the State of this object.
Source§

fn client(&self) -> Option<Rc<Client>>

Returns the Client associated with this object, if any.
Source§

fn create_child<P>(&self) -> Rc<P>
where P: Object,

Creates a child of this object. Read more
Source§

fn interface(&self) -> ObjectInterface

Returns the ObjectInterface of this object.
Source§

fn version(&self) -> u32

Returns the version of this object.
Source§

fn unique_id(&self) -> u64

Returns the unique ID of this object. Read more
Source§

fn client_id(&self) -> Option<u32>

Returns the client ID of this object, if any.
Source§

fn server_id(&self) -> Option<u32>

Returns the server ID of this object, if any.
Source§

fn delete_id(&self)

Sends a wl_display.delete_id event for this object. Read more
Source§

fn try_delete_id(&self) -> Result<(), ObjectError>

Tries to send a wl_display.delete_id event for this object. Read more
Source§

fn set_forward_to_client(&self, enabled: bool)

Enables or disables automatic forwarding of events to the client. Read more
Source§

fn set_forward_to_server(&self, enabled: bool)

Enables or disables automatic forwarding of requests to the server. Read more
Source§

impl<T> ObjectUtils for T
where T: Object + ?Sized,

Source§

fn try_get_handler_ref<T>( &self, ) -> Result<HandlerRef<'_, T>, HandlerAccessError>
where T: 'static,

Tries to get a shared reference to the handler.
Source§

fn get_handler_ref<T>(&self) -> HandlerRef<'_, T>
where T: 'static,

Gets a shared reference to the handler. Read more
Source§

fn try_get_handler_mut<T>( &self, ) -> Result<HandlerMut<'_, T>, HandlerAccessError>
where T: 'static,

Tries to get a mutable reference to the handler.
Source§

fn get_handler_mut<T>(&self) -> HandlerMut<'_, T>
where T: 'static,

Gets a mutable reference to the handler. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.