OpenTuiBindings class
Main OpenTUI bindings class that wraps the generated FFI bindings with our existing API and error handling.
Constructors
- OpenTuiBindings()
- Creates a OpenTuiBindings.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addToHitGrid(
Pointer< RendererHandle> renderer, int x, int y, int width, int height, int id) → void - Registers a rectangular region in OpenTUI's low-level hit grid.
-
bufferClear(
Pointer< OptimizedBufferHandle> buffer, Color bg) → void -
Clears every cell of
bufferto thebgcolor. Throws FFIException on failure. -
bufferDrawBox(
Pointer< OptimizedBufferHandle> buffer, int x, int y, int width, int height, BoxOptions options, Color borderColor, Color backgroundColor) → void -
Draws a
width×heightbox at (x,y) intobufferusing the border glyphs, packed flags, and optional title fromoptions, withborderColorandbackgroundColor. Defaults to single-line border chars whenoptionsdoes not supply all 11. Throws FFIException on failure. -
bufferDrawText(
Pointer< OptimizedBufferHandle> buffer, String text, int x, int y, Color fg, Color? bg, int attributes) → void -
Draws UTF-8
textat (x,y) intobufferwithfg/bgcolors and packedattributes. A nullbgis passed as a null pointer (transparent). Throws FFIException on failure. -
bufferDrawTextBuffer(
Pointer< OptimizedBufferHandle> buffer, Pointer<TextBufferHandle> textBuffer, int x, int y, int clipX, int clipY, int clipWidth, int clipHeight, bool hasClipRect) → void -
Renders
textBufferintobufferat (x,y). WhenhasClipRectis true, only the (clipX,clipY,clipWidth,clipHeight) region is drawn. Throws FFIException on failure. -
bufferFillRect(
Pointer< OptimizedBufferHandle> buffer, int x, int y, int width, int height, Color bg) → void -
Fills the
width×heightrectangle at (x,y) inbufferwith thebgcolor. Throws FFIException on failure. -
bufferGetAttributesPtr(
Pointer< OptimizedBufferHandle> buffer) → Pointer<Uint8> -
Returns a pointer to
buffer's per-cell packed attributes array. Throws FFIException on a null result. -
bufferGetBgPtr(
Pointer< OptimizedBufferHandle> buffer) → Pointer<Float> -
Returns a pointer to
buffer's background-color (RGBA float) array. Throws FFIException on a null result. -
bufferGetCharPtr(
Pointer< OptimizedBufferHandle> buffer) → Pointer<Uint32> -
Returns a pointer to
buffer's character-code cell array. Throws FFIException on a null result. -
bufferGetFgPtr(
Pointer< OptimizedBufferHandle> buffer) → Pointer<Float> -
Returns a pointer to
buffer's foreground-color (RGBA float) array. Throws FFIException on a null result. -
bufferResize(
Pointer< OptimizedBufferHandle> buffer, int width, int height) → void -
Resizes
buffertowidth×heightcells. Throws FFIException on failure. -
bufferSetCellWithAlphaBlending(
Pointer< OptimizedBufferHandle> buffer, int x, int y, int charCode, Color fg, Color bg, int attributes) → void -
Sets the cell at (
x,y) inbuffertocharCodewithfg/bgcolors and packedattributes, alpha-blending against existing content. Throws FFIException on failure. -
checkHit(
Pointer< RendererHandle> renderer, int x, int y) → int - Queries OpenTUI's low-level hit grid at the specified coordinates.
-
clearTerminal(
Pointer< RendererHandle> renderer) → void -
Clears the terminal driven by
renderer. Throws FFIException on failure. -
createRenderer(
int width, int height, {bool testing = false}) → Pointer< RendererHandle> -
Creates a native renderer of
width×heightand returns its handle. Throws FFIException on invalid dimensions or a null result. -
createTextBuffer(
int length, int widthMethod) → Pointer< TextBufferHandle> -
Creates a text buffer with capacity
lengthusing width methodwidthMethod, and returns its handle. Throws FFIException on failure. -
destroyRenderer(
Pointer< RendererHandle> renderer, {bool useAlternateScreen = false, int splitHeight = 0}) → void -
Destroys
renderer, optionally restoring the main screen and reservingsplitHeightrows. Throws FFIException on failure. -
destroyTextBuffer(
Pointer< TextBufferHandle> textBuffer) → void -
Destroys
textBufferand frees its native memory. Throws FFIException on failure. -
disableKittyKeyboard(
Pointer< RendererHandle> renderer) → void -
Disables the Kitty keyboard protocol for
renderer. Throws FFIException on failure. -
disableMouse(
Pointer< RendererHandle> renderer) → void -
Disables mouse reporting for
renderer. Throws FFIException on failure. -
drawFrameBuffer(
Pointer< OptimizedBufferHandle> target, int destX, int destY, Pointer<OptimizedBufferHandle> frameBuffer, int sourceX, int sourceY, int sourceWidth, int sourceHeight) → void -
Composites the (
sourceX,sourceY,sourceWidth,sourceHeight) region offrameBufferontotargetat (destX,destY). Throws FFIException on failure. -
dumpBuffers(
Pointer< RendererHandle> renderer, int timestamp) → void -
Dumps
renderer's buffers for debugging, tagged withtimestamp. Throws FFIException on failure. -
dumpHitGrid(
Pointer< RendererHandle> renderer) → void -
Dumps
renderer's hit grid for debugging. Throws FFIException on failure. -
dumpStdoutBuffer(
Pointer< RendererHandle> renderer, int timestamp) → void -
Dumps
renderer's pending stdout buffer for debugging, tagged withtimestamp. Throws FFIException on failure. -
enableKittyKeyboard(
Pointer< RendererHandle> renderer, int flags) → void -
Enables the Kitty keyboard protocol for
rendererwith the given progressive-enhancementflags. Throws FFIException on failure. -
enableMouse(
Pointer< RendererHandle> renderer, bool enableMovement) → void -
Enables mouse reporting for
renderer, including motion events whenenableMovementis true. Throws FFIException on failure. -
getBufferHeight(
Pointer< OptimizedBufferHandle> buffer) → int -
Returns the height of
bufferin cells. Throws FFIException on failure. -
getBufferWidth(
Pointer< OptimizedBufferHandle> buffer) → int -
Returns the width of
bufferin cells. Throws FFIException on failure. -
getCurrentBuffer(
Pointer< RendererHandle> renderer) → Pointer<OptimizedBufferHandle> -
Returns
renderer's current (front) buffer handle. Throws FFIException on a null result. -
getNextBuffer(
Pointer< RendererHandle> renderer) → Pointer<OptimizedBufferHandle> -
Returns
renderer's next (back) buffer handle for drawing. Throws FFIException on a null result. -
getTerminalCapabilities(
Pointer< RendererHandle> renderer, Pointer<CapabilitiesHandle> caps) → void -
Fills
capswith the terminal capabilities detected forrenderer. Throws FFIException on failure. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
processCapabilityResponse(
Pointer< RendererHandle> renderer, String response) → void -
Parses a terminal capability query
responseintorenderer's detected capabilities. Throws FFIException on failure. -
render(
Pointer< RendererHandle> renderer, bool force) → void -
Renders
renderer's current frame to the terminal, redrawing everything whenforceis true. Throws FFIException on failure. -
resizeRenderer(
Pointer< RendererHandle> renderer, int width, int height) → void -
Resizes
rendererand its buffers towidth×height. Throws FFIException on failure. -
setBackgroundColor(
Pointer< RendererHandle> renderer, Color color) → void -
Sets
renderer's clear/backgroundcolor. Throws FFIException on failure. -
setCursorColor(
Pointer< RendererHandle> renderer, Color color) → void -
Sets
renderer's cursorcolor. Throws FFIException on failure. -
setCursorPosition(
Pointer< RendererHandle> renderer, int x, int y, bool visible) → void -
Moves
renderer's terminal cursor to (x,y) and sets itsvisiblestate. Throws FFIException on failure. -
setCursorStyle(
Pointer< RendererHandle> renderer, String style, bool blinking) → void -
Sets
renderer's cursor shape tostylewith optionalblinking. Throws FFIException on failure. -
setDebugOverlay(
Pointer< RendererHandle> renderer, bool enabled, int corner) → void -
Toggles
renderer's debug overlay viaenabledand positions it at the givencorner. Throws FFIException on failure. -
setupTerminal(
Pointer< RendererHandle> renderer, bool useAlternateScreen) → void -
Prepares the terminal for
renderer, switching to the alternate screen whenuseAlternateScreenis true. Throws FFIException on failure. -
textBufferFinalizeLineInfo(
Pointer< TextBufferHandle> textBuffer) → void -
Finalizes
textBuffer's line-start/width metadata after writes. Throws FFIException on failure. -
textBufferGetAttributesPtr(
Pointer< TextBufferHandle> textBuffer) → Pointer<Uint16> -
Returns a pointer to
textBuffer's per-cell packed attributes array. Throws FFIException on failure. -
textBufferGetBgPtr(
Pointer< TextBufferHandle> textBuffer) → Pointer<Float> -
Returns a pointer to
textBuffer's background-color (RGBA float) array. Throws FFIException on failure. -
textBufferGetCharPtr(
Pointer< TextBufferHandle> textBuffer) → Pointer<Uint32> -
Returns a pointer to
textBuffer's character-code cell array. Throws FFIException on failure. -
textBufferGetFgPtr(
Pointer< TextBufferHandle> textBuffer) → Pointer<Float> -
Returns a pointer to
textBuffer's foreground-color (RGBA float) array. Throws FFIException on failure. -
textBufferGetLength(
Pointer< TextBufferHandle> textBuffer) → int -
Returns the number of cells stored in
textBuffer. Throws FFIException on failure. -
textBufferGetLineCount(
Pointer< TextBufferHandle> textBuffer) → int -
Returns the number of lines in
textBuffer. Throws FFIException on failure. -
textBufferGetLineStartsPtr(
Pointer< TextBufferHandle> textBuffer) → Pointer<Uint32> -
Returns a pointer to
textBuffer's per-line start offsets. Throws FFIException on failure. -
textBufferGetLineWidthsPtr(
Pointer< TextBufferHandle> textBuffer) → Pointer<Uint32> -
Returns a pointer to
textBuffer's per-line cell widths. Throws FFIException on failure. -
textBufferReset(
Pointer< TextBufferHandle> textBuffer) → void -
Clears all content from
textBuffer, resetting it to empty. Throws FFIException on failure. -
textBufferResetSelection(
Pointer< TextBufferHandle> textBuffer) → void -
Clears any active selection highlight in
textBuffer. Throws FFIException on failure. -
textBufferSetCell(
Pointer< TextBufferHandle> textBuffer, int index, int charCode, Color fg, Color bg, int attributes) → void -
Sets the cell at
indexintextBuffertocharCodewithfg/bgcolors and packedattributes. Throws FFIException on failure. -
textBufferSetSelection(
Pointer< TextBufferHandle> textBuffer, int start, int end, Color bgColor, Color fgColor) → void -
Highlights cells
start..endintextBufferusingbgColor/fgColor. Throws FFIException on failure. -
textBufferWriteChunk(
Pointer< TextBufferHandle> textBuffer, String text, Color fg, Color bg, int attributes) → int -
Appends UTF-8
texttotextBufferwithfg/bgcolors and packedattributes, returning the native write result. Throws FFIException on failure. -
textBufferWriteUtf8Chunk(
Pointer< TextBufferHandle> textBuffer, Pointer<Uint8> textBytes, int textLen, Color fg, Color bg, int attributes) → int -
Appends
textLencaller-owned persistent UTF-8textBytestotextBufferwithfg/bgcolors and packedattributes, returning the native write result. Throws FFIException on failure. -
toString(
) → String -
A string representation of this object.
inherited
-
updateMemoryStats(
Pointer< RendererHandle> renderer, int heapUsed, int heapTotal, int arrayBuffers) → void -
Updates
renderer's debug-overlay memory stats withheapUsed,heapTotal, andarrayBuffers. Throws FFIException on failure. -
updateStats(
Pointer< RendererHandle> renderer, double time, int fps, double frameCallbackTime) → void -
Updates
renderer's debug-overlay frame stats withtime,fps, andframeCallbackTime. Throws FFIException on failure.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited