libpromeki main
PROfessional MEdia toolKIt
 
Loading...
Searching...
No Matches
TuiPainter Class Reference

Painting context for TUI widgets. More...

#include <painter.h>

Public Member Functions

 TuiPainter (TuiScreen &screen, const Rect2Di32 &clipRect)
 Constructs a TuiPainter.
 
void drawChar (int x, int y, char32_t ch)
 Draws a single character at the given position.
 
void drawText (int x, int y, const String &text)
 Draws horizontal text at the given position.
 
void drawRect (const Rect2Di32 &rect, char32_t ch=0)
 Draws a rectangle outline using the given character.
 
void fillRect (const Rect2Di32 &rect, char32_t ch=U' ')
 Fills a rectangle with the given character.
 
void drawHLine (int x, int y, int len, char32_t ch=U'\u2500')
 Draws a horizontal line.
 
void drawVLine (int x, int y, int len, char32_t ch=U'\u2502')
 Draws a vertical line.
 
void setForeground (const Color &color)
 Sets the current foreground color.
 
void setBackground (const Color &color)
 Sets the current background color.
 
void setAttrs (uint8_t attrs)
 Sets the current attribute flags.
 
void setStyle (const TuiStyle &style)
 Sets all visual properties from a TuiStyle.
 
Color foreground () const
 Returns the current foreground color.
 
Color background () const
 Returns the current background color.
 
uint8_t attrs () const
 Returns the current attribute flags.
 
const TuiStylestyle () const
 Returns the current style.
 
void setClipRect (const Rect2Di32 &rect)
 Sets the clipping rectangle.
 
const Rect2Di32clipRect () const
 Returns the current clipping rectangle.
 

Detailed Description

Painting context for TUI widgets.

Draws to a TuiScreen within a clipped region corresponding to the widget's visible area. Coordinates are relative to the clip region origin (the widget's top-left corner in screen coordinates).

Constructor & Destructor Documentation

◆ TuiPainter()

TuiPainter::TuiPainter ( TuiScreen screen,
const Rect2Di32 clipRect 
)

Constructs a TuiPainter.

Parameters
screenThe screen to draw to.
clipRectThe clipping rectangle in screen coordinates.

Member Function Documentation

◆ drawRect()

void TuiPainter::drawRect ( const Rect2Di32 rect,
char32_t  ch = 0 
)

Draws a rectangle outline using the given character.

If ch is 0, uses Unicode box-drawing characters.


The documentation for this class was generated from the following file: