diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2013-06-27 20:02:52 +0100 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2013-07-09 09:30:02 +0100 |
commit | 0899ef7cc9cf73824901923143f38bb9b6d224a3 (patch) | |
tree | 16207a8837da8a89a6f4a1d1a1c23074fd29aa1d /gtk/gtkcellrenderer.c | |
parent | 365919d5f6da0a8648815ca5cf5805fb88c9be16 (diff) | |
download | gtk+-0899ef7cc9cf73824901923143f38bb9b6d224a3.tar.gz |
gtk: Use new macros for defining private data
https://bugzilla.gnome.org/show_bug.cgi?id=702996
Diffstat (limited to 'gtk/gtkcellrenderer.c')
-rw-r--r-- | gtk/gtkcellrenderer.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/gtk/gtkcellrenderer.c b/gtk/gtkcellrenderer.c index 9f4b4e203f..3ebe9ae5c0 100644 --- a/gtk/gtkcellrenderer.c +++ b/gtk/gtkcellrenderer.c @@ -164,16 +164,21 @@ enum { LAST_SIGNAL }; +static gint GtkCellRenderer_private_offset; static guint cell_renderer_signals[LAST_SIGNAL] = { 0 }; +static inline gpointer +gtk_cell_renderer_get_instance_private (GtkCellRenderer *self) +{ + return (G_STRUCT_MEMBER_P (self, GtkCellRenderer_private_offset)); +} + static void gtk_cell_renderer_init (GtkCellRenderer *cell) { GtkCellRendererPrivate *priv; - cell->priv = G_TYPE_INSTANCE_GET_PRIVATE (cell, - GTK_TYPE_CELL_RENDERER, - GtkCellRendererPrivate); + cell->priv = gtk_cell_renderer_get_instance_private (cell); priv = cell->priv; priv->mode = GTK_CELL_RENDERER_MODE_INERT; @@ -427,7 +432,8 @@ gtk_cell_renderer_class_init (GtkCellRendererClass *class) P_("Cell background set"), P_("Whether the cell background color is set")); - g_type_class_add_private (class, sizeof (GtkCellRendererPrivate)); + if (GtkCellRenderer_private_offset != 0) + g_type_class_adjust_private_offset (class, &GtkCellRenderer_private_offset); gtk_cell_renderer_class_set_accessible_type (class, GTK_TYPE_RENDERER_CELL_ACCESSIBLE); } @@ -463,6 +469,8 @@ gtk_cell_renderer_get_type (void) cell_renderer_type = g_type_register_static (G_TYPE_INITIALLY_UNOWNED, "GtkCellRenderer", &cell_renderer_info, G_TYPE_FLAG_ABSTRACT); + GtkCellRenderer_private_offset = + g_type_add_instance_private (cell_renderer_type, sizeof (GtkCellRendererPrivate)); g_type_add_class_private (cell_renderer_type, sizeof (GtkCellRendererClassPrivate)); } |