xcursor

package
v0.50.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: BSD-2-Clause Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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.

Types

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
y or Y : Canonical URL