mmenu: Mostly untested; pushing in list-view changes so porg/pmprog can fiddle easier :)
[pandora-libraries.git] / minimenu / mmcache.h
1
2 #ifndef h_mmcache_h
3 #define h_mmcache_h
4
5 /* this cache is used, rather than just pointing right from the mm_app_t iconcache, since many apps
6  * may re-use the same icon, this lets the apps just cross-link to the same icon to save a bit of
7  * memory; probably irrelevent, but what the heck, I'm writing this quick ;)
8  */
9
10 /* the same structure can be used to contain preview pics, in a different list of same type
11  */
12
13 typedef struct _mm_cache_t {
14   char uniqueid [ 1024 ]; // pnd unique-id
15   void /*SDL_Surface*/ *i;
16   void /*SDL_Surface*/ *itiny; // for list view
17   // structure
18   struct _mm_cache_t *next; // next in linked list
19 } mm_cache_t;
20
21 unsigned char cache_icon ( pnd_disco_t *app, unsigned char maxwidth, unsigned char maxheight );
22 unsigned char cache_preview ( pnd_disco_t *app, unsigned int maxwidth, unsigned int maxheight );
23
24 mm_cache_t *cache_query ( char *id, mm_cache_t *head );
25 mm_cache_t *cache_query_icon ( char *id ); // specialized version
26 mm_cache_t *cache_query_preview ( char *id ); // specialized version
27
28 unsigned char cache_find_writable ( char *originpath, char *r_writepath, unsigned int len );
29
30 #endif