[−][src]Struct wayland_client::cursor::Cursor
A cursor from a theme. Can contain several images if animated.
Implementations
impl<'a> Cursor<'a>
[src]
pub fn name(&self) -> String
[src]
Returns the name of this cursor.
pub fn image_count(&self) -> usize
[src]
Returns the number of images contained in this animated cursor
pub fn frame(&self, duration: u32) -> usize
[src]
Returns which frame of an animated cursor should be displayed at a given time.
The time is given in milliseconds after the beginning of the animation.
pub fn frame_and_duration(&self, duration: u32) -> (usize, u32)
[src]
Returns the frame number and its remaining duration.
Same as frame()
, but also returns the amount of milliseconds this
frame should continue to be displayed.
pub fn frame_buffer(&self, frame: usize) -> Option<CursorImageBuffer<'_>>
[src]
Returns a CursorImageBuffer
containing the given image of an animation.
It can 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]
Returns the metadata associated with a 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
Auto Trait Implementations
impl<'a> RefUnwindSafe for Cursor<'a>
impl<'a> !Sync for Cursor<'a>
impl<'a> Unpin for Cursor<'a>
impl<'a> UnwindSafe for Cursor<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Downcast for T where
T: Any,
[src]
T: Any,
fn into_any(self: Box<T>) -> Box<dyn Any + 'static>
[src]
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
[src]
fn as_any(&self) -> &(dyn Any + 'static)
[src]
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
[src]
impl<T> DowncastSync for T where
T: Send + Sync + Any,
[src]
T: Send + Sync + Any,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,