Basically i glued Peter Drescher and Simon Ford libs in a GraphicsDisplay class, then derived TFT or LCD class (which inherits Protocols class), then the most derived ones (Inits), which are per-display and are the only part needed to be adapted to diff hw.

Fork of UniGraphic by GraphicsDisplay

Embed: (wiki syntax)

« Back to documentation index

TextDisplay Class Reference

TextDisplay Class Reference

A common base class for Text displays. More...

#include <TextDisplay.h>

Inherited by GraphicsDisplay.

Public Member Functions

 TextDisplay (const char *name=NULL)
 Create a TextDisplay interface.
virtual void character (int column, int row, int c)=0
 output a character at the given position
virtual int rows ()=0
 return number of rows on TextDisplay
virtual int columns ()=0
 return number of columns on TextDisplay
virtual bool claim (FILE *stream)
 redirect output from a stream (stoud, sterr) to display
virtual void cls ()
 clear the entire screen
virtual void locate (int column, int row)
 locate the cursor at a character position.
virtual void foreground (uint16_t colour)
 set the foreground color
virtual void background (uint16_t colour)
 set the background color

Detailed Description

A common base class for Text displays.

Definition at line 23 of file TextDisplay.h.


Constructor & Destructor Documentation

TextDisplay ( const char *  name = NULL )

Create a TextDisplay interface.

Parameters:
nameThe name used in the path to access the strean through the filesystem

Definition at line 8 of file TextDisplay.cpp.


Member Function Documentation

void background ( uint16_t  colour ) [virtual]

set the background color

Note:
this method may be overridden in a derived class.
Parameters:
coloris color to use for background drawing.

Definition at line 61 of file TextDisplay.cpp.

virtual void character ( int  column,
int  row,
int  c 
) [pure virtual]

output a character at the given position

Parameters:
columncolumn where charater must be written
rowwhere character must be written
cthe character to be written to the TextDisplay
Note:
this method may be overridden in a derived class.

Implemented in GraphicsDisplay.

bool claim ( FILE *  stream ) [virtual]

redirect output from a stream (stoud, sterr) to display

Parameters:
streamstream that shall be redirected to the TextDisplay
Note:
this method may be overridden in a derived class.
Returns:
true if the claim succeeded.

Definition at line 65 of file TextDisplay.cpp.

void cls ( void   ) [virtual]

clear the entire screen

Note:
this method may be overridden in a derived class.

Reimplemented in LCD, TFT, TFT932x, and GraphicsDisplay.

Definition at line 41 of file TextDisplay.cpp.

virtual int columns (  ) [pure virtual]

return number of columns on TextDisplay

Returns:
number of columns
Note:
this method must be supported in the derived class.

Implemented in GraphicsDisplay.

void foreground ( uint16_t  colour ) [virtual]

set the foreground color

Note:
this method may be overridden in a derived class.
Parameters:
coloris color to use for foreground drawing.

Definition at line 57 of file TextDisplay.cpp.

void locate ( int  column,
int  row 
) [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:
columnis the horizontal offset from the left side.
rowis the vertical offset from the top.

Reimplemented in GraphicsDisplay.

Definition at line 48 of file TextDisplay.cpp.

virtual int rows (  ) [pure virtual]

return number of rows on TextDisplay

Returns:
number of rows
Note:
this method must be supported in the derived class.

Implemented in GraphicsDisplay.