KetraTerm
API · DevelopmentAll versions

TerminalRenderFrame

Short-lived primitive view of the terminal's render state for one viewport.

A frame exposes stable public render encodings, not core internal storage. Consumers should copy rows into caller-owned primitive arrays during the enclosing TerminalRenderFrameReader.readRenderFrame callback.

Properties

Link copied to clipboard

Currently active terminal screen buffer.

Link copied to clipboard
abstract val columns: Int

Number of visible columns in each render row.

Link copied to clipboard

Generation for retained cell content and terminal-owned row mapping, including off-screen history. Cell, cluster, stored attribute, wrap, resize, scroll, reset, and buffer changes advance this value; cursor and caller-requested viewport changes do not need to. Compare for equality, since generations can wrap.

Link copied to clipboard

Current render cursor overlay state.

Link copied to clipboard

Number of history lines discarded due to ring buffer capacity wrapping.

Link copied to clipboard
abstract val frameGeneration: Long

Monotonic generation that changes on any visually relevant mutation.

Link copied to clipboard

Image-resource, placement or image-geometry invalidation token, local to this source. Compare for inequality and include source, viewport, active buffer and structure in cache keys. Providers implementing copyImages must advance this token and frameGeneration when their image presentation changes; text-row generations need not change. The default describes a provider without images.

Link copied to clipboard

Generation of retained-history identity and layout in activeBuffer.

Link copied to clipboard
open val historySize: Int

Number of retained off-screen history lines available in this frame.

Link copied to clipboard

Exclusive absolute row boundary of retained output in the active buffer, independent of the requested viewport. Rows before this boundary include admitted history, written text and explicitly authored blank lines; an untouched live tail is excluded. Cursor movement alone does not advance it. Changes advance contentGeneration and frameGeneration, including an explicit line feed that authors a previously untouched blank row.

Link copied to clipboard

Currently active resolved color palette. The default is shared and immutable.

Link copied to clipboard
abstract val rows: Int

Number of visible render rows.

Link copied to clipboard

Clamped scrollback offset used by this frame, in lines from the live bottom viewport. Zero means the frame is pinned to the newest output.

Link copied to clipboard

Generation that changes when terminal-owned row mapping or shape changes.

Functions

Link copied to clipboard

Copies the current cursor overlay state into sink.

Link copied to clipboard

Delivers visible image placements synchronously in back-to-front stacking order. Placement metadata must be copied during this frame's callback; immutable TerminalRenderImage resources may be retained. The default supplies no images.

Link copied to clipboard
abstract fun copyLine(row: Int, codeWords: IntArray, codeOffset: Int = 0, attrWords: LongArray, attrOffset: Int = 0, flags: IntArray, flagOffset: Int = 0, extraAttrWords: LongArray? = null, extraAttrOffset: Int = 0, hyperlinkIds: IntArray? = null, hyperlinkOffset: Int = 0, clusterSink: TerminalRenderClusterSink? = null, clusterDataSink: TerminalRenderClusterDataSink? = null)

Copies one visible row into caller-owned primitive arrays in logical terminal-column order.

Link copied to clipboard
open fun copyTextLine(row: Int, codeWords: IntArray, codeOffset: Int = 0, flags: IntArray, flagOffset: Int = 0, clusterDataSink: TerminalRenderClusterDataSink? = null)

Copies only text and cell geometry for one visible row, in logical column order.

Link copied to clipboard
abstract fun lineGeneration(row: Int): Long

Returns the generation for visible row.

Link copied to clipboard
open fun lineId(row: Int): Long

Returns the stable logical line identity for visible row.

Link copied to clipboard
abstract fun lineWrapped(row: Int): Boolean

Reports whether visible row soft-wraps into the next row.