More significant mmenu changes, couple minor fixes/additions to libpnd proper
[pandora-libraries.git] / minimenu / mmcat.h
1
2 #ifndef h_mmcat_h
3 #define h_mmcat_h
4
5 typedef struct _mm_appref_t {
6   pnd_disco_t *ref;
7   pnd_conf_handle ovrh;
8   // anything else?
9   struct _mm_appref_t *next;
10 } mm_appref_t;
11
12 typedef struct {
13   char *catname;          // name of the category
14   mm_appref_t *refs;      // apps (from g_active_apps) that are in this category
15   unsigned int refcount;  // how many apps in this category
16 } mm_category_t;
17
18 #define MAX_CATS 100
19
20 #define CATEGORY_ALL "All"
21
22 // try to populate as many cats as necessary
23 unsigned char category_push ( char *catname, pnd_disco_t *app, pnd_conf_handle ovrh ); // catname is not pulled from app, so we can make them up on the fly (ie: "All")
24 mm_category_t *category_query ( char *catname );
25 void category_dump ( void ); // sort the apprefs
26 void category_freeall ( void );
27
28 // category mapping hack
29 typedef struct {
30   mm_category_t *target;  // mapping a category _to_ this other category
31   char *from;             // from this category
32 } mm_catmap_t;
33
34 unsigned char category_map_setup ( void ); // set up the mappings
35 mm_category_t *category_map_query ( char *cat );
36 unsigned char category_meta_push ( char *catname, pnd_disco_t *app, pnd_conf_handle ovrh );
37
38 #endif