Added gm_color_table_get_scheme_name

This commit is contained in:
Jesse van den Kieboom 2006-01-05 23:26:38 +00:00
parent 52f0c5a54e
commit c26565a274
2 changed files with 19 additions and 3 deletions

View File

@ -238,7 +238,7 @@ gm_color_table_fill_from_options(GmColorTable *table) {
gm_color_table_set_use_system_font(table, TRUE);
} else {
value = gm_options_get(options, "font_family");
if (!value || *value == '\0') {
font = gm_color_table_default_font(table);
gm_options_set(options, "font_family", font);
@ -471,9 +471,9 @@ gm_color_table_load_scheme(GmColorTable *table,
void
gm_color_table_set_from_scheme_name(GmColorTable *table, gchar const *scheme) {
int i = 0;
gint i = 0;
while (scheme_names[i].name != NULL) {
while (scheme_names[i].name) {
if (strcasecmp(scheme_names[i].name, scheme) == 0) {
gm_color_table_load_scheme(table, scheme_names[i].scheme);
break;
@ -492,6 +492,20 @@ gm_color_table_set_from_scheme_name(GmColorTable *table, gchar const *scheme) {
}
}
gchar const *
gm_color_table_get_scheme_name(GmColorTable *table) {
gint i = 0;
while (scheme_names[i].name) {
if (scheme_names[i].scheme == table->priv->scheme) {
return scheme_names[i].name;
}
++i;
}
return NULL;
}
/* Callbacks */
static void
on_gm_color_table_monospace_font_change_notify(GConfClient *client,

View File

@ -82,6 +82,8 @@ void gm_color_table_load_scheme(GmColorTable *table,
GmColorTableScheme scheme);
void gm_color_table_set_from_scheme_name(GmColorTable *table,
gchar const *name);
gchar const *gm_color_table_get_scheme_name(GmColorTable *table);
void gm_color_table_set_from_options(GmColorTable *table, GmOptions *options);
G_END_DECLS