summaryrefslogtreecommitdiff
path: root/gtk/gtkcellrendererpixbuf.c
diff options
context:
space:
mode:
authorMatthias Clasen <matthiasc@src.gnome.org>2006-05-02 23:56:43 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2006-05-02 23:56:43 +0000
commitf26aad1916445d25c99878138dfc384de67a2060 (patch)
treeb72263ecb326e82a49f1e8d1871ec4288b8aa299 /gtk/gtkcellrendererpixbuf.c
parent33cddd12d78abb2efe6facba9c859017f8df9819 (diff)
downloadgtk+-f26aad1916445d25c99878138dfc384de67a2060.tar.gz
Boilerplate reduction
Diffstat (limited to 'gtk/gtkcellrendererpixbuf.c')
-rw-r--r--gtk/gtkcellrendererpixbuf.c37
1 files changed, 2 insertions, 35 deletions
diff --git a/gtk/gtkcellrendererpixbuf.c b/gtk/gtkcellrendererpixbuf.c
index 054130012d..6bdfbcaa24 100644
--- a/gtk/gtkcellrendererpixbuf.c
+++ b/gtk/gtkcellrendererpixbuf.c
@@ -34,8 +34,6 @@ static void gtk_cell_renderer_pixbuf_set_property (GObject *
guint param_id,
const GValue *value,
GParamSpec *pspec);
-static void gtk_cell_renderer_pixbuf_init (GtkCellRendererPixbuf *celltext);
-static void gtk_cell_renderer_pixbuf_class_init (GtkCellRendererPixbufClass *class);
static void gtk_cell_renderer_pixbuf_finalize (GObject *object);
static void gtk_cell_renderer_pixbuf_create_stock_pixbuf (GtkCellRendererPixbuf *cellpixbuf,
GtkWidget *widget);
@@ -69,8 +67,6 @@ enum {
PROP_ICON_NAME
};
-static gpointer parent_class;
-
#define GTK_CELL_RENDERER_PIXBUF_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GTK_TYPE_CELL_RENDERER_PIXBUF, GtkCellRendererPixbufPrivate))
@@ -85,34 +81,7 @@ struct _GtkCellRendererPixbufPrivate
gchar *icon_name;
};
-
-GType
-gtk_cell_renderer_pixbuf_get_type (void)
-{
- static GType cell_pixbuf_type = 0;
-
- if (!cell_pixbuf_type)
- {
- static const GTypeInfo cell_pixbuf_info =
- {
- sizeof (GtkCellRendererPixbufClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) gtk_cell_renderer_pixbuf_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (GtkCellRendererPixbuf),
- 0, /* n_preallocs */
- (GInstanceInitFunc) gtk_cell_renderer_pixbuf_init,
- };
-
- cell_pixbuf_type =
- g_type_register_static (GTK_TYPE_CELL_RENDERER, I_("GtkCellRendererPixbuf"),
- &cell_pixbuf_info, 0);
- }
-
- return cell_pixbuf_type;
-}
+G_DEFINE_TYPE (GtkCellRendererPixbuf, gtk_cell_renderer_pixbuf, GTK_TYPE_CELL_RENDERER);
static void
gtk_cell_renderer_pixbuf_init (GtkCellRendererPixbuf *cellpixbuf)
@@ -129,8 +98,6 @@ gtk_cell_renderer_pixbuf_class_init (GtkCellRendererPixbufClass *class)
GObjectClass *object_class = G_OBJECT_CLASS (class);
GtkCellRendererClass *cell_class = GTK_CELL_RENDERER_CLASS (class);
- parent_class = g_type_class_peek_parent (class);
-
object_class->finalize = gtk_cell_renderer_pixbuf_finalize;
object_class->get_property = gtk_cell_renderer_pixbuf_get_property;
@@ -247,7 +214,7 @@ gtk_cell_renderer_pixbuf_finalize (GObject *object)
g_free (priv->stock_detail);
g_free (priv->icon_name);
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ (* G_OBJECT_CLASS (gtk_cell_renderer_pixbuf_parent_class)->finalize) (object);
}
static void