## MateThemeFile MateThemeFile — APIs to parse icon theme files. |

## Synopsis

    #include <libmateui/libmateui.h>

                        MateThemeFile;
    void                (*MateThemeFileSectionFunc)        (MateThemeFile *df,
                                                             const char *name,
                                                             gpointer data);
    enum                MateThemeFileParseError;
    void                (*MateThemeFileLineFunc)           (MateThemeFile *df,
                                                             const char *key,
                                                             const char *locale,
                                                             const char *value,
                                                             gpointer data);
    MateThemeFile *    mate_theme_file_new_from_string    (char *data,
                                                             GError **error);
    char *              mate_theme_file_to_string          (MateThemeFile *df);
    void                mate_theme_file_free               (MateThemeFile *df);
    void                mate_theme_file_foreach_section    (MateThemeFile *df,
                                                             MateThemeFileSectionFunc func,
                                                             gpointer user_data);
    void                mate_theme_file_foreach_key        (MateThemeFile *df,
                                                             const char *section,
                                                             gboolean include_localized,
                                                             MateThemeFileLineFunc func,
                                                             gpointer user_data);
    gboolean            mate_theme_file_get_raw            (MateThemeFile *df,
                                                             const char *section,
                                                             const char *keyname,
                                                             const char *locale,
                                                             char **val);
    gboolean            mate_theme_file_get_integer        (MateThemeFile *df,
                                                             const char *section,
                                                             const char *keyname,
                                                             int *val);
    gboolean            mate_theme_file_get_string         (MateThemeFile *df,
                                                             const char *section,
                                                             const char *keyname,
                                                             char **val);
    gboolean            mate_theme_file_get_locale_string  (MateThemeFile *df,
                                                             const char *section,
                                                             const char *keyname,
                                                             char **val);
    #define             MATE_THEME_FILE_PARSE_ERROR
    GQuark              mate_theme_file_parse_error_quark  (void);

## Description

## Details

### MateThemeFile

    typedef struct _MateThemeFile MateThemeFile;

### Warning

`MateThemeFile` is deprecated and should not be used in newly-written code.

A MateThemeFile contains information about the number of sections, pointers to the sections and information about the current locale.

### MateThemeFileSectionFunc ()

    void                (*MateThemeFileSectionFunc)        (MateThemeFile *df,
                                                             const char *name,
                                                             gpointer data);

### Warning

`MateThemeFileSectionFunc` is deprecated and should not be used in newly-written code.

`df` : |
`name` : |
`data` : |

### enum MateThemeFileParseError

    typedef enum
    {
      MATE_THEME_FILE_PARSE_ERROR_INVALID_SYNTAX,
      MATE_THEME_FILE_PARSE_ERROR_INVALID_ESCAPES,
      MATE_THEME_FILE_PARSE_ERROR_INVALID_CHARS
    } MateThemeFileParseError;

### Warning

`MateThemeFileParseError` is deprecated and should not be used in newly-written code.

### MateThemeFileLineFunc ()

    void                (*MateThemeFileLineFunc)           (MateThemeFile *df,
                                                             const char *key,
                                                             const char *locale,
                                                             const char *value,
                                                             gpointer data);

### Warning

`MateThemeFileLineFunc` is deprecated and should not be used in newly-written code.

`df` : |
`key` : |
`locale` : |
`value` : |
`data` : |

### mate_theme_file_new_from_string ()

    MateThemeFile *    mate_theme_file_new_from_string    (char *data,
                                                             GError **error);

### Warning

`mate_theme_file_new_from_string` is deprecated and should not be used in newly-written code.

Creates a MateThemeFile from the data string passed.

`data` : | the string used to create a MateThemeFile.
`error` : | location to store the error occuring, or NULL to ignore errors
Returns : | a MateThemeFile.

Since 2.2

### mate_theme_file_to_string ()

    char *              mate_theme_file_to_string          (MateThemeFile *df);

### Warning

`mate_theme_file_to_string` is deprecated and should not be used in newly-written code.

This function retrieves the string representing the MateThemeFile.

`df` : | A MateThemeFile
Returns : | a char *.

Since 2.2

### mate_theme_file_free ()

    void                mate_theme_file_free               (MateThemeFile *df);

### Warning

`mate_theme_file_free` is deprecated and should not be used in newly-written code.

Frees the MateThemeFile structure.

`df` : | a MateThemeFile.

Since 2.2

### mate_theme_file_foreach_section ()

    void                mate_theme_file_foreach_section    (MateThemeFile *df,
                                                             MateThemeFileSectionFunc func,
                                                             gpointer user_data);

### Warning

`mate_theme_file_foreach_section` is deprecated and should not be used in newly-written code.

Calls `func` for each section in the MateThemeFile with `user_data`.

`df` : | a MateThemeFile.
`func` : | a MateThemeFileSectionFunc
`user_data` : | a pointer to the user data.

Since 2.2

### mate_theme_file_foreach_key ()

    void                mate_theme_file_foreach_key        (MateThemeFile *df,
                                                             const char *section,
                                                             gboolean include_localized,
                                                             MateThemeFileLineFunc func,
                                                             gpointer user_data);

### Warning

`mate_theme_file_foreach_key` is deprecated and should not be used in newly-written code.

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 MateThemeFile.
`section` : | name of the section
`include_localized` : | a boolean value
`func` : | a MateThemeFileLineFunc.
`user_data` : | a pointer to user_data.

Since 2.2

### mate_theme_file_get_raw ()

    gboolean            mate_theme_file_get_raw            (MateThemeFile *df,
                                                             const char *section,
                                                             const char *keyname,
                                                             const char *locale,
                                                             char **val);

### Warning

`mate_theme_file_get_raw` is deprecated and should not be used in newly-written code.

Searches section name and line in the MateThemeFile data structure. If found, sets the `val` to value field in MateThemeFileLine and returns a boolean value.

`df` : | A MateThemeFile.
`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 MateThemeFile, FALSE otherwise.

Since 2.2

### mate_theme_file_get_integer ()

    gboolean            mate_theme_file_get_integer        (MateThemeFile *df,
                                                             const char *section,
                                                             const char *keyname,
                                                             int *val);

### Warning

`mate_theme_file_get_integer` is deprecated and should not be used in newly-written code.

This function calls `mate_theme_file_get_raw()` with the parameters. If mate_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 MateThemeFile.
`section` : | the section name.
`keyname` : | the key name.
`val` : | an int*.
Returns : | `TRUE` if mate_theme_file_get_raw returns `TRUE`, `FALSE` otherwise.

Since 2.2

### mate_theme_file_get_string ()

    gboolean            mate_theme_file_get_string         (MateThemeFile *df,
                                                             const char *section,
                                                             const char *keyname,
                                                             char **val);

### Warning

`mate_theme_file_get_string` is deprecated and should not be used in newly-written code.

This function calls `mate_theme_file_get_raw()` with the parameters and returns the boolean value.

`df` : | A MateThemeFile.
`section` : | the section name.
`keyname` : | the key name.
`val` : | a char**.
Returns : | a gboolean value.

Since 2.2

### mate_theme_file_get_locale_string ()

    gboolean            mate_theme_file_get_locale_string  (MateThemeFile *df,
                                                             const char *section,
                                                             const char *keyname,
                                                             char **val);

### Warning

`mate_theme_file_get_locale_string` is deprecated and should not be used in newly-written code.

Calculates the locale if the current_locale field of `df` is NULL. Then calls `mate_theme_file_get_raw()` with the parameters and returns the boolean value obtained.

`df` : | A MateThemeFile
`section` : | the section name.
`keyname` : | the keyname.
`val` : | a char **.
Returns : | a gboolean value.

Since 2.2

### MATE_THEME_FILE_PARSE_ERROR

    #define MATE_THEME_FILE_PARSE_ERROR mate_theme_file_parse_error_quark()

### Warning

`MATE_THEME_FILE_PARSE_ERROR` is deprecated and should not be used in newly-written code.

### mate_theme_file_parse_error_quark ()

    GQuark              mate_theme_file_parse_error_quark  (void);

### Warning

`mate_theme_file_parse_error_quark` is deprecated and should not be used in newly-written code.

This function gets a GQuark representing the error string.

Returns : | a GQuark.

Since 2.2