Foundation classes for a basic GUI implementing simple widgets and events

Dependents:   TouchScreenGUIDemo

Committer:
duncanFrance
Date:
Sat May 28 14:50:14 2016 +0000
Revision:
18:d849f3ada858
Parent:
8:a460cabc85ac
Moved the event queue into the EventDispatcher; Improved event handling across Window/Widget

Who changed what in which revision?

UserRevisionLine numberNew contents of line
duncanFrance 7:303850a4b30c 1 #ifndef SIMPLEGUI_FAST_FONT_H
duncanFrance 7:303850a4b30c 2 #define SIMPLEGUI_FAST_FONT_H
duncanFrance 7:303850a4b30c 3
duncanFrance 7:303850a4b30c 4 #include "mbed.h" // types
duncanFrance 7:303850a4b30c 5 #include "Font.h"
duncanFrance 7:303850a4b30c 6
duncanFrance 7:303850a4b30c 7 #define FAST_FONT_HEIGHT 0
duncanFrance 7:303850a4b30c 8 #define FAST_FONT_DATA_BYTES_PER_GLYPH 1
duncanFrance 7:303850a4b30c 9 #define FAST_FONT_FIRST_ASCII 2
duncanFrance 7:303850a4b30c 10 #define FAST_FONT_LAST_ASCII 3
duncanFrance 7:303850a4b30c 11 #define FAST_FONT_PROPORTIONAL 4
duncanFrance 7:303850a4b30c 12 #define FAST_FONT_DATA 5
duncanFrance 7:303850a4b30c 13
duncanFrance 7:303850a4b30c 14 class FastFont : public Font
duncanFrance 7:303850a4b30c 15 {
duncanFrance 7:303850a4b30c 16
duncanFrance 7:303850a4b30c 17 public:
duncanFrance 7:303850a4b30c 18
duncanFrance 7:303850a4b30c 19 FastFont(uint8_t* fastFont);
duncanFrance 7:303850a4b30c 20
duncanFrance 7:303850a4b30c 21 virtual uint8_t firstAscii();
duncanFrance 7:303850a4b30c 22 virtual uint8_t lastAscii();
duncanFrance 7:303850a4b30c 23 /**
duncanFrance 7:303850a4b30c 24 * The unzoomed width of the character
duncanFrance 7:303850a4b30c 25 **/
duncanFrance 7:303850a4b30c 26 virtual uint8_t widthOf(char c);
duncanFrance 7:303850a4b30c 27 virtual uint8_t zoomedWidthOf(char c);
duncanFrance 7:303850a4b30c 28 /**
duncanFrance 7:303850a4b30c 29 * The unzoomed height of a character
duncanFrance 7:303850a4b30c 30 **/
duncanFrance 7:303850a4b30c 31 virtual uint8_t height();
duncanFrance 7:303850a4b30c 32 virtual uint8_t zoomedHeight();
duncanFrance 7:303850a4b30c 33 virtual bool isProportional();
duncanFrance 7:303850a4b30c 34
duncanFrance 7:303850a4b30c 35 /*********************************
duncanFrance 7:303850a4b30c 36 * Methods specific to this class
duncanFrance 7:303850a4b30c 37 *********************************/
duncanFrance 7:303850a4b30c 38 uint8_t totalBytesPerGlyph();
duncanFrance 7:303850a4b30c 39 uint8_t dataBytesPerGlyph();
duncanFrance 7:303850a4b30c 40 uint8_t bytesPerRow();
duncanFrance 7:303850a4b30c 41 uint8_t* glyph(char c);
duncanFrance 7:303850a4b30c 42
duncanFrance 7:303850a4b30c 43
duncanFrance 7:303850a4b30c 44 private:
duncanFrance 7:303850a4b30c 45
duncanFrance 7:303850a4b30c 46 uint8_t* _font;
duncanFrance 7:303850a4b30c 47 uint8_t _totalBytesPerGlyph;
duncanFrance 7:303850a4b30c 48 uint8_t _bytesPerRow;
duncanFrance 7:303850a4b30c 49 };
duncanFrance 7:303850a4b30c 50
duncanFrance 7:303850a4b30c 51
duncanFrance 7:303850a4b30c 52 #endif