summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimm Bäder <mail@baedert.org>2016-10-04 20:01:33 +0200
committerBenjamin Otte <otte@redhat.com>2016-10-16 18:17:21 +0200
commit6a6c49369e24b895a51282482daae32ef6f37eea (patch)
treecce269d4b03904e4f56a7eac3d4ed7a5062438de
parent601839c8251950e6ac8f66ae225f8143e08e3867 (diff)
downloadgtk+-6a6c49369e24b895a51282482daae32ef6f37eea.tar.gz
Fix a few GtkTextTag:*-gdk references
-rw-r--r--gtk/a11y/gtktextviewaccessible.c10
-rw-r--r--gtk/gtktextbufferserialize.c78
-rw-r--r--gtk/gtktexttag.c4
3 files changed, 25 insertions, 67 deletions
diff --git a/gtk/a11y/gtktextviewaccessible.c b/gtk/a11y/gtktextviewaccessible.c
index 4adff0cb52..549439d033 100644
--- a/gtk/a11y/gtktextviewaccessible.c
+++ b/gtk/a11y/gtktextviewaccessible.c
@@ -1460,11 +1460,11 @@ gtk_text_view_accessible_set_run_attributes (AtkEditableText *text,
else if (!strcmp (name, atk_text_attribute_get_name (ATK_TEXT_ATTR_FG_COLOR)))
{
RGB_vals = g_strsplit (value, ",", 3);
- color = g_malloc (sizeof (GdkColor));
- color->red = atoi (RGB_vals[0]);
- color->green = atoi (RGB_vals[1]);
- color->blue = atoi (RGB_vals[2]);
- g_object_set (G_OBJECT (tag), "foreground-gdk", color, NULL);
+ color = g_malloc (sizeof (GdkRGBA));
+ color->red = atoi (RGB_vals[0]) / 65535.0;
+ color->green = atoi (RGB_vals[1]) / 65535.0;
+ color->blue = atoi (RGB_vals[2]) / 65535.0;
+ g_object_set (G_OBJECT (tag), "foreground-rgba", color, NULL);
}
else if (!strcmp (name, atk_text_attribute_get_name (ATK_TEXT_ATTR_STRETCH)))
diff --git a/gtk/gtktextbufferserialize.c b/gtk/gtktextbufferserialize.c
index 27fe43ab59..8baf780cc4 100644
--- a/gtk/gtktextbufferserialize.c
+++ b/gtk/gtktextbufferserialize.c
@@ -205,78 +205,40 @@ is_param_set (GObject *object,
GParamSpec *pspec,
GValue *value)
{
- /* We need to special case some attributes here */
- if (strcmp (pspec->name, "background-gdk") == 0)
- {
- gboolean is_set;
-
- g_object_get (object, "background-set", &is_set, NULL);
+ gboolean is_set;
+ gchar *is_set_name;
- if (is_set)
- {
- g_value_init (value, G_PARAM_SPEC_VALUE_TYPE (pspec));
+ is_set_name = g_strdup_printf ("%s-set", pspec->name);
- g_object_get_property (object, pspec->name, value);
-
- return TRUE;
- }
-
- return FALSE;
- }
- else if (strcmp (pspec->name, "foreground-gdk") == 0)
+ if (g_object_class_find_property (G_OBJECT_GET_CLASS (object), is_set_name) == NULL)
{
- gboolean is_set;
-
- g_object_get (object, "foreground-set", &is_set, NULL);
-
- if (is_set)
- {
- g_value_init (value, G_PARAM_SPEC_VALUE_TYPE (pspec));
-
- g_object_get_property (object, pspec->name, value);
-
- return TRUE;
- }
-
+ g_free (is_set_name);
return FALSE;
}
else
{
- gboolean is_set;
- gchar *is_set_name;
-
- is_set_name = g_strdup_printf ("%s-set", pspec->name);
+ g_object_get (object, is_set_name, &is_set, NULL);
- if (g_object_class_find_property (G_OBJECT_GET_CLASS (object), is_set_name) == NULL)
- {
- g_free (is_set_name);
- return FALSE;
- }
- else
- {
- g_object_get (object, is_set_name, &is_set, NULL);
-
- if (!is_set)
- {
- g_free (is_set_name);
- return FALSE;
- }
+ if (!is_set)
+ {
+ g_free (is_set_name);
+ return FALSE;
+ }
- g_free (is_set_name);
+ g_free (is_set_name);
- g_value_init (value, G_PARAM_SPEC_VALUE_TYPE (pspec));
+ g_value_init (value, G_PARAM_SPEC_VALUE_TYPE (pspec));
- g_object_get_property (object, pspec->name, value);
+ g_object_get_property (object, pspec->name, value);
- if (g_param_value_defaults (pspec, value))
- {
- g_value_unset (value);
+ if (g_param_value_defaults (pspec, value))
+ {
+ g_value_unset (value);
- return FALSE;
- }
- }
- return TRUE;
+ return FALSE;
+ }
}
+ return TRUE;
}
static void
diff --git a/gtk/gtktexttag.c b/gtk/gtktexttag.c
index eeeb11628c..4918ceac28 100644
--- a/gtk/gtktexttag.c
+++ b/gtk/gtktexttag.c
@@ -1301,8 +1301,6 @@ gtk_text_tag_set_property (GObject *object,
set_bg_rgba (text_tag, &rgba);
else
g_warning ("Don't know color '%s'", g_value_get_string (value));
-
- g_object_notify (object, "background-gdk");
}
break;
@@ -1316,8 +1314,6 @@ gtk_text_tag_set_property (GObject *object,
set_fg_rgba (text_tag, &rgba);
else
g_warning ("Don't know color '%s'", g_value_get_string (value));
-
- g_object_notify (object, "foreground-gdk");
}
break;