|
|
| TuiScreen () |
| | Constructs an empty screen with no buffers.
|
| |
|
| ~TuiScreen () |
| | Destructor.
|
| |
| void | resize (int cols, int rows) |
| | Resizes both buffers to the given dimensions.
|
| |
|
int | cols () const |
| | Returns the number of columns.
|
| |
|
int | rows () const |
| | Returns the number of rows.
|
| |
| void | setCell (int x, int y, const TuiCell &cell) |
| | Sets a cell in the back buffer.
|
| |
| TuiCell | cell (int x, int y) const |
| | Returns the cell at the given position in the back buffer.
|
| |
| void | clear (const Color &fg=Color::White, const Color &bg=Color::Black) |
| | Clears the back buffer with blank cells.
|
| |
| void | flush (AnsiStream &stream) |
| | Diffs front vs back buffer and emits minimal ANSI updates.
|
| |
|
void | invalidate () |
| | Forces a full redraw on the next flush.
|
| |
| void | setColorMode (Terminal::ColorSupport mode) |
| | Sets the color mode used when emitting colors during flush.
|
| |
| Terminal::ColorSupport | colorMode () const |
| | Returns the current color mode.
|
| |
Double-buffered character cell grid for TUI rendering.
Maintains front and back buffers. Widgets draw to the back buffer via setCell(). flush() diffs front vs back and emits minimal ANSI escape sequences for changed cells, then swaps buffers.
Colors are stored as full RGB values in each TuiCell. During flush(), the active colorMode() determines how those colors are emitted: TrueColor uses 24-bit RGB sequences, Color256 maps to the closest ANSI 256-color palette entry, Basic restricts to 16 system colors, and the Grayscale variants convert colors to perceptual luminance before emitting. NoColor suppresses all color output. The TUI will do its best to gracefully degrade color, but for optimal results, use a TuiPalette whose colors are tuned for the active color mode.
NOT an ObjectBase – this is infrastructure.
- Thread Safety
- Conditionally thread-safe. Distinct instances may be used concurrently; concurrent access to a single instance — including any combination of
setCell() / flush() / resize() — must be externally synchronized. In typical use a screen is owned and driven by a single TUI thread.