lib/unigraphic/TextDisplay.h

changeset 28
424d792fea4f
parent 5
f1c85c2500f2
child 55
694e5030b0e9
equal deleted inserted replaced
27:8f2be7aaec00 28:424d792fea4f
7 * the constructor (setup the display), character (put a character 7 * the constructor (setup the display), character (put a character
8 * at a location), rows and columns (number of rows/cols) functions. 8 * at a location), rows and columns (number of rows/cols) functions.
9 * Everything else (locate, printf, putc, cls) will come for free 9 * Everything else (locate, printf, putc, cls) will come for free
10 * 10 *
11 * The model is the display will wrap at the right and bottom, so you can 11 * The model is the display will wrap at the right and bottom, so you can
12 * keep writing and will always get valid characters. The location is 12 * keep writing and will always get valid characters. The location is
13 * maintained internally to the class to make this easy 13 * maintained internally to the class to make this easy
14 */ 14 */
15 15
16 #ifndef MBED_TEXTDISPLAY_H 16 #ifndef MBED_TEXTDISPLAY_H
17 #define MBED_TEXTDISPLAY_H 17 #define MBED_TEXTDISPLAY_H
18 18
19 #include "mbed.h" 19 #include <mbed.h>
20 #include <Stream.h>
21
20 22
21 /** A common base class for Text displays 23 /** A common base class for Text displays
22 */ 24 */
23 class TextDisplay : public Stream { 25 class TextDisplay : public Stream {
24 public: 26 public:
48 /** return number of columns on TextDisplay 50 /** return number of columns on TextDisplay
49 * @result number of columns 51 * @result number of columns
50 * @note this method must be supported in the derived class. 52 * @note this method must be supported in the derived class.
51 */ 53 */
52 virtual int columns() = 0; 54 virtual int columns() = 0;
53 55
54 // functions that come for free, but can be overwritten 56 // functions that come for free, but can be overwritten
55 // ---------------------------------------------------- 57 // ----------------------------------------------------
56 /** redirect output from a stream (stoud, sterr) to display 58 /** redirect output from a stream (stoud, sterr) to display
57 * @param stream stream that shall be redirected to the TextDisplay 59 * @param stream stream that shall be redirected to the TextDisplay
58 * @note this method may be overridden in a derived class. 60 * @note this method may be overridden in a derived class.
85 */ 87 */
86 virtual void background(uint16_t colour); 88 virtual void background(uint16_t colour);
87 89
88 // putc (from Stream) 90 // putc (from Stream)
89 // printf (from Stream) 91 // printf (from Stream)
90 92
91 protected: 93 protected:
92 94
93 virtual int _putc(int value); 95 virtual int _putc(int value);
94 virtual int _getc(); 96 virtual int _getc();
95 97

mercurial