testclient

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: MIT, MIT Imports: 27 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 testclient is a scripted Wayland client for integration tests: it maps toplevels, paints shm frames and keeps animating while frame callbacks arrive.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UDMABUF

func UDMABUF(size image.Point, paint Painter) (gpu.DMABUF, func() error, error)

Types

type Answer

type Answer uint8
const (
	AnswerByDrawing Answer = iota
	AnswerNever
	AnswerAckOnly
	AnswerKeepingTheBuffer
)

type Band

type Band struct {
	Height, Step int
}

func (Band) Damage

func (b Band) Damage(size image.Point, frame int) []image.Rectangle

func (Band) Paint

func (b Band) Paint(pix []byte, stride int, size image.Point, frame int)

func (Band) Rows

func (b Band) Rows(size image.Point, frame int) image.Rectangle

type Client

type Client struct {
	Display          *wlclient.Display
	Compositor       *cw.WlCompositor
	Subcompositor    *cw.WlSubcompositor
	Shm              *cw.WlShm
	WM               *cxdg.XdgWmBase
	Viewporter       *cvp.WpViewporter
	Fractional       *cfs.WpFractionalScaleManagerV1
	CursorShape      *ccs.WpCursorShapeManagerV1
	LayerShell       *cwlr.ZwlrLayerShellV1
	DataDevices      *cw.WlDataDeviceManager
	PrimarySelection *cps.ZwpPrimarySelectionDeviceManagerV1
	Outputs          []*cw.WlOutput
	// contains filtered or unexported fields
}

func Connect

func Connect(t testing.TB, socket string) *Client

func (*Client) Bind

func (c *Client) Bind(r wire.Resource)

func (*Client) Buffer

func (c *Client) Buffer(size image.Point, frame int, paint Painter) *cw.WlBuffer

func (*Client) Clipboard

func (c *Client) Clipboard(seat *cw.WlSeat) *Clipboard

func (*Client) DMABUF

func (c *Client) DMABUF(size image.Point, paint Painter) *DMABUF

func (*Client) DMABUFIn

func (c *Client) DMABUFIn(format fourcc.Format, size image.Point, paint Painter) *DMABUF

func (*Client) DMABUFOutside

func (c *Client) DMABUFOutside(size image.Point, excluded []fourcc.Modifier) (*DMABUF, bool)

func (*Client) DataSource

func (c *Client) DataSource(content map[string]string) *Source

func (*Client) Dialog

func (c *Client) Dialog(parent *Window, title string, paint Painter) *Window

func (*Client) DispatchUntil

func (c *Client) DispatchUntil(what string, cond func() bool)

func (*Client) ExpectProtocolError

func (c *Client) ExpectProtocolError(code uint32) *wire.ProtocolError

func (*Client) FormatBuffer

func (c *Client) FormatBuffer(size image.Point, format cw.WlShmFormat, frame int, paint Painter) *cw.WlBuffer

func (*Client) HasDMABUFFeedback

func (c *Client) HasDMABUFFeedback() bool

func (*Client) HasGlobal

func (c *Client) HasGlobal(iface string) bool

HasGlobal reports whether the compositor offered iface at connect.

func (*Client) Layer

func (c *Client) Layer(spec LayerSpec, paint Painter) *Window

func (*Client) PartialWindow

func (c *Client) PartialWindow(title string, paint Painter, damage Damager) *Window

func (*Client) Popup

func (c *Client) Popup(parent *Window, p Placement, grab *Grab, paint Painter) *Window

func (*Client) Positioner

func (c *Client) Positioner(p Placement) *cxdg.XdgPositioner

func (*Client) PrimarySource

func (c *Client) PrimarySource(content map[string]string) *Source

func (*Client) Receive

func (c *Client) Receive(request func(fd int) error, source *Client) string

func (*Client) RenderTarget

func (c *Client) RenderTarget(size image.Point, modifiers []fourcc.Modifier) *DMABUF

func (*Client) ScaledWindow

func (c *Client) ScaledWindow(title string, scaling Scaling, paint Painter) *Window

func (*Client) Seat

func (c *Client) Seat() (*cw.WlSeat, *Input)

func (*Client) Surface

func (c *Client) Surface() *cw.WlSurface

func (*Client) Sync

func (c *Client) Sync()

func (*Client) Target

func (c *Client) Target(size image.Point) (*cw.WlBuffer, []byte)

func (*Client) Window

func (c *Client) Window(title string, paint Painter) *Window

func (*Client) WindowWith

func (c *Client) WindowWith(title string, paint Painter, setup func(*Window) error) *Window

type Clipboard

type Clipboard struct {
	Device    *cw.WlDataDevice
	Primaries *cps.ZwpPrimarySelectionDeviceV1
	Log       Log
	Selection *Offer
	Primary   *Offer
	Drag      *Offer
	Serial    uint32
	// contains filtered or unexported fields
}

type DMABUF

type DMABUF struct {
	WL       *cw.WlBuffer
	Released bool
	// contains filtered or unexported fields
}

func (*DMABUF) Pixels

func (b *DMABUF) Pixels() []byte

func (*DMABUF) Release

func (b *DMABUF) Release(*cw.WlBuffer) error

type Damager

type Damager func(size image.Point, frame int) []image.Rectangle

type Grab

type Grab struct {
	Seat   *cw.WlSeat
	Serial uint32
}

type Input

type Input struct {
	Log        Log
	Surfaces   map[wire.ObjectID]string
	Serial     uint32
	Press      uint32
	Pointer    *cw.WlPointer
	KeymapSize uint32
	Repeat     [2]int32
	Depressed  uint32
	Locked     uint32
	Keymaps    int
}

func (*Input) Name

func (in *Input) Name(s *cw.WlSurface, name string)

type LayerSpec

type LayerSpec struct {
	Output        *cw.WlOutput
	Layer         cwlr.ZwlrLayerShellV1Layer
	Anchor        cwlr.ZwlrLayerSurfaceV1Anchor
	Size          image.Point
	ExclusiveZone int32
	Interactivity cwlr.ZwlrLayerSurfaceV1KeyboardInteractivity
	Namespace     string
}

type Log

type Log []string

func (*Log) Note

func (l *Log) Note(format string, args ...any) error

type Offer

type Offer struct {
	Data          *cw.WlDataOffer
	Primary       *cps.ZwpPrimarySelectionOfferV1
	Mimes         []string
	SourceActions cw.WlDataDeviceManagerDndAction
	Action        cw.WlDataDeviceManagerDndAction
}

type Painter

type Painter func(pix []byte, stride int, size image.Point, frame int)

func Fill

func Fill(b, g, r byte) Painter

type Placement

type Placement struct {
	Size       image.Point
	Anchor     image.Rectangle
	Edge       cxdg.XdgPositionerAnchor
	Gravity    cxdg.XdgPositionerGravity
	Adjustment cxdg.XdgPositionerConstraintAdjustment
}

type Scaling

type Scaling uint8
const (
	Unscaled Scaling = iota
	IntegerScale
	FractionalScale
)

type Source

type Source struct {
	Data    *cw.WlDataSource
	Primary *cps.ZwpPrimarySelectionSourceV1
	Log     Log
	Send    func(mime string, f *os.File)
	// contains filtered or unexported fields
}

type Window

type Window struct {
	Surface    *cw.WlSurface
	XdgSurface *cxdg.XdgSurface
	Toplevel   *cxdg.XdgToplevel
	Popup      *cxdg.XdgPopup
	Layer      *cwlr.ZwlrLayerSurfaceV1
	Placed     image.Rectangle
	Dismissed  bool

	Logical      image.Point
	Size         image.Point
	BufferScale  int32
	Preferred120 uint32
	Entered      int
	Frames       int
	Closed       bool
	States       []cxdg.XdgToplevelState

	Translucent bool
	Answer      Answer
	Configures  int
	// contains filtered or unexported fields
}

func (*Window) Destroy

func (w *Window) Destroy() error

func (*Window) Mapped

func (w *Window) Mapped() bool

func (*Window) Redraw

func (w *Window) Redraw() error

func (*Window) Stop

func (w *Window) Stop()

Jump to

Keyboard shortcuts

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