X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fconfig.h;h=9b62b8e5e009527fb483653290ef34f5d19d45b0;hb=1593473d6e27dbfca1a5f6b2c96acc2d902a19b6;hp=9797f9e40b72bb9704a2c7bcad517d358b2304ab;hpb=56dc0446cd8a9a2685e1ffadb58b781e52e1a95a;p=chaz%2Fopenbox diff --git a/openbox/config.h b/openbox/config.h index 9797f9e4..9b62b8e5 100644 --- a/openbox/config.h +++ b/openbox/config.h @@ -5,12 +5,14 @@ typedef enum { Config_String, - Config_Integer + Config_Integer, + Config_Bool } ConfigValueType; typedef union { char *string; int integer; + gboolean bool; } ConfigValue; typedef struct { @@ -19,11 +21,39 @@ typedef struct { ConfigValue value; } ConfigEntry; +typedef struct { + char *name; + char *descriptive_name; /* user friendly name */ + char *long_description; /* text description of option */ + ConfigValueType type; + /* if it is a string type optionally provide a list of valid strings */ + gboolean hasList; + GSList *values; +} ConfigDefEntry; + void config_startup(); void config_shutdown(); +/* Set a config variable's value. The variable must have already been defined + with a call to config_def_set */ gboolean config_set(char *name, ConfigValueType type, ConfigValue value); +/* Get a config variable's value. Returns FALSE if the value has not been + set. */ +gboolean config_get(char *name, ConfigValueType type, ConfigValue *value); + +/* Create a new config definition to add to the config system */ +ConfigDefEntry *config_def_new(char *name, ConfigValueType type, + char *descriptive_name, char *long_description); + +/* Add a value to a String type config definition */ +gboolean config_def_add_value(ConfigDefEntry *entry, char *value); + +/* Sets up the definition in the config system, Don't free or touch the entry + after setting it with this. It is invalidated even if the function returns + FALSE. */ +gboolean config_def_set(ConfigDefEntry *entry); + void config_parse(); #endif