Fix a few GtkTextTag:*-gdk references
This commit is contained in:
committed by
Benjamin Otte
parent
601839c825
commit
6a6c49369e
@@ -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)))
|
||||
|
||||
@@ -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;
|
||||
gchar *is_set_name;
|
||||
|
||||
is_set_name = g_strdup_printf ("%s-set", pspec->name);
|
||||
|
||||
if (g_object_class_find_property (G_OBJECT_GET_CLASS (object), is_set_name) == NULL)
|
||||
{
|
||||
gboolean is_set;
|
||||
|
||||
g_object_get (object, "background-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;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
else if (strcmp (pspec->name, "foreground-gdk") == 0)
|
||||
{
|
||||
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;
|
||||
g_object_get (object, is_set_name, &is_set, NULL);
|
||||
|
||||
is_set_name = g_strdup_printf ("%s-set", pspec->name);
|
||||
if (!is_set)
|
||||
{
|
||||
g_free (is_set_name);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
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);
|
||||
g_free (is_set_name);
|
||||
|
||||
if (!is_set)
|
||||
{
|
||||
g_free (is_set_name);
|
||||
return FALSE;
|
||||
}
|
||||
g_value_init (value, G_PARAM_SPEC_VALUE_TYPE (pspec));
|
||||
|
||||
g_free (is_set_name);
|
||||
g_object_get_property (object, pspec->name, value);
|
||||
|
||||
g_value_init (value, G_PARAM_SPEC_VALUE_TYPE (pspec));
|
||||
if (g_param_value_defaults (pspec, value))
|
||||
{
|
||||
g_value_unset (value);
|
||||
|
||||
g_object_get_property (object, pspec->name, value);
|
||||
|
||||
if (g_param_value_defaults (pspec, value))
|
||||
{
|
||||
g_value_unset (value);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user