Revert "Replace yield_codec() with a call to queue_wait_w_tmo()" and the related...
[Rockbox.git] / firmware / include / font_cache.h
blob813cd189872d6de5b5256c06c6387f83931ddb68
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
9 * Copyright (C) 2003 Tat Tang
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.
14 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
15 * KIND, either express or implied.
17 ****************************************************************************/
19 #include "lru.h"
21 /*******************************************************************************
23 ******************************************************************************/
24 struct font_cache
26 struct lru _lru;
27 int _size;
28 int _capacity;
29 short *_index; /* index of lru handles in char_code order */
32 struct font_cache_entry
34 unsigned short _char_code;
35 unsigned char width;
36 unsigned char bitmap[1]; /* place holder */
39 /* void (*f) (void*, struct font_cache_entry*); */
40 /* Create an auto sized font cache from buf */
41 void font_cache_create(
42 struct font_cache* fcache, void* buf, int buf_size, int bitmap_bytes_size);
43 /* Get font cache entry */
44 struct 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);