summaryrefslogtreecommitdiffstats
path: root/apps/settings_list.h
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2007-01-24 03:14:07 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2007-01-24 03:14:07 +0000
commit0c3375648cdd22c341cfb632b66ae673a82aa52c (patch)
tree5fbf21d08bc616a63759f265b4f5365c85ea6b42 /apps/settings_list.h
parent228d62dd18906eaef814ec63cf888b30a94cd1c8 (diff)
downloadrockbox-0c3375648cdd22c341cfb632b66ae673a82aa52c.tar.gz
rockbox-0c3375648cdd22c341cfb632b66ae673a82aa52c.tar.bz2
rockbox-0c3375648cdd22c341cfb632b66ae673a82aa52c.zip
allow int settings to call a function to get the default value (Fixes the contrast problem on archos)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12102 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/settings_list.h')
-rw-r--r--apps/settings_list.h25
1 files changed, 18 insertions, 7 deletions
diff --git a/apps/settings_list.h b/apps/settings_list.h
index d76d10aea1..d9ad20077a 100644
--- a/apps/settings_list.h
+++ b/apps/settings_list.h
@@ -24,12 +24,15 @@
#include <limits.h>
#include "inttypes.h"
+typedef int (*_isfunc_type)(void);
+
union storage_type {
int int_;
unsigned int uint_;
bool bool_;
char *charptr;
unsigned char *ucharptr;
+ _isfunc_type func;
};
/* the variable type for the setting */
#define F_T_INT 1
@@ -53,12 +56,25 @@ struct bool_setting {
#define F_BOOL_SETTING F_T_BOOL|0x10
#define F_RGB 0x20
+struct filename_setting {
+ const char* prefix;
+ const char* suffix;
+ int max_len;
+};
+#define F_FILENAME 0x40
+
struct int_setting {
void (*option_callback)(int);
int min;
int max;
int step;
};
+/* these use the _isfunc_type type for the function */
+/* typedef int (*_isfunc_type)(void); */
+#define F_MIN_ISFUNC 0x100000 /* min(above) is function pointer to above type */
+#define F_MAX_ISFUNC 0x200000 /* max(above) is function pointer to above type */
+#define F_DEF_ISFUNC 0x400000 /* default_val is function pointer to above type */
+
#define F_NVRAM_BYTES_MASK 0xE00 /*0-4 bytes can be stored */
#define F_NVRAM_MASK_SHIFT 9
#define NVRAM_CONFIG_VERSION 2
@@ -68,14 +84,9 @@ struct int_setting {
- a NVRAM setting is removed
*/
-struct filename_setting {
- const char* prefix;
- const char* suffix;
- int max_len;
-};
-#define F_FILENAME 0x40
+
struct settings_list {
- uint32_t flags; /* ____ ____ ____ ____ ____ NNN_ _FRB STTT */
+ uint32_t flags; /* ____ ____ _FFF ____ ____ NNN_ IFRB STTT */
void *setting;
union storage_type default_val;
const char *cfg_name; /* this settings name in the cfg file */