Documentation ¶
Overview ¶
Package wlcursor implements a Wayland cursor
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 ¶
Types ¶
type Cursor ¶
type Cursor struct { Name string Images []*ImageBuffer TotalDuration uint32 }
Cursor is a Theme cursor
func (*Cursor) FrameAndDuration ¶
func (c *Cursor) FrameAndDuration(millis uint32) FrameAndDuration
FrameAndDuration informs which frame and duration should be used at a specific time
func (*Cursor) GetCursorImage ¶
func (c *Cursor) GetCursorImage(n int) *ImageBuffer
GetCursorImage gets the n-th image from cursor or nil
type FrameAndDuration ¶
FrameAndDuration carries information about a frame and duration that should be used
type Image ¶
type Image interface { GetBuffer() *wl.Buffer GetWidth() int GetHeight() int GetHotspotX() int GetHotspotY() int }
Image is a wlCursor cursor image
type ImageBuffer ¶
type ImageBuffer struct { Delay uint32 // contains filtered or unexported fields }
ImageBuffer is a Wayland buffer for cursor
func NewImageBuffer ¶
func NewImageBuffer(theme *Theme, image *xcursor.Image) (*ImageBuffer, error)
NewImageBuffer creates a new ImageBuffer from Theme and cursor Image
func (*ImageBuffer) Destroy ¶
func (b *ImageBuffer) Destroy() error
Destroy destroys the ImageBuffer
func (*ImageBuffer) GetHotspotX ¶
func (b *ImageBuffer) GetHotspotX() int
GetHotspotX gets hotspot x
func (*ImageBuffer) GetHotspotY ¶
func (b *ImageBuffer) GetHotspotY() int
GetHotspotY gets hotspot Y
type Theme ¶
type Theme struct { Pool *wl.ShmPool File *os.File Name string Cursors []*Cursor Size uint32 PoolSize int32 }
Theme is a wlCursor cursor image theme
func LoadTheme ¶
LoadTheme loads a default-named theme with default size and shm pool, based on environment
func LoadThemeFromName ¶
LoadThemeFromName loads a named theme with size and shm pool
func LoadThemeOr ¶
LoadThemeOr loads a named theme with size and shm pool, based on environment