Documentation
¶
Overview ¶
Package eistest drives an EIS server with libei, the reference C client, loaded through purego: the oracle an EIS server, and a portal serving one, are held to in tests.
Index ¶
- Constants
- type Client
- type Device
- func (d Device) Button(code uint32, press bool)
- func (d Device) Frame()
- func (d Device) Has(c uint32) bool
- func (d Device) Key(code uint32, press bool)
- func (d Device) Keysym(sym uint32, press bool)
- func (d Device) Motion(x, y float64)
- func (d Device) MotionAbsolute(x, y float64)
- func (d Device) Name() string
- func (d Device) ScrollDelta(x, y float64)
- func (d Device) ScrollDiscrete(x, y int32)
- func (d Device) ScrollStop(x, y bool)
- func (d Device) Start()
- func (d Device) Stop()
- func (d Device) Touch(x, y, mx, my float64)
- type Lib
- type Region
- type Session
Constants ¶
const ( CapPointer = 1 << 0 CapAbsolute = 1 << 1 CapKeyboard = 1 << 2 CapTouch = 1 << 3 CapScroll = 1 << 4 CapButton = 1 << 5 CapText = 1 << 6 )
The device capabilities a client binds (libei.h's EI_DEVICE_CAP_*).
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
Log []string
Keymaps map[string]string
// contains filtered or unexported fields
}
Client is a libei context connected to an EIS server that writes what it receives to Log, one line per event: "connect", "disconnect", "seat <name>", "resumed <device>", "removed <device>", "start <device> <sequence>", "stop <device>", "frame <device>", "motion <dx> <dy>", "button <code> <pressed>", "scroll <dx> <dy>", "scroll-stop <x> <y>", "discrete <dx> <dy>", "key <code> <pressed>" and "modifiers <depressed> <latched> <locked> <group>". Devices are named without the seat's prefix.
func Receive ¶
Receive connects a libei receiver called name to fd (which it takes over) and binds caps on every seat once Until has dispatched it.
func Send ¶
Send connects a libei sender instead, for a test that a receiver's server turns it away.
type Device ¶
type Device struct {
// contains filtered or unexported fields
}
Device is a resumed device, for the emulate callback of Drive.
func (Device) MotionAbsolute ¶
MotionAbsolute moves the pointer to a point of the regions.
func (Device) ScrollDiscrete ¶
ScrollDiscrete scrolls in 120ths of a detent.
func (Device) ScrollStop ¶
ScrollStop ends a smooth scroll on the axes set.
type Lib ¶
type Lib struct {
// contains filtered or unexported fields
}
Lib is libei's sender API.
func (*Lib) Drive ¶
func (l *Lib) Drive(t testing.TB, fd int, name string, caps []uintptr, want int, timeout time.Duration, emulate func(Device)) Session
Drive connects a libei sender called name to fd (which it takes over), binds caps on every seat, and runs emulate on every device the server resumes, until resumed devices reach want or the timeout passes.
type Session ¶
type Session struct {
Connected bool
// Seats and Devices are the names of the seats added and the
// devices resumed, in order.
Seats, Devices []string
// Regions are each resumed device's regions, by device name.
Regions map[string][]Region
}
Session is what a libei sender saw of the server.