KetraTerm
API · v0.2.2All versions

updateFrom

Copies changed rows and cursor state from reader.

The read callback is used only to copy primitive frame data into this cache. After this method returns, renderers should build glyph or text runs from the copied rows and paint from their own backend-specific state.

Parameters

reader

source of the short-lived render frame.


fun updateFrom(reader: TerminalRenderFrameReader, scrollbackOffset: Int)

Copies changed rows and cursor state for a caller-owned scrollback viewport.

scrollbackOffset is requested in lines from the live bottom viewport. The reader clamps it to available history; this cache stores the resolved value reported by the frame and treats changes to it as row-mapping changes even when line generations happen to match.

Parameters

reader

source of the short-lived render frame.

scrollbackOffset

requested lines above the live bottom viewport.


fun updateFrom(reader: TerminalRenderFrameReader, scrollbackOffset: Int, viewportRows: Int)

Copies changed rows and cursor state for a caller-owned scrollback viewport with optional render-only overscan rows.

A viewportRows value greater than zero asks the reader for that many rows without resizing terminal state. Readers clamp the resolved count before exposing TerminalRenderFrame.rows, and this cache resizes only to the resolved frame shape.

Reader identity owns the generation namespace; replacement readers force a full copy.

Parameters

reader

source of the short-lived render frame.

scrollbackOffset

requested lines above the live bottom viewport.

viewportRows

requested render rows, or zero for the reader default.


Bulk-copies a stable published cache into this caller-owned cache.

The caller must keep source leased from its publisher for the duration of this call. Primitive storage is reused whenever the destination has sufficient capacity, and no per-cell objects are allocated.

Parameters

source

stable published cache to copy.