gtksettings.c: Do not use GdkColor API
This commit is contained in:
@ -655,7 +655,7 @@ gtk_settings_class_init (GtkSettingsClass *class)
|
|||||||
* Color names must be acceptable as identifiers in the
|
* Color names must be acceptable as identifiers in the
|
||||||
* <link linkend="gtk-Resource-Files">gtkrc</link> syntax, and
|
* <link linkend="gtk-Resource-Files">gtkrc</link> syntax, and
|
||||||
* color specifications must be in the format accepted by
|
* color specifications must be in the format accepted by
|
||||||
* gdk_color_parse().
|
* gdk_rgba_parse().
|
||||||
*
|
*
|
||||||
* Note that due to the way the color tables from different sources are
|
* Note that due to the way the color tables from different sources are
|
||||||
* merged, color specifications will be converted to hexadecimal form
|
* merged, color specifications will be converted to hexadecimal form
|
||||||
@ -2775,7 +2775,7 @@ settings_update_color_scheme (GtkSettings *settings)
|
|||||||
|
|
||||||
data = g_slice_new0 (ColorSchemeData);
|
data = g_slice_new0 (ColorSchemeData);
|
||||||
data->color_hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free,
|
data->color_hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free,
|
||||||
(GDestroyNotify) gdk_color_free);
|
(GDestroyNotify) gdk_rgba_free);
|
||||||
g_object_set_data_full (G_OBJECT (settings), "gtk-color-scheme",
|
g_object_set_data_full (G_OBJECT (settings), "gtk-color-scheme",
|
||||||
data, (GDestroyNotify) color_scheme_data_free);
|
data, (GDestroyNotify) color_scheme_data_free);
|
||||||
|
|
||||||
@ -2876,15 +2876,15 @@ settings_update_key_theme (GtkSettings *settings)
|
|||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
add_color_to_hash (gchar *name,
|
add_color_to_hash (gchar *name,
|
||||||
GdkColor *color,
|
GdkRGBA *color,
|
||||||
GHashTable *target)
|
GHashTable *target)
|
||||||
{
|
{
|
||||||
GdkColor *old;
|
GdkRGBA *old;
|
||||||
|
|
||||||
old = g_hash_table_lookup (target, name);
|
old = g_hash_table_lookup (target, name);
|
||||||
if (!old || !gdk_color_equal (old, color))
|
if (!old || !gdk_rgba_equal (old, color))
|
||||||
{
|
{
|
||||||
g_hash_table_insert (target, g_strdup (name), gdk_color_copy (color));
|
g_hash_table_insert (target, g_strdup (name), gdk_rgba_copy (color));
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@ -2897,7 +2897,7 @@ add_colors_to_hash_from_string (GHashTable *hash,
|
|||||||
const gchar *colors)
|
const gchar *colors)
|
||||||
{
|
{
|
||||||
gchar *s, *p, *name;
|
gchar *s, *p, *name;
|
||||||
GdkColor color;
|
GdkRGBA color;
|
||||||
gboolean changed = FALSE;
|
gboolean changed = FALSE;
|
||||||
gchar *copy;
|
gchar *copy;
|
||||||
|
|
||||||
@ -2930,7 +2930,7 @@ add_colors_to_hash_from_string (GHashTable *hash,
|
|||||||
s++;
|
s++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gdk_color_parse (p, &color))
|
if (gdk_rgba_parse (&color, p))
|
||||||
changed |= add_color_to_hash (name, &color, hash);
|
changed |= add_color_to_hash (name, &color, hash);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2972,7 +2972,7 @@ update_color_hash (ColorSchemeData *data,
|
|||||||
if (data->tables[source] == NULL)
|
if (data->tables[source] == NULL)
|
||||||
data->tables[source] = g_hash_table_new_full (g_str_hash, g_str_equal,
|
data->tables[source] = g_hash_table_new_full (g_str_hash, g_str_equal,
|
||||||
g_free,
|
g_free,
|
||||||
(GDestroyNotify) gdk_color_free);
|
(GDestroyNotify) gdk_rgba_free);
|
||||||
|
|
||||||
g_free (data->lastentry[source]);
|
g_free (data->lastentry[source]);
|
||||||
data->lastentry[source] = g_strdup (str);
|
data->lastentry[source] = g_strdup (str);
|
||||||
@ -2986,7 +2986,7 @@ update_color_hash (ColorSchemeData *data,
|
|||||||
if (data->color_hash)
|
if (data->color_hash)
|
||||||
{
|
{
|
||||||
old_hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free,
|
old_hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free,
|
||||||
(GDestroyNotify) gdk_color_free);
|
(GDestroyNotify) gdk_rgba_free);
|
||||||
|
|
||||||
g_hash_table_iter_init (&iter, data->color_hash);
|
g_hash_table_iter_init (&iter, data->color_hash);
|
||||||
while (g_hash_table_iter_next (&iter, &name, &color))
|
while (g_hash_table_iter_next (&iter, &name, &color))
|
||||||
@ -3022,7 +3022,7 @@ update_color_hash (ColorSchemeData *data,
|
|||||||
while (g_hash_table_iter_next (&iter, &key, &value))
|
while (g_hash_table_iter_next (&iter, &key, &value))
|
||||||
{
|
{
|
||||||
new_value = g_hash_table_lookup (data->color_hash, key);
|
new_value = g_hash_table_lookup (data->color_hash, key);
|
||||||
if (!new_value || !gdk_color_equal (value, new_value))
|
if (!new_value || !gdk_rgba_equal (value, new_value))
|
||||||
{
|
{
|
||||||
changed = TRUE;
|
changed = TRUE;
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user