gtkcellrendererspin: Use private pointer instead GET_PRIV macro

This commit is contained in:
Javier Jardón 2010-06-01 19:27:25 +02:00
parent ee1d9df94c
commit c2b079ca05
2 changed files with 11 additions and 6 deletions

View File

@ -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;

View File

@ -42,6 +42,9 @@ typedef struct _GtkCellRendererSpinPrivate GtkCellRendererSpinPrivate;
struct _GtkCellRendererSpin
{
GtkCellRendererText parent;
/* <private> */
GtkCellRendererSpinPrivate *priv;
};
struct _GtkCellRendererSpinClass