Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
fonts/EAFontCacheEntry.h@7:6cf21b018420, 2010-11-01 (annotated)
- Committer:
- richardparker
- Date:
- Mon Nov 01 13:07:40 2010 +0000
- Revision:
- 7:6cf21b018420
Embedded Artists LCD panel:- Version 0.7
Who changed what in which revision?
| User | Revision | Line number | New contents of line | 
|---|---|---|---|
| richardparker | 7:6cf21b018420 | 1 | // Copyright 2010 Richard Parker | 
| richardparker | 7:6cf21b018420 | 2 | |
| richardparker | 7:6cf21b018420 | 3 | #ifndef MBED_EAFONTCACHEENTRY_H | 
| richardparker | 7:6cf21b018420 | 4 | #define MBED_EAFONTCACHEENTRY_H | 
| richardparker | 7:6cf21b018420 | 5 | |
| richardparker | 7:6cf21b018420 | 6 | #include "mbed.h" | 
| richardparker | 7:6cf21b018420 | 7 | |
| richardparker | 7:6cf21b018420 | 8 | #include <string> | 
| richardparker | 7:6cf21b018420 | 9 | #include <vector> | 
| richardparker | 7:6cf21b018420 | 10 | |
| richardparker | 7:6cf21b018420 | 11 | #include "EAFont.h" | 
| richardparker | 7:6cf21b018420 | 12 | #include "EAImage.h" | 
| richardparker | 7:6cf21b018420 | 13 | |
| richardparker | 7:6cf21b018420 | 14 | /** | 
| richardparker | 7:6cf21b018420 | 15 | * Class to handle the font cache entries for the EA LCD. | 
| richardparker | 7:6cf21b018420 | 16 | * @author Richard Parker | 
| richardparker | 7:6cf21b018420 | 17 | */ | 
| richardparker | 7:6cf21b018420 | 18 | class EAFontCacheEntry | 
| richardparker | 7:6cf21b018420 | 19 | { | 
| richardparker | 7:6cf21b018420 | 20 | public: | 
| richardparker | 7:6cf21b018420 | 21 | EAFontCacheEntry(); | 
| richardparker | 7:6cf21b018420 | 22 | ~EAFontCacheEntry(); | 
| richardparker | 7:6cf21b018420 | 23 | |
| richardparker | 7:6cf21b018420 | 24 | bool load(const std::string& path); | 
| richardparker | 7:6cf21b018420 | 25 | void unload(); | 
| richardparker | 7:6cf21b018420 | 26 | |
| richardparker | 7:6cf21b018420 | 27 | inline const std::string& path() { return _path; } | 
| richardparker | 7:6cf21b018420 | 28 | inline int noChars() { return _chars.size(); } | 
| richardparker | 7:6cf21b018420 | 29 | inline const std::vector<EAFont::EACharacter>& chars() { return _chars; } | 
| richardparker | 7:6cf21b018420 | 30 | inline const EAImage& data() { return _img; } | 
| richardparker | 7:6cf21b018420 | 31 | inline int references() { return _refs; } | 
| richardparker | 7:6cf21b018420 | 32 | |
| richardparker | 7:6cf21b018420 | 33 | void incReferences(); | 
| richardparker | 7:6cf21b018420 | 34 | void decReferences(); | 
| richardparker | 7:6cf21b018420 | 35 | |
| richardparker | 7:6cf21b018420 | 36 | private: | 
| richardparker | 7:6cf21b018420 | 37 | std::vector<EAFont::EACharacter> _chars; | 
| richardparker | 7:6cf21b018420 | 38 | std::string _path; | 
| richardparker | 7:6cf21b018420 | 39 | int _refs; | 
| richardparker | 7:6cf21b018420 | 40 | EAImage _img; | 
| richardparker | 7:6cf21b018420 | 41 | |
| richardparker | 7:6cf21b018420 | 42 | }; | 
| richardparker | 7:6cf21b018420 | 43 | |
| richardparker | 7:6cf21b018420 | 44 | #endif |