surface

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: MIT, MIT Imports: 16 Imported by: 0 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 surface implements wl_compositor, wl_surface, wl_region and wl_subcompositor: double-buffered surface state, subsurface trees and roles.

Index

Constants

View Source
const CursorRole = "wl_pointer-cursor"

Variables

This section is empty.

Functions

func RegionValue

func RegionValue(r *sw.WlRegion) (region.Region, error)

Types

type Awaited

type Awaited interface {
	AwaitWriter(c Awaiter) error
}

Awaited is a buffer whose writer may still be at work when it is committed, as implicit synchronization allows. AwaitWriter takes a hold on the commit for each thing the writer has yet to finish, and releases it once it has.

type Awaiter

type Awaiter interface {
	Await() (release func() error)
	DamagedPixels() int
	Surface() *Surface
}

Awaiter is a commit an Awaited buffer can keep from taking effect: Await holds it until the returned func is called. Surface is the surface it commits to.

type Backing

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

func NewBacking

func NewBacking(res *sw.WlBuffer, release func() error) *Backing

func (*Backing) Lock

func (b *Backing) Lock()

func (*Backing) ResourceID

func (b *Backing) ResourceID() (wire.ObjectID, bool)

func (*Backing) Unlock

func (b *Backing) Unlock() error

type Barrier

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

func NewBarrier

func NewBarrier(arrived func() error) *Barrier

func (*Barrier) Release

func (b *Barrier) Release() error

type Buffer

type Buffer interface {
	Size() image.Point
	Lock()
	Unlock() error
}

type HandoverRole

type HandoverRole interface {
	HandoverPrelude(s *server.Stream, res *sw.WlSurface) (commit bool, err error)
}

type Hold

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

func (*Hold) Release

func (h *Hold) Release() error

type Hooks

type Hooks struct {
	Commit     func(u *Update) error
	Applied    func() error
	Destroying func() error
	Destroyed  func() error
	Handover   func(st *server.Stream) error
}

type Latched

type Latched[T comparable] struct {
	// contains filtered or unexported fields
}

func NewLatched

func NewLatched[T comparable](fallback T) *Latched[T]

func (*Latched[T]) Attach

func (l *Latched[T]) Attach(s *Surface) (*LatchedValue[T], bool)

func (*Latched[T]) Get

func (l *Latched[T]) Get(s *Surface) T

type LatchedValue

type LatchedValue[T comparable] struct {
	// contains filtered or unexported fields
}

func (*LatchedValue[T]) Detach

func (v *LatchedValue[T]) Detach() error

func (*LatchedValue[T]) Gone

func (v *LatchedValue[T]) Gone() bool

func (*LatchedValue[T]) Set

func (v *LatchedValue[T]) Set(value T)

type Listener

type Listener interface {
	Committed(s *Surface) error
	Destroyed(s *Surface) error
}

type Manager

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

func New

func New(d *server.Display, l Listener) (*Manager, error)

func (*Manager) Busy

func (m *Manager) Busy() string

type PresentationKind

type PresentationKind = spt.WpPresentationFeedbackKind

type Role

type Role interface {
	RoleName() string
	Committed(s *Surface) error
}

type Subsurface

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

func (*Subsurface) Committed

func (sub *Subsurface) Committed(*Surface) error

func (*Subsurface) Parent

func (sub *Subsurface) Parent() *Surface

func (*Subsurface) Position

func (sub *Subsurface) Position() image.Point

func (*Subsurface) RoleName

func (sub *Subsurface) RoleName() string

func (*Subsurface) Synchronized

func (sub *Subsurface) Synchronized() bool

type Surface

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

func From

func From(r *sw.WlSurface) (*Surface, error)

func (*Surface) AcceptsInput

func (s *Surface) AcceptsInput(p image.Point) bool

func (*Surface) AddHooks

func (s *Surface) AddHooks(h *Hooks)

func (*Surface) Attached

func (s *Surface) Attached() bool

func (*Surface) Buffer

func (s *Surface) Buffer() Buffer

func (*Surface) BufferDamage

func (s *Surface) BufferDamage() []image.Rectangle

func (*Surface) BufferSource

func (s *Surface) BufferSource() render.FRect

func (*Surface) ClearRole

func (s *Surface) ClearRole(r Role)

func (*Surface) Client

func (s *Surface) Client() *server.Client

func (*Surface) Damage

func (s *Surface) Damage() []image.Rectangle

func (*Surface) Enter

func (s *Surface) Enter(outputs []*sw.WlOutput) error

func (*Surface) FrameDone

func (s *Surface) FrameDone(msec uint32) error

func (*Surface) FrameDoneUndrawn

func (s *Surface) FrameDoneUndrawn(msec uint32) error

func (*Surface) HasBuffer

func (s *Surface) HasBuffer() bool

func (*Surface) Input

func (s *Surface) Input() region.Region

func (*Surface) Latch

func (s *Surface) Latch()

func (*Surface) Leave

func (s *Surface) Leave(outputs []*sw.WlOutput) error

func (*Surface) Offset

func (s *Surface) Offset() image.Point

func (*Surface) Opaque

func (s *Surface) Opaque() region.Region

func (*Surface) PendingBuffer

func (s *Surface) PendingBuffer() (Buffer, bool)

func (*Surface) Presented

func (s *Surface) Presented(outputs []*sw.WlOutput, at, refresh time.Duration, variable bool, seq uint64, kind PresentationKind) error

func (*Surface) RemoveHooks

func (s *Surface) RemoveHooks(h *Hooks)

func (*Surface) Resource

func (s *Surface) Resource() *sw.WlSurface

func (*Surface) Retry

func (s *Surface) Retry() error

func (*Surface) Role

func (s *Surface) Role() Role

func (*Surface) Root

func (s *Surface) Root() *Surface

func (*Surface) Scale

func (s *Surface) Scale() int32

func (*Surface) SetPreferredScale

func (s *Surface) SetPreferredScale(scale120 uint32) error

func (*Surface) SetRole

func (s *Surface) SetRole(r Role) error

func (*Surface) Size

func (s *Surface) Size() image.Point

func (*Surface) Stack

func (s *Surface) Stack() iter.Seq[*Surface]

func (*Surface) StackTopDown

func (s *Surface) StackTopDown() iter.Seq[*Surface]

func (*Surface) Subsurface

func (s *Surface) Subsurface() *Subsurface

func (*Surface) SurfaceRect

func (s *Surface) SurfaceRect(buffer image.Rectangle) render.FRect

func (*Surface) Transform

func (s *Surface) Transform() render.Transform

func (*Surface) TreeBounds

func (s *Surface) TreeBounds() image.Rectangle

func (*Surface) WantsFrame

func (s *Surface) WantsFrame() bool

func (*Surface) Watch

func (s *Surface) Watch(f func(*Update))

type Update

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

func (*Update) Await

func (u *Update) Await() func() error

func (*Update) Buffer

func (u *Update) Buffer() Buffer

func (*Update) DamagedPixels

func (u *Update) DamagedPixels() int

func (*Update) ExplicitlySynced

func (u *Update) ExplicitlySynced()

func (*Update) Gate

func (u *Update) Gate(ready func() bool)

func (*Update) Hold

func (u *Update) Hold() *Hold

func (*Update) OnApply

func (u *Update) OnApply(f func() error)

func (*Update) Park

func (u *Update) Park(b *Barrier)

func (*Update) Surface

func (u *Update) Surface() *Surface

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL