API Reference
One frame's accessibility projection of a semantic node.
init(nodeId: Int, nodeParent: Int, nodeRole: String, nodeRoleId: Int, nodeName: String, nodeValue: String, bx: Int, by: Int, bw: Int, bh: Int, mask: Int, isChecked: Bool, isDisabled: Bool, isFocused: Bool, isInert: Bool, isSelected: Bool, expandedValue: Int, isBusy: Bool, isRequired: Bool, invalidValue: Int, levelValue: Int, liveValue: Int, nodeDescription: String, minValue: Float, maxValue: Float, stepValue: Float, labelValue: Int, describedByValue: Int, controlsValue: Int, announceValue: Int)
fields
- actions: Int
- announceSeq: Int
- busy: Bool
- checked: Bool
- controlsId: Int
- describedById: Int
- description: String
- disabled: Bool
- expanded: Int
- focused: Bool
- h: Int
- id: Int
- inert: Bool
- invalid: Int
- labelId: Int
- level: Int
- live: Int
- name: String
- parent: Int
- required: Bool
- role: String
- roleId: Int
- selected: Bool
- value: String
- valueMax: Float
- valueMin: Float
- valueStep: Float
- w: Int
- x: Int
- y: Int
fn can(a: String): Boolfn describe(): StringBounds and step of a numeric control, as reported by Driver.rangeOf.
init(low: Float, high: Float, by: Float)
fields
- max: Float
- min: Float
- step: Float
The accessibility view of one frame, built from the semantic tree.
fields
- linkSeq: Int
- nodes: Array<A11yNode>
fn at(i: Int): A11yNodefn count(): Intfn dump(): Stringfn encode(): ByteBufferEncode the projection as the host accessibility packet.
fn find(role: String, name: String): Intfn increment(t: Tree, id: Int, delta: Float): Boolfn press(t: Tree, id: Int): Boolfn setValue(t: Tree, id: Int, s: String): Boolinit(w: Window, th: Theme, v: fn(Build): Node)
fields
- animatingFlag: Bool
- announcePriorityV: Int
- announceSeqV: Int
- announceTextV: String
- cameraOn: Bool
- cameraV: Camera
- clipboard: String
- clipboardGen: Int
- clipboardStale: Bool
- closeRequested: Bool
- colorV: Int
- damageOverlay: Bool
- deferCommit: Bool
- eventWindow: Int
- explicitAnimating: Bool
- extraWindows: Int
- fakeNowV: Int
- fixedFrameNsV: Int
- forceFull: Bool
- frameClock: FrameClock
- frames: Int
- gamepadHandler: fn(Gamepad): Void
- hostAddr: Int
- hostFrameHook: fn(Int): Void
- hostGenerationSeen: Int
- imeFocused: Int
- inspectorEnvRead: Bool
- inspectorNodeV: Int
- inspectorOn: Bool
- lastH: Int
- lastStatsV: String
- lastTimelineV: String
- lastW: Int
- linkHandler: fn(String): Void
- linkHandlerSet: Bool
- modifiers: Int
- pad: Gamepad
- pointerMode: Int
- pointerX: Int
- pointerY: Int
- reactiveV: Reactive?
- rendererChoice: Renderer
- resumeAnimating: Bool
- rootTree: Tree
- scaleV: Int
- shortcuts: Shortcuts
- status: Int
- surfaceSocket: String
- suspended: Bool
- textEngine: TextEngine
- textInput: Bool
- theme: Theme
- themeRevV: Int
- view: fn(Build): Node
- window: Window
fn accessibility(): AccessibilityThe accessibility projection of the current tree, plus any announcement.
fn accessibilityTree(): AccessibilityThe accessibility projection of the tree alone, without announcements.
fn advance(dtNs: Int): FrameAdvance the virtual clock by dtNs and build one frame. Headless tests
use this so animation state depends on the step count, not wall time.
fn animating(): Boolfn announce(text: String, priority: Int)Announce a transient message to assistive technology. Priority 1 is polite and priority 2 is assertive. The message replaces the previous announcement and advances the sequence, so repeated calls do not stack.
fn bind(chord: String, run: fn(): Void)Bind a named chord such as ctrl+s or f1.
fn bindReactive(rx: Reactive)Bind the reactive graph the view reads. The app drains its queued
effects at the start of a frame and folds its frame intent into
setAnimating. One graph per app; none is created for you.
fn camera(): Camerafn capture(path: String): BoolWrite the last presented frame as a PNG. Uses the host surface in a window.
fn clearCamera()fn clipboardText(): StringThe current clipboard text. Reads the host selection lazily.
fn clock(): FrameClockTime source for the view. Ticked once per frame by App.frame.
fn colorSpace(): Intfn confinePointer()Keep pointer motion inside the window.
fn copy(): BoolCopy the focused text box's selection into the system clipboard.
fn cut(): BoolCut the focused text box's selection.
fn draw(f: Frame): SurfaceRender an encoded frame into a new surface.
fn eventWindowId(): IntThe window that produced the last host event.
fn focusNext(): Intfn frame(): Framefn gamepad(): Gamepadfn inspector(): Boolfn isSuspended(): Boolfn keyDown(k: Key): BoolRoute a key to the focused node, focusing the first control if none is.
fn lastStats(): StringBuild the tree, lay it out, and encode a full frame.
fn lastStatus(): Intfn lastTimeline(): StringPhase timings of the last built frame, in integer microseconds.
fn lockPointer()Lock the pointer to its current position.
fn measureStyledText(s: String, size: Float, weight: Int, italic: Bool, tracking: Float): FloatWidth of one unwrapped line with weight, italic, and tracking applied.
fn measureText(s: String, size: Float): FloatWidth of one unwrapped line, using the app's shaping engine.
fn onGamepad(handler: fn(Gamepad): Void)Observe normalized gamepad axis and button changes.
fn onHostFrame(handler: fn(Int): Void)Run after every host frame with the frame index, for automation and tracing.
fn onLink(h: fn(String): Void)Observe completed link clicks from any text node.
fn openLink(url: String): BoolRun the link handler for url. False for an empty URL or no handler.
fn openWindow(title: String, w: Int, h: Int): IntOpen another toplevel; returns its window id or a negative status.
fn paste(): BoolPaste the system clipboard into the focused text box.
fn pointerDown(x: Int, y: Int): Boolfn pointerLeave(): Boolfn pointerMove(x: Int, y: Int): Boolfn pointerUp(x: Int, y: Int): Boolfn presentWindow(id: Int, f: Frame): IntPresent one frame to a specific toplevel.
fn quit()Ask the live host loop to close the window after the current frame.
fn releasePointer()fn renderer(): Rendererfn resume()Resume drawing and restore the previous animation request.
fn runScript(script: String): IntRun a semicolon-separated UI script headless. Returns 0 when every step passes.
fn scale(): Intfn screenshot(path: String): BoolRender the current frame and write it as a PNG.
fn screenshotBytes(): ByteBufferRender the current frame on the CPU and return a PNG.
fn scrollAt(x: Int, y: Int, dy: Float): Boolfn sendKey(code: Int, down: Bool)Feed an evdev key code. Tests and automation use this instead of a window.
fn setAnimating(on: Bool)Ask for continuous frames. While animating, the window draws as fast as the compositor accepts frames. While paused, it draws once per input event and sleeps otherwise, and the frame clock stops advancing.
fn setCamera(c: Camera)Apply a scene camera to presentation and hit testing.
fn setClipboard(s: String)fn setColorSpace(c: Int)Color space wire id: 0 sRGB, 1 linear, 2 Display P3.
fn setDamageOverlay(on: Bool)Outline changed regions, like the show-surface-updates developer flag.
fn setDpi(d: Float)Device pixel ratio: tags the frame and exposes Tree.dp to the view.
fn setFixedFrameNs(ns: Int)Use a fixed frame step instead of the real clock, for tests and captures.
fn setInspector(on: Bool)Draw node outlines and role labels over the frame for devtools.
fn setInspectorNode(id: Int)Tint and thicken one node's outline. Pass -1 to clear the selection.
fn setKeyboardInset(bottom: Int)fn setRenderer(r: Renderer)Change the backend before the first GPU call. One backend per process.
fn setSafeArea(top: Int, right: Int, bottom: Int, left: Int)fn setScale(s: Int)Output scale in thousandths. 2000 asks for a 2x buffer.
fn setSurfaceSocket(path: String)Send frames to a surface socket instead of the Wayland window.
fn setTextScale(f: Float)fn setTheme(th: Theme)Swap the theme before the next frame and invalidate every cached paint.
fn shortcuts(): Shortcutsfn show(): IntOpen the window and render until it closes.
fn showFor(frames: Int): IntOpen the window, render frames frames, then close. For smoke tests.
fn suspend()Stop drawing and pause the frame clock, as a hidden surface does.
fn themeRevision(): IntInteger theme revision; increments on every setTheme.
fn tick(): SurfaceEncode one frame and render it into a new surface.
fn touchCancel(id: Int): BoolCancel one host touch id.
fn touchDown(id: Int, x: Int, y: Int): BoolPress one host touch id at screen coordinates.
fn touchMove(id: Int, x: Int, y: Int): BoolMove one host touch id.
fn touchUp(id: Int, x: Int, y: Int): BoolRelease one host touch id.
fn tree(): Treefn windowCount(): Intfn windowGeneration(id: Int): Intfn windowHeight(id: Int): Intfn windowWidth(id: Int): IntThe packaging manifest for an app bundle.
init(name: String, version: String, entry: String, capabilities: Array<String>)
fields
- capabilities: Array<String>
- entry: String
- name: String
- version: String
fn manifest(): Stringfn writeTo(path: String): BoolWrite the manifest to an exact path.
Static app description, separate from the running window.
init(title: String, width: Int, height: Int, appearance: Appearance, entry: String)
fields
- appearance: Appearance
- entry: String
- height: Int
- title: String
- width: Int
fn heightValue(): Intfn theme(systemDark: Bool): ThemeResolve the appearance against a desktop preference.
fn titleText(): Stringfn widthValue(): IntFile helpers for app code. Paths are passed through untouched.
fn exists(path: String): Boolfn join(dir: String, name: String): Stringfn readText(path: String): Stringfn writeText(path: String, text: String): BoolTest-driver API over the accessibility projection.
init(a: App)
fields
- app: App
- pinchRotationV: Float
- pinchValueV: Float
fn access(): Accessibilityfn announce(text: String, priority: Int)Announce a transient message; priority 1 is polite, 2 assertive.
fn busyOf(role: String, name: String): BoolWhether the named node is busy.
fn checked(role: String, name: String): BoolThe checked state of the named toggle, checkbox, or radio.
fn click(role: String, name: String): Boolfn descriptionOf(role: String, name: String): StringThe accessible description of the named node.
fn doubleTap(role: String, name: String): BoolTwo quick presses on the center of the named node. Returns true when the tree counted the pair as a double tap.
fn drag(role: String, name: String, dx: Float, dy: Float, steps: Int): BoolPress the center of the named node, move to dx/dy in timed steps,
and release. Returns true when the press hit a node.
fn dragTo(sourceRole: String, sourceName: String, targetRole: String, targetName: String, steps: Int): BoolPress the center of the source, move to the center of the target in timed steps, and release. Returns true only when a drop occurred.
fn dump(): Stringfn encode(): ByteBufferEncode the projection, including announcements, as the host packet.
fn exists(role: String, name: String): Boolfn expandedOf(role: String, name: String): IntExpansion state of the named node: -1 unknown, 0 collapsed, 1 expanded.
fn fling(role: String, name: String, velocity: Float): BoolStart a fling on the scroll node containing the named node.
fn focus(role: String, name: String): Boolfn frame()fn increment(role: String, name: String, delta: Float): Boolfn inspect(on: Bool)Toggle the node inspector overlay.
fn key(role: String, name: String, key: Key): BoolRoute a key to the named node after focusing it.
fn longPress(role: String, name: String): BoolHold the center of the named node for about 0.55 s, then release. Returns true when both the press and the release reached a node.
fn openLink(name: String): BoolOpen the link node with accessible name name.
fn openLinkUrl(url: String): BoolOpen url through the app link handler.
fn pinch(role: String, name: String, scale: Float): BoolPut two pointers on either side of the named node's center and move them
until the distance ratio reaches scale. The pre-release ratio stays
readable through pinchValue and pinchRotationValue.
fn pinchRotation(): FloatAlias for pinchRotationValue that matches the tree query.
fn pinchRotationValue(): FloatThe rotation in radians measured before the last driver pinch released.
fn pinchScale(): FloatAlias for pinchValue that matches the tree query.
fn pinchValue(): FloatThe pinch ratio measured just before the last driver pinch released.
fn press(role: String, name: String): Boolfn rangeOf(role: String, name: String): A11yRangeBounds and step of the named numeric control.
fn runScript(script: String): IntRun a semicolon-separated script of UI steps. Steps that change state build a frame before the next step so assertions see current state.
fn screenshot(path: String): BoolRender the current frame and write it as a PNG.
fn scroll(role: String, name: String, dy: Float): BoolScroll at the center of the named node.
fn selectedOf(role: String, name: String): BoolWhether the named node is selected.
fn setValue(role: String, name: String, value: String): Boolfn stats(): StringCounts from the last built frame.
fn timeline(): StringPhase timings of the last built frame, in integer microseconds.
fn tree(): Treefn value(role: String, name: String): Stringfn valueOf(role: String, name: String): StringThe current value of the named text box or slider.
One encoded frame: the display list plus the semantic snapshot that made it.
init(index: Int, list: ByteBuffer, snapshot: String, damageList: Damage, packetBuf: ByteBuffer, scaleV: Int, colorV: Int, dropped: Int, buildTime: Int, layoutTime: Int, paintTime: Int, totalTime: Int)
fields
- buildNs: Int
- byteCountV: Int
- colorV: Int
- damageList: Damage
- droppedV: Int
- index: Int
- layoutNs: Int
- list: ByteBuffer
- nodeCountV: Int
- packetBuf: ByteBuffer
- paintNs: Int
- recordCountV: Int
- scaleV: Int
- snapshot: String
- totalNs: Int
fn bytes(): Intfn colorSpace(): IntColor space wire id: 0 sRGB, 1 linear, 2 Display P3.
fn damage(): Damagefn describe(): StringThe display list in text form, for tests and the inspector.
fn dropped(): IntRecords the display list refused because its 1024-record budget filled.
fn nodes(): FramePacketDecoded packet, for hosts and tests.
fn packet(): ByteBufferThe node layout and semantics packet for this frame.
fn records(): Intfn scale(): IntOutput scale in thousandths: 1000 is 1x, 2000 is 2x.
fn stats(): StringOne-line frame summary for devtools and AI tests.
fn timeline(): StringPer-frame phase timings in integer microseconds.
Normalized gamepad state. Axes are -1..1; buttons are pressed.
fields
- axes: Array<Float>
- buttons: Array<Bool>
- online: Bool
fn axis(i: Int): Floatfn connected(): Boolfn pressed(i: Int): Boolfn reset()fn setAxis(i: Int, raw: Int)fn setButton(i: Int, down: Bool)fn setConnected(on: Bool)One transient message.
init(id: Int, title: String, body: String)
fields
- body: String
- id: Int
- title: String
App-local notification queue.
fields
- items: Array<Notice>
- nextId: Int
fn at(i: Int): Noticefn body(i: Int): Stringfn clear()fn count(): Intfn dismiss(id: Int): Boolfn post(title: String, body: String): Intfn title(i: Int): Stringfn view(b: Build): NodeBuild a toast stack for the current queue.
A route pattern relative to its parent, plus its own children.
init(pattern: String, build: fn(RouteMatch): View, children: Array<Route>)
fields
- build: fn(RouteMatch): View
- children: Array<Route>
- pattern: String
One level of a resolved nested route. The route build receives it, reads
params(), and places outlet() where the child view belongs.
init(fullPath: String, paramMap: Map<String, String>, rest: Array<String>, children: Array<Route>, build: fn(RouteMatch): View, matched: Bool)
fields
- buildV: fn(RouteMatch): View
- childrenV: Array<Route>
- fullPathV: String
- matchedV: Bool
- paramMapV: Map<String, String>
- restV: Array<String>
fn matched(): Boolfn outlet(): ViewThe child view for the remaining path, or a not-found page.
fn params(): Map<String, String>Merged parent and child params plus the parsed query string.
fn path(): StringThe full requested path, query string included.
A route table with a back stack.
fields
- builders: Array<fn(): Node>
- current: String
- paths: Array<String>
- stack: Array<String>
fn back(): Boolfn currentPath(): Stringfn depth(): Intfn has(path: String): Boolfn navigate(path: String): Boolfn replace(path: String): Boolfn route(path: String, view: fn(): Node): Routerfn view(): Nodeinit(width: Int, height: Int, list: ByteBuffer)
fields
- height: Int
- list: ByteBuffer
- pixels: ByteBuffer
- usedBackend: Int
- width: Int
fn backend(): Int1 after a GPU draw, 2 after a CPU draw, 0 before any draw.
fn describe(): StringThe display list in text form, for tests and the inspector.
fn draw(): IntRender on the GPU, falling back to the CPU when no device answers.
fn drawCpu(): IntForce the CPU renderer. Zero on success.
fn encodePng(): ByteBufferEncode the pixels as a PNG.
fn pendingImages(): IntNumber of images still decoding on the CPU worker.
fn pixel(x: Int, y: Int): IntOne pixel as 0xRRGGBBAA.
fn pixels(): ByteBufferRaw RGBA8 pixels, row-major. For dumps and tests.
fn records(): Intfn rgbaAt(x: Int, y: Int): Stringfn waitImages(timeoutMs: Int): IntWait for CPU image decodes, returning the remaining count.
fn writePng(path: String): BoolWrite the frame as a PNG.
A route table over declarative View values. Patterns hold exact
segments, :name parameters, and a final * wildcard. Each router owns
its route list and history stack. A nested root adds parent layouts and
outlets while the flat route surface keeps working.
fields
- builders: Array<fn(Map<String, String>): View>
- current: String
- lastKey: String
- lastPath: String
- lastView: View?
- navSeq: Int
- nestedRootV: Route?
- patterns: Array<String>
- previousKey: String
- previousView: View?
- stack: Array<String>
- transitionV: Transition?
fn back(): Boolfn currentPath(): Stringfn depth(): Intfn navigate(path: String): Boolfn nested(root: Route): ViewRouterAttach a nested root. Flat route entries stay in place.
fn params(): Map<String, String>fn replace(path: String): Boolfn resolve(path: String): Viewfn route(pattern: String, build: fn(Map<String, String>): View): ViewRouterfn view(): Viewfn withTransition(t: Transition): ViewRouterCross-fade a path change with t. The outgoing view stays mounted under
its old key while it fades out, and the incoming view fades in over it.
Once the fade reaches zero the outgoing view becomes a zero-height
placeholder until the next path change replaces it.
The app's one window. On runixOS, the surface socket owns the surface, not the app.
init(title: String, width: Int, height: Int)
fields
- height: Int
- title: String
- width: Int
An app: a window, a theme, and a view function. The view runs again on every frame, because the MVP tree is append-only and reconciliation is not here yet.
Per-window state for an app that owns more than one surface.
fields
- focusId: Int
- frames: Array<Int>
- heights: Array<Int>
- ids: Array<Int>
- nextId: Int
- paused: Array<Bool>
- titles: Array<String>
- visible: Array<Bool>
- widths: Array<Int>
fn close(id: Int): Boolfn count(): Intfn focus(id: Int): Boolfn focused(): Intfn frame(id: Int): BoolCount a frame only when the window can draw.
fn framesOf(id: Int): Intfn heightOf(id: Int): Intfn isOpen(id: Int): Boolfn open(title: String, w: Int, h: Int): Intfn resize(id: Int, w: Int, h: Int): Boolfn resume(id: Int): Boolfn route(id: Int): Boolfn setVisible(id: Int, on: Bool): Boolfn suspend(id: Int): Boolfn suspendedAt(id: Int): Boolfn titleOf(id: Int): Stringfn visibleAt(id: Int): Boolfn widthOf(id: Int): IntA worker thread with a typed result.
init(handle: Thread)
fields
- handle: Thread
fn join(): Int- dark
- light
- system
- auto
- gles
- vulkan
Functions
fn abiVersion(): Intfn measureText(s: String, size: Float): FloatWidth of shaped text at size, in device pixels.
fn rendererVersion(): Int