18PROMEKI_NAMESPACE_BEGIN
84 int cols()
const {
return _cols; }
87 int rows()
const {
return _rows; }
110 void clear(
const Color &fg = Color::White,
const Color &bg = Color::Black);
139 Terminal::ColorSupport
colorMode()
const {
return _colorMode; }
144 List<TuiCell> _front;
146 bool _fullRedraw =
true;
147 Terminal::ColorSupport _colorMode = Terminal::TrueColor;
149 int index(
int x,
int y)
const {
return y * _cols + x; }
150 bool inBounds(
int x,
int y)
const {
return x >= 0 && x < _cols && y >= 0 && y < _rows; }
152 void emitCell(AnsiStream &stream,
const TuiCell &cell,
int &cursorX,
int &cursorY,
int x,
int y,
153 Color &lastFg, Color &lastBg, uint8_t &lastStyle);
Double-buffered character cell grid for TUI rendering.
Definition screen.h:68
int cols() const
Returns the number of columns.
Definition screen.h:84
int rows() const
Returns the number of rows.
Definition screen.h:87
TuiScreen()
Constructs an empty screen with no buffers.
void setCell(int x, int y, const TuiCell &cell)
Sets a cell in the back buffer.
void resize(int cols, int rows)
Resizes both buffers to the given dimensions.
void flush(AnsiStream &stream)
Diffs front vs back buffer and emits minimal ANSI updates.
Terminal::ColorSupport colorMode() const
Returns the current color mode.
Definition screen.h:139
void setColorMode(Terminal::ColorSupport mode)
Sets the color mode used when emitting colors during flush.
Definition screen.h:133
TuiCell cell(int x, int y) const
Returns the cell at the given position in the back buffer.
void invalidate()
Forces a full redraw on the next flush.
void clear(const Color &fg=Color::White, const Color &bg=Color::Black)
Clears the back buffer with blank cells.
Visual properties of a TUI cell (everything except the character).
Definition style.h:35
A single cell in the TUI screen buffer.
Definition screen.h:33
bool operator!=(const TuiCell &other) const
Returns true if character or style differ.
Definition screen.h:40
bool operator==(const TuiCell &other) const
Returns true if both character and style match.
Definition screen.h:38
TuiStyle style
Visual style (colors and attributes).
Definition screen.h:35
Char ch
The Unicode character in this cell.
Definition screen.h:34