10 #ifndef TEXTDISPLAY_HPP 11 #define TEXTDISPLAY_HPP 13 #include <boost/noncopyable.hpp> 16 namespace duds {
namespace hardware {
64 virtual void moveImpl(
unsigned int c,
unsigned int r) = 0;
77 virtual void writeImpl(
const std::string &text);
84 const std::string &text,
115 void move(
unsigned int c,
unsigned int r);
131 void write(
const std::string &text);
144 void write(
const std::string &text,
unsigned int c,
unsigned int r);
150 virtual void clear() = 0;
161 void clearTo(
unsigned int c,
unsigned int r);
192 #endif // #ifndef TEXTDISPLAY_HPP unsigned int columnPos() const
The current column position of the cursor.
void move(unsigned int c, unsigned int r)
Moves the cursor to the given location.
virtual void clear()=0
Removes all text from the display and moves the cursor to the upper left corner.
unsigned int columns() const
Returns the number of columns on the display.
std::uint8_t cpos
Cursor column position.
virtual void writeImpl(int c)=0
Writes a single character onto the display at the current cursor location.
std::uint8_t columnsize
Number of columns on the display.
std::uint8_t rowsize
Number of rows on the display.
std::uint8_t rpos
Cursor row position.
virtual ~TextDisplay()=0
Allows destruction of a pointer of this base class to properly destruct the derived object...
unsigned int rows() const
Returns the number of rows on the display.
TextDisplay()
Initializes the object with an invalid display size and cursor position.
A fairly generic interface to a character based display that lacks color.
virtual void moveImpl(unsigned int c, unsigned int r)=0
Moves the display's cursor to the indicated position.
void clearTo(unsigned int c, unsigned int r)
Clear text from the current cursor position to the given position, inclusive.
void write(int c)
Writes a single character onto the display at the current cursor location and advances the cursor...
unsigned int rowPos() const
The current row position of the cursor.
virtual bool advance()
Advances the column position, and if it goes off the visible portion of the display, updates the row position.