[gtk+] Fix a few GtkTextTag:*-gdk references
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Fix a few GtkTextTag:*-gdk references
- Date: Sun, 16 Oct 2016 16:35:10 +0000 (UTC)
commit 6a6c49369e24b895a51282482daae32ef6f37eea
Author: Timm Bäder <mail baedert org>
Date: Tue Oct 4 20:01:33 2016 +0200
Fix a few GtkTextTag:*-gdk references
gtk/a11y/gtktextviewaccessible.c | 10 ++--
gtk/gtktextbufferserialize.c | 78 ++++++++++----------------------------
gtk/gtktexttag.c | 4 --
3 files changed, 25 insertions(+), 67 deletions(-)
---
diff --git a/gtk/a11y/gtktextviewaccessible.c b/gtk/a11y/gtktextviewaccessible.c
index 4adff0c..549439d 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 27fe43a..8baf780 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 eeeb116..4918cea 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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]