[gtk+/refactor: 17/106] gtkcellrendererspin: Use private pointer instead GET_PRIV macro



commit c2b079ca05f59abc12047f93abfbfb1f163ee888
Author: Javier Jardón <jjardon gnome org>
Date:   Tue Jun 1 19:27:25 2010 +0200

    gtkcellrendererspin: Use private pointer instead GET_PRIV macro

 gtk/gtkcellrendererspin.c |   14 ++++++++------
 gtk/gtkcellrendererspin.h |    3 +++
 2 files changed, 11 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtkcellrendererspin.c b/gtk/gtkcellrendererspin.c
index ab583f9..a514657 100644
--- a/gtk/gtkcellrendererspin.c
+++ b/gtk/gtkcellrendererspin.c
@@ -27,7 +27,6 @@
 #include "gtkspinbutton.h"
 #include "gtkcellrendererspin.h"
 
-#define GTK_CELL_RENDERER_SPIN_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GTK_TYPE_CELL_RENDERER_SPIN, GtkCellRendererSpinPrivate))
 
 struct _GtkCellRendererSpinPrivate
 {
@@ -132,7 +131,10 @@ gtk_cell_renderer_spin_init (GtkCellRendererSpin *self)
 {
   GtkCellRendererSpinPrivate *priv;
 
-  priv = GTK_CELL_RENDERER_SPIN_GET_PRIVATE (self);
+  self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
+                                            GTK_TYPE_CELL_RENDERER_SPIN,
+                                            GtkCellRendererSpinPrivate);
+  priv = self->priv;
 
   priv->adjustment = NULL;
   priv->climb_rate = 0.0;
@@ -144,7 +146,7 @@ gtk_cell_renderer_spin_finalize (GObject *object)
 {
   GtkCellRendererSpinPrivate *priv;
 
-  priv = GTK_CELL_RENDERER_SPIN_GET_PRIVATE (object);
+  priv = GTK_CELL_RENDERER_SPIN (object)->priv;
 
   if (priv && priv->adjustment)
     g_object_unref (priv->adjustment);
@@ -162,7 +164,7 @@ gtk_cell_renderer_spin_get_property (GObject      *object,
   GtkCellRendererSpinPrivate *priv;
 
   renderer = GTK_CELL_RENDERER_SPIN (object);
-  priv = GTK_CELL_RENDERER_SPIN_GET_PRIVATE (renderer);
+  priv = renderer->priv;
 
   switch (prop_id)
     {
@@ -192,7 +194,7 @@ gtk_cell_renderer_spin_set_property (GObject      *object,
   GObject *obj;
 
   renderer = GTK_CELL_RENDERER_SPIN (object);
-  priv = GTK_CELL_RENDERER_SPIN_GET_PRIVATE (renderer);
+  priv = renderer->priv;
 
   switch (prop_id)
     {
@@ -301,7 +303,7 @@ gtk_cell_renderer_spin_start_editing (GtkCellRenderer     *cell,
   GtkWidget *spin;
 
   cell_text = GTK_CELL_RENDERER_TEXT (cell);
-  priv = GTK_CELL_RENDERER_SPIN_GET_PRIVATE (cell);
+  priv = GTK_CELL_RENDERER_SPIN (cell)->priv;
 
   if (!cell_text->editable)
     return NULL;
diff --git a/gtk/gtkcellrendererspin.h b/gtk/gtkcellrendererspin.h
index 5daccda..3d19b27 100644
--- a/gtk/gtkcellrendererspin.h
+++ b/gtk/gtkcellrendererspin.h
@@ -42,6 +42,9 @@ typedef struct _GtkCellRendererSpinPrivate GtkCellRendererSpinPrivate;
 struct _GtkCellRendererSpin
 {
   GtkCellRendererText parent;
+
+  /* <private> */
+  GtkCellRendererSpinPrivate *priv;
 };
 
 struct _GtkCellRendererSpinClass



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]