ezfc_config_t

ezfc_config_t — A class for managing the configuration file.

Functions

Types and Values

Description

This class provides an easy access to assign an instance of ezfc_alias_t to a language and to read/write the configuration file.

Functions

ezfc_config_new ()

ezfc_config_t *
ezfc_config_new (void);

Create a new instance of a ezfc_config_t.

Returns

a new instance of ezfc_config_t.

[transfer full]


ezfc_config_ref ()

ezfc_config_t *
ezfc_config_ref (ezfc_config_t *config);

Increases the refernce count of config .

Parameters

config

a ezfc_config_t.

 

Returns

the same config object.

[transfer none]


ezfc_config_unref ()

void
ezfc_config_unref (ezfc_config_t *config);

Decreases the reference count of config . when its reference count drops to 0, the object is finalized (i.e. its memory is freed).

Parameters

config

a ezfc_config_t.

 

ezfc_config_set_priority ()

void
ezfc_config_set_priority (ezfc_config_t *config,
                          guint priority);

Set priority to config instance.

Parameters

config

a ezfc_config_t.

 

priority

a priority number that is used for a filename. it has to be within 3 digits. so the maximum value is 999.

 

ezfc_config_get_priority ()

gint
ezfc_config_get_priority (ezfc_config_t *config);

Obtains the priority number in config .

Parameters

config

a ezfc_config_t.

 

Returns

the priority number. if any errors happens, returns -1.


ezfc_config_set_name ()

void
ezfc_config_set_name (ezfc_config_t *config,
                      const gchar *name);

Set name as the additional configuration name. this is an optional to make the change in the filename for output.

Parameters

config

a ezfc_config_t.

 

name

additional configuration name.

[allow-none]

ezfc_config_get_name ()

const gchar *
ezfc_config_get_name (ezfc_config_t *config);

Obtains the configuration name that is set by ezfc_config_set_name().

Parameters

config

a ezfc_config_t.

 

Returns

the configuration name.


ezfc_config_add_alias ()

gboolean
ezfc_config_add_alias (ezfc_config_t *config,
                       const gchar *language,
                       ezfc_alias_t *alias);

Add a alias font for language language. if giving NULL to language , alias takes effect for any languages.

Parameters

config

a ezfc_config_t.

 

language

a language name to add alias for or NULL for global settings.

[allow-none]

alias

a ezfc_alias_t.

 

Returns

TRUE if it's successfully completed, otherwise FALSE.


ezfc_config_remove_alias ()

gboolean
ezfc_config_remove_alias (ezfc_config_t *config,
                          const gchar *language,
                          const gchar *alias_name);

Removes alias_name assigned for language language from config .

Parameters

config

a ezfc_config_t.

 

language

a language name to remove alias_name from.

[allow-none]

alias_name

a alias font name to remove.

 

Returns

TRUE if it's successfully removed, otherwise FALSE.


ezfc_config_remove_aliases ()

gboolean
ezfc_config_remove_aliases (ezfc_config_t *config,
                            const gchar *language);

Removes all of aliases assigned for language language from config .

Parameters

config

a ezfc_config_t.

 

language

a language name to remove alias_name from.

[allow-none]

Returns

TRUE if it's successfully removed, otherwise FALSE.


ezfc_config_add_font ()

gboolean
ezfc_config_add_font (ezfc_config_t *config,
                      ezfc_font_t *font);

Add a font font to generate non-language-specific, non-alias-specific rules.

Parameters

config

a ezfc_config_t.

 

font

a ezfc_font_t.

 

Returns

TRUE if it's successfully completed, otherwise FALSE.


ezfc_config_remove_font ()

gboolean
ezfc_config_remove_font (ezfc_config_t *config,
                         const gchar *family);

Remove a ezfc_font_t instance corresponding to family .

Parameters

config

a ezfc_config_t.

 

family

a family name to be removed.

 

Returns

TRUE if it's successfully removed, otherwise FALSE.


ezfc_config_remove_fonts ()

gboolean
ezfc_config_remove_fonts (ezfc_config_t *config);

Remove all of fonts from config , which added by ezfc_config_add_font().

Parameters

config

a ezfc_config_t.

 

Returns

TRUE if it's successfully removed, otherwise FALSE.


ezfc_config_add_subst ()

gboolean
ezfc_config_add_subst (ezfc_config_t *config,
                       const gchar *family_name,
                       ezfc_font_t *subst);

Add a subst font as a substitute font for family_name .

Parameters

config

a ezfc_config_t.

 

family_name

a family name to be substituted.

 

subst

a ezfc_font_t for substitute font

 

Returns

TRUE if it's successfully completed, otherwise FALSE.

Since: 0.11


ezfc_config_remove_subst ()

gboolean
ezfc_config_remove_subst (ezfc_config_t *config,
                          const gchar *family_name,
                          const gchar *subst_name);

Remove subst_name from the substitute font list of family_name .

Parameters

config

a ezfc_config_t.

 

family_name

a family name to be substituted.

 

subst_name

a substitute font name

 

Returns

TRUE if it's successfully completed, otherwise FALSE.

Since: 0.11


ezfc_config_remove_substs ()

gboolean
ezfc_config_remove_substs (ezfc_config_t *config,
                           const gchar *family_name);

Remove all of substitute font list of family_name .

Parameters

config

a ezfc_config_t.

 

family_name

a family name to be substituted.

 

Returns

TRUE if it's successfully completed, otherwise FALSE.

Since: 0.11


ezfc_config_get_language_list ()

GList *
ezfc_config_get_language_list (ezfc_config_t *config);

Obtains the list of languages registered by ezfc_config_add_alias() in config .

Parameters

config

a ezfc_config_t.

 

Returns

a GList contains languages or NULL.

[element-type utf8][transfer none]


ezfc_config_get_aliases ()

const GList *
ezfc_config_get_aliases (ezfc_config_t *config,
                         const gchar *language);

Obtains the list of ezfc_alias_t in ezfc_config_t instance.

Parameters

config

a ezfc_config_t.

 

language

a language name referenced to the alias.

[allow-none]

Returns

a GList contains ezfc_alias_t or NULL.

[element-type ezfc_alias_t][transfer none]


ezfc_config_get_fonts ()

GList *
ezfc_config_get_fonts (ezfc_config_t *config);

Obtains the list of ezfc_font_t in config .

Parameters

config

a ezfc_config_t.

 

Returns

a GList contains ezfc_font_t or NULL.

[element-type ezfc_font_t][transfer container]


ezfc_config_get_subst_family ()

GList *
ezfc_config_get_subst_family (ezfc_config_t *config);

Obtains the list of the family name being substituted

Parameters

config

a ezfc_config_t.

 

Returns

a GList contains languages or NULL.

[element-type utf8][transfer none]

Since: 0.11


ezfc_config_get_substs ()

const GList *
ezfc_config_get_substs (ezfc_config_t *config,
                        const gchar *family_name);

Obtains the list of ezfc_font_t to be substituted for family_name .

Parameters

config

a ezfc_config_t.

 

family_name

a family name being substituted.

 

Returns

a GList contains ezfc_font_t or NULL.

[element-type ezfc_font_t][transfer none]

Since: 0.11


ezfc_config_load ()

gboolean
ezfc_config_load (ezfc_config_t *config,
                  GError **error);

Read the configuration file and rebuild the object. You have to invoke ezfc_config_set_priority() and ezfc_config_set_name() first to read the appropriate configuration file.

Parameters

config

a ezfc_config_t.

 

error

a GError.

[allow-none]

Returns

TRUE if it's successfully completed, otherwise FALSE.


ezfc_config_save ()

gboolean
ezfc_config_save (ezfc_config_t *config,
                  GError **error);

Write the data to the configuration file. you may want to invoke ezfc_config_set_priority() and ezfc_config_set_name() first to write it to the appropriate configuration file.

Parameters

config

a ezfc_config_t.

 

error

a GError.

[allow-none]

Returns

TRUE if it's successfully completed, otherwise FALSE.


ezfc_config_save_to_buffer ()

GString *
ezfc_config_save_to_buffer (ezfc_config_t *config,
                            GError **error);

Write the data to the buffer.

Parameters

config

a ezfc_config_t.

 

error

a GError.

[allow-none]

Returns

a GString containing a xml data. NULL if fails.


ezfc_config_dump ()

void
ezfc_config_dump (ezfc_config_t *config);

Output the object data to the standard output.

Parameters

config

a ezfc_config_t.

 

ezfc_config_set_migration ()

void
ezfc_config_set_migration (ezfc_config_t *config,
                           gboolean flag);

Set a flag to migrate the configuration file on the older place to the new one where XDG Base Directory Specification defines. If flag is TRUE, ezfc_config_load() will tries to read the config file from the old path prior to new place and the old file will be removed during ezfc_config_save().

This feature is enabled by default.

Parameters

config

a ezfc_config_t.

 

flag

a gboolean.

 

Since: 0.8

Types and Values

ezfc_config_t

typedef struct _ezfc_config_t ezfc_config_t;

All the fields in the ezfc_config_t structure are private to the ezfc_config_t implementation.