Documentation
¶
Overview ¶
Package headless is a shell.Window that has no display: it applies each Present(frame, damage) to an in-memory "screen", records timing, and replays scripted input events. It is the test harness for the whole GUI stack and produces the screenshots used to verify rendering without X11.
The screen only changes inside the damage rectangle the app reports, so a test that compares Screen() with the compositor's frame catches any missing damage.
Index ¶
- func KeyEvents(chord string) []shell.Event
- func Open(cfg shell.Config) (shell.Window, error)
- func TypeEvents(text string) []shell.Event
- type Window
- func (w *Window) At(x, y int) color.RGBA
- func (w *Window) Clipboard() string
- func (w *Window) Close()
- func (w *Window) Cursor() shell.Cursor
- func (w *Window) Damages() []image.Rectangle
- func (w *Window) Events() <-chan shell.Event
- func (w *Window) Fullscreen() bool
- func (w *Window) LastPresent() time.Time
- func (w *Window) OpenURL(u string) error
- func (w *Window) Opened() []string
- func (w *Window) Present(frame *image.RGBA, damage image.Rectangle)
- func (w *Window) Presents() int
- func (w *Window) Push(ev shell.Event)
- func (w *Window) PushAndMeasure(ev shell.Event, timeout time.Duration) (time.Duration, bool)
- func (w *Window) Resize(lw, lh int, scale float64)
- func (w *Window) SavePNG(path string) error
- func (w *Window) Screen() *image.RGBA
- func (w *Window) SetClipboard(s string)
- func (w *Window) SetCursor(c shell.Cursor)
- func (w *Window) SetFullscreen(b bool)
- func (w *Window) SetTitle(s string)
- func (w *Window) Size() (int, int, float64)
- func (w *Window) Title() string
- func (w *Window) WaitPixel(start time.Time, x, y int, ok func(color.RGBA) bool, timeout time.Duration) (time.Duration, bool)
- func (w *Window) WaitPresents(n int, timeout time.Duration) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func KeyEvents ¶
KeyEvents expands a chord like "ctrl+shift+t" or "Enter" into the KeyDown/KeyUp pair a native shell would send.
func TypeEvents ¶
TypeEvents returns one EvText per rune sequence (committed text input).
Types ¶
type Window ¶
type Window struct {
// OnPresent, when set, is called after each Present (no locks held).
OnPresent func(damage image.Rectangle)
// contains filtered or unexported fields
}
Window implements shell.Window.
func (*Window) Fullscreen ¶
func (*Window) LastPresent ¶
LastPresent returns the time of the last Present.
func (*Window) PushAndMeasure ¶
PushAndMeasure injects ev and returns the time until the next Present. ok is false if no frame was presented within timeout.