Documentation
¶
Overview ¶
Package xcursor reads Xcursor files and resolves cursor themes the way libXcursor does: XCURSOR_PATH, theme inheritance and nominal sizes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Shapes = []Shape{ {"default", []string{"left_ptr"}}, {"context-menu", []string{"left_ptr"}}, {"help", []string{"question_arrow", "left_ptr"}}, {"pointer", []string{"hand2", "hand1"}}, {"progress", []string{"left_ptr_watch", "watch"}}, {"wait", []string{"watch"}}, {"cell", []string{"plus"}}, {"crosshair", []string{"cross", "tcross"}}, {"text", []string{"xterm"}}, {"vertical-text", []string{"xterm"}}, {"alias", []string{"dnd-link"}}, {"copy", []string{"dnd-copy"}}, {"move", []string{"fleur", "dnd-move"}}, {"no-drop", []string{"dnd-none", "crossed_circle"}}, {"not-allowed", []string{"crossed_circle"}}, {"grab", []string{"openhand", "hand1"}}, {"grabbing", []string{"closedhand", "fleur"}}, {"e-resize", []string{"right_side"}}, {"n-resize", []string{"top_side"}}, {"ne-resize", []string{"top_right_corner"}}, {"nw-resize", []string{"top_left_corner"}}, {"s-resize", []string{"bottom_side"}}, {"se-resize", []string{"bottom_right_corner"}}, {"sw-resize", []string{"bottom_left_corner"}}, {"w-resize", []string{"left_side"}}, {"ew-resize", []string{"sb_h_double_arrow"}}, {"ns-resize", []string{"sb_v_double_arrow"}}, {"nesw-resize", []string{"fd_double_arrow"}}, {"nwse-resize", []string{"bd_double_arrow"}}, {"col-resize", []string{"sb_h_double_arrow"}}, {"row-resize", []string{"sb_v_double_arrow"}}, {"all-scroll", []string{"fleur"}}, {"zoom-in", []string{"left_ptr"}}, {"zoom-out", []string{"left_ptr"}}, {"dnd-ask", []string{"dnd-copy"}}, {"all-resize", []string{"fleur"}}, }
Shapes is cursor-shape-v1's shapes in protocol order, the first being its value 1.
Functions ¶
func SearchPath ¶
SearchPath lists the directories a theme is looked for in: XCURSOR_PATH, else the XDG data directories' icons, ~/.icons and /usr/share/pixmaps.
Types ¶
type Image ¶
Image is one cursor frame. Pixels are as the file stores them, premultiplied ARGB32 in little-endian bytes, which is what wl_shm's argb8888 means, four bytes a pixel with no padding. Delay is how long the frame of an animated cursor shows, in milliseconds.
func Builtin ¶
Builtin draws an arrow of the given size for a machine with no cursor theme, its tip at the hotspot.
func Nearest ¶
Nearest reads the first image of the size nearest to want, leaving the rest of the file unread.
func NearestFrames ¶
NearestFrames reads every frame of the size nearest to want, in file order: the frames of a cursor that is animated at that size. Frames stored one after the other, as xcursorgen writes them, cost one read and share one allocation; their Pixels must not be appended to.
func ReadWidest ¶
ReadWidest reads the widest image of the Xcursor file at path.
type Theme ¶
type Theme struct {
// contains filtered or unexported fields
}
Theme is a cursor theme resolved through its Inherits.
func Open ¶
Open resolves the theme's cursor directories along searchPath, the theme first and then what it inherits. A theme with no cursors anywhere is an error; a malformed index.theme is too.