Added category mapping support to mmenu .. lets user define what categories to have...
[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   // anything else?
8   struct _mm_appref_t *next;
9 } mm_appref_t;
10
11 typedef struct {
12   char *catname;          // name of the category
13   mm_appref_t *refs;      // apps (from g_active_apps) that are in this category
14   unsigned int refcount;  // how many apps in this category
15 } mm_category_t;
16
17 #define MAX_CATS 100
18
19 #define CATEGORY_ALL "All"
20
21 // try to populate as many cats as necessary
22 unsigned char category_push ( char *catname, pnd_disco_t *app ); // catname is not pulled from app, so we can make them up on the fly (ie: "All")
23 mm_category_t *category_query ( char *catname );
24 void category_dump ( void ); // sort the apprefs
25 void category_freeall ( void );
26
27 // category mapping hack
28 typedef struct {
29   mm_category_t *target;  // mapping a category _to_ this other category
30   char *from;             // from this category
31 } mm_catmap_t;
32
33 unsigned char category_map_setup ( void ); // set up the mappings
34 mm_category_t *category_map_query ( char *cat );
35 unsigned char category_meta_push ( char *catname, pnd_disco_t *app );
36
37 #endif