Version: v0.0.0-...-24e3d11 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Jun 14, 2021 License: BSD-2-Clause Imports: 6 Imported by: 0



Package xcursor is Go port of libxcursor functions required by wayland/cursor



This section is empty.


This section is empty.


func LoadTheme

func LoadTheme(theme string, size int, loadCallback func(name string, images []Image))

LoadTheme loads all the cursor images of a given theme and its inherited themes. Each cursor is loaded into []Image which is passed to the caller's load callback. If a cursor appears more than once across all the inherited themes, the load callback will be called multiple times, with possibly different []Image which have the same name.

theme: The name of theme that should be loaded
size: The desired size of the cursor images
loadCallback: A callback function that will be called
 for each cursor loaded. The first parameter is name of the cursor
 representing the loaded cursor and the second is []Image representing
 the cursor's animated frames, for static ones slice will contain single image.


type Image

type Image struct {
	Version  uint32 // version of the image data
	Size     uint32 // nominal size for matching
	Width    uint32 // actual width
	Height   uint32 // actual height
	HotspotX uint32 // hot spot x (must be inside image)
	HotspotY uint32 // hot spot y (must be inside image)
	Delay    uint32 // animation delay to next frame (ms)
	Pixels   []byte // pointer to pixels

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL