| libeasyfc Documentation | ||||
|---|---|---|---|---|
| Top | Description | ||||
gboolean ezfc_config_add_alias (ezfc_config_t *config,const gchar *language,ezfc_alias_t *alias); gboolean ezfc_config_add_font (ezfc_config_t *config,ezfc_font_t *font); gboolean ezfc_config_add_subst (ezfc_config_t *config,const gchar *family_name,ezfc_font_t *subst); void ezfc_config_dump (ezfc_config_t *config); const GList * ezfc_config_get_aliases (ezfc_config_t *config,const gchar *language); GList * ezfc_config_get_fonts (ezfc_config_t *config); GList * ezfc_config_get_language_list (ezfc_config_t *config); const gchar * ezfc_config_get_name (ezfc_config_t *config); gint ezfc_config_get_priority (ezfc_config_t *config); GList * ezfc_config_get_subst_family (ezfc_config_t *config); const GList * ezfc_config_get_substs (ezfc_config_t *config,const gchar *family_name); gboolean ezfc_config_load (ezfc_config_t *config,GError **error); ezfc_config_t * ezfc_config_new (void); ezfc_config_t * ezfc_config_ref (ezfc_config_t *config); gboolean ezfc_config_remove_alias (ezfc_config_t *config,const gchar *language,const gchar *alias_name); gboolean ezfc_config_remove_aliases (ezfc_config_t *config,const gchar *language); gboolean ezfc_config_remove_font (ezfc_config_t *config,const gchar *family); gboolean ezfc_config_remove_fonts (ezfc_config_t *config); gboolean ezfc_config_remove_subst (ezfc_config_t *config,const gchar *family_name,const gchar *subst_name); gboolean ezfc_config_remove_substs (ezfc_config_t *config,const gchar *family_name); gboolean ezfc_config_save (ezfc_config_t *config,GError **error); GString * ezfc_config_save_to_buffer (ezfc_config_t *config,GError **error); void ezfc_config_set_migration (ezfc_config_t *config,gboolean flag); void ezfc_config_set_name (ezfc_config_t *config,const gchar *name); void ezfc_config_set_priority (ezfc_config_t *config,guint priority); ezfc_config_t; void ezfc_config_unref (ezfc_config_t *config);
This class provides an easy access to assign an instance of ezfc_alias_t to a language and to read/write the configuration file.
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.
|
a ezfc_config_t. |
|
a language name to add alias for or NULL for global settings. [allow-none]
|
|
a ezfc_alias_t. |
Returns : |
TRUE if it's successfully completed, otherwise FALSE. |
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.
|
a ezfc_config_t. |
|
a ezfc_font_t. |
Returns : |
TRUE if it's successfully completed, otherwise FALSE. |
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.
|
a ezfc_config_t. |
|
a family name to be substituted. |
|
a ezfc_font_t for substitute font |
Returns : |
TRUE if it's successfully completed, otherwise FALSE. |
Since 0.11
void ezfc_config_dump (ezfc_config_t *config);
Output the object data to the standard output.
|
a ezfc_config_t. |
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.
|
a ezfc_config_t. |
|
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]
|
GList * ezfc_config_get_fonts (ezfc_config_t *config);
Obtains the list of ezfc_font_t in config.
|
a ezfc_config_t. |
Returns : |
a GList contains ezfc_font_t or NULL. [element-type ezfc_font_t][transfer container]
|
GList * ezfc_config_get_language_list (ezfc_config_t *config);
Obtains the list of languages registered by ezfc_config_add_alias() in config.
|
a ezfc_config_t. |
Returns : |
a GList contains languages or NULL. [element-type utf8][transfer none]
|
const gchar * ezfc_config_get_name (ezfc_config_t *config);
Obtains the configuration name that is set by ezfc_config_set_name().
|
a ezfc_config_t. |
Returns : |
the configuration name. |
gint ezfc_config_get_priority (ezfc_config_t *config);
Obtains the priority number in config.
|
a ezfc_config_t. |
Returns : |
the priority number. if any errors happens, returns -1. |
GList * ezfc_config_get_subst_family (ezfc_config_t *config);
Obtains the list of the family name being substituted
|
a ezfc_config_t. |
Returns : |
a GList contains languages or NULL. [element-type utf8][transfer none]
|
Since 0.11
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.
|
a ezfc_config_t. |
|
a family name being substituted. |
Returns : |
a GList contains ezfc_font_t or NULL. [element-type ezfc_font_t][transfer none]
|
Since 0.11
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.
|
a ezfc_config_t. |
|
a GError. [allow-none] |
Returns : |
TRUE if it's successfully completed, otherwise FALSE. |
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_t * ezfc_config_ref (ezfc_config_t *config);
Increases the refernce count of config.
|
a ezfc_config_t. |
Returns : |
the same config object. [transfer none]
|
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.
|
a ezfc_config_t. |
|
a language name to remove alias_name from. [allow-none]
|
|
a alias font name to remove. |
Returns : |
TRUE if it's successfully removed, otherwise FALSE. |
gboolean ezfc_config_remove_aliases (ezfc_config_t *config,const gchar *language);
Removes all of aliases assigned for language language from config.
|
a ezfc_config_t. |
|
a language name to remove alias_name from. [allow-none]
|
Returns : |
TRUE if it's successfully removed, otherwise FALSE. |
gboolean ezfc_config_remove_font (ezfc_config_t *config,const gchar *family);
Remove a ezfc_font_t instance corresponding to family.
|
a ezfc_config_t. |
|
a family name to be removed. |
Returns : |
TRUE if it's successfully removed, otherwise FALSE. |
gboolean ezfc_config_remove_fonts (ezfc_config_t *config);
Remove all of fonts from config, which added by ezfc_config_add_font().
|
a ezfc_config_t. |
Returns : |
TRUE if it's successfully removed, otherwise FALSE. |
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.
|
a ezfc_config_t. |
|
a family name to be substituted. |
|
a substitute font name |
Returns : |
TRUE if it's successfully completed, otherwise FALSE. |
Since 0.11
gboolean ezfc_config_remove_substs (ezfc_config_t *config,const gchar *family_name);
Remove all of substitute font list of family_name.
|
a ezfc_config_t. |
|
a family name to be substituted. |
Returns : |
TRUE if it's successfully completed, otherwise FALSE. |
Since 0.11
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.
|
a ezfc_config_t. |
|
a GError. [allow-none] |
Returns : |
TRUE if it's successfully completed, otherwise FALSE. |
GString * ezfc_config_save_to_buffer (ezfc_config_t *config,GError **error);
Write the data to the buffer.
|
a ezfc_config_t. |
|
a GError. [allow-none] |
Returns : |
a GString containing a xml data. NULL if fails. |
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.
|
a ezfc_config_t. |
|
a gboolean. |
Since 0.8
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.
|
a ezfc_config_t. |
|
additional configuration name. [allow-none] |
void ezfc_config_set_priority (ezfc_config_t *config,guint priority);
Set priority to config instance.
|
a ezfc_config_t. |
|
a priority number that is used for a filename. it has to be within 3 digits. so the maximum value is 999. |
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.
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).
|
a ezfc_config_t. |