From 6d91806986ef863f087676d246f76fb50096b260 Mon Sep 17 00:00:00 2001 From: Xan Lopez Date: Mon, 23 Feb 2009 07:22:11 +0000 Subject: ephy-zoom-control: use G_DEFINE_TYPE, remove unneeded includes. svn path=/trunk/; revision=8808 --- lib/widgets/ephy-zoom-control.c | 41 ++++------------------------------------- 1 file changed, 4 insertions(+), 37 deletions(-) diff --git a/lib/widgets/ephy-zoom-control.c b/lib/widgets/ephy-zoom-control.c index b719ace71..6a18b1eb4 100644 --- a/lib/widgets/ephy-zoom-control.c +++ b/lib/widgets/ephy-zoom-control.c @@ -19,13 +19,10 @@ #include "config.h" +#include + #include "ephy-zoom-control.h" -#include "ephy-marshal.h" #include "ephy-zoom.h" -#include "ephy-debug.h" - -#include -#include #define EPHY_ZOOM_CONTROL_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), EPHY_TYPE_ZOOM_CONTROL, EphyZoomControlPrivate)) @@ -50,39 +47,11 @@ enum static guint signals[LAST_SIGNAL]; -static GObjectClass *parent_class = NULL; - static void ephy_zoom_control_class_init (EphyZoomControlClass *klass); static void ephy_zoom_control_init (EphyZoomControl *control); static void ephy_zoom_control_finalize (GObject *o); -GType -ephy_zoom_control_get_type (void) -{ - static GType type = 0; - - if (G_UNLIKELY (type == 0)) - { - const GTypeInfo our_info = - { - sizeof (EphyZoomControlClass), - NULL, /* base_init */ - NULL, /* base_finalize */ - (GClassInitFunc) ephy_zoom_control_class_init, - NULL, - NULL, /* class_data */ - sizeof (EphyZoomControl), - 0, /* n_preallocs */ - (GInstanceInitFunc) ephy_zoom_control_init, - }; - - type = g_type_register_static (GTK_TYPE_TOOL_ITEM, - "EphyZoomControl", - &our_info, 0); - } - - return type; -} +G_DEFINE_TYPE (EphyZoomControl, ephy_zoom_control, GTK_TYPE_TOOL_ITEM) static void combo_changed_cb (GtkComboBox *combo, EphyZoomControl *control) @@ -199,8 +168,6 @@ ephy_zoom_control_class_init (EphyZoomControlClass *klass) GObjectClass *object_class; GtkToolItemClass *tool_item_class; - parent_class = g_type_class_peek_parent (klass); - object_class = (GObjectClass *)klass; tool_item_class = (GtkToolItemClass *)klass; @@ -238,7 +205,7 @@ ephy_zoom_control_finalize (GObject *o) g_object_unref (control->priv->combo); - G_OBJECT_CLASS (parent_class)->finalize (o); + G_OBJECT_CLASS (ephy_zoom_control_parent_class)->finalize (o); } /** -- cgit v1.2.3