brw1

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

TextDisplay Class Reference

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
 output a character at the given position
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

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:
nameThe name used in the path to access the display through the stdio stream.

Definition at line 22 of file TextDisplay.cpp.


Member Function Documentation

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]coloris color to use for background drawing.
Returns:
error code.

Implemented in RA8875.

virtual int character ( int  x,
int  y,
int  c 
) [pure virtual]

output a character at the given position

Note:
this method may be overridden in a derived class.
Parameters:
[in]xposition in pixels
[in]yposition in pixels
[in]cthe 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]streamthat shall be redirected to the TextDisplay
Returns:
true if the claim succeeded.

Definition at line 95 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]layersis ignored, but supports maintaining the same API for the graphics layer.
Returns:
error code.

Implemented in GraphicsDisplay, and RA8875.

Definition at line 58 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]coloris 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]columnis the horizontal offset from the left side.
[in]rowis the vertical offset from the top.
Returns:
error code.

Implemented in RA8875.

Definition at line 68 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.