Skip to content

Compositor

[Source]

Receives grids from widget-actors, composites by z-order, diffs against previous frame, and writes ANSI output.

actor tag Compositor is
  WidgetParent tag

Implements


Constructors

create

[Source]

new tag create(
  output: TerminalOutput tag,
  width: USize val,
  height: USize val)
: Compositor tag^

Parameters

Returns


Public Behaviours

register_root

[Source]

Register the root widget at NorthWest filling the full screen. Does not send a resize — the caller must send resize() to the widget directly to ensure correct message ordering.

be register_root(
  widget: Widget tag)

Parameters


receive_grid

[Source]

Receive an updated grid from a widget. Stores the grid and schedules a deferred recompose if not already pending.

be receive_grid(
  widget: Any tag,
  grid: Grid val)

Parameters


hit_test

[Source]

Find the topmost widget at the given screen coordinate and send the result back to the requester.

be hit_test(
  col: USize val,
  row: USize val,
  requester: _HitTestRequester tag)

Parameters

  • col: USize val
  • row: USize val
  • requester: _HitTestRequester tag

screen_resize

[Source]

Handle terminal resize: update dimensions, clear screen, and recompose.

be screen_resize(
  width: USize val,
  height: USize val)

Parameters