a8d6c7b68e18a74fefbe14c5e4adb5d879dc81ee
[pandora-libraries.git] / minimenu / mmconf.h
1
2 #ifndef h_mmconf_h
3 #define h_mmconf_h
4
5 typedef enum {
6   ct_nil,                       // nothing special
7   ct_switch_page,               // change to another page
8   ct_reset,                     // reset to defaults
9   ct_visible_tab_list,          // show list of _visible tabs_
10   ct_cpu_speed,                 // show available CPU speeds
11   ct_boolean,                   // boolean 1/0 value
12   ct_exit,                      // save and quit configuring
13   ct_filename,                  // pick a filename
14   //ct_category_list
15 } change_type_e;
16
17 #define CONF_MAX_LISTLENGTH 2000 /* no more than this number of tabs or apps in the show/hide config pages; perhaps should go multi-page for so many.. */
18
19 #define CONF_APPLIST_TAG "*applist*"
20 #define CONF_TABLIST_TAG "*tablist*"
21
22 typedef struct _confitem_t {
23   char *text;                   // human readable title
24   char *desc;                   // slightly longer description
25   char *def;                    // default value (to show user, and for resets); NULL means key is normally undefined
26
27   char *key;                    // key to find this item in the config box
28   change_type_e type;           // what happens with this value
29   struct _confitem_t *newhead;  // value for type: if specified, will switch to this page (for TOC page)
30 } confitem_t;
31
32 unsigned char conf_run_menu ( confitem_t *toplevel ); // returns >0 for 'request restart'
33 void conf_display_page ( confitem_t *page, unsigned int selitem, unsigned int first_visible, unsigned int max_visible );
34 #define CONF_SELECTED 1
35 #define CONF_UNSELECTED 0
36 unsigned char conf_prepare_page ( confitem_t *page );
37
38 void conf_merge_into ( char *fullpath, pnd_conf_handle h ); // merge fullpath as a conf file into 'h'; no turning back.
39 unsigned char conf_write ( pnd_conf_handle h, char *fullpath ); // emit a conf file, based on items known to conf-ui
40 #define CONF_PREF_FILENAME ".mmpref.conf" // or should be .mmprefrc? tend to use '.conf' already so go with it.
41 char *conf_determine_location ( pnd_conf_handle h ); // where to stick the conf file?
42 void conf_setup_missing ( pnd_conf_handle h ); // find missing keys, set them to default values
43
44 void conf_reset_to_default ( pnd_conf_handle h ); // sets keys to their default value (if they have one), all apps to show, all tabs to show
45
46 #endif