Documentation
¶
Overview ¶
Package ui is the platform-neutral screen model: a tree of nodes read from a device.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Coll ¶
type Coll struct{ Rows, Cols int }
Coll is a list's size (Rows, Cols; -1 unknown) or an item's row and column in one.
type Node ¶
type Node struct {
Text string // Android text / iOS title or value
Desc string // Android content-description / iOS label (accessibilityText in selectors)
ID string // Android resource-id / iOS accessibilityIdentifier
Hint string // placeholder
Value string // iOS value
Error string
State string // Android stateDescription
Class string // Android class name / iOS element type
Bounds Rect
Clickable, LongClickable, Enabled, Focused, Checked, Checkable, Selected bool
Scrollable, Password, Editable, Visible, ShowingHint bool
// Android scroll containers: whether it can scroll further (forward = down or right),
// and a list's size / an item's row and column in it, when the app reports them.
MoreAfter, MoreBefore bool
Coll, Item *Coll
Window int // index of its window in Screen.Windows
Depth int // depth within its window
Index int // pre-order position in Screen.Nodes
Parent *Node
Children []*Node
}
Node is one element on screen.
func (*Node) ClipRect ¶
ClipRect is the part of the screen where n can show: the screen, cut to every scrolling ancestor's bounds (a row scrolled out of its list is not on screen, though inside the screen). Ignored: ancestors with empty bounds, and a window's root, whose scrolling is the window's own (a web page's body: its box moves up off the screen as the page scrolls, while what shows is the window).
func (*Node) IsDescendantOf ¶
IsDescendantOf reports whether n is anc or inside it.
func (*Node) Label ¶
Label is what a person reads on the node: its text, else its accessibility description.
func (*Node) ShortClass ¶
ShortClass is the last segment of the class name.
type Screen ¶
type Screen struct {
Platform string
Width int
Height int
Seq int64 // the device's change counter when it was read
Keyboard bool
Windows []*Window // top-most first
Nodes []*Node // every node, pre-order, windows top-most first
}
Screen is one read of the device's screen.
func (*Screen) Foreground ¶
Foreground is the package or bundle id of the active app window.
type Window ¶
type Window struct {
ID int
Type string // app, keyboard, system, overlay
Package string
Title string
Active bool
Focused bool
Bounds Rect
Nodes []*Node // this window's nodes, pre-order with Depth set (input to Link)
Roots []*Node
}
Window is one window (an app, the keyboard, a system dialog).