summaryrefslogtreecommitdiff
path: root/firmware/include/font_cache.h
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/include/font_cache.h')
-rw-r--r--firmware/include/font_cache.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/firmware/include/font_cache.h b/firmware/include/font_cache.h
new file mode 100644
index 0000000000..813cd18987
--- /dev/null
+++ b/firmware/include/font_cache.h
@@ -0,0 +1,48 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 *
9 * Copyright (C) 2003 Tat Tang
10 *
11 * All files in this archive are subject to the GNU General Public License.
12 * See the file COPYING in the source tree root for full license agreement.
13 *
14 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
15 * KIND, either express or implied.
16 *
17 ****************************************************************************/
18
19#include "lru.h"
20
21/*******************************************************************************
22 *
23 ******************************************************************************/
24struct font_cache
25{
26 struct lru _lru;
27 int _size;
28 int _capacity;
29 short *_index; /* index of lru handles in char_code order */
30};
31
32struct font_cache_entry
33{
34 unsigned short _char_code;
35 unsigned char width;
36 unsigned char bitmap[1]; /* place holder */
37};
38
39/* void (*f) (void*, struct font_cache_entry*); */
40/* Create an auto sized font cache from buf */
41void font_cache_create(
42 struct font_cache* fcache, void* buf, int buf_size, int bitmap_bytes_size);
43/* Get font cache entry */
44struct font_cache_entry* font_cache_get(
45 struct font_cache* fcache,
46 unsigned short char_code,
47 void (*callback) (struct font_cache_entry* p, void *callback_data),
48 void *callback_data);