![]() |
![]() |
![]() |
Grits Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Signals |
struct GritsPrefs; struct GritsPrefsClass; gboolean grits_prefs_get_boolean (GritsPrefs *prefs
,const gchar *key
,GError **error
); gboolean grits_prefs_get_boolean_v (GritsPrefs *prefs
,const gchar *group
,const gchar *key
,GError **error
); gdouble grits_prefs_get_double (GritsPrefs *prefs
,const gchar *key
,GError **error
); gdouble grits_prefs_get_double_v (GritsPrefs *prefs
,const gchar *group
,const gchar *key
,GError **error
); gint grits_prefs_get_integer (GritsPrefs *prefs
,const gchar *key
,GError **error
); gint grits_prefs_get_integer_v (GritsPrefs *prefs
,const gchar *group
,const gchar *key
,GError **error
); gchar * grits_prefs_get_string (GritsPrefs *prefs
,const gchar *key
,GError **error
); gchar * grits_prefs_get_string_v (GritsPrefs *prefs
,const gchar *group
,const gchar *key
,GError **error
); GritsPrefs * grits_prefs_new (const gchar *config
,const gchar *defaults
); void grits_prefs_set_boolean (GritsPrefs *prefs
,const gchar *key
,gboolean value
); void grits_prefs_set_boolean_v (GritsPrefs *prefs
,const gchar *group
,const gchar *key
,gboolean value
); void grits_prefs_set_double (GritsPrefs *prefs
,const gchar *key
,gdouble value
); void grits_prefs_set_double_v (GritsPrefs *prefs
,const gchar *group
,const gchar *key
,gdouble value
); void grits_prefs_set_integer (GritsPrefs *prefs
,const gchar *key
,gint value
); void grits_prefs_set_integer_v (GritsPrefs *prefs
,const gchar *group
,const gchar *key
,gint value
); void grits_prefs_set_string (GritsPrefs *prefs
,const gchar *key
,const gchar *string
); void grits_prefs_set_string_v (GritsPrefs *prefs
,const gchar *group
,const gchar *key
,const gchar *string
);
GritsPrefs is used to store and access preferences in grits. It is mostly a wrapper around a GKeyFile. Preferences can be stored for the application using grits, but may also be stored by grits itself. An example of this are whether grits is in online or offline mode. Many GritsPlugins also store preferences.
There are two variants of preference functions. The normal variant takes group and a key separated by a "/" as they key to the preference. The "_v" variant takes the group and the key as separate parameters.
gboolean grits_prefs_get_boolean (GritsPrefs *prefs
,const gchar *key
,GError **error
);
gboolean grits_prefs_get_boolean_v (GritsPrefs *prefs
,const gchar *group
,const gchar *key
,GError **error
);
gdouble grits_prefs_get_double (GritsPrefs *prefs
,const gchar *key
,GError **error
);
gdouble grits_prefs_get_double_v (GritsPrefs *prefs
,const gchar *group
,const gchar *key
,GError **error
);
gint grits_prefs_get_integer (GritsPrefs *prefs
,const gchar *key
,GError **error
);
gint grits_prefs_get_integer_v (GritsPrefs *prefs
,const gchar *group
,const gchar *key
,GError **error
);
gchar * grits_prefs_get_string (GritsPrefs *prefs
,const gchar *key
,GError **error
);
gchar * grits_prefs_get_string_v (GritsPrefs *prefs
,const gchar *group
,const gchar *key
,GError **error
);
GritsPrefs * grits_prefs_new (const gchar *config
,const gchar *defaults
);
Create a new preference object for the given config
. If the config does not
exist the defaults
file is loaded.
|
the path to the config file |
|
the path to the default config file |
Returns : |
the new GritsPrefs |
void grits_prefs_set_boolean (GritsPrefs *prefs
,const gchar *key
,gboolean value
);
void grits_prefs_set_boolean_v (GritsPrefs *prefs
,const gchar *group
,const gchar *key
,gboolean value
);
void grits_prefs_set_double (GritsPrefs *prefs
,const gchar *key
,gdouble value
);
void grits_prefs_set_double_v (GritsPrefs *prefs
,const gchar *group
,const gchar *key
,gdouble value
);
void grits_prefs_set_integer (GritsPrefs *prefs
,const gchar *key
,gint value
);
void grits_prefs_set_integer_v (GritsPrefs *prefs
,const gchar *group
,const gchar *key
,gint value
);
void grits_prefs_set_string (GritsPrefs *prefs
,const gchar *key
,const gchar *string
);
void grits_prefs_set_string_v (GritsPrefs *prefs
,const gchar *group
,const gchar *key
,const gchar *string
);
"pref-changed"
signalvoid user_function (GritsPrefs *prefs,
gchar *key,
guint type,
gpointer value,
gpointer user_data) : Run Last
The ::pref-changed signal is emitted each time a preference is changed.
|
the preference store. |
|
the key to the preference. |
|
the type of the preference that changed. |
|
a pointer to the value of the preference. |
|
user data set when the signal handler was connected. |