[−][src]Struct wlroots::cursor::xcursor::Theme
Wrapper for an xcursor theme from the X11 xcursor library.
Xcursor (mostly) follows the freedesktop.org spec for theming icons.
Methods
impl Theme
[src]
impl Theme
pub fn load_theme<T: Into<Option<String>>>(name: T, size: c_int) -> Option<Self>
[src]
pub fn load_theme<T: Into<Option<String>>>(name: T, size: c_int) -> Option<Self>
Loads the named xcursor theme at the given cursor size (in pixels).
This is useful if you need cursor images for your compositor to use when a client-side cursors is not available or you wish to override client-side cursors for a particular UI interaction (such as using a grab cursor when moving a window around)
The default search path it uses is ~/.icons, /usr/share/icons, /usr/share/pixmaps. Within each of these directories, it searches for a directory using the theme name. Within the theme directory, it looks for cursor files in the 'cursors' subdirectory. It uses the first cursor file found along the path.
If necessary, Xcursor also looks for a "index.theme" file in each theme directory to find inherited themes and searches along the path for those themes as well.
If no name is given, defaults to "default".
If no theme can be found None
is returned.
pub fn name(&self) -> Option<String>
[src]
pub fn name(&self) -> Option<String>
Get the name of this theme.
If the name returned by wlroots was malformed, or nonexistent, then the value will be None.
pub fn size(&self) -> c_int
[src]
pub fn size(&self) -> c_int
Get the size of the images.
pub fn cursor_count(&self) -> usize
[src]
pub fn cursor_count(&self) -> usize
Get the number of cursors in this theme.
pub fn cursors<'theme>(&'theme mut self) -> Vec<XCursor<'theme>>
[src]
pub fn cursors<'theme>(&'theme mut self) -> Vec<XCursor<'theme>>
Gets all the cursors from this theme.
pub fn get_cursor<'theme>(&'theme self, name: String) -> Option<XCursor<'theme>>
[src]
pub fn get_cursor<'theme>(&'theme self, name: String) -> Option<XCursor<'theme>>
Get the cursor with the provided name (e.g. "left_ptr"), if it exists.
pub unsafe fn from_ptr(theme: *mut wlr_xcursor_theme) -> Theme
[src]
pub unsafe fn from_ptr(theme: *mut wlr_xcursor_theme) -> Theme
Constructs a Theme
from a raw pointer.
Unsafety
Takes ownership of the cursor theme. When the Theme
is dropped it
calls wlr_cursor_theme_destroy
.
Trait Implementations
impl Drop for Theme
[src]
impl Drop for Theme
impl Eq for Theme
[src]
impl Eq for Theme
impl PartialOrd<Theme> for Theme
[src]
impl PartialOrd<Theme> for Theme
fn partial_cmp(&self, other: &Theme) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &Theme) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Theme) -> bool
[src]
fn lt(&self, other: &Theme) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Theme) -> bool
[src]
fn le(&self, other: &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: &Theme) -> bool
[src]
fn gt(&self, other: &Theme) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Theme) -> bool
[src]
fn ge(&self, other: &Theme) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl PartialEq<Theme> for Theme
[src]
impl PartialEq<Theme> for Theme
fn eq(&self, other: &Theme) -> bool
[src]
fn eq(&self, other: &Theme) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Theme) -> bool
[src]
fn ne(&self, other: &Theme) -> bool
This method tests for !=
.
impl Ord for Theme
[src]
impl Ord for Theme
fn cmp(&self, other: &Theme) -> Ordering
[src]
fn cmp(&self, other: &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 Hash for Theme
[src]
impl Hash for 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 Debug for Theme
[src]
impl Debug for 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