Class wl_cursor_theme
A wl_cursor_theme is a set of wl_cursors with a unified appearance.
Thus the normal workflow is to load a cursor theme through load
and to then retrieve the needed wl_cursor through get_cursor.
Once you got a wl_cursor, you can access its wl_cursor_images through
the wl_cursor.image property. Then you can get the images buffer
with the wl_cursor_image.get_buffer method. After that you can attach the
buffer to a surface and run set_cursor
on the surface whose cursor you want
to set.
You can look up on how it can be done in the xdg_top.lua example.
See also:
Usage:
local ctheme = wau.wl_cursor_theme.load(nil, 24, shm) local cursor = ctheme:get_cursor("cross")
Methods
wl_cursor_theme:load (name, size, shm) | Load a cursor theme to memory shared with the compositor |
wl_cursor_theme:destroy () | Destroys a cursor theme object |
wl_cursor_theme:get_cursor (name) | Get the cursor for a given name from a cursor theme |
Methods
- wl_cursor_theme:load (name, size, shm)
-
Load a cursor theme to memory shared with the compositor
Parameters:
- name
string
The name of the cursor theme to load. If
nil
, the default theme will be loaded. - size integer Desired size of the cursor images.
- shm wl_shm The compositor's shm interface.
Returns:
-
wl_cursor_theme
An object representing the theme that
Usage:
-- issue with ldoc: This is a static function / constructor and not a method local ctheme = wau.wl_cursor_theme.load(name, size, shm)
- name
string
The name of the cursor theme to load. If
- wl_cursor_theme:destroy ()
- Destroys a cursor theme object
- wl_cursor_theme:get_cursor (name)
-
Get the cursor for a given name from a cursor theme
Parameters:
- name string Name of the desired cursor
Returns:
-
wl_cursor
The theme's cursor of the given name or %NULL if there is no such cursor