UiTree

A retained, platform-neutral UI tree.

Every operation is confined to the execution owner that creates this tree. Operational methods and close are not reentrant. The state property may be read under the execution owner during an active callback. An empty tree measures to IntSize.Zero. An empty tree performs no layout work and returns empty paint, input, and semantics results. A complete description is validated before mutation. Structural validation and local validation-hook failures leave an active tree unchanged and available for retry. Any failure after validation begins reconciliation, lifecycle work, or a pipeline operation poisons the tree. The tree clears retained ownership and attempts cleanup. Cleanup preserves the primary Throwable instance and suppresses later distinct failures on it.

Constructors

Link copied to clipboard
constructor(eventSession: UiSession? = null)

Properties

Link copied to clipboard

The current lifecycle state, read under the tree's execution owner.

Functions

Link copied to clipboard
open override fun close()

Cleans all retained ownership in descendant-first order.

Link copied to clipboard

Dispatches event to the currently focused logical component.

Link copied to clipboard

Dispatches event to the reverse paint-order hit path.

Link copied to clipboard

Dispatches event to the currently focused logical component.

Link copied to clipboard
fun layout()

Places every measured node that participates in the current pass.

Link copied to clipboard
fun measure(constraints: Constraints): IntSize

Measures the retained tree under constraints.

Link copied to clipboard

Paints the laid-out tree in parent-before-child order.

Link copied to clipboard

Collects unresolved semantics in parent-before-child order.

Link copied to clipboard

Starts owner-thread monitoring at an operation boundary with existing nodes as the baseline. A second active monitor, reentrant access, or an unavailable tree is rejected without changing the screen. The caller closes the monitor; terminal tree cleanup also releases it automatically.

Link copied to clipboard
fun update(description: Element)

Reconciles a complete immutable element description.