From 1557095113a3c0f5baadcfb1e953d73762e5263e Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Mon, 5 May 2008 20:34:41 +0000 Subject: Keep a priv pointer in the object struct instead of using G_TYPE_INSTANCE_GET_PRIVATE all the time. svn path=/trunk/; revision=1082 --- libempathy-gtk/empathy-cell-renderer-expander.c | 54 ++++++++++++------------- 1 file changed, 25 insertions(+), 29 deletions(-) (limited to 'libempathy-gtk/empathy-cell-renderer-expander.c') diff --git a/libempathy-gtk/empathy-cell-renderer-expander.c b/libempathy-gtk/empathy-cell-renderer-expander.c index 51930ab6a..fc9189d2d 100644 --- a/libempathy-gtk/empathy-cell-renderer-expander.c +++ b/libempathy-gtk/empathy-cell-renderer-expander.c @@ -31,12 +31,31 @@ #include +#include #include "empathy-cell-renderer-expander.h" -#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), EMPATHY_TYPE_CELL_RENDERER_EXPANDER, EmpathyCellRendererExpanderPriv)) +#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyCellRendererExpander) +typedef struct { + GtkExpanderStyle expander_style; + gint expander_size; + + GtkTreeView *animation_view; + GtkTreeRowReference *animation_node; + GtkExpanderStyle animation_style; + guint animation_timeout; + GdkRectangle animation_area; + + guint activatable : 1; + guint animation_expanding : 1; +} EmpathyCellRendererExpanderPriv; + +enum { + PROP_0, + PROP_EXPANDER_STYLE, + PROP_EXPANDER_SIZE, + PROP_ACTIVATABLE +}; -static void empathy_cell_renderer_expander_init (EmpathyCellRendererExpander *expander); -static void empathy_cell_renderer_expander_class_init (EmpathyCellRendererExpanderClass *klass); static void empathy_cell_renderer_expander_get_property (GObject *object, guint param_id, GValue *value, @@ -68,38 +87,15 @@ static gboolean empathy_cell_renderer_expander_activate (GtkCellRenderer GdkRectangle *cell_area, GtkCellRendererState flags); -enum { - PROP_0, - PROP_EXPANDER_STYLE, - PROP_EXPANDER_SIZE, - PROP_ACTIVATABLE -}; - -typedef struct _EmpathyCellRendererExpanderPriv EmpathyCellRendererExpanderPriv; - -struct _EmpathyCellRendererExpanderPriv { - GtkExpanderStyle expander_style; - gint expander_size; - - GtkTreeView *animation_view; - GtkTreeRowReference *animation_node; - GtkExpanderStyle animation_style; - guint animation_timeout; - GdkRectangle animation_area; - - guint activatable : 1; - guint animation_expanding : 1; -}; - G_DEFINE_TYPE (EmpathyCellRendererExpander, empathy_cell_renderer_expander, GTK_TYPE_CELL_RENDERER) static void empathy_cell_renderer_expander_init (EmpathyCellRendererExpander *expander) { - EmpathyCellRendererExpanderPriv *priv; - - priv = GET_PRIV (expander); + EmpathyCellRendererExpanderPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (expander, + EMPATHY_TYPE_CELL_RENDERER_EXPANDER, EmpathyCellRendererExpanderPriv); + expander->priv = priv; priv->expander_style = GTK_EXPANDER_COLLAPSED; priv->expander_size = 12; priv->activatable = TRUE; -- cgit v1.2.3