terminal-profile: replace deprecated GDK_TYPE_COLOR

master-1.22
raveit65 2016-06-10 20:22:24 +02:00
parent d85c96ad64
commit 22ddefc332
1 changed files with 12 additions and 12 deletions

View File

@ -367,7 +367,7 @@ set_value_from_palette (GValue *ret_value,
{ {
GValue *value = g_value_array_get_nth (array, i); GValue *value = g_value_array_get_nth (array, i);
g_value_init (value, GDK_TYPE_COLOR); g_value_init (value, GDK_TYPE_RGBA);
g_value_set_boxed (value, &colors[i]); g_value_set_boxed (value, &colors[i]);
} }
@ -376,7 +376,7 @@ set_value_from_palette (GValue *ret_value,
{ {
GValue *value = g_value_array_get_nth (array, i); GValue *value = g_value_array_get_nth (array, i);
g_value_init (value, GDK_TYPE_COLOR); g_value_init (value, GDK_TYPE_RGBA);
g_value_set_boxed (value, &DEFAULT_PALETTE[i]); g_value_set_boxed (value, &DEFAULT_PALETTE[i]);
} }
@ -399,14 +399,14 @@ values_equal (GParamSpec *pspec,
if (g_param_values_cmp (pspec, va, vb) == 0) if (g_param_values_cmp (pspec, va, vb) == 0)
return TRUE; return TRUE;
if (G_PARAM_SPEC_VALUE_TYPE (pspec) == GDK_TYPE_COLOR) if (G_PARAM_SPEC_VALUE_TYPE (pspec) == GDK_TYPE_RGBA)
return rgba_equal (g_value_get_boxed (va), g_value_get_boxed (vb)); return rgba_equal (g_value_get_boxed (va), g_value_get_boxed (vb));
if (G_PARAM_SPEC_VALUE_TYPE (pspec) == PANGO_TYPE_FONT_DESCRIPTION) if (G_PARAM_SPEC_VALUE_TYPE (pspec) == PANGO_TYPE_FONT_DESCRIPTION)
return pango_font_description_equal (g_value_get_boxed (va), g_value_get_boxed (vb)); return pango_font_description_equal (g_value_get_boxed (va), g_value_get_boxed (vb));
if (G_IS_PARAM_SPEC_VALUE_ARRAY (pspec) && if (G_IS_PARAM_SPEC_VALUE_ARRAY (pspec) &&
G_PARAM_SPEC_VALUE_TYPE (G_PARAM_SPEC_VALUE_ARRAY (pspec)->element_spec) == GDK_TYPE_COLOR) G_PARAM_SPEC_VALUE_TYPE (G_PARAM_SPEC_VALUE_ARRAY (pspec)->element_spec) == GDK_TYPE_RGBA)
{ {
GValueArray *ara, *arb; GValueArray *ara, *arb;
guint i; guint i;
@ -585,7 +585,7 @@ terminal_profile_gsettings_notify_cb (GSettings *settings,
g_value_set_enum (&value, g_settings_get_enum (settings, key)); g_value_set_enum (&value, g_settings_get_enum (settings, key));
} }
else if (G_PARAM_SPEC_VALUE_TYPE (pspec) == GDK_TYPE_COLOR) else if (G_PARAM_SPEC_VALUE_TYPE (pspec) == GDK_TYPE_RGBA)
{ {
GdkRGBA color; GdkRGBA color;
@ -621,7 +621,7 @@ terminal_profile_gsettings_notify_cb (GSettings *settings,
g_value_set_int (&value, g_settings_get_int(settings, key)); g_value_set_int (&value, g_settings_get_int(settings, key));
} }
else if (G_IS_PARAM_SPEC_VALUE_ARRAY (pspec) && else if (G_IS_PARAM_SPEC_VALUE_ARRAY (pspec) &&
G_PARAM_SPEC_VALUE_TYPE (G_PARAM_SPEC_VALUE_ARRAY (pspec)->element_spec) == GDK_TYPE_COLOR) G_PARAM_SPEC_VALUE_TYPE (G_PARAM_SPEC_VALUE_ARRAY (pspec)->element_spec) == GDK_TYPE_RGBA)
{ {
char **color_strings; char **color_strings;
GdkRGBA *colors; GdkRGBA *colors;
@ -744,7 +744,7 @@ terminal_profile_gsettings_changeset_add (TerminalProfile *profile,
g_settings_set_enum (changeset, key, eval->value); g_settings_set_enum (changeset, key, eval->value);
} }
else if (G_PARAM_SPEC_VALUE_TYPE (pspec) == GDK_TYPE_COLOR) else if (G_PARAM_SPEC_VALUE_TYPE (pspec) == GDK_TYPE_RGBA)
{ {
GdkRGBA *color; GdkRGBA *color;
char str[16]; char str[16];
@ -779,7 +779,7 @@ terminal_profile_gsettings_changeset_add (TerminalProfile *profile,
else if (G_IS_PARAM_SPEC_INT (pspec)) else if (G_IS_PARAM_SPEC_INT (pspec))
g_settings_set_int (changeset, key, g_value_get_int (value)); g_settings_set_int (changeset, key, g_value_get_int (value));
else if (G_IS_PARAM_SPEC_VALUE_ARRAY (pspec) && else if (G_IS_PARAM_SPEC_VALUE_ARRAY (pspec) &&
G_PARAM_SPEC_VALUE_TYPE (G_PARAM_SPEC_VALUE_ARRAY (pspec)->element_spec) == GDK_TYPE_COLOR) G_PARAM_SPEC_VALUE_TYPE (G_PARAM_SPEC_VALUE_ARRAY (pspec)->element_spec) == GDK_TYPE_RGBA)
{ {
GValueArray *array; GValueArray *array;
GString *string; GString *string;
@ -1274,10 +1274,10 @@ terminal_profile_class_init (TerminalProfileClass *klass)
TERMINAL_PROFILE_PROPERTY_BOOLEAN (USE_SYSTEM_FONT, DEFAULT_USE_SYSTEM_FONT, KEY_USE_SYSTEM_FONT); TERMINAL_PROFILE_PROPERTY_BOOLEAN (USE_SYSTEM_FONT, DEFAULT_USE_SYSTEM_FONT, KEY_USE_SYSTEM_FONT);
TERMINAL_PROFILE_PROPERTY_BOOLEAN (USE_THEME_COLORS, DEFAULT_USE_THEME_COLORS, KEY_USE_THEME_COLORS); TERMINAL_PROFILE_PROPERTY_BOOLEAN (USE_THEME_COLORS, DEFAULT_USE_THEME_COLORS, KEY_USE_THEME_COLORS);
TERMINAL_PROFILE_PROPERTY_BOXED (BACKGROUND_COLOR, GDK_TYPE_COLOR, KEY_BACKGROUND_COLOR); TERMINAL_PROFILE_PROPERTY_BOXED (BACKGROUND_COLOR, GDK_TYPE_RGBA, KEY_BACKGROUND_COLOR);
TERMINAL_PROFILE_PROPERTY_BOXED (BOLD_COLOR, GDK_TYPE_COLOR, KEY_BOLD_COLOR); TERMINAL_PROFILE_PROPERTY_BOXED (BOLD_COLOR, GDK_TYPE_RGBA, KEY_BOLD_COLOR);
TERMINAL_PROFILE_PROPERTY_BOXED (FONT, PANGO_TYPE_FONT_DESCRIPTION, KEY_FONT); TERMINAL_PROFILE_PROPERTY_BOXED (FONT, PANGO_TYPE_FONT_DESCRIPTION, KEY_FONT);
TERMINAL_PROFILE_PROPERTY_BOXED (FOREGROUND_COLOR, GDK_TYPE_COLOR, KEY_FOREGROUND_COLOR); TERMINAL_PROFILE_PROPERTY_BOXED (FOREGROUND_COLOR, GDK_TYPE_RGBA, KEY_FOREGROUND_COLOR);
/* 0.0 = normal bg, 1.0 = all black bg, 0.5 = half darkened */ /* 0.0 = normal bg, 1.0 = all black bg, 0.5 = half darkened */
TERMINAL_PROFILE_PROPERTY_DOUBLE (BACKGROUND_DARKNESS, 0.0, 1.0, DEFAULT_BACKGROUND_DARKNESS, KEY_BACKGROUND_DARKNESS); TERMINAL_PROFILE_PROPERTY_DOUBLE (BACKGROUND_DARKNESS, 0.0, 1.0, DEFAULT_BACKGROUND_DARKNESS, KEY_BACKGROUND_DARKNESS);
@ -1304,7 +1304,7 @@ terminal_profile_class_init (TerminalProfileClass *klass)
TERMINAL_PROFILE_PROPERTY_STRING (VISIBLE_NAME, _(DEFAULT_VISIBLE_NAME), KEY_VISIBLE_NAME); TERMINAL_PROFILE_PROPERTY_STRING (VISIBLE_NAME, _(DEFAULT_VISIBLE_NAME), KEY_VISIBLE_NAME);
TERMINAL_PROFILE_PROPERTY_STRING (WORD_CHARS, DEFAULT_WORD_CHARS, KEY_WORD_CHARS); TERMINAL_PROFILE_PROPERTY_STRING (WORD_CHARS, DEFAULT_WORD_CHARS, KEY_WORD_CHARS);
TERMINAL_PROFILE_PROPERTY_VALUE_ARRAY_BOXED (PALETTE, "palette-color", GDK_TYPE_COLOR, KEY_PALETTE); TERMINAL_PROFILE_PROPERTY_VALUE_ARRAY_BOXED (PALETTE, "palette-color", GDK_TYPE_RGBA, KEY_PALETTE);
} }
/* Semi-Public API */ /* Semi-Public API */