[][src]Struct wayland_client::cursor::Cursor

pub struct Cursor<'a> { /* fields omitted */ }

A cursor from a theme. Can contain several images if animated.

Methods

impl<'a> Cursor<'a>[src]

pub fn name(&self) -> String[src]

Retrieve the name of this cursor.

pub fn image_count(&self) -> usize[src]

Retrieve the number of images contained in this animated cursor

pub fn frame(&self, duration: u32) -> usize[src]

Retrieve the image number of cursor animation.

Returns the image number of the animation that should be displayed after a given amount of time since the beginning of the animation, in milliseconds.

pub fn frame_and_duration(&self, duration: u32) -> (usize, u32)[src]

Retrieve the image number and its duration.

Same as frame(), but also returns the number of milliseconds this frame should still be displayed.

pub fn frame_buffer(&self, frame: usize) -> Option<CursorImageBuffer>[src]

Retrieve a CursorImageBuffer containing the given image of an animation.

It can be used to be attached to a surface as a classic WlBuffer.

Returns None if the frame is out of bounds.

Note: destroying this buffer (using the destroy method) will corrupt your theme data, so you might not want to do it.

pub fn frame_info(&self, frame: usize) -> Option<(u32, u32, u32, u32, u32)>[src]

Retrieve the metadata associated with given frame of the animation.

The tuple contains: (width, height, hotspot_x, hotspot_y, delay)

Returns None if the frame is out of bounds.

Trait Implementations

impl<'a> Send for Cursor<'a>[src]

Auto Trait Implementations

impl<'a> Unpin for Cursor<'a>

impl<'a> !Sync for Cursor<'a>

impl<'a> UnwindSafe for Cursor<'a>

impl<'a> RefUnwindSafe for Cursor<'a>

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]