Cairo-Dock
3.4.0
|
Functions | |
GKeyFile * | cairo_dock_open_key_file (const gchar *cConfFilePath) |
void | cairo_dock_write_keys_to_file (GKeyFile *pKeyFile, const gchar *cConfFilePath) |
void | cairo_dock_merge_conf_files (const gchar *cConfFilePath, gchar *cReplacementConfFilePath, gchar iIdentifier) |
void | cairo_dock_upgrade_conf_file_full (const gchar *cConfFilePath, GKeyFile *pKeyFile, const gchar *cDefaultConfFilePath, gboolean bUpdateKeys) |
void | cairo_dock_get_conf_file_version (GKeyFile *pKeyFile, gchar **cConfFileVersion) |
gboolean | cairo_dock_conf_file_needs_update (GKeyFile *pKeyFile, const gchar *cVersion) |
void | cairo_dock_add_remove_element_to_key (const gchar *cConfFilePath, const gchar *cGroupName, const gchar *cKeyName, gchar *cElementName, gboolean bAdd) |
void | cairo_dock_add_group_key_to_conf_file (GKeyFile *pKeyFile, const gchar *cGroupName, const gchar *ckeyName, const gchar *cInitialValue, CairoDockGUIWidgetType iWidgetType, const gchar *cAuthorizedValues, const gchar *cDescription, const gchar *cTooltip) |
void | cairo_dock_remove_group_key_from_conf_file (GKeyFile *pKeyFile, const gchar *cGroupName, const gchar *ckeyName) |
void | cairo_dock_update_keyfile (const gchar *cConfFilePath, GType iFirstDataType,...) |
This class provides useful functions to manipulate the conf files of Cairo-Dock, which are classic group/key pair files.
GKeyFile* cairo_dock_open_key_file | ( | const gchar * | cConfFilePath | ) |
Open a conf file to be read/written. Returns NULL if the file couldn't be found/opened/parsed. Free it with g_key_file_free after you're done.
void cairo_dock_write_keys_to_file | ( | GKeyFile * | pKeyFile, |
const gchar * | cConfFilePath | ||
) |
Write a key file on the disk.
void cairo_dock_merge_conf_files | ( | const gchar * | cConfFilePath, |
gchar * | cReplacementConfFilePath, | ||
gchar | iIdentifier | ||
) |
Merge the values of a conf-file into another one. Keys are filtered by an identifier on the original conf-file.
cConfFilePath | an up-to-date conf-file with old values, that will be updated. |
cReplacementConfFilePath | an old conf-file containing values we want to use |
iIdentifier | a character to filter the keys, or 0. |
void cairo_dock_upgrade_conf_file_full | ( | const gchar * | cConfFilePath, |
GKeyFile * | pKeyFile, | ||
const gchar * | cDefaultConfFilePath, | ||
gboolean | bUpdateKeys | ||
) |
Update a conf-file, by merging values from a given key-file into a template conf-file.
cConfFilePath | path to the conf-file to update. |
pKeyFile | a key-file with correct values, but old comments and possibly missing or old keys. It is not modified by the function. |
cDefaultConfFilePath | a template conf-file. |
bUpdateKeys | whether to remove old keys (hidden and persistent) or not. |
void cairo_dock_get_conf_file_version | ( | GKeyFile * | pKeyFile, |
gchar ** | cConfFileVersion | ||
) |
Get the version of a conf file. The version is written on the first line of the file, as a comment.
gboolean cairo_dock_conf_file_needs_update | ( | GKeyFile * | pKeyFile, |
const gchar * | cVersion | ||
) |
Say if a conf file's version mismatches a given version.
void cairo_dock_add_remove_element_to_key | ( | const gchar * | cConfFilePath, |
const gchar * | cGroupName, | ||
const gchar * | cKeyName, | ||
gchar * | cElementName, | ||
gboolean | bAdd | ||
) |
Add or remove a value in a list of values to a given (group,key) pair of a conf file.
void cairo_dock_add_group_key_to_conf_file | ( | GKeyFile * | pKeyFile, |
const gchar * | cGroupName, | ||
const gchar * | ckeyName, | ||
const gchar * | cInitialValue, | ||
CairoDockGUIWidgetType | iWidgetType, | ||
const gchar * | cAuthorizedValues, | ||
const gchar * | cDescription, | ||
const gchar * | cTooltip | ||
) |
Add a key to a conf file, so that it can be parsed by the GUI manager.
void cairo_dock_remove_group_key_from_conf_file | ( | GKeyFile * | pKeyFile, |
const gchar * | cGroupName, | ||
const gchar * | ckeyName | ||
) |
Remove a key from a conf file.
void cairo_dock_update_keyfile | ( | const gchar * | cConfFilePath, |
GType | iFirstDataType, | ||
... | |||
) |
Update a conf file with a list of values of the form : {type, name of the groupe, name of the key, value}. Must end with G_TYPE_INVALID.
cConfFilePath | path to the conf file. |
iFirstDataType | type of the first value. |