text cell renderer: Convert to g_object_notify_by_pspec

This avoids pspec lookup overhead in g_object_notify.
This commit is contained in:
Matthias Clasen 2015-09-06 15:31:37 -04:00
parent 14c0ed8bae
commit 65be0f5be9

View File

@ -150,10 +150,13 @@ enum {
PROP_RISE_SET,
PROP_LANGUAGE_SET,
PROP_ELLIPSIZE_SET,
PROP_ALIGN_SET
PROP_ALIGN_SET,
LAST_PROP
};
static guint text_cell_renderer_signals [LAST_SIGNAL];
static GParamSpec *text_cell_renderer_props [LAST_PROP];
#define GTK_CELL_RENDERER_TEXT_PATH "gtk-cell-renderer-text-path"
@ -247,46 +250,40 @@ gtk_cell_renderer_text_class_init (GtkCellRendererTextClass *class)
cell_class->get_preferred_height_for_width = gtk_cell_renderer_text_get_preferred_height_for_width;
cell_class->get_aligned_area = gtk_cell_renderer_text_get_aligned_area;
g_object_class_install_property (object_class,
PROP_TEXT,
text_cell_renderer_props[PROP_TEXT] =
g_param_spec_string ("text",
P_("Text"),
P_("Text to render"),
NULL,
GTK_PARAM_READWRITE));
GTK_PARAM_READWRITE);
g_object_class_install_property (object_class,
PROP_MARKUP,
text_cell_renderer_props[PROP_MARKUP] =
g_param_spec_string ("markup",
P_("Markup"),
P_("Marked up text to render"),
NULL,
GTK_PARAM_WRITABLE));
GTK_PARAM_WRITABLE);
g_object_class_install_property (object_class,
PROP_ATTRIBUTES,
text_cell_renderer_props[PROP_ATTRIBUTES] =
g_param_spec_boxed ("attributes",
P_("Attributes"),
P_("A list of style attributes to apply to the text of the renderer"),
PANGO_TYPE_ATTR_LIST,
GTK_PARAM_READWRITE));
GTK_PARAM_READWRITE);
g_object_class_install_property (object_class,
PROP_SINGLE_PARAGRAPH_MODE,
text_cell_renderer_props[PROP_SINGLE_PARAGRAPH_MODE] =
g_param_spec_boolean ("single-paragraph-mode",
P_("Single Paragraph Mode"),
P_("Whether to keep all text in a single paragraph"),
FALSE,
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
g_object_class_install_property (object_class,
PROP_BACKGROUND,
text_cell_renderer_props[PROP_BACKGROUND] =
g_param_spec_string ("background",
P_("Background color name"),
P_("Background color as a string"),
NULL,
GTK_PARAM_WRITABLE));
GTK_PARAM_WRITABLE);
/**
* GtkCellRendererText:background-gdk:
@ -296,13 +293,12 @@ gtk_cell_renderer_text_class_init (GtkCellRendererTextClass *class)
* Deprecated: 3.4: Use #GtkCellRendererText:background-rgba instead.
*/
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
g_object_class_install_property (object_class,
PROP_BACKGROUND_GDK,
text_cell_renderer_props[PROP_BACKGROUND_GDK] =
g_param_spec_boxed ("background-gdk",
P_("Background color"),
P_("Background color as a GdkColor"),
GDK_TYPE_COLOR,
GTK_PARAM_READWRITE | G_PARAM_DEPRECATED));
GTK_PARAM_READWRITE | G_PARAM_DEPRECATED);
G_GNUC_END_IGNORE_DEPRECATIONS
/**
@ -312,20 +308,18 @@ G_GNUC_END_IGNORE_DEPRECATIONS
*
* Since: 3.0
*/
g_object_class_install_property (object_class,
PROP_BACKGROUND_RGBA,
text_cell_renderer_props[PROP_BACKGROUND_RGBA] =
g_param_spec_boxed ("background-rgba",
P_("Background color as RGBA"),
P_("Background color as a GdkRGBA"),
GDK_TYPE_RGBA,
GTK_PARAM_READWRITE));
g_object_class_install_property (object_class,
PROP_FOREGROUND,
GTK_PARAM_READWRITE);
text_cell_renderer_props[PROP_FOREGROUND] =
g_param_spec_string ("foreground",
P_("Foreground color name"),
P_("Foreground color as a string"),
NULL,
GTK_PARAM_WRITABLE));
GTK_PARAM_WRITABLE);
/**
* GtkCellRendererText:foreground-gdk:
@ -335,13 +329,12 @@ G_GNUC_END_IGNORE_DEPRECATIONS
* Deprecated: 3.4: Use #GtkCellRendererText:foreground-rgba instead.
*/
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
g_object_class_install_property (object_class,
PROP_FOREGROUND_GDK,
text_cell_renderer_props[PROP_FOREGROUND_GDK] =
g_param_spec_boxed ("foreground-gdk",
P_("Foreground color"),
P_("Foreground color as a GdkColor"),
GDK_TYPE_COLOR,
GTK_PARAM_READWRITE | G_PARAM_DEPRECATED));
GTK_PARAM_READWRITE | G_PARAM_DEPRECATED);
G_GNUC_END_IGNORE_DEPRECATIONS
/**
@ -351,154 +344,130 @@ G_GNUC_END_IGNORE_DEPRECATIONS
*
* Since: 3.0
*/
g_object_class_install_property (object_class,
PROP_FOREGROUND_RGBA,
text_cell_renderer_props[PROP_FOREGROUND_RGBA] =
g_param_spec_boxed ("foreground-rgba",
P_("Foreground color as RGBA"),
P_("Foreground color as a GdkRGBA"),
GDK_TYPE_RGBA,
GTK_PARAM_READWRITE));
GTK_PARAM_READWRITE);
g_object_class_install_property (object_class,
PROP_EDITABLE,
text_cell_renderer_props[PROP_EDITABLE] =
g_param_spec_boolean ("editable",
P_("Editable"),
P_("Whether the text can be modified by the user"),
FALSE,
GTK_PARAM_READWRITE));
GTK_PARAM_READWRITE);
g_object_class_install_property (object_class,
PROP_FONT,
text_cell_renderer_props[PROP_FONT] =
g_param_spec_string ("font",
P_("Font"),
P_("Font description as a string, e.g. \"Sans Italic 12\""),
NULL,
GTK_PARAM_READWRITE));
GTK_PARAM_READWRITE);
g_object_class_install_property (object_class,
PROP_FONT_DESC,
text_cell_renderer_props[PROP_FONT_DESC] =
g_param_spec_boxed ("font-desc",
P_("Font"),
P_("Font description as a PangoFontDescription struct"),
PANGO_TYPE_FONT_DESCRIPTION,
GTK_PARAM_READWRITE));
GTK_PARAM_READWRITE);
g_object_class_install_property (object_class,
PROP_FAMILY,
text_cell_renderer_props[PROP_FAMILY] =
g_param_spec_string ("family",
P_("Font family"),
P_("Name of the font family, e.g. Sans, Helvetica, Times, Monospace"),
NULL,
GTK_PARAM_READWRITE));
GTK_PARAM_READWRITE);
g_object_class_install_property (object_class,
PROP_STYLE,
text_cell_renderer_props[PROP_STYLE] =
g_param_spec_enum ("style",
P_("Font style"),
P_("Font style"),
PANGO_TYPE_STYLE,
PANGO_STYLE_NORMAL,
GTK_PARAM_READWRITE));
GTK_PARAM_READWRITE);
g_object_class_install_property (object_class,
PROP_VARIANT,
text_cell_renderer_props[PROP_VARIANT] =
g_param_spec_enum ("variant",
P_("Font variant"),
P_("Font variant"),
PANGO_TYPE_VARIANT,
PANGO_VARIANT_NORMAL,
GTK_PARAM_READWRITE));
GTK_PARAM_READWRITE);
g_object_class_install_property (object_class,
PROP_WEIGHT,
text_cell_renderer_props[PROP_WEIGHT] =
g_param_spec_int ("weight",
P_("Font weight"),
P_("Font weight"),
0,
G_MAXINT,
0, G_MAXINT,
PANGO_WEIGHT_NORMAL,
GTK_PARAM_READWRITE));
GTK_PARAM_READWRITE);
g_object_class_install_property (object_class,
PROP_STRETCH,
text_cell_renderer_props[PROP_STRETCH] =
g_param_spec_enum ("stretch",
P_("Font stretch"),
P_("Font stretch"),
PANGO_TYPE_STRETCH,
PANGO_STRETCH_NORMAL,
GTK_PARAM_READWRITE));
GTK_PARAM_READWRITE);
g_object_class_install_property (object_class,
PROP_SIZE,
text_cell_renderer_props[PROP_SIZE] =
g_param_spec_int ("size",
P_("Font size"),
P_("Font size"),
0, G_MAXINT,
0,
G_MAXINT,
0,
GTK_PARAM_READWRITE));
GTK_PARAM_READWRITE);
g_object_class_install_property (object_class,
PROP_SIZE_POINTS,
text_cell_renderer_props[PROP_SIZE_POINTS] =
g_param_spec_double ("size-points",
P_("Font points"),
P_("Font size in points"),
0.0, G_MAXDOUBLE,
0.0,
G_MAXDOUBLE,
0.0,
GTK_PARAM_READWRITE));
GTK_PARAM_READWRITE);
g_object_class_install_property (object_class,
PROP_SCALE,
text_cell_renderer_props[PROP_SCALE] =
g_param_spec_double ("scale",
P_("Font scale"),
P_("Font scaling factor"),
0.0,
G_MAXDOUBLE,
0.0, G_MAXDOUBLE,
1.0,
GTK_PARAM_READWRITE));
GTK_PARAM_READWRITE);
g_object_class_install_property (object_class,
PROP_RISE,
text_cell_renderer_props[PROP_RISE] =
g_param_spec_int ("rise",
P_("Rise"),
P_("Offset of text above the baseline "
"(below the baseline if rise is negative)"),
-G_MAXINT,
G_MAXINT,
P_("Offset of text above the baseline (below the baseline if rise is negative)"),
-G_MAXINT, G_MAXINT,
0,
GTK_PARAM_READWRITE));
GTK_PARAM_READWRITE);
g_object_class_install_property (object_class,
PROP_STRIKETHROUGH,
text_cell_renderer_props[PROP_STRIKETHROUGH] =
g_param_spec_boolean ("strikethrough",
P_("Strikethrough"),
P_("Whether to strike through the text"),
FALSE,
GTK_PARAM_READWRITE));
GTK_PARAM_READWRITE);
g_object_class_install_property (object_class,
PROP_UNDERLINE,
text_cell_renderer_props[PROP_UNDERLINE] =
g_param_spec_enum ("underline",
P_("Underline"),
P_("Style of underline for this text"),
PANGO_TYPE_UNDERLINE,
PANGO_UNDERLINE_NONE,
GTK_PARAM_READWRITE));
GTK_PARAM_READWRITE);
g_object_class_install_property (object_class,
PROP_LANGUAGE,
text_cell_renderer_props[PROP_LANGUAGE] =
g_param_spec_string ("language",
P_("Language"),
P_("The language this text is in, as an ISO code. "
"Pango can use this as a hint when rendering the text. "
"If you don't understand this parameter, you probably don't need it"),
NULL,
GTK_PARAM_READWRITE));
GTK_PARAM_READWRITE);
/**
* GtkCellRendererText:ellipsize:
@ -510,8 +479,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
*
* Since: 2.6
*/
g_object_class_install_property (object_class,
PROP_ELLIPSIZE,
text_cell_renderer_props[PROP_ELLIPSIZE] =
g_param_spec_enum ("ellipsize",
P_("Ellipsize"),
P_("The preferred place to ellipsize the string, "
@ -519,7 +487,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
"to display the entire string"),
PANGO_TYPE_ELLIPSIZE_MODE,
PANGO_ELLIPSIZE_NONE,
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
/**
* GtkCellRendererText:width-chars:
@ -530,16 +498,13 @@ G_GNUC_END_IGNORE_DEPRECATIONS
*
* Since: 2.6
**/
g_object_class_install_property (object_class,
PROP_WIDTH_CHARS,
text_cell_renderer_props[PROP_WIDTH_CHARS] =
g_param_spec_int ("width-chars",
P_("Width In Characters"),
P_("The desired width of the label, in characters"),
-1, G_MAXINT,
-1,
G_MAXINT,
-1,
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
/**
* GtkCellRendererText:max-width-chars:
@ -555,15 +520,13 @@ G_GNUC_END_IGNORE_DEPRECATIONS
*
* Since: 3.0
**/
g_object_class_install_property (object_class,
PROP_MAX_WIDTH_CHARS,
text_cell_renderer_props[PROP_MAX_WIDTH_CHARS] =
g_param_spec_int ("max-width-chars",
P_("Maximum Width In Characters"),
P_("The maximum width of the cell, in characters"),
-1, G_MAXINT,
-1,
G_MAXINT,
-1,
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
/**
* GtkCellRendererText:wrap-mode:
@ -574,8 +537,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
*
* Since: 2.8
*/
g_object_class_install_property (object_class,
PROP_WRAP_MODE,
text_cell_renderer_props[PROP_WRAP_MODE] =
g_param_spec_enum ("wrap-mode",
P_("Wrap mode"),
P_("How to break the string into multiple lines, "
@ -583,7 +545,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
"to display the entire string"),
PANGO_TYPE_WRAP_MODE,
PANGO_WRAP_CHAR,
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
/**
* GtkCellRendererText:wrap-width:
@ -594,15 +556,13 @@ G_GNUC_END_IGNORE_DEPRECATIONS
*
* Since: 2.8
*/
g_object_class_install_property (object_class,
PROP_WRAP_WIDTH,
text_cell_renderer_props[PROP_WRAP_WIDTH] =
g_param_spec_int ("wrap-width",
P_("Wrap width"),
P_("The width at which the text is wrapped"),
-1, G_MAXINT,
-1,
G_MAXINT,
-1,
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
/**
* GtkCellRendererText:alignment:
@ -615,14 +575,13 @@ G_GNUC_END_IGNORE_DEPRECATIONS
*
* Since: 2.10
*/
g_object_class_install_property (object_class,
PROP_ALIGN,
text_cell_renderer_props[PROP_ALIGN] =
g_param_spec_enum ("alignment",
P_("Alignment"),
P_("How to align the lines"),
PANGO_TYPE_ALIGNMENT,
PANGO_ALIGN_LEFT,
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
/**
* GtkCellRendererText:placeholder-text:
@ -632,18 +591,16 @@ G_GNUC_END_IGNORE_DEPRECATIONS
*
* Since 3.6
*/
g_object_class_install_property (object_class,
PROP_PLACEHOLDER_TEXT,
text_cell_renderer_props[PROP_PLACEHOLDER_TEXT] =
g_param_spec_string ("placeholder-text",
P_("Placeholder text"),
P_("Text rendered when an editable cell is empty"),
NULL,
GTK_PARAM_READWRITE));
GTK_PARAM_READWRITE);
/* Style props are set or not */
#define ADD_SET_PROP(propname, propval, nick, blurb) g_object_class_install_property (object_class, propval, g_param_spec_boolean (propname, nick, blurb, FALSE, GTK_PARAM_READWRITE))
#define ADD_SET_PROP(propname, propval, nick, blurb) text_cell_renderer_props[propval] = g_param_spec_boolean (propname, nick, blurb, FALSE, GTK_PARAM_READWRITE)
ADD_SET_PROP ("background-set", PROP_BACKGROUND_SET,
P_("Background set"),
@ -709,6 +666,8 @@ G_GNUC_END_IGNORE_DEPRECATIONS
P_("Align set"),
P_("Whether this tag affects the alignment mode"));
g_object_class_install_properties (object_class, LAST_PROP, text_cell_renderer_props);
/**
* GtkCellRendererText::edited:
* @renderer: the object which received the signal
@ -995,7 +954,7 @@ set_bg_color (GtkCellRendererText *celltext,
if (!priv->background_set)
{
priv->background_set = TRUE;
g_object_notify (G_OBJECT (celltext), "background-set");
g_object_notify_by_pspec (G_OBJECT (celltext), text_cell_renderer_props[PROP_BACKGROUND_SET]);
}
priv->background = *rgba;
@ -1005,7 +964,7 @@ set_bg_color (GtkCellRendererText *celltext,
if (priv->background_set)
{
priv->background_set = FALSE;
g_object_notify (G_OBJECT (celltext), "background-set");
g_object_notify_by_pspec (G_OBJECT (celltext), text_cell_renderer_props[PROP_BACKGROUND_SET]);
}
}
}
@ -1022,7 +981,7 @@ set_fg_color (GtkCellRendererText *celltext,
if (!priv->foreground_set)
{
priv->foreground_set = TRUE;
g_object_notify (G_OBJECT (celltext), "foreground-set");
g_object_notify_by_pspec (G_OBJECT (celltext), text_cell_renderer_props[PROP_FOREGROUND_SET]);
}
priv->foreground = *rgba;
@ -1032,7 +991,7 @@ set_fg_color (GtkCellRendererText *celltext,
if (priv->foreground_set)
{
priv->foreground_set = FALSE;
g_object_notify (G_OBJECT (celltext), "foreground-set");
g_object_notify_by_pspec (G_OBJECT (celltext), text_cell_renderer_props[PROP_FOREGROUND_SET]);
}
}
}
@ -1082,17 +1041,17 @@ notify_set_changed (GObject *object,
PangoFontMask changed_mask)
{
if (changed_mask & PANGO_FONT_MASK_FAMILY)
g_object_notify (object, "family-set");
g_object_notify_by_pspec (object, text_cell_renderer_props[PROP_FAMILY_SET]);
if (changed_mask & PANGO_FONT_MASK_STYLE)
g_object_notify (object, "style-set");
g_object_notify_by_pspec (object, text_cell_renderer_props[PROP_STYLE_SET]);
if (changed_mask & PANGO_FONT_MASK_VARIANT)
g_object_notify (object, "variant-set");
g_object_notify_by_pspec (object, text_cell_renderer_props[PROP_VARIANT_SET]);
if (changed_mask & PANGO_FONT_MASK_WEIGHT)
g_object_notify (object, "weight-set");
g_object_notify_by_pspec (object, text_cell_renderer_props[PROP_WEIGHT_SET]);
if (changed_mask & PANGO_FONT_MASK_STRETCH)
g_object_notify (object, "stretch-set");
g_object_notify_by_pspec (object, text_cell_renderer_props[PROP_STRETCH_SET]);
if (changed_mask & PANGO_FONT_MASK_SIZE)
g_object_notify (object, "size-set");
g_object_notify_by_pspec (object, text_cell_renderer_props[PROP_SIZE_SET]);
}
static void
@ -1100,17 +1059,20 @@ notify_fields_changed (GObject *object,
PangoFontMask changed_mask)
{
if (changed_mask & PANGO_FONT_MASK_FAMILY)
g_object_notify (object, "family");
g_object_notify_by_pspec (object, text_cell_renderer_props[PROP_FAMILY]);
if (changed_mask & PANGO_FONT_MASK_STYLE)
g_object_notify (object, "style");
g_object_notify_by_pspec (object, text_cell_renderer_props[PROP_STYLE]);
if (changed_mask & PANGO_FONT_MASK_VARIANT)
g_object_notify (object, "variant");
g_object_notify_by_pspec (object, text_cell_renderer_props[PROP_VARIANT]);
if (changed_mask & PANGO_FONT_MASK_WEIGHT)
g_object_notify (object, "weight");
g_object_notify_by_pspec (object, text_cell_renderer_props[PROP_WEIGHT]);
if (changed_mask & PANGO_FONT_MASK_STRETCH)
g_object_notify (object, "stretch");
g_object_notify_by_pspec (object, text_cell_renderer_props[PROP_STRETCH]);
if (changed_mask & PANGO_FONT_MASK_SIZE)
g_object_notify (object, "size");
{
g_object_notify_by_pspec (object, text_cell_renderer_props[PROP_SIZE]);
g_object_notify_by_pspec (object, text_cell_renderer_props[PROP_SIZE_POINTS]);
}
}
static void
@ -1138,25 +1100,10 @@ set_font_description (GtkCellRendererText *celltext,
g_object_freeze_notify (object);
g_object_notify (object, "font-desc");
g_object_notify (object, "font");
if (changed_mask & PANGO_FONT_MASK_FAMILY)
g_object_notify (object, "family");
if (changed_mask & PANGO_FONT_MASK_STYLE)
g_object_notify (object, "style");
if (changed_mask & PANGO_FONT_MASK_VARIANT)
g_object_notify (object, "variant");
if (changed_mask & PANGO_FONT_MASK_WEIGHT)
g_object_notify (object, "weight");
if (changed_mask & PANGO_FONT_MASK_STRETCH)
g_object_notify (object, "stretch");
if (changed_mask & PANGO_FONT_MASK_SIZE)
{
g_object_notify (object, "size");
g_object_notify (object, "size-points");
}
g_object_notify_by_pspec (object, text_cell_renderer_props[PROP_FONT_DESC]);
g_object_notify_by_pspec (object, text_cell_renderer_props[PROP_FONT]);
notify_fields_changed (object, changed_mask);
notify_set_changed (object, set_changed_mask);
g_object_thaw_notify (object);
@ -1185,7 +1132,7 @@ gtk_cell_renderer_text_set_property (GObject *object,
}
priv->text = g_value_dup_string (value);
g_object_notify (object, "text");
g_object_notify_by_pspec (object, pspec);
break;
case PROP_ATTRIBUTES:
@ -1204,13 +1151,7 @@ gtk_cell_renderer_text_set_property (GObject *object,
PangoAttrList *attrs = NULL;
str = g_value_get_string (value);
if (str && !pango_parse_markup (str,
-1,
0,
&attrs,
&text,
NULL,
&error))
if (str && !pango_parse_markup (str, -1, 0, &attrs, &text, NULL, &error))
{
g_warning ("Failed to set text from markup due to error parsing markup: %s",
error->message);
@ -1248,7 +1189,7 @@ gtk_cell_renderer_text_set_property (GObject *object,
else
g_warning ("Don't know color `%s'", g_value_get_string (value));
g_object_notify (object, "background-gdk");
g_object_notify_by_pspec (object, text_cell_renderer_props[PROP_BACKGROUND_GDK]);
}
break;
@ -1263,7 +1204,7 @@ gtk_cell_renderer_text_set_property (GObject *object,
else
g_warning ("Don't know color `%s'", g_value_get_string (value));
g_object_notify (object, "foreground-gdk");
g_object_notify_by_pspec (object, text_cell_renderer_props[PROP_FOREGROUND_GDK]);
}
break;
@ -1314,12 +1255,10 @@ gtk_cell_renderer_text_set_property (GObject *object,
break;
case PROP_BACKGROUND_RGBA:
/* This notifies the GObject itself. */
set_bg_color (celltext, g_value_get_boxed (value));
break;
case PROP_FOREGROUND_RGBA:
/* This notifies the GObject itself. */
set_fg_color (celltext, g_value_get_boxed (value));
break;
@ -1384,12 +1323,12 @@ gtk_cell_renderer_text_set_property (GObject *object,
case PROP_SIZE:
pango_font_description_set_size (priv->font,
g_value_get_int (value));
g_object_notify (object, "size");
g_object_notify_by_pspec (object, pspec);
break;
case PROP_SIZE_POINTS:
pango_font_description_set_size (priv->font,
g_value_get_double (value) * PANGO_SCALE);
g_object_notify (object, "size-points");
g_object_notify_by_pspec (object, pspec);
break;
}
@ -1397,8 +1336,8 @@ gtk_cell_renderer_text_set_property (GObject *object,
priv->calc_fixed_height = TRUE;
notify_set_changed (object, old_set_mask & pango_font_description_get_set_fields (priv->font));
g_object_notify (object, "font-desc");
g_object_notify (object, "font");
g_object_notify_by_pspec (object, text_cell_renderer_props[PROP_FONT_DESC]);
g_object_notify_by_pspec (object, text_cell_renderer_props[PROP_FONT]);
break;
}
@ -1408,7 +1347,7 @@ gtk_cell_renderer_text_set_property (GObject *object,
priv->scale_set = TRUE;
if (priv->fixed_height_rows != -1)
priv->calc_fixed_height = TRUE;
g_object_notify (object, "scale-set");
g_object_notify_by_pspec (object, text_cell_renderer_props[PROP_SCALE_SET]);
break;
case PROP_EDITABLE:
@ -1418,26 +1357,26 @@ gtk_cell_renderer_text_set_property (GObject *object,
g_object_set (celltext, "mode", GTK_CELL_RENDERER_MODE_EDITABLE, NULL);
else
g_object_set (celltext, "mode", GTK_CELL_RENDERER_MODE_INERT, NULL);
g_object_notify (object, "editable-set");
g_object_notify_by_pspec (object, text_cell_renderer_props[PROP_EDITABLE_SET]);
break;
case PROP_STRIKETHROUGH:
priv->strikethrough = g_value_get_boolean (value);
priv->strikethrough_set = TRUE;
g_object_notify (object, "strikethrough-set");
g_object_notify_by_pspec (object, text_cell_renderer_props[PROP_STRIKETHROUGH_SET]);
break;
case PROP_UNDERLINE:
priv->underline_style = g_value_get_enum (value);
priv->underline_set = TRUE;
g_object_notify (object, "underline-set");
g_object_notify_by_pspec (object, text_cell_renderer_props[PROP_UNDERLINE_SET]);
break;
case PROP_RISE:
priv->rise = g_value_get_int (value);
priv->rise_set = TRUE;
g_object_notify (object, "rise-set");
g_object_notify_by_pspec (object, text_cell_renderer_props[PROP_RISE_SET]);
if (priv->fixed_height_rows != -1)
priv->calc_fixed_height = TRUE;
break;
@ -1447,13 +1386,13 @@ gtk_cell_renderer_text_set_property (GObject *object,
if (priv->language)
g_object_unref (priv->language);
priv->language = pango_language_from_string (g_value_get_string (value));
g_object_notify (object, "language-set");
g_object_notify_by_pspec (object, text_cell_renderer_props[PROP_LANGUAGE_SET]);
break;
case PROP_ELLIPSIZE:
priv->ellipsize = g_value_get_enum (value);
priv->ellipsize_set = TRUE;
g_object_notify (object, "ellipsize-set");
g_object_notify_by_pspec (object, text_cell_renderer_props[PROP_ELLIPSIZE_SET]);
break;
case PROP_WRAP_MODE:
@ -1492,10 +1431,10 @@ gtk_cell_renderer_text_set_property (GObject *object,
if (priv->align != g_value_get_enum (value))
{
priv->align = g_value_get_enum (value);
g_object_notify (object, "alignment");
g_object_notify_by_pspec (object, pspec);
}
priv->align_set = TRUE;
g_object_notify (object, "align-set");
g_object_notify_by_pspec (object, text_cell_renderer_props[PROP_ALIGN_SET]);
break;
case PROP_BACKGROUND_SET: