#define GHB_CELL_RENDERER_TEXT_PATH "gtk-cell-renderer-text-path"
-#define GHB_CELL_RENDERER_TEXT_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GHB_TYPE_CELL_RENDERER_TEXT, GhbCellRendererTextPrivate))
-
typedef struct _GhbCellRendererTextPrivate GhbCellRendererTextPrivate;
struct _GhbCellRendererTextPrivate
{
+
+ gchar *text;
+ PangoFontDescription *font;
+ gdouble font_scale;
+ GdkRGBA foreground;
+ GdkRGBA background;
+
+ PangoAttrList *extra_attrs;
+
+ PangoUnderline underline_style;
+
+ gint rise;
+ gint fixed_height_rows;
+
+ guint strikethrough : 1;
+
+ guint editable : 1;
+
+ guint scale_set : 1;
+
+ guint foreground_set : 1;
+ guint background_set : 1;
+
+ guint underline_set : 1;
+
+ guint rise_set : 1;
+
+ guint strikethrough_set : 1;
+
+ guint editable_set : 1;
+ guint calc_fixed_height : 1;
guint single_paragraph : 1;
guint language_set : 1;
guint markup_set : 1;
GtkWidget *entry;
};
-G_DEFINE_TYPE (GhbCellRendererText, ghb_cell_renderer_text, GTK_TYPE_CELL_RENDERER)
+G_DEFINE_TYPE_WITH_CODE (GhbCellRendererText, ghb_cell_renderer_text,
+ GTK_TYPE_CELL_RENDERER,
+ G_ADD_PRIVATE(GhbCellRendererText))
static void
ghb_cell_renderer_text_init (GhbCellRendererText *celltext)
{
GhbCellRendererTextPrivate *priv;
- priv = GHB_CELL_RENDERER_TEXT_GET_PRIVATE (celltext);
+ priv = ghb_cell_renderer_text_get_instance_private (celltext);
g_object_set(celltext, "xalign", 0.0, NULL);
g_object_set(celltext, "yalign", 0.5, NULL);
g_object_set(celltext, "xpad", 2, NULL);
g_object_set(celltext, "ypad", 2, NULL);
- celltext->font_scale = 1.0;
- celltext->fixed_height_rows = -1;
- celltext->font = pango_font_description_new ();
+ priv->font_scale = 1.0;
+ priv->fixed_height_rows = -1;
+ priv->font = pango_font_description_new ();
priv->width_chars = -1;
priv->wrap_width = -1;
ghb_marshal_BOOLEAN__BOXED,
G_TYPE_BOOLEAN, 1,
GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
-
- g_type_class_add_private (object_class, sizeof (GhbCellRendererTextPrivate));
}
static void
GhbCellRendererText *celltext = GHB_CELL_RENDERER_TEXT (object);
GhbCellRendererTextPrivate *priv;
- priv = GHB_CELL_RENDERER_TEXT_GET_PRIVATE (object);
+ priv = ghb_cell_renderer_text_get_instance_private (celltext);
- pango_font_description_free (celltext->font);
+ pango_font_description_free (priv->font);
- g_free (celltext->text);
+ g_free (priv->text);
- if (celltext->extra_attrs)
- pango_attr_list_unref (celltext->extra_attrs);
+ if (priv->extra_attrs)
+ pango_attr_list_unref (priv->extra_attrs);
if (priv->language)
g_object_unref (priv->language);
GhbCellRendererText *celltext = GHB_CELL_RENDERER_TEXT (object);
GhbCellRendererTextPrivate *priv;
- priv = GHB_CELL_RENDERER_TEXT_GET_PRIVATE (object);
+ priv = ghb_cell_renderer_text_get_instance_private (celltext);
switch (param_id)
{
case PROP_TEXT:
- g_value_set_string (value, celltext->text);
+ g_value_set_string (value, priv->text);
break;
case PROP_ATTRIBUTES:
- g_value_set_boxed (value, celltext->extra_attrs);
+ g_value_set_boxed (value, priv->extra_attrs);
break;
case PROP_SINGLE_PARAGRAPH_MODE:
case PROP_BACKGROUND_RGBA:
{
- g_value_set_boxed(value, &celltext->background);
+ g_value_set_boxed(value, &priv->background);
}
break;
case PROP_FOREGROUND_RGBA:
{
- g_value_set_boxed(value, &celltext->foreground);
+ g_value_set_boxed(value, &priv->foreground);
}
break;
case PROP_FONT:
- g_value_take_string (value, pango_font_description_to_string (celltext->font));
+ g_value_take_string (value, pango_font_description_to_string (priv->font));
break;
case PROP_FONT_DESC:
- g_value_set_boxed (value, celltext->font);
+ g_value_set_boxed (value, priv->font);
break;
case PROP_FAMILY:
- g_value_set_string (value, pango_font_description_get_family (celltext->font));
+ g_value_set_string (value, pango_font_description_get_family (priv->font));
break;
case PROP_STYLE:
- g_value_set_enum (value, pango_font_description_get_style (celltext->font));
+ g_value_set_enum (value, pango_font_description_get_style (priv->font));
break;
case PROP_VARIANT:
- g_value_set_enum (value, pango_font_description_get_variant (celltext->font));
+ g_value_set_enum (value, pango_font_description_get_variant (priv->font));
break;
case PROP_WEIGHT:
- g_value_set_int (value, pango_font_description_get_weight (celltext->font));
+ g_value_set_int (value, pango_font_description_get_weight (priv->font));
break;
case PROP_STRETCH:
- g_value_set_enum (value, pango_font_description_get_stretch (celltext->font));
+ g_value_set_enum (value, pango_font_description_get_stretch (priv->font));
break;
case PROP_SIZE:
- g_value_set_int (value, pango_font_description_get_size (celltext->font));
+ g_value_set_int (value, pango_font_description_get_size (priv->font));
break;
case PROP_SIZE_POINTS:
- g_value_set_double (value, ((double)pango_font_description_get_size (celltext->font)) / (double)PANGO_SCALE);
+ g_value_set_double (value, ((double)pango_font_description_get_size (priv->font)) / (double)PANGO_SCALE);
break;
case PROP_SCALE:
- g_value_set_double (value, celltext->font_scale);
+ g_value_set_double (value, priv->font_scale);
break;
case PROP_EDITABLE:
- g_value_set_boolean (value, celltext->editable);
+ g_value_set_boolean (value, priv->editable);
break;
case PROP_STRIKETHROUGH:
- g_value_set_boolean (value, celltext->strikethrough);
+ g_value_set_boolean (value, priv->strikethrough);
break;
case PROP_UNDERLINE:
- g_value_set_enum (value, celltext->underline_style);
+ g_value_set_enum (value, priv->underline_style);
break;
case PROP_RISE:
- g_value_set_int (value, celltext->rise);
+ g_value_set_int (value, priv->rise);
break;
case PROP_LANGUAGE:
break;
case PROP_BACKGROUND_SET:
- g_value_set_boolean (value, celltext->background_set);
+ g_value_set_boolean (value, priv->background_set);
break;
case PROP_FOREGROUND_SET:
- g_value_set_boolean (value, celltext->foreground_set);
+ g_value_set_boolean (value, priv->foreground_set);
break;
case PROP_FAMILY_SET:
case PROP_SIZE_SET:
{
PangoFontMask mask = get_property_font_set_mask (param_id);
- g_value_set_boolean (value, (pango_font_description_get_set_fields (celltext->font) & mask) != 0);
+ g_value_set_boolean (value, (pango_font_description_get_set_fields (priv->font) & mask) != 0);
break;
}
case PROP_SCALE_SET:
- g_value_set_boolean (value, celltext->scale_set);
+ g_value_set_boolean (value, priv->scale_set);
break;
case PROP_EDITABLE_SET:
- g_value_set_boolean (value, celltext->editable_set);
+ g_value_set_boolean (value, priv->editable_set);
break;
case PROP_STRIKETHROUGH_SET:
- g_value_set_boolean (value, celltext->strikethrough_set);
+ g_value_set_boolean (value, priv->strikethrough_set);
break;
case PROP_UNDERLINE_SET:
- g_value_set_boolean (value, celltext->underline_set);
+ g_value_set_boolean (value, priv->underline_set);
break;
case PROP_RISE_SET:
- g_value_set_boolean (value, celltext->rise_set);
+ g_value_set_boolean (value, priv->rise_set);
break;
case PROP_LANGUAGE_SET:
set_bg_color (GhbCellRendererText *celltext,
GdkRGBA *rgba)
{
+ GhbCellRendererTextPrivate *priv;
+
+ priv = ghb_cell_renderer_text_get_instance_private (celltext);
if (rgba)
{
- if (!celltext->background_set)
+ if (!priv->background_set)
{
- celltext->background_set = TRUE;
+ priv->background_set = TRUE;
g_object_notify (G_OBJECT (celltext), "background-set");
}
- celltext->background = *rgba;
+ priv->background = *rgba;
}
else
{
- if (celltext->background_set)
+ if (priv->background_set)
{
- celltext->background_set = FALSE;
+ priv->background_set = FALSE;
g_object_notify (G_OBJECT (celltext), "background-set");
}
}
set_fg_color (GhbCellRendererText *celltext,
GdkRGBA *rgba)
{
+ GhbCellRendererTextPrivate *priv;
+
+ priv = ghb_cell_renderer_text_get_instance_private (celltext);
if (rgba)
{
- if (!celltext->foreground_set)
+ if (!priv->foreground_set)
{
- celltext->foreground_set = TRUE;
+ priv->foreground_set = TRUE;
g_object_notify (G_OBJECT (celltext), "foreground-set");
}
- celltext->foreground = *rgba;
+ priv->foreground = *rgba;
}
else
{
- if (celltext->foreground_set)
+ if (priv->foreground_set)
{
- celltext->foreground_set = FALSE;
+ priv->foreground_set = FALSE;
g_object_notify (G_OBJECT (celltext), "foreground-set");
}
}
GObject *object = G_OBJECT (celltext);
PangoFontDescription *new_font_desc;
PangoFontMask old_mask, new_mask, changed_mask, set_changed_mask;
+ GhbCellRendererTextPrivate *priv;
+
+ priv = ghb_cell_renderer_text_get_instance_private (celltext);
if (font_desc)
new_font_desc = pango_font_description_copy (font_desc);
else
new_font_desc = pango_font_description_new ();
- old_mask = pango_font_description_get_set_fields (celltext->font);
+ old_mask = pango_font_description_get_set_fields (priv->font);
new_mask = pango_font_description_get_set_fields (new_font_desc);
changed_mask = old_mask | new_mask;
set_changed_mask = old_mask ^ new_mask;
- pango_font_description_free (celltext->font);
- celltext->font = new_font_desc;
+ pango_font_description_free (priv->font);
+ priv->font = new_font_desc;
g_object_freeze_notify (object);
GhbCellRendererText *celltext = GHB_CELL_RENDERER_TEXT (object);
GhbCellRendererTextPrivate *priv;
- priv = GHB_CELL_RENDERER_TEXT_GET_PRIVATE (object);
+ priv = ghb_cell_renderer_text_get_instance_private (celltext);
switch (param_id)
{
case PROP_TEXT:
- g_free (celltext->text);
+ g_free (priv->text);
if (priv->markup_set)
{
- if (celltext->extra_attrs)
- pango_attr_list_unref (celltext->extra_attrs);
- celltext->extra_attrs = NULL;
+ if (priv->extra_attrs)
+ pango_attr_list_unref (priv->extra_attrs);
+ priv->extra_attrs = NULL;
priv->markup_set = FALSE;
}
- celltext->text = g_strdup (g_value_get_string (value));
+ priv->text = g_strdup (g_value_get_string (value));
g_object_notify (object, "text");
break;
case PROP_ATTRIBUTES:
- if (celltext->extra_attrs)
- pango_attr_list_unref (celltext->extra_attrs);
+ if (priv->extra_attrs)
+ pango_attr_list_unref (priv->extra_attrs);
- celltext->extra_attrs = g_value_get_boxed (value);
- if (celltext->extra_attrs)
- pango_attr_list_ref (celltext->extra_attrs);
+ priv->extra_attrs = g_value_get_boxed (value);
+ if (priv->extra_attrs)
+ pango_attr_list_ref (priv->extra_attrs);
break;
case PROP_MARKUP:
{
return;
}
- g_free (celltext->text);
+ g_free (priv->text);
- if (celltext->extra_attrs)
- pango_attr_list_unref (celltext->extra_attrs);
+ if (priv->extra_attrs)
+ pango_attr_list_unref (priv->extra_attrs);
- celltext->text = text;
- celltext->extra_attrs = attrs;
+ priv->text = text;
+ priv->extra_attrs = attrs;
priv->markup_set = TRUE;
}
break;
pango_font_description_free (font_desc);
- if (celltext->fixed_height_rows != -1)
- celltext->calc_fixed_height = TRUE;
+ if (priv->fixed_height_rows != -1)
+ priv->calc_fixed_height = TRUE;
}
break;
case PROP_FONT_DESC:
set_font_description (celltext, g_value_get_boxed (value));
- if (celltext->fixed_height_rows != -1)
- celltext->calc_fixed_height = TRUE;
+ if (priv->fixed_height_rows != -1)
+ priv->calc_fixed_height = TRUE;
break;
case PROP_FAMILY:
case PROP_SIZE:
case PROP_SIZE_POINTS:
{
- PangoFontMask old_set_mask = pango_font_description_get_set_fields (celltext->font);
+ PangoFontMask old_set_mask = pango_font_description_get_set_fields (priv->font);
switch (param_id)
{
case PROP_FAMILY:
- pango_font_description_set_family (celltext->font,
+ pango_font_description_set_family (priv->font,
g_value_get_string (value));
break;
case PROP_STYLE:
- pango_font_description_set_style (celltext->font,
+ pango_font_description_set_style (priv->font,
g_value_get_enum (value));
break;
case PROP_VARIANT:
- pango_font_description_set_variant (celltext->font,
+ pango_font_description_set_variant (priv->font,
g_value_get_enum (value));
break;
case PROP_WEIGHT:
- pango_font_description_set_weight (celltext->font,
+ pango_font_description_set_weight (priv->font,
g_value_get_int (value));
break;
case PROP_STRETCH:
- pango_font_description_set_stretch (celltext->font,
+ pango_font_description_set_stretch (priv->font,
g_value_get_enum (value));
break;
case PROP_SIZE:
- pango_font_description_set_size (celltext->font,
+ pango_font_description_set_size (priv->font,
g_value_get_int (value));
g_object_notify (object, "size-points");
break;
case PROP_SIZE_POINTS:
- pango_font_description_set_size (celltext->font,
+ pango_font_description_set_size (priv->font,
g_value_get_double (value) * PANGO_SCALE);
g_object_notify (object, "size");
break;
}
- if (celltext->fixed_height_rows != -1)
- celltext->calc_fixed_height = TRUE;
+ if (priv->fixed_height_rows != -1)
+ priv->calc_fixed_height = TRUE;
- notify_set_changed (object, old_set_mask & pango_font_description_get_set_fields (celltext->font));
+ 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");
}
case PROP_SCALE:
- celltext->font_scale = g_value_get_double (value);
- celltext->scale_set = TRUE;
- if (celltext->fixed_height_rows != -1)
- celltext->calc_fixed_height = TRUE;
+ priv->font_scale = g_value_get_double (value);
+ priv->scale_set = TRUE;
+ if (priv->fixed_height_rows != -1)
+ priv->calc_fixed_height = TRUE;
g_object_notify (object, "scale-set");
break;
case PROP_EDITABLE:
- celltext->editable = g_value_get_boolean (value);
- celltext->editable_set = TRUE;
- if (celltext->editable)
+ priv->editable = g_value_get_boolean (value);
+ priv->editable_set = TRUE;
+ if (priv->editable)
g_object_set(celltext, "mode", GTK_CELL_RENDERER_MODE_EDITABLE, NULL);
else
g_object_set(celltext, "mode", GTK_CELL_RENDERER_MODE_INERT, NULL);
break;
case PROP_STRIKETHROUGH:
- celltext->strikethrough = g_value_get_boolean (value);
- celltext->strikethrough_set = TRUE;
+ priv->strikethrough = g_value_get_boolean (value);
+ priv->strikethrough_set = TRUE;
g_object_notify (object, "strikethrough-set");
break;
case PROP_UNDERLINE:
- celltext->underline_style = g_value_get_enum (value);
- celltext->underline_set = TRUE;
+ priv->underline_style = g_value_get_enum (value);
+ priv->underline_set = TRUE;
g_object_notify (object, "underline-set");
break;
case PROP_RISE:
- celltext->rise = g_value_get_int (value);
- celltext->rise_set = TRUE;
+ priv->rise = g_value_get_int (value);
+ priv->rise_set = TRUE;
g_object_notify (object, "rise-set");
- if (celltext->fixed_height_rows != -1)
- celltext->calc_fixed_height = TRUE;
+ if (priv->fixed_height_rows != -1)
+ priv->calc_fixed_height = TRUE;
break;
case PROP_LANGUAGE:
break;
case PROP_BACKGROUND_SET:
- celltext->background_set = g_value_get_boolean (value);
+ priv->background_set = g_value_get_boolean (value);
break;
case PROP_FOREGROUND_SET:
- celltext->foreground_set = g_value_get_boolean (value);
+ priv->foreground_set = g_value_get_boolean (value);
break;
case PROP_FAMILY_SET:
case PROP_SIZE_SET:
if (!g_value_get_boolean (value))
{
- pango_font_description_unset_fields (celltext->font,
+ pango_font_description_unset_fields (priv->font,
get_property_font_set_mask (param_id));
}
else
{
PangoFontMask changed_mask;
- changed_mask = set_font_desc_fields (celltext->font,
+ changed_mask = set_font_desc_fields (priv->font,
get_property_font_set_mask (param_id));
notify_fields_changed (G_OBJECT (celltext), changed_mask);
}
break;
case PROP_SCALE_SET:
- celltext->scale_set = g_value_get_boolean (value);
+ priv->scale_set = g_value_get_boolean (value);
break;
case PROP_EDITABLE_SET:
- celltext->editable_set = g_value_get_boolean (value);
+ priv->editable_set = g_value_get_boolean (value);
break;
case PROP_STRIKETHROUGH_SET:
- celltext->strikethrough_set = g_value_get_boolean (value);
+ priv->strikethrough_set = g_value_get_boolean (value);
break;
case PROP_UNDERLINE_SET:
- celltext->underline_set = g_value_get_boolean (value);
+ priv->underline_set = g_value_get_boolean (value);
break;
case PROP_RISE_SET:
- celltext->rise_set = g_value_get_boolean (value);
+ priv->rise_set = g_value_get_boolean (value);
break;
case PROP_LANGUAGE_SET:
PangoUnderline uline;
GhbCellRendererTextPrivate *priv;
- priv = GHB_CELL_RENDERER_TEXT_GET_PRIVATE (celltext);
+ priv = ghb_cell_renderer_text_get_instance_private (celltext);
- layout = gtk_widget_create_pango_layout (widget, celltext->text);
+ layout = gtk_widget_create_pango_layout (widget, priv->text);
- if (celltext->extra_attrs)
- attr_list = pango_attr_list_copy (celltext->extra_attrs);
+ if (priv->extra_attrs)
+ attr_list = pango_attr_list_copy (priv->extra_attrs);
else
attr_list = pango_attr_list_new ();
* background_area not the PangoLayout area
*/
- if (celltext->foreground_set
+ if (priv->foreground_set
&& (flags & GTK_CELL_RENDERER_SELECTED) == 0)
{
add_attr(attr_list,
- pango_attr_foreground_new(celltext->foreground.red,
- celltext->foreground.green,
- celltext->foreground.blue));
+ pango_attr_foreground_new(priv->foreground.red,
+ priv->foreground.green,
+ priv->foreground.blue));
}
- if (celltext->strikethrough_set)
+ if (priv->strikethrough_set)
add_attr (attr_list,
- pango_attr_strikethrough_new (celltext->strikethrough));
+ pango_attr_strikethrough_new (priv->strikethrough));
}
- add_attr (attr_list, pango_attr_font_desc_new (celltext->font));
+ add_attr (attr_list, pango_attr_font_desc_new (priv->font));
- if (celltext->scale_set &&
- celltext->font_scale != 1.0)
- add_attr (attr_list, pango_attr_scale_new (celltext->font_scale));
+ if (priv->scale_set &&
+ priv->font_scale != 1.0)
+ add_attr (attr_list, pango_attr_scale_new (priv->font_scale));
- if (celltext->underline_set)
- uline = celltext->underline_style;
+ if (priv->underline_set)
+ uline = priv->underline_style;
else
uline = PANGO_UNDERLINE_NONE;
}
if (uline != PANGO_UNDERLINE_NONE)
- add_attr (attr_list, pango_attr_underline_new (celltext->underline_style));
+ add_attr (attr_list, pango_attr_underline_new (priv->underline_style));
- if (celltext->rise_set)
- add_attr (attr_list, pango_attr_rise_new (celltext->rise));
+ if (priv->rise_set)
+ add_attr (attr_list, pango_attr_rise_new (priv->rise));
if (priv->ellipsize_set)
pango_layout_set_ellipsize (layout, priv->ellipsize);
PangoRectangle rect;
GhbCellRendererTextPrivate *priv;
- priv = GHB_CELL_RENDERER_TEXT_GET_PRIVATE (cell);
+ priv = ghb_cell_renderer_text_get_instance_private (celltext);
gint cell_width, cell_height, cell_xpad, cell_ypad;
gfloat cell_xalign, cell_yalign;
gtk_cell_renderer_get_alignment(cell, &cell_xalign, &cell_yalign);
gtk_cell_renderer_get_padding(cell, &cell_xpad, &cell_ypad);
- if (celltext->calc_fixed_height)
+ if (priv->calc_fixed_height)
{
PangoContext *context;
PangoFontMetrics *metrics;
gint row_height;
font_desc = pango_font_description_copy_static(ghb_widget_get_font(widget));
- pango_font_description_merge_static(font_desc, celltext->font, TRUE);
+ pango_font_description_merge_static(font_desc, priv->font, TRUE);
- if (celltext->scale_set)
+ if (priv->scale_set)
pango_font_description_set_size (font_desc,
- celltext->font_scale * pango_font_description_get_size (font_desc));
+ priv->font_scale * pango_font_description_get_size (font_desc));
context = gtk_widget_get_pango_context (widget);
gtk_cell_renderer_set_fixed_size (cell,
cell_width, 2*cell_ypad +
- celltext->fixed_height_rows * PANGO_PIXELS (row_height));
+ priv->fixed_height_rows * PANGO_PIXELS (row_height));
if (height)
{
*height = cell_height;
height = NULL;
}
- celltext->calc_fixed_height = FALSE;
+ priv->calc_fixed_height = FALSE;
if (width == NULL)
return;
}
gint xpad, ypad;
PangoRectangle rect;
- priv = GHB_CELL_RENDERER_TEXT_GET_PRIVATE (cell);
+ priv = ghb_cell_renderer_text_get_instance_private (celltext);
layout = get_layout (celltext, widget, TRUE, flags);
get_size(cell, widget, cell_area, layout, &x_offset, &y_offset, NULL, NULL);
context = gtk_widget_get_style_context(widget);
- if (celltext->background_set && (flags & GTK_CELL_RENDERER_SELECTED) == 0)
+ if (priv->background_set && (flags & GTK_CELL_RENDERER_SELECTED) == 0)
{
gtk_snapshot_append_color(snapshot,
- &celltext->background,
+ &priv->background,
&GRAPHENE_RECT_INIT(
background_area->x, background_area->y,
background_area->width,
gint y_offset = 0;
GhbCellRendererTextPrivate *priv;
- priv = GHB_CELL_RENDERER_TEXT_GET_PRIVATE (cell);
+ priv = ghb_cell_renderer_text_get_instance_private (celltext);
layout = get_layout (celltext, widget, TRUE, flags);
get_size(cell, widget, cell_area, layout, &x_offset, &y_offset, NULL, NULL);
gtk_cell_renderer_get_padding(cell, &xpad, &ypad);
- if (celltext->background_set &&
+ if (priv->background_set &&
(flags & GTK_CELL_RENDERER_SELECTED) == 0)
{
gdk_cairo_rectangle (cr, background_area);
cairo_set_source_rgb (cr,
- celltext->background.red / 65535.,
- celltext->background.green / 65535.,
- celltext->background.blue / 65535.);
+ priv->background.red / 65535.,
+ priv->background.green / 65535.,
+ priv->background.blue / 65535.);
cairo_fill (cr);
}
const gchar *new_text;
GhbCellRendererTextPrivate *priv;
- priv = GHB_CELL_RENDERER_TEXT_GET_PRIVATE (data);
+ priv = ghb_cell_renderer_text_get_instance_private(GHB_CELL_RENDERER_TEXT(data));
priv->entry = NULL;
{
GhbCellRendererTextPrivate *priv;
- priv = GHB_CELL_RENDERER_TEXT_GET_PRIVATE (data);
+ priv = ghb_cell_renderer_text_get_instance_private(GHB_CELL_RENDERER_TEXT(data));
priv->entry_menu_popdown_timeout = 0;
{
GhbCellRendererTextPrivate *priv;
- priv = GHB_CELL_RENDERER_TEXT_GET_PRIVATE (data);
+ priv = ghb_cell_renderer_text_get_instance_private(GHB_CELL_RENDERER_TEXT(data));
priv->in_entry_menu = FALSE;
{
GhbCellRendererTextPrivate *priv;
- priv = GHB_CELL_RENDERER_TEXT_GET_PRIVATE (data);
+ priv = ghb_cell_renderer_text_get_instance_private(GHB_CELL_RENDERER_TEXT(data));
if (priv->entry_menu_popdown_timeout)
{
{
GhbCellRendererTextPrivate *priv;
- priv = GHB_CELL_RENDERER_TEXT_GET_PRIVATE (data);
+ priv = ghb_cell_renderer_text_get_instance_private(GHB_CELL_RENDERER_TEXT(data));
if (priv->in_entry_menu)
return FALSE;
GhbCellRendererTextPrivate *priv;
celltext = GHB_CELL_RENDERER_TEXT (cell);
- priv = GHB_CELL_RENDERER_TEXT_GET_PRIVATE (cell);
+ priv = ghb_cell_renderer_text_get_instance_private (celltext);
/* If the cell isn't editable we return NULL. */
- if (celltext->editable == FALSE)
+ if (priv->editable == FALSE)
return NULL;
gint xalign;
"xalign", xalign,
NULL);
- if (celltext->text)
- gtk_entry_set_text (GTK_ENTRY (priv->entry), celltext->text);
+ if (priv->text)
+ gtk_entry_set_text (GTK_ENTRY (priv->entry), priv->text);
g_object_set_data_full (G_OBJECT (priv->entry),
I_(GHB_CELL_RENDERER_TEXT_PATH), g_strdup (path), g_free);
* the height is determined by the properties again.
**/
void
-ghb_cell_renderer_text_set_fixed_height_from_font (GhbCellRendererText *renderer,
+ghb_cell_renderer_text_set_fixed_height_from_font (GhbCellRendererText *celltext,
gint number_of_rows)
{
- g_return_if_fail (GHB_IS_CELL_RENDERER_TEXT (renderer));
+ g_return_if_fail (GHB_IS_CELL_RENDERER_TEXT (celltext));
g_return_if_fail (number_of_rows == -1 || number_of_rows > 0);
+ GhbCellRendererTextPrivate *priv;
+ priv = ghb_cell_renderer_text_get_instance_private (celltext);
if (number_of_rows == -1)
{
gint width;
- g_object_get(renderer, "width", &width, NULL);
- gtk_cell_renderer_set_fixed_size (GTK_CELL_RENDERER (renderer),
+ g_object_get(celltext, "width", &width, NULL);
+ gtk_cell_renderer_set_fixed_size (GTK_CELL_RENDERER (celltext),
width,
-1);
}
else
{
- renderer->fixed_height_rows = number_of_rows;
- renderer->calc_fixed_height = TRUE;
+ priv->fixed_height_rows = number_of_rows;
+ priv->calc_fixed_height = TRUE;
}
}