Documentation ¶
Overview ¶
Package cursor is Go port of wayland/cursor library
Index ¶
Constants ¶
const ( BottomLeftCorner = "bottom_left_corner" BottomRightCorner = "bottom_right_corner" BottomSide = "bottom_side" Grabbing = "grabbing" LeftPtr = "left_ptr" LeftSide = "left_side" RightSide = "right_side" TopLeftCorner = "top_left_corner" TopRightCorner = "top_right_corner" TopSide = "top_side" Xterm = "xterm" Hand1 = "hand1" Watch = "watch" )
interesting cursor icons.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cursor ¶
type Cursor struct { // slice of still images composing this animation Images []Image // name of this cursor Name string // contains filtered or unexported fields }
Cursor as returned by Theme.GetCursor()
func (*Cursor) Frame ¶
Frame finds the frame for a given elapsed time in a cursor animation
cursor: The cursor time: Elapsed time in ms since the beginning of the animation
Returns the index of the image that should be displayed for the given time in the cursor animation.
func (*Cursor) FrameAndDuration ¶
FrameAndDuration finds the frame for a given elapsed time in a cursor animation as well as the time left until next cursor change.
cursor: The cursor time: Elapsed time in ms since the beginning of the animation duration: Time left for this image or zero if the cursor won't change.
Returns the index of the image that should be displayed for the given time in the cursor animation and updated duration.
type Image ¶
type Image struct { // Actual Width Width uint32 // Actual Height Height uint32 // Hotspot x (must be inside image) HotspotX uint32 // Hotspot y (must be inside image) HotspotY uint32 // Animation Delay to next frame (ms) Delay uint32 // contains filtered or unexported fields }
Image is a still image part of a cursor
Use Image.GetBuffer() to get the corresponding WlBuffer to attach to your WlSurface.
type MultiError ¶
type MultiError struct {
// contains filtered or unexported fields
}
func (*MultiError) Add ¶
func (e *MultiError) Add(err error)
func (*MultiError) Err ¶
func (e *MultiError) Err() error
func (*MultiError) Error ¶
func (e *MultiError) Error() string
Error returns `\n` separated string of all errors.
type Theme ¶
type Theme struct {
// contains filtered or unexported fields
}
func LoadTheme ¶
LoadTheme loads a cursor theme to memory shared with the compositor
name: The name of the cursor theme to load. If empty, the default theme will be loaded. size: Desired size of the cursor images. shm: The compositor's shm interface.
Returns an object representing the theme that should be destroyed with Theme.Destroy().