LCD LIB
Fork of RA8875 by
TextDisplay Class Reference
A text display class that supports character based presentation. More...
#include <TextDisplay.h>
Inherited by GraphicsDisplay.
Public Member Functions | |
TextDisplay (const char *name=NULL) | |
Create a TextDisplay interface. | |
virtual int | character (int x, int y, int c)=0 |
destructor to clean up | |
virtual int | rows ()=0 |
return number of rows on TextDisplay | |
virtual int | columns ()=0 |
return number if columns on TextDisplay | |
virtual bool | claim (FILE *stream) |
redirect output from a stream (stoud, sterr) to display | |
virtual RetCode_t | cls (uint16_t layers=0)=0 |
clear screen | |
virtual RetCode_t | locate (textloc_t column, textloc_t row)=0 |
locate the cursor at a character position. | |
virtual RetCode_t | foreground (color_t color)=0 |
set the foreground color | |
virtual RetCode_t | background (color_t color)=0 |
set the background color | |
Protected Member Functions | |
virtual int | _putc (int value) |
a method to put a character to the display. | |
virtual int | _getc () |
a method to get a character from the stdin | |
Protected Attributes | |
uint16_t | _column |
character column location | |
uint16_t | _row |
character row location | |
color_t | _foreground |
presently set foreground color | |
color_t | _background |
presently set background color | |
char * | _path |
stream name when redirecting stdio |
Detailed Description
A text display class that supports character based presentation.
Definition at line 26 of file TextDisplay.h.
Constructor & Destructor Documentation
TextDisplay | ( | const char * | name = NULL ) |
Create a TextDisplay interface.
- Parameters:
-
name The name used in the path to access the display through the stdio stream.
Definition at line 22 of file TextDisplay.cpp.
Member Function Documentation
int _getc | ( | ) | [protected, virtual] |
a method to get a character from the stdin
- Returns:
- the fetched character.
Definition at line 82 of file TextDisplay.cpp.
int _putc | ( | int | value ) | [protected, virtual] |
a method to put a character to the display.
- Parameters:
-
value is the character value to send to the display
- Returns:
- the character that was sent.
Reimplemented in RA8875.
Definition at line 40 of file TextDisplay.cpp.
virtual RetCode_t background | ( | color_t | color ) | [pure virtual] |
set the background color
- Note:
- this method may be overridden in a derived class.
- Parameters:
-
[in] color is color to use for background drawing.
- Returns:
- error code.
Implemented in RA8875.
virtual int character | ( | int | x, |
int | y, | ||
int | c | ||
) | [pure virtual] |
destructor to clean up
output a character at the given position
- Note:
- this method may be overridden in a derived class.
- Parameters:
-
[in] x position in pixels [in] y position in pixels [in] c the character to be written to the TextDisplay
- Returns:
- number of pixels to advance the cursor which could be the cell width for non-proportional characters, or the actual character width for proportional characters.
Implemented in GraphicsDisplay.
bool claim | ( | FILE * | stream ) | [virtual] |
redirect output from a stream (stoud, sterr) to display
- Note:
- this method may be overridden in a derived class.
- Parameters:
-
[in] stream that shall be redirected to the TextDisplay
- Returns:
- true if the claim succeeded.
Definition at line 101 of file TextDisplay.cpp.
RetCode_t cls | ( | uint16_t | layers = 0 ) |
[pure virtual] |
clear screen
- Note:
- this method may be overridden in a derived class.
- Parameters:
-
[in] layers is ignored, but supports maintaining the same API for the graphics layer.
- Returns:
- error code.
Implemented in GraphicsDisplay, and RA8875.
Definition at line 64 of file TextDisplay.cpp.
virtual int columns | ( | ) | [pure virtual] |
return number if columns on TextDisplay
- Note:
- this method may be overridden in a derived class.
- Returns:
- number of text rows for the display for the currently active font.
Implemented in GraphicsDisplay, and RA8875.
virtual RetCode_t foreground | ( | color_t | color ) | [pure virtual] |
set the foreground color
- Note:
- this method may be overridden in a derived class.
- Parameters:
-
[in] color is color to use for foreground drawing.
- Returns:
- error code.
Implemented in RA8875.
RetCode_t locate | ( | textloc_t | column, |
textloc_t | row | ||
) | [pure virtual] |
locate the cursor at a character position.
Based on the currently active font, locate the cursor on screen.
- Note:
- this method may be overridden in a derived class.
- Parameters:
-
[in] column is the horizontal offset from the left side. [in] row is the vertical offset from the top.
- Returns:
- error code.
Implemented in RA8875.
Definition at line 74 of file TextDisplay.cpp.
virtual int rows | ( | ) | [pure virtual] |
return number of rows on TextDisplay
- Note:
- this method may be overridden in a derived class.
- Returns:
- number of text rows for the display for the currently active font.
Implemented in GraphicsDisplay, and RA8875.
Field Documentation
color_t _background [protected] |
presently set background color
Definition at line 145 of file TextDisplay.h.
uint16_t _column [protected] |
character column location
Definition at line 140 of file TextDisplay.h.
color_t _foreground [protected] |
presently set foreground color
Definition at line 144 of file TextDisplay.h.
char* _path [protected] |
stream name when redirecting stdio
Definition at line 146 of file TextDisplay.h.
uint16_t _row [protected] |
character row location
Definition at line 141 of file TextDisplay.h.
Generated on Tue Jul 12 2022 20:19:47 by 1.7.2