[−][src]Struct wlroots::cursor::xcursor::XCursor
Wrapper for an xcursor from the X11 xcursor library.
The cursor must live as long as the Theme
that it comes from.
Methods
impl<'theme> XCursor<'theme>
[src]
impl<'theme> XCursor<'theme>
pub fn images<'cursor>(&'cursor self) -> Vec<Image<'cursor>>
[src]
pub fn images<'cursor>(&'cursor self) -> Vec<Image<'cursor>>
Get all the image frames associated with an xcursor.
pub fn image<'cursor>(&'cursor self, index: usize) -> Option<Image<'cursor>>
[src]
pub fn image<'cursor>(&'cursor self, index: usize) -> Option<Image<'cursor>>
Get a specific frame of the image from the animation. Returns None
if
the index is out of bounds.
We suggest paring this with XCursor::frame
to avoid going out of bounds.
pub fn frame(&mut self, duration: Duration) -> usize
[src]
pub fn frame(&mut self, duration: Duration) -> usize
Returns the current frame number for an animated cursor give a monotonic time reference in milliseconds.
e.g. if it's been animating for 500 milliseconds duration
should be constructed from Duration::from_millis(500)
.
pub fn image_len(&self) -> usize
[src]
pub fn image_len(&self) -> usize
Get the number of animation frames for the cursor.
pub fn total_delay(&self) -> u32
[src]
pub fn total_delay(&self) -> u32
Length of the animation in milliseconds.
pub unsafe fn from_ptr<'unbound>(xcursor: *mut wlr_xcursor) -> XCursor<'unbound>
[src]
pub unsafe fn from_ptr<'unbound>(xcursor: *mut wlr_xcursor) -> XCursor<'unbound>
Constructs an XCursor
from a raw pointer
Unsafety
This lifetime is unbounded, but it must not outlive the xcursor manager that the pointer came from.
Trait Implementations
impl<'theme> Eq for XCursor<'theme>
[src]
impl<'theme> Eq for XCursor<'theme>
impl<'theme> PartialOrd<XCursor<'theme>> for XCursor<'theme>
[src]
impl<'theme> PartialOrd<XCursor<'theme>> for XCursor<'theme>
fn partial_cmp(&self, other: &XCursor<'theme>) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &XCursor<'theme>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &XCursor<'theme>) -> bool
[src]
fn lt(&self, other: &XCursor<'theme>) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &XCursor<'theme>) -> bool
[src]
fn le(&self, other: &XCursor<'theme>) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &XCursor<'theme>) -> bool
[src]
fn gt(&self, other: &XCursor<'theme>) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &XCursor<'theme>) -> bool
[src]
fn ge(&self, other: &XCursor<'theme>) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<'theme> PartialEq<XCursor<'theme>> for XCursor<'theme>
[src]
impl<'theme> PartialEq<XCursor<'theme>> for XCursor<'theme>
fn eq(&self, other: &XCursor<'theme>) -> bool
[src]
fn eq(&self, other: &XCursor<'theme>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &XCursor<'theme>) -> bool
[src]
fn ne(&self, other: &XCursor<'theme>) -> bool
This method tests for !=
.
impl<'theme> Ord for XCursor<'theme>
[src]
impl<'theme> Ord for XCursor<'theme>
fn cmp(&self, other: &XCursor<'theme>) -> Ordering
[src]
fn cmp(&self, other: &XCursor<'theme>) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
impl<'theme> Hash for XCursor<'theme>
[src]
impl<'theme> Hash for XCursor<'theme>
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<'theme> Debug for XCursor<'theme>
[src]
impl<'theme> Debug for XCursor<'theme>
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
try_from
)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
try_from
)Performs the conversion.
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Gets the TypeId
of self
. Read more