![]() |
![]() |
![]() |
GNOME UI Library Reference Manual | ![]() |
---|---|---|---|---|
#include <libgnomeui/libgnomeui.h> GnomeThemeFile; void (*GnomeThemeFileSectionFunc) (GnomeThemeFile *df, const char *name, gpointer data); enum GnomeThemeFileParseError; void (*GnomeThemeFileLineFunc) (GnomeThemeFile *df, const char *key, const char *locale, const char *value, gpointer data); GnomeThemeFile* gnome_theme_file_new_from_string (char *data, GError **error); char* gnome_theme_file_to_string (GnomeThemeFile *df); void gnome_theme_file_free (GnomeThemeFile *df); void gnome_theme_file_foreach_section (GnomeThemeFile *df, GnomeThemeFileSectionFunc func, gpointer user_data); void gnome_theme_file_foreach_key (GnomeThemeFile *df, const char *section, gboolean include_localized, GnomeThemeFileLineFunc func, gpointer user_data); gboolean gnome_theme_file_get_raw (GnomeThemeFile *df, const char *section, const char *keyname, const char *locale, char **val); gboolean gnome_theme_file_get_integer (GnomeThemeFile *df, const char *section, const char *keyname, int *val); gboolean gnome_theme_file_get_string (GnomeThemeFile *df, const char *section, const char *keyname, char **val); gboolean gnome_theme_file_get_locale_string (GnomeThemeFile *df, const char *section, const char *keyname, char **val); #define GNOME_THEME_FILE_PARSE_ERROR GQuark gnome_theme_file_parse_error_quark (void);
typedef struct _GnomeThemeFile GnomeThemeFile;
A GnomeThemeFile contains information about the number of sections, pointers to the sections and information about the current locale.
void (*GnomeThemeFileSectionFunc) (GnomeThemeFile *df, const char *name, gpointer data);
df : | |
name : | |
data : |
typedef enum { GNOME_THEME_FILE_PARSE_ERROR_INVALID_SYNTAX, GNOME_THEME_FILE_PARSE_ERROR_INVALID_ESCAPES, GNOME_THEME_FILE_PARSE_ERROR_INVALID_CHARS } GnomeThemeFileParseError;
void (*GnomeThemeFileLineFunc) (GnomeThemeFile *df, const char *key, const char *locale, const char *value, gpointer data);
df : | |
key : | |
locale : | |
value : | |
data : |
GnomeThemeFile* gnome_theme_file_new_from_string (char *data, GError **error);
Creates a GnomeThemeFile from the data string passed.
data : | the string used to create a GnomeThemeFile. |
error : | location to store the error occuring, or NULL to ignore errors |
Returns : | a GnomeThemeFile. |
Since 2.2
char* gnome_theme_file_to_string (GnomeThemeFile *df);
This function retrieves the string representing the GnomeThemeFile.
df : | A GnomeThemeFile |
Returns : | a char *. |
Since 2.2
void gnome_theme_file_free (GnomeThemeFile *df);
Frees the GnomeThemeFile structure.
df : | a GnomeThemeFile. |
Since 2.2
void gnome_theme_file_foreach_section (GnomeThemeFile *df, GnomeThemeFileSectionFunc func, gpointer user_data);
Calls func for each section in the GnomeThemeFile with user_data.
df : | a GnomeThemeFile. |
func : | a GnomeThemeFileSectionFunc |
user_data : | a pointer to the user data. |
Since 2.2
void gnome_theme_file_foreach_key (GnomeThemeFile *df, const char *section, gboolean include_localized, GnomeThemeFileLineFunc func, gpointer user_data);
Looks for the section section_name. If found, this function calls func for each line in the section with fields of line and user_data.
df : | a GnomeThemeFile. |
section : | name of the section |
include_localized : | a boolean value |
func : | a GnomeThemeFileLineFunc. |
user_data : | a pointer to user_data. |
Since 2.2
gboolean gnome_theme_file_get_raw (GnomeThemeFile *df, const char *section, const char *keyname, const char *locale, char **val);
Searches section name and line in the GnomeThemeFile data structure. If found, sets the val to value field in GnomeThemeFileLine and returns a boolean value.
df : | A GnomeThemeFile. |
section : | the string representing the section name |
keyname : | the string representing the key name. |
locale : | the string representing the locale. |
val : | a char**. |
Returns : | TRUE if section and line were found in the GnomeThemeFile, FALSE otherwise. |
Since 2.2
gboolean gnome_theme_file_get_integer (GnomeThemeFile *df, const char *section, const char *keyname, int *val);
This function calls gnome_theme_file_get_raw() with the parameters. If gnome_theme_file_get_raw returns TRUE, then converts the value string filled in by the function to an integer and writes it in val.
df : | a GnomeThemeFile. |
section : | the section name. |
keyname : | the key name. |
val : | an int*. |
Returns : | TRUE if gnome_theme_file_get_raw returns TRUE, FALSE otherwise. |
Since 2.2
gboolean gnome_theme_file_get_string (GnomeThemeFile *df, const char *section, const char *keyname, char **val);
This function calls gnome_theme_file_get_raw() with the parameters and returns the boolean value.
df : | A GnomeThemeFile. |
section : | the section name. |
keyname : | the key name. |
val : | a char**. |
Returns : | a gboolean value. |
Since 2.2
gboolean gnome_theme_file_get_locale_string (GnomeThemeFile *df, const char *section, const char *keyname, char **val);
Calculates the locale if the current_locale field of df is NULL. Then calls gnome_theme_file_get_raw() with the parameters and returns the boolean value obtained.
df : | A GnomeThemeFile |
section : | the section name. |
keyname : | the keyname. |
val : | a char **. |
Returns : | a gboolean value. |
Since 2.2
#define GNOME_THEME_FILE_PARSE_ERROR gnome_theme_file_parse_error_quark()