aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXan Lopez <xan@src.gnome.org>2009-02-23 15:14:05 +0800
committerXan Lopez <xan@src.gnome.org>2009-02-23 15:14:05 +0800
commit20e78e3ebc2d902d601f0e5a440c107fc140cfdc (patch)
tree7c2aec3b534a351d9390c3604307cef0dd5ec20c
parente1f38b7cdc074914a5298b5aac6918195c889ec4 (diff)
downloadgsoc2013-epiphany-20e78e3ebc2d902d601f0e5a440c107fc140cfdc.tar
gsoc2013-epiphany-20e78e3ebc2d902d601f0e5a440c107fc140cfdc.tar.gz
gsoc2013-epiphany-20e78e3ebc2d902d601f0e5a440c107fc140cfdc.tar.bz2
gsoc2013-epiphany-20e78e3ebc2d902d601f0e5a440c107fc140cfdc.tar.lz
gsoc2013-epiphany-20e78e3ebc2d902d601f0e5a440c107fc140cfdc.tar.xz
gsoc2013-epiphany-20e78e3ebc2d902d601f0e5a440c107fc140cfdc.tar.zst
gsoc2013-epiphany-20e78e3ebc2d902d601f0e5a440c107fc140cfdc.zip
ephy-zoom-action: use G_DEFINE_TYPE, remove unneeded includes.
svn path=/trunk/; revision=8807
-rw-r--r--lib/widgets/ephy-zoom-action.c42
1 files changed, 5 insertions, 37 deletions
diff --git a/lib/widgets/ephy-zoom-action.c b/lib/widgets/ephy-zoom-action.c
index 342757abb..577a4fc6c 100644
--- a/lib/widgets/ephy-zoom-action.c
+++ b/lib/widgets/ephy-zoom-action.c
@@ -20,14 +20,12 @@
#include "config.h"
+#include <glib/gi18n.h>
+
#include "ephy-zoom-action.h"
#include "ephy-zoom-control.h"
#include "ephy-zoom.h"
-#include <glib-object.h>
-#include <glib/gi18n.h>
-#include <gtk/gtk.h>
-
#define EPHY_ZOOM_ACTION_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), EPHY_TYPE_ZOOM_ACTION, EphyZoomActionPrivate))
struct _EphyZoomActionPrivate
@@ -53,35 +51,7 @@ enum
static guint signals[LAST_SIGNAL] = { 0 };
-static GObjectClass *parent_class = NULL;
-
-GType
-ephy_zoom_action_get_type (void)
-{
- static GType type = 0;
-
- if (G_UNLIKELY (type == 0))
- {
- const GTypeInfo our_info =
- {
- sizeof (EphyZoomActionClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) ephy_zoom_action_class_init,
- NULL,
- NULL, /* class_data */
- sizeof (EphyZoomAction),
- 0, /* n_preallocs */
- (GInstanceInitFunc) ephy_zoom_action_init,
- };
-
- type = g_type_register_static (GTK_TYPE_ACTION,
- "EphyZoomAction",
- &our_info, 0);
- }
-
- return type;
-}
+G_DEFINE_TYPE (EphyZoomAction, ephy_zoom_action, GTK_TYPE_ACTION)
static void
zoom_to_level_cb (EphyZoomControl *control,
@@ -115,7 +85,7 @@ connect_proxy (GtkAction *action, GtkWidget *proxy)
G_CALLBACK (zoom_to_level_cb), action);
}
- GTK_ACTION_CLASS (parent_class)->connect_proxy (action, proxy);
+ GTK_ACTION_CLASS (ephy_zoom_action_parent_class)->connect_proxy (action, proxy);
}
static void
@@ -164,7 +134,7 @@ create_menu_item (GtkAction *action)
gtk_widget_show (menu);
- menu_item = GTK_ACTION_CLASS (parent_class)->create_menu_item (action);
+ menu_item = GTK_ACTION_CLASS (ephy_zoom_action_parent_class)->create_menu_item (action);
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu_item), menu);
@@ -218,8 +188,6 @@ ephy_zoom_action_class_init (EphyZoomActionClass *class)
object_class->set_property = ephy_zoom_action_set_property;
object_class->get_property = ephy_zoom_action_get_property;
- parent_class = g_type_class_peek_parent (class);
-
action_class->toolbar_item_type = EPHY_TYPE_ZOOM_CONTROL;
action_class->connect_proxy = connect_proxy;
action_class->create_menu_item = create_menu_item;