|
VT100 Terminal App
Circle VT100 module documentation
|
Combines Circle framebuffer access with a VT100-aware state machine. More...
#include <TRenderer.h>
Classes | |
| struct | TRendererState |
Public Member Functions | |
| CTRenderer (void) | |
| ~CTRenderer (void) | |
| Release renderer resources and buffers. | |
| boolean | Initialize (void) |
| Initialize framebuffer access and Circle device registration. | |
| boolean | SetFont (const TFont &rFont, CCharGenerator::TFontFlags FontFlags=CCharGenerator::FontFlagsNone) |
| Set the font to be used. | |
| boolean | SetFont (EFontSelection selection, CCharGenerator::TFontFlags FontFlags=CCharGenerator::FontFlagsNone) |
| Set the font by selection identifier. | |
| TRendererColor | MapColor (EColorSelection color) |
| Translate a configured color selection into the renderer palette. | |
| unsigned | GetWidth (void) const |
| Query the screen width in pixels. | |
| unsigned | GetHeight (void) const |
| Query the screen height in pixels. | |
| unsigned | GetColumns (void) const |
| Query the screen width in characters. | |
| unsigned | GetRows (void) const |
| Query the screen height in characters. | |
| unsigned | GetCursorColumn (void) const |
| Query the current cursor column (0-based). | |
| unsigned | GetCursorRow (void) const |
| Query the current cursor row (0-based). | |
| CBcmFrameBuffer * | GetDisplay (void) |
| Access the underlying framebuffer device. | |
| void | ClearDisplay (void) |
| Clear entire display area and home the cursor. | |
| int | Write (const void *pBuffer, size_t nCount) override |
| Write characters to screen. | |
| void | ResetParserState (void) |
| Reset ANSI parser state (used by VT tests). | |
| void | Goto (unsigned nRow, unsigned nColumn) |
| Move the cursor to a specific position. | |
| void | SetPixel (unsigned nPosX, unsigned nPosY, TRendererColor Color) |
| Set a pixel to a specific logical color. | |
| void | SetPixel (unsigned nPosX, unsigned nPosY, CDisplay::TRawColor nColor) |
| Set a pixel to a specific raw color. | |
| TRendererColor | GetPixel (unsigned nPosX, unsigned nPosY) |
| Get the color value of a pixel. | |
| boolean | SetColors (EColorSelection Foreground, EColorSelection Background) |
| Set the text colors using logical selections. | |
| void | SetColors (TRendererColor Foreground=kColorWhite, TRendererColor Background=kColorBlack) |
| Set the text colors using explicit renderer colors. | |
| void | SetCursorBlock (boolean bCursorBlock) |
| Enable a block cursor instead of the default underline. | |
| void | SetBlinkingCursor (boolean bBlinkingCursor, unsigned nPeriodMilliSeconds=500) |
| Enable or disable cursor blinking. | |
| void | Update (void) |
| Periodic display maintenance invoked from the task loop. | |
| void | SetCursorMode (boolean bVisible) |
| Enable or disable cursor visibility. | |
| void | SetVT52Mode (boolean bEnable) |
| Enable or disable VT52 emulation mode. | |
| void | SetAutoPageMode (boolean bEnable) |
| Enable or disable automatic page mode (cursor wrap to top). | |
| void | SetSmoothScrollEnabled (boolean bEnable) |
| Enable or disable smooth-scroll animation. | |
| boolean | GetSmoothScrollEnabled (void) const |
| Query whether smooth-scroll animation is enabled. | |
| void | ForceHideCursor (void) |
| Force-hide the cursor and restore underlying pixels. | |
| void | Run (void) override |
| Entry point of the rendering task. | |
| void | SetRawPixel (unsigned nPosX, unsigned nPosY, CDisplay::TRawColor nColor) |
| Set a pixel to a specific raw color. | |
| CDisplay::TRawColor | GetRawPixel (unsigned nPosX, unsigned nPosY) |
| Get the raw color value of a pixel. | |
| CDisplay::TColor | AdjustBrightness (CDisplay::TColor color, float factor) |
| Adjust brightness of a logical color. | |
| CDisplay::TRawColor | AdjustBrightness565 (CDisplay::TRawColor color, float factor) |
| Adjust brightness of a raw RGB565 color. | |
| void | SetBrightnessScaling (float boldFactor=1.6f, float reverseBackgroundFactor=0.7f, float reverseForegroundFactor=1.25f) |
| Set scaling factors for bold and reverse video attributes. | |
| void | doRenderTest (void) |
| Conduct a rendering self-test using various attributes. | |
| void | SaveState (TRendererState &state) |
| Save the current renderer state for later restore. | |
| void | RestoreState (const TRendererState &state) |
| Restore a previously saved renderer state. | |
| size_t | GetBufferSize (void) const |
| Query the size of the internal pixel buffer. | |
| void | SaveScreenBuffer (void *buffer, size_t bufferSize) |
| Save the internal pixel buffer into a caller-provided buffer. | |
| void | RestoreScreenBuffer (const void *buffer, size_t bufferSize) |
| Restore the internal pixel buffer from a caller-provided buffer. | |
Static Public Member Functions | |
| static CTRenderer * | Get (void) |
| Access the singleton renderer instance. | |
Combines Circle framebuffer access with a VT100-aware state machine.
CTRenderer implements the full terminal drawing pipeline including escape sequence handling, scrolling regions, cursor updates, and attribute effects. By inheriting from CDevice it can receive bytes directly from the ANSI parser, while inheriting from CTask permits cooperative refresh and cursor blinking without busy waiting.
| CTRenderer::CTRenderer | ( | void | ) |
Creates a CTRenderer instance with default font selection VT100Font10x20 and no font flags and white on black colors.
| CDisplay::TColor CTRenderer::AdjustBrightness | ( | CDisplay::TColor | color, |
| float | factor | ||
| ) |
Adjust brightness of a logical color.
| color | The logical color to be adjusted. |
| factor | Brightness factor (1.0 = no change, < 1.0 = darker, > 1.0 = brighter). |
| CDisplay::TRawColor CTRenderer::AdjustBrightness565 | ( | CDisplay::TRawColor | color, |
| float | factor | ||
| ) |
Adjust brightness of a raw RGB565 color.
| color | The raw RGB565 color to be adjusted. |
| factor | Brightness factor (1.0 = no change, < 1.0 = darker, > 1.0 = brighter). |
|
static |
Access the singleton renderer instance.
| unsigned CTRenderer::GetColumns | ( | void | ) | const |
Query the screen width in characters.
| CBcmFrameBuffer * CTRenderer::GetDisplay | ( | void | ) |
Access the underlying framebuffer device.
| unsigned CTRenderer::GetHeight | ( | void | ) | const |
Query the screen height in pixels.
| TRendererColor CTRenderer::GetPixel | ( | unsigned | nPosX, |
| unsigned | nPosY | ||
| ) |
Get the color value of a pixel.
| nPosX | X-Position of the pixel (based on 0). |
| nPosY | Y-Position of the pixel (based on 0). |
|
inline |
Get the raw color value of a pixel.
| nPosX | X-Position of the pixel (based on 0). |
| nPosY | Y-Position of the pixel (based on 0). |
| unsigned CTRenderer::GetRows | ( | void | ) | const |
Query the screen height in characters.
|
inline |
Query whether smooth-scroll animation is enabled.
| unsigned CTRenderer::GetWidth | ( | void | ) | const |
Query the screen width in pixels.
| void CTRenderer::Goto | ( | unsigned | nRow, |
| unsigned | nColumn | ||
| ) |
Move the cursor to a specific position.
| nRow | Row number (based on 0). |
| nColumn | Column number (based on 0). |
| boolean CTRenderer::Initialize | ( | void | ) |
Initialize framebuffer access and Circle device registration.
| TRendererColor CTRenderer::MapColor | ( | EColorSelection | color | ) |
Translate a configured color selection into the renderer palette.
| color | Logical color selection enum value. |
| void CTRenderer::SetAutoPageMode | ( | boolean | bEnable | ) |
Enable or disable automatic page mode (cursor wrap to top).
| bEnable | TRUE to enable auto page mode, FALSE for normal scrolling. |
| void CTRenderer::SetBlinkingCursor | ( | boolean | bBlinkingCursor, |
| unsigned | nPeriodMilliSeconds = 500 |
||
| ) |
Enable or disable cursor blinking.
| bBlinkingCursor | TRUE to enable blinking. |
| nPeriodMilliSeconds | Blink period in milliseconds. |
| void CTRenderer::SetBrightnessScaling | ( | float | boldFactor = 1.6f, |
| float | reverseBackgroundFactor = 0.7f, |
||
| float | reverseForegroundFactor = 1.25f |
||
| ) |
Set scaling factors for bold and reverse video attributes.
| boldFactor | Scaling factor for bold attribute. |
| reverseBackgroundFactor | Scaling factor for reverse video background. |
| reverseForegroundFactor | Scaling factor for reverse video foreground. |
| boolean CTRenderer::SetColors | ( | EColorSelection | Foreground, |
| EColorSelection | Background | ||
| ) |
Set the text colors using logical selections.
| Foreground | Foreground color selection. |
| Background | Background color selection. |
| void CTRenderer::SetColors | ( | TRendererColor | Foreground = kColorWhite, |
| TRendererColor | Background = kColorBlack |
||
| ) |
Set the text colors using explicit renderer colors.
| Foreground | Foreground color value. |
| Background | Background color value. |
| void CTRenderer::SetCursorBlock | ( | boolean | bCursorBlock | ) |
Enable a block cursor instead of the default underline.
| bCursorBlock | TRUE to enable block cursor mode. |
| void CTRenderer::SetCursorMode | ( | boolean | bVisible | ) |
Enable or disable cursor visibility.
| bVisible | TRUE to show the cursor. |
| bool CTRenderer::SetFont | ( | const TFont & | rFont, |
| CCharGenerator::TFontFlags | FontFlags = CCharGenerator::FontFlagsNone |
||
| ) |
Set the font to be used.
| rFont | Font to be used for text rendering. |
| FontFlags | Optional generator font flags. |
| bool CTRenderer::SetFont | ( | EFontSelection | selection, |
| CCharGenerator::TFontFlags | FontFlags = CCharGenerator::FontFlagsNone |
||
| ) |
Set the font by selection identifier.
| selection | Font selection identifier. |
| FontFlags | Optional generator font flags. |
| void CTRenderer::SetPixel | ( | unsigned | nPosX, |
| unsigned | nPosY, | ||
| CDisplay::TRawColor | nColor | ||
| ) |
Set a pixel to a specific raw color.
| nPosX | X-Position of the pixel (based on 0). |
| nPosY | Y-Position of the pixel (based on 0). |
| nColor | The raw color to be set. |
| void CTRenderer::SetPixel | ( | unsigned | nPosX, |
| unsigned | nPosY, | ||
| TRendererColor | Color | ||
| ) |
Set a pixel to a specific logical color.
| nPosX | X-Position of the pixel (based on 0). |
| nPosY | Y-Position of the pixel (based on 0). |
| Color | The logical color to be set. |
|
inline |
Set a pixel to a specific raw color.
| nPosX | X-Position of the pixel (based on 0). |
| nPosY | Y-Position of the pixel (based on 0). |
| nColor | The raw color to be set. |
| void CTRenderer::SetSmoothScrollEnabled | ( | boolean | bEnable | ) |
Enable or disable smooth-scroll animation.
| bEnable | TRUE to enable smooth-scroll animation. |
| void CTRenderer::SetVT52Mode | ( | boolean | bEnable | ) |
Enable or disable VT52 emulation mode.
| bEnable | TRUE to enable VT52 mode, FALSE for ANSI mode. |
|
override |
Write characters to screen.
| pBuffer | Pointer to the characters to be written. |
| nCount | Number of characters to be written. |