avyos.dev/pkg/graphics/backend/wayland

package wayland

Overview

No package-level documentation is provided.

Export GroupCount
Constants0
Variables0
Functions0
Types1

Types

Backend

type Backend struct {
	// contains filtered or unexported fields
}

Backend implements the display backend and input handler interfaces for Wayland.

Functions

New

func New() *Backend

New creates a new Wayland backend.

Methods

Buffer

func (b *Backend) Buffer() *core.Buffer

Buffer returns the back buffer for drawing.

Close

func (b *Backend) Close() error

Close cleans up the Wayland connection.

Flush

func (b *Backend) Flush() error

Flush copies the entire back buffer to the Wayland surface.

FlushRect

func (b *Backend) FlushRect(r image.Rectangle) error

FlushRect commits a damaged region to the Wayland surface.

HasSystemCursor

func (b *Backend) HasSystemCursor() bool

HasSystemCursor returns true since Wayland compositors provide cursors.

Info

func (b *Backend) Info() string

Info returns information about the Wayland backend.

MousePosition

func (b *Backend) MousePosition() (int, int)

MousePosition returns the last known mouse position.

Open

func (b *Backend) Open() error

Open connects to the Wayland compositor and creates a window.

Poll

func (b *Backend) Poll() *gfxinput.Event

Poll returns the next event or nil.

SetScreenSize

func (b *Backend) SetScreenSize(_, _ int)

SetScreenSize is a no-op for Wayland (window-based, not screen-based).

SetTitle

func (b *Backend) SetTitle(title string)

SetTitle sets the window title (must be called before Open).

Size

func (b *Backend) Size() (int, int)

Size returns the window dimensions.

Start

func (b *Backend) Start()

Start begins the event dispatch goroutine.