[Kazehakase-cvs] CVS update: kazehakase/src/actions

Back to archive index

Hiroyuki Ikezoe ikezo****@users*****
Sat Dec 2 18:50:49 JST 2006


Index: kazehakase/src/actions/kz-entry-action.c
diff -u kazehakase/src/actions/kz-entry-action.c:1.8 kazehakase/src/actions/kz-entry-action.c:1.9
--- kazehakase/src/actions/kz-entry-action.c:1.8	Thu Mar 10 23:01:59 2005
+++ kazehakase/src/actions/kz-entry-action.c	Sat Dec  2 18:50:49 2006
@@ -23,25 +23,20 @@
 #include <kz-entry.h>
 #include <glib/gi18n.h>
 
-#include "gobject-utils.h"
-
 enum {
   PROP_0,
   PROP_TEXT
 };
 
-static void       kz_entry_action_init         (KzEntryAction *action);
-static void       kz_entry_action_class_init   (KzEntryActionClass *class);
-
-static void       kz_entry_action_dispose      (GObject *object);
-static void       kz_entry_action_set_property (GObject      *object,
-						 guint         prop_id,
-						 const GValue *value,
-						 GParamSpec   *pspec);
-static void       kz_entry_action_get_property (GObject      *object,
-						 guint         prop_id,
-						 GValue       *value,
-						 GParamSpec   *pspec);
+static void       dispose      (GObject *object);
+static void       set_property (GObject      *object,
+                                guint         prop_id,
+                                const GValue *value,
+                                GParamSpec   *pspec);
+static void       get_property (GObject      *object,
+                                guint         prop_id,
+                                GValue       *value,
+                                GParamSpec   *pspec);
 
 static GtkWidget *create_menu_item              (GtkAction *action);
 static GtkWidget *create_tool_item              (GtkAction *action);
@@ -54,11 +49,7 @@
 static GtkEntry  *kz_entry_action_real_get_entry_widget (KzEntryAction *action,
 							  GtkWidget      *proxy);
 
-static GtkActionClass *parent_class = NULL;
-
-KZ_OBJECT_GET_TYPE(kz_entry_action, "KzEntryAction", KzEntryAction,
-		   kz_entry_action_class_init, kz_entry_action_init,
-		   GTK_TYPE_ACTION)
+G_DEFINE_TYPE(KzEntryAction, kz_entry_action, GTK_TYPE_ACTION)
 
 static void
 kz_entry_action_class_init (KzEntryActionClass *klass)
@@ -66,13 +57,12 @@
 	GObjectClass *object_class;
 	GtkActionClass *action_class;
 
-	parent_class = g_type_class_peek_parent(klass);
 	object_class = G_OBJECT_CLASS(klass);
 	action_class = GTK_ACTION_CLASS(klass);
 
-	object_class->dispose      = kz_entry_action_dispose;
-	object_class->set_property = kz_entry_action_set_property;
-	object_class->get_property = kz_entry_action_get_property;
+	object_class->dispose      = dispose;
+	object_class->set_property = set_property;
+	object_class->get_property = get_property;
 
 	action_class->create_menu_item = create_menu_item;
 	action_class->create_tool_item = create_tool_item;
@@ -101,7 +91,7 @@
 
 
 static void
-kz_entry_action_dispose (GObject *object)
+dispose (GObject *object)
 {
 	KzEntryAction *action = KZ_ENTRY_ACTION(object);
 
@@ -109,16 +99,16 @@
 		g_free (action->text);
 	action->text = NULL;
 
-	if (G_OBJECT_CLASS (parent_class)->dispose)
-		G_OBJECT_CLASS (parent_class)->dispose(object);
+	if (G_OBJECT_CLASS (kz_entry_action_parent_class)->dispose)
+		G_OBJECT_CLASS (kz_entry_action_parent_class)->dispose(object);
 }
 
 
 static void
-kz_entry_action_set_property (GObject      *object,
-			       guint         prop_id,
-			       const GValue *value,
-			       GParamSpec   *pspec)
+set_property (GObject      *object,
+              guint         prop_id,
+              const GValue *value,
+              GParamSpec   *pspec)
 {
 	KzEntryAction *action;
 
@@ -138,10 +128,10 @@
 
 
 static void
-kz_entry_action_get_property (GObject    *object,
-			       guint       prop_id,
-			       GValue     *value,
-			       GParamSpec *pspec)
+get_property (GObject    *object,
+              guint       prop_id,
+              GValue     *value,
+              GParamSpec *pspec)
 {
 	KzEntryAction *action;
 
@@ -267,7 +257,7 @@
 {
 	GtkWidget *widget, *entry;
 
-	widget = (*GTK_ACTION_CLASS(parent_class)->create_tool_item) (action);
+	widget = (*GTK_ACTION_CLASS(kz_entry_action_parent_class)->create_tool_item) (action);
 	gtk_tool_item_set_expand (GTK_TOOL_ITEM(widget), TRUE);
 
 	entry = kz_entry_new();
@@ -375,7 +365,7 @@
 		if (entry_action->text)
 			gtk_entry_set_text(entry, entry_action->text);
 	}
-	GTK_ACTION_CLASS (parent_class)->connect_proxy (action, proxy);
+	GTK_ACTION_CLASS (kz_entry_action_parent_class)->connect_proxy (action, proxy);
 }
 
 
@@ -397,7 +387,7 @@
 	}
 
 	/* other signals will be remove by parent */
-	GTK_ACTION_CLASS (parent_class)->disconnect_proxy(action, proxy);
+	GTK_ACTION_CLASS (kz_entry_action_parent_class)->disconnect_proxy(action, proxy);
 }
 
 
Index: kazehakase/src/actions/kz-history-action.c
diff -u kazehakase/src/actions/kz-history-action.c:1.25 kazehakase/src/actions/kz-history-action.c:1.26
--- kazehakase/src/actions/kz-history-action.c:1.25	Fri Sep  8 13:26:51 2006
+++ kazehakase/src/actions/kz-history-action.c	Sat Dec  2 18:50:49 2006
@@ -25,8 +25,6 @@
 #include <string.h>
 #include <glib/gi18n.h>
 
-#include "gobject-utils.h"
-
 
 enum {
 	HISTORY_CHANGED_SIGNAL,
@@ -42,13 +40,11 @@
 };
 
 
-static void       kz_history_action_class_init       (KzHistoryActionClass *klass);
-static void       kz_history_action_init             (KzHistoryAction *action);
-static void       kz_history_action_dispose          (GObject *object);
-
-static void       kz_history_action_activate         (GtkAction *action);
-static GtkWidget *kz_history_action_create_menu_item (GtkAction *action);
-static GtkWidget *kz_history_action_create_tool_item (GtkAction *action);
+static void       dispose          (GObject *object);
+
+static void       activate         (GtkAction *action);
+static GtkWidget *create_menu_item (GtkAction *action);
+static GtkWidget *create_tool_item (GtkAction *action);
 
 static GtkComboBox  *kz_history_action_real_get_combo_widget
 						     (KzHistoryAction *action,
@@ -56,16 +52,12 @@
 static void       kz_history_action_real_set_history (KzHistoryAction *action,
 						      GList            *list);
 
-static void       kz_history_action_connect_proxy    (GtkAction        *action,
-						      GtkWidget        *proxy);
-
-static KzEntryActionClass *parent_class = NULL;
+static void       connect_proxy    (GtkAction        *action,
+                                    GtkWidget        *proxy);
 
 static gint history_action_signals[LAST_SIGNAL] = { 0 };
 
-KZ_OBJECT_GET_TYPE(kz_history_action, "KzHistoryAction", KzHistoryAction,
-		   kz_history_action_class_init, kz_history_action_init,
-		   KZ_TYPE_ENTRY_ACTION)
+G_DEFINE_TYPE(KzHistoryAction, kz_history_action, KZ_TYPE_ENTRY_ACTION)
 
 static void
 kz_history_action_class_init (KzHistoryActionClass *klass)
@@ -74,21 +66,16 @@
 	GtkActionClass *action_class;
 	KzEntryActionClass *entry_action_class;
 
-	parent_class = g_type_class_peek_parent(klass);
 	object_class = G_OBJECT_CLASS(klass);
 	action_class = GTK_ACTION_CLASS(klass);
 	entry_action_class = KZ_ENTRY_ACTION_CLASS(klass);
 
-	object_class->dispose      = kz_history_action_dispose;
-	/*
-	object_class->set_property = kz_history_action_set_property;
-	object_class->get_property = kz_history_action_get_property;
-	*/
-
-	action_class->activate         = kz_history_action_activate;
-	action_class->create_menu_item = kz_history_action_create_menu_item;
-	action_class->create_tool_item = kz_history_action_create_tool_item;
-	action_class->connect_proxy    = kz_history_action_connect_proxy;
+	object_class->dispose      = dispose;
+
+	action_class->activate         = activate;
+	action_class->create_menu_item = create_menu_item;
+	action_class->create_tool_item = create_tool_item;
+	action_class->connect_proxy    = connect_proxy;
 
 	action_class->toolbar_item_type = GTK_TYPE_TOOL_ITEM;
 
@@ -123,7 +110,7 @@
 
 
 static void
-kz_history_action_dispose (GObject *object)
+dispose (GObject *object)
 {
 	KzHistoryAction *action = KZ_HISTORY_ACTION(object);
 
@@ -151,8 +138,8 @@
 		action->completion_previous_key = NULL;
 	}
 
-	if (G_OBJECT_CLASS (parent_class)->dispose)
-		G_OBJECT_CLASS (parent_class)->dispose(object);
+	if (G_OBJECT_CLASS (kz_history_action_parent_class)->dispose)
+		G_OBJECT_CLASS (kz_history_action_parent_class)->dispose(object);
 }
 
 
@@ -203,7 +190,7 @@
 
 
 static void
-kz_history_action_activate (GtkAction *action)
+activate (GtkAction *action)
 {
 	KzHistoryAction *hist_act = KZ_HISTORY_ACTION(action);
 	const gchar *text;
@@ -255,8 +242,8 @@
 		      history_action_signals[HISTORY_CHANGED_SIGNAL], 0);
 
 	/* not needed */
-	if (GTK_ACTION_CLASS (parent_class)->activate)
-		GTK_ACTION_CLASS (parent_class)->activate(action);
+	if (GTK_ACTION_CLASS (kz_history_action_parent_class)->activate)
+		GTK_ACTION_CLASS (kz_history_action_parent_class)->activate(action);
 }
 
 
@@ -381,7 +368,7 @@
 }
 
 static GtkWidget *
-kz_history_action_create_menu_item (GtkAction *action)
+create_menu_item (GtkAction *action)
 {
 	GtkWidget *widget, *combo;
 
@@ -399,7 +386,7 @@
 
 
 static GtkWidget *
-kz_history_action_create_tool_item (GtkAction *action)
+create_tool_item (GtkAction *action)
 {
 	GType toolbar_item_type;
 	GtkWidget *widget, *combo;
@@ -420,7 +407,7 @@
 
 
 static void
-kz_history_action_connect_proxy (GtkAction *action, GtkWidget *proxy)
+connect_proxy (GtkAction *action, GtkWidget *proxy)
 {
 	GtkComboBox *combo;
 
@@ -432,7 +419,7 @@
 	{
 		gtk_entry_set_text(GTK_ENTRY(GTK_BIN(combo)->child), "");
 	}
-	GTK_ACTION_CLASS(parent_class)->connect_proxy(action, proxy);
+	GTK_ACTION_CLASS(kz_history_action_parent_class)->connect_proxy(action, proxy);
 }
 
 
Index: kazehakase/src/actions/kz-location-entry-action.c
diff -u kazehakase/src/actions/kz-location-entry-action.c:1.52 kazehakase/src/actions/kz-location-entry-action.c:1.53
--- kazehakase/src/actions/kz-location-entry-action.c:1.52	Fri Aug 25 11:38:48 2006
+++ kazehakase/src/actions/kz-location-entry-action.c	Sat Dec  2 18:50:49 2006
@@ -32,7 +32,6 @@
 
 #include "kazehakase.h"
 #include "utils/utils.h"
-#include "gobject-utils.h"
 #include "kz-bookmark.h"
 #include "kz-smart-bookmark.h"
 #include "kz-actions.h"
@@ -46,23 +45,21 @@
 	PROP_KZ_BOOKMARK
 };
 
-static void kz_location_entry_action_class_init       (KzLocationEntryActionClass *class);
-static void kz_location_entry_action_init             (KzLocationEntryAction      *action);
-static void kz_location_entry_action_dispose          (GObject *obj);
-static void kz_location_entry_action_set_property     (GObject           *object,
-						       guint              prop_id,
-						       const GValue      *value,
-						       GParamSpec        *pspec);
-static void kz_location_entry_action_get_property     (GObject           *object,
-						       guint              prop_id,
-						       GValue            *value,
-						       GParamSpec        *pspec);
-
-static void kz_location_entry_action_activate         (GtkAction         *action);
-static void kz_location_entry_action_connect_proxy    (GtkAction         *action,
-						       GtkWidget         *proxy);
-static void kz_location_entry_action_disconnect_proxy (GtkAction         *action,
-						       GtkWidget         *proxy);
+static void dispose          (GObject *obj);
+static void set_property     (GObject           *object,
+                              guint              prop_id,
+                              const GValue      *value,
+                              GParamSpec        *pspec);
+static void get_property     (GObject           *object,
+                              guint              prop_id,
+                              GValue            *value,
+                              GParamSpec        *pspec);
+
+static void activate         (GtkAction         *action);
+static void connect_proxy    (GtkAction         *action,
+                              GtkWidget         *proxy);
+static void disconnect_proxy (GtkAction         *action,
+                              GtkWidget         *proxy);
 
 static void     kz_location_entry_action_history_changed (KzHistoryAction *action);
 static void     kz_location_entry_action_sync_history    (KzLocationEntryAction *action);
@@ -82,16 +79,7 @@
 					       const gchar     *key,
 					       const gchar     *old_value,
 					       GtkEntry        *entry);
-static KzHistoryActionClass *parent_class = NULL;
-
-
-KZ_OBJECT_GET_TYPE(kz_location_entry_action,
-		   "KzLocationEntryAction",
-		   KzLocationEntryAction,
-		   kz_location_entry_action_class_init,
-		   kz_location_entry_action_init,
-		   KZ_TYPE_HISTORY_ACTION)
-
+G_DEFINE_TYPE(KzLocationEntryAction, kz_location_entry_action, KZ_TYPE_HISTORY_ACTION)
 
 static void
 kz_location_entry_action_class_init (KzLocationEntryActionClass *klass)
@@ -100,18 +88,17 @@
 	GtkActionClass *action_class;
 	KzHistoryActionClass *history_class;
 
-	parent_class  = g_type_class_peek_parent(klass);
 	object_class  = G_OBJECT_CLASS(klass);
 	action_class  = GTK_ACTION_CLASS(klass);
 	history_class = KZ_HISTORY_ACTION_CLASS(klass);
 
-	object_class->set_property     = kz_location_entry_action_set_property;
-	object_class->get_property     = kz_location_entry_action_get_property;
-	object_class->dispose          = kz_location_entry_action_dispose;
-
-	action_class->activate         = kz_location_entry_action_activate;
-	action_class->connect_proxy    = kz_location_entry_action_connect_proxy;
-	action_class->disconnect_proxy = kz_location_entry_action_disconnect_proxy;
+	object_class->set_property     = set_property;
+	object_class->get_property     = get_property;
+	object_class->dispose          = dispose;
+
+	action_class->activate         = activate;
+	action_class->connect_proxy    = connect_proxy;
+	action_class->disconnect_proxy = disconnect_proxy;
 
 	history_class->history_changed = kz_location_entry_action_history_changed;
 
@@ -147,7 +134,7 @@
 
 
 static void
-kz_location_entry_action_dispose (GObject *obj)
+dispose (GObject *obj)
 {
 	KzLocationEntryAction *action = KZ_LOCATION_ENTRY_ACTION(obj);
 
@@ -168,16 +155,16 @@
 		action->bookmark = NULL;
 	}
 
-	if (G_OBJECT_CLASS(parent_class)->dispose)
-		G_OBJECT_CLASS(parent_class)->dispose(obj);
+	if (G_OBJECT_CLASS(kz_location_entry_action_parent_class)->dispose)
+		G_OBJECT_CLASS(kz_location_entry_action_parent_class)->dispose(obj);
 }
 
 
 static void
-kz_location_entry_action_set_property (GObject         *object,
-				       guint            prop_id,
-				       const GValue    *value,
-				       GParamSpec      *pspec)
+set_property (GObject         *object,
+              guint            prop_id,
+              const GValue    *value,
+              GParamSpec      *pspec)
 {
 	KzLocationEntryAction *action = KZ_LOCATION_ENTRY_ACTION(object);
   
@@ -199,10 +186,10 @@
 
 
 static void
-kz_location_entry_action_get_property (GObject         *object,
-				       guint            prop_id,
-				       GValue          *value,
-				       GParamSpec      *pspec)
+get_property (GObject         *object,
+              guint            prop_id,
+              GValue          *value,
+              GParamSpec      *pspec)
 {
 	KzLocationEntryAction *action = KZ_LOCATION_ENTRY_ACTION(object);
 
@@ -222,7 +209,7 @@
 
 
 static void
-kz_location_entry_action_activate (GtkAction *action)
+activate (GtkAction *action)
 {
 	KzLocationEntryAction *entry_action;
 	const gchar *uri;
@@ -238,8 +225,8 @@
 	kz_location_entry_action_reset_history(entry_action);
 	
 	entry_action->activating = TRUE;
-	if (GTK_ACTION_CLASS(parent_class)->activate)
-		GTK_ACTION_CLASS(parent_class)->activate(action);
+	if (GTK_ACTION_CLASS(kz_location_entry_action_parent_class)->activate)
+		GTK_ACTION_CLASS(kz_location_entry_action_parent_class)->activate(action);
 	entry_action->activating = FALSE;
 
 
@@ -261,11 +248,11 @@
 
 
 static void
-kz_location_entry_action_connect_proxy (GtkAction *action, GtkWidget *proxy)
+connect_proxy (GtkAction *action, GtkWidget *proxy)
 {
 	GtkEntry *entry;
 
-	GTK_ACTION_CLASS (parent_class)->connect_proxy (action, proxy);
+	GTK_ACTION_CLASS (kz_location_entry_action_parent_class)->connect_proxy (action, proxy);
 
 	entry = kz_entry_action_get_entry_widget(KZ_ENTRY_ACTION(action), proxy);
 	if (entry)
@@ -291,7 +278,7 @@
 
 
 static void
-kz_location_entry_action_disconnect_proxy (GtkAction *action, GtkWidget *proxy)
+disconnect_proxy (GtkAction *action, GtkWidget *proxy)
 {
 	GtkEntry *entry;
 
@@ -319,7 +306,7 @@
 			          NULL);
 	}
 
-	GTK_ACTION_CLASS (parent_class)->disconnect_proxy (action, proxy);
+	GTK_ACTION_CLASS (kz_location_entry_action_parent_class)->disconnect_proxy (action, proxy);
 }
 
 
@@ -330,8 +317,8 @@
 
 	kz_location_entry_action_sync_history(KZ_LOCATION_ENTRY_ACTION(action));
 
-	if (KZ_HISTORY_ACTION_CLASS(parent_class)->history_changed)
-		KZ_HISTORY_ACTION_CLASS(parent_class)->history_changed(action);
+	if (KZ_HISTORY_ACTION_CLASS(kz_location_entry_action_parent_class)->history_changed)
+		KZ_HISTORY_ACTION_CLASS(kz_location_entry_action_parent_class)->history_changed(action);
 }
 
 
Index: kazehakase/src/actions/kz-navigation-action.c
diff -u kazehakase/src/actions/kz-navigation-action.c:1.11 kazehakase/src/actions/kz-navigation-action.c:1.12
--- kazehakase/src/actions/kz-navigation-action.c:1.11	Tue May 16 09:18:51 2006
+++ kazehakase/src/actions/kz-navigation-action.c	Sat Dec  2 18:50:49 2006
@@ -23,7 +23,6 @@
 
 #include <glib/gi18n.h>
 #include "kazehakase.h"
-#include "gobject-utils.h"
 #include "kz-favicon.h"
 #include "kz-icons.h"
 
@@ -33,33 +32,23 @@
 };
 
 
-static void kz_navigation_action_class_init       (KzNavigationActionClass *class);
-static void kz_navigation_action_init             (KzNavigationAction      *action);
-static void kz_navigation_action_dispose          (GObject *obj);
-static void kz_navigation_action_set_property     (GObject           *object,
-						   guint              prop_id,
-						   const GValue      *value,
-						   GParamSpec        *pspec);
-static void kz_navigation_action_get_property     (GObject           *object,
-						   guint              prop_id,
-						   GValue            *value,
-						   GParamSpec        *pspec);
-static void kz_navigation_action_connect_proxy    (GtkAction         *action,
-						   GtkWidget         *proxy);
-static void kz_navigation_action_activate         (GtkAction         *action);
-#if 0
-static void kz_navigation_action_disconnect_proxy (GtkAction         *action,
-						   GtkWidget         *proxy);
-#endif
-static void cb_menu_activated                     (GtkMenuToolButton *b,
-						   KzNavigationAction *action);
-static GtkActionClass *parent_class = NULL;
-
-
-KZ_OBJECT_GET_TYPE(kz_navigation_action, "KzNavigationAction", KzNavigationAction,
-		   kz_navigation_action_class_init, kz_navigation_action_init,
-		   GTK_TYPE_ACTION)
+static void dispose          (GObject *obj);
+static void set_property     (GObject           *object,
+                              guint              prop_id,
+                              const GValue      *value,
+                              GParamSpec        *pspec);
+static void get_property     (GObject           *object,
+                              guint              prop_id,
+                              GValue            *value,
+                              GParamSpec        *pspec);
+static void connect_proxy    (GtkAction         *action,
+                              GtkWidget         *proxy);
+static void activate         (GtkAction         *action);
 
+static void cb_menu_activated   (GtkMenuToolButton *b,
+                                 KzNavigationAction *action);
+
+G_DEFINE_TYPE(KzNavigationAction, kz_navigation_action, GTK_TYPE_ACTION)
 
 static void
 kz_navigation_action_class_init (KzNavigationActionClass *klass)
@@ -67,17 +56,16 @@
 	GObjectClass *object_class;
 	GtkActionClass *action_class;
 
-	parent_class = g_type_class_peek_parent(klass);
 	object_class = G_OBJECT_CLASS(klass);
 	action_class = GTK_ACTION_CLASS(klass);
 
-	object_class->set_property     = kz_navigation_action_set_property;
-	object_class->get_property     = kz_navigation_action_get_property;
-	object_class->dispose          = kz_navigation_action_dispose;
+	object_class->set_property     = set_property;
+	object_class->get_property     = get_property;
+	object_class->dispose          = dispose;
 
 	action_class->toolbar_item_type = GTK_TYPE_MENU_TOOL_BUTTON;
-	action_class->connect_proxy     = kz_navigation_action_connect_proxy;
-	action_class->activate          = kz_navigation_action_activate;
+	action_class->connect_proxy     = connect_proxy;
+	action_class->activate          = activate;
 
 	g_object_class_install_property
 		(object_class,
@@ -99,7 +87,7 @@
 
 
 static void
-kz_navigation_action_dispose (GObject *obj)
+dispose (GObject *obj)
 {
 	KzNavigationAction *action = KZ_NAVIGATION_ACTION(obj);
 
@@ -107,16 +95,16 @@
 		g_object_unref(action->kz);
 	action->kz = NULL;
 
-	if (G_OBJECT_CLASS(parent_class)->dispose)
-		G_OBJECT_CLASS(parent_class)->dispose(obj);
+	if (G_OBJECT_CLASS(kz_navigation_action_parent_class)->dispose)
+		G_OBJECT_CLASS(kz_navigation_action_parent_class)->dispose(obj);
 }
 
 
 static void
-kz_navigation_action_set_property (GObject         *object,
-				   guint            prop_id,
-				   const GValue    *value,
-				   GParamSpec      *pspec)
+set_property (GObject         *object,
+              guint            prop_id,
+              const GValue    *value,
+              GParamSpec      *pspec)
 {
 	KzNavigationAction *action = KZ_NAVIGATION_ACTION(object);
   
@@ -133,10 +121,10 @@
 
 
 static void
-kz_navigation_action_get_property (GObject         *object,
-				   guint            prop_id,
-				   GValue          *value,
-				   GParamSpec      *pspec)
+get_property (GObject         *object,
+              guint            prop_id,
+              GValue          *value,
+              GParamSpec      *pspec)
 {
 	KzNavigationAction *action = KZ_NAVIGATION_ACTION(object);
 
@@ -152,7 +140,7 @@
 }
 
 static void
-kz_navigation_action_connect_proxy (GtkAction *action, GtkWidget *proxy)
+connect_proxy (GtkAction *action, GtkWidget *proxy)
 {
 	GtkWidget *menu;
 
@@ -169,20 +157,12 @@
 		}
 	}
 
-	(* GTK_ACTION_CLASS (parent_class)->connect_proxy) (action, proxy);
+	(* GTK_ACTION_CLASS (kz_navigation_action_parent_class)->connect_proxy) (action, proxy);
 }
 
 
-#if 0
-static void
-kz_navigation_action_disconnect_proxy (GtkAction *action, GtkWidget *proxy)
-{
-	GTK_ACTION_CLASS (parent_class)->disconnect_proxy (action, proxy);
-}
-#endif
-
 static void
-kz_navigation_action_activate (GtkAction *action)
+activate (GtkAction *action)
 {
 	GtkWidget *widget;
 
Index: kazehakase/src/actions/kz-smart-bookmark-action.c
diff -u kazehakase/src/actions/kz-smart-bookmark-action.c:1.47 kazehakase/src/actions/kz-smart-bookmark-action.c:1.48
--- kazehakase/src/actions/kz-smart-bookmark-action.c:1.47	Thu Feb 23 22:31:58 2006
+++ kazehakase/src/actions/kz-smart-bookmark-action.c	Sat Dec  2 18:50:49 2006
@@ -29,7 +29,6 @@
 #include "kz-smart-bookmark.h"
 #include "utils/utils.h"
 #include "utils/gtk-utils.h"
-#include "gobject-utils.h"
 #include "kz-entry.h"
 #include "kz-actions.h"
 #include "kz-icons.h"
@@ -42,19 +41,17 @@
 	PROP_KZ_BOOKMARK
 };
 
-static void kz_smart_bookmark_action_class_init   (KzSmartBookmarkActionClass *class);
-static void kz_smart_bookmark_action_init         (KzSmartBookmarkAction *action);
-static void kz_smart_bookmark_action_dispose      (GObject *obj);
-static void kz_smart_bookmark_action_set_property (GObject      *object,
-						   guint         prop_id,
-						   const GValue *value,
-						   GParamSpec   *pspec);
-static void kz_smart_bookmark_action_get_property (GObject      *object,
-						   guint         prop_id,
-						   GValue       *value,
-						   GParamSpec   *pspec);
+static void dispose      (GObject *obj);
+static void set_property (GObject      *object,
+                          guint         prop_id,
+                          const GValue *value,
+                          GParamSpec   *pspec);
+static void get_property (GObject      *object,
+                          guint         prop_id,
+                          GValue       *value,
+                          GParamSpec   *pspec);
 
-static void kz_smart_bookmark_action_activate     (GtkAction    *action);
+static void activate     (GtkAction    *action);
 
 static GtkWidget *create_tool_item                (GtkAction    *action);
 static void       connect_proxy                   (GtkAction    *action,
@@ -91,15 +88,7 @@
 
 static void       update_icon_and_bgtext         (KzSmartBookmarkAction *action);
 
-static KzEntryActionClass *parent_class = NULL;
-
-KZ_OBJECT_GET_TYPE(kz_smart_bookmark_action,
-		   "KzSmartBookmarkAction",
-		   KzSmartBookmarkAction,
-		   kz_smart_bookmark_action_class_init,
-		   kz_smart_bookmark_action_init,
-		   KZ_TYPE_ENTRY_ACTION)
-
+G_DEFINE_TYPE(KzSmartBookmarkAction, kz_smart_bookmark_action, KZ_TYPE_ENTRY_ACTION)
 
 static void
 kz_smart_bookmark_action_class_init (KzSmartBookmarkActionClass *klass)
@@ -108,16 +97,15 @@
 	GtkActionClass *action_class;
 	KzEntryActionClass *entry_class;
 
-	parent_class  = g_type_class_peek_parent(klass);
 	object_class  = G_OBJECT_CLASS(klass);
 	action_class  = GTK_ACTION_CLASS(klass);
 	entry_class   = KZ_ENTRY_ACTION_CLASS(klass);
 
-	object_class->set_property     = kz_smart_bookmark_action_set_property;
-	object_class->get_property     = kz_smart_bookmark_action_get_property;
-	object_class->dispose          = kz_smart_bookmark_action_dispose;
+	object_class->set_property     = set_property;
+	object_class->get_property     = get_property;
+	object_class->dispose          = dispose;
 
-	action_class->activate         = kz_smart_bookmark_action_activate;
+	action_class->activate         = activate;
 	action_class->connect_proxy    = connect_proxy;
 	action_class->disconnect_proxy = disconnect_proxy;
 	action_class->create_tool_item = create_tool_item;
@@ -154,7 +142,7 @@
 
 
 static void
-kz_smart_bookmark_action_dispose (GObject *obj)
+dispose (GObject *obj)
 {
 	KzSmartBookmarkAction *action = KZ_SMART_BOOKMARK_ACTION(obj);
 
@@ -191,16 +179,16 @@
 		action->menulist = NULL;
 	}
 
-	if (G_OBJECT_CLASS(parent_class)->dispose)
-		G_OBJECT_CLASS(parent_class)->dispose(obj);
+	if (G_OBJECT_CLASS(kz_smart_bookmark_action_parent_class)->dispose)
+		G_OBJECT_CLASS(kz_smart_bookmark_action_parent_class)->dispose(obj);
 }
 
 
 static void
-kz_smart_bookmark_action_set_property (GObject         *object,
-				       guint            prop_id,
-				       const GValue    *value,
-				       GParamSpec      *pspec)
+set_property (GObject         *object,
+              guint            prop_id,
+              const GValue    *value,
+              GParamSpec      *pspec)
 {
 	KzSmartBookmarkAction *action = KZ_SMART_BOOKMARK_ACTION(object);
   
@@ -234,10 +222,10 @@
 
 
 static void
-kz_smart_bookmark_action_get_property (GObject         *object,
-				       guint            prop_id,
-				       GValue          *value,
-				       GParamSpec      *pspec)
+get_property (GObject         *object,
+              guint            prop_id,
+              GValue          *value,
+              GParamSpec      *pspec)
 {
 	KzSmartBookmarkAction *action = KZ_SMART_BOOKMARK_ACTION(object);
 
@@ -257,7 +245,7 @@
 
 
 static void
-kz_smart_bookmark_action_activate (GtkAction *action)
+activate (GtkAction *action)
 {
 	KzSmartBookmarkAction *smart_action;
 	gchar *smart_uri;
@@ -265,8 +253,8 @@
 
 	g_return_if_fail(KZ_IS_SMART_BOOKMARK_ACTION(action));
 
-	if (GTK_ACTION_CLASS(parent_class)->activate)
-		GTK_ACTION_CLASS(parent_class)->activate(action);
+	if (GTK_ACTION_CLASS(kz_smart_bookmark_action_parent_class)->activate)
+		GTK_ACTION_CLASS(kz_smart_bookmark_action_parent_class)->activate(action);
 
 	smart_action = KZ_SMART_BOOKMARK_ACTION(action);
 
@@ -294,7 +282,7 @@
 {
 	GtkWidget *widget;
 
-	widget = (*GTK_ACTION_CLASS(parent_class)->create_tool_item) (action);
+	widget = (*GTK_ACTION_CLASS(kz_smart_bookmark_action_parent_class)->create_tool_item) (action);
 	gtk_tool_item_set_expand (GTK_TOOL_ITEM(widget), FALSE);
 
 	return widget;
@@ -306,7 +294,7 @@
 {
 	GtkEntry *entry;
 
-	GTK_ACTION_CLASS (parent_class)->connect_proxy (action, proxy);
+	GTK_ACTION_CLASS (kz_smart_bookmark_action_parent_class)->connect_proxy (action, proxy);
 
 	entry = kz_entry_action_get_entry_widget(KZ_ENTRY_ACTION(action), proxy);
 	if (entry)
@@ -352,7 +340,7 @@
 			 action);
 	}
 
-	GTK_ACTION_CLASS (parent_class)->disconnect_proxy (action, proxy);
+	GTK_ACTION_CLASS (kz_smart_bookmark_action_parent_class)->disconnect_proxy (action, proxy);
 }
 
 
Index: kazehakase/src/actions/kz-stop-reload-action.c
diff -u kazehakase/src/actions/kz-stop-reload-action.c:1.9 kazehakase/src/actions/kz-stop-reload-action.c:1.10
--- kazehakase/src/actions/kz-stop-reload-action.c:1.9	Mon May  9 10:20:13 2005
+++ kazehakase/src/actions/kz-stop-reload-action.c	Sat Dec  2 18:50:49 2006
@@ -23,7 +23,6 @@
 
 #include <glib/gi18n.h>
 #include "kazehakase.h"
-#include "gobject-utils.h"
 
 typedef struct _KzStopReloadActionPrivate KzStopReloadActionPrivate;
 struct _KzStopReloadActionPrivate 
@@ -41,33 +40,27 @@
 };
 
 
-static void kz_stop_reload_action_class_init       (KzStopReloadActionClass *class);
-static void kz_stop_reload_action_init             (KzStopReloadAction      *action);
-static void kz_stop_reload_action_dispose          (GObject *obj);
-static void kz_stop_reload_action_set_property     (GObject           *object,
-						    guint              prop_id,
-						    const GValue      *value,
-						    GParamSpec        *pspec);
-static void kz_stop_reload_action_get_property     (GObject           *object,
-						    guint              prop_id,
-						    GValue            *value,
-						    GParamSpec        *pspec);
-
-static void kz_stop_reload_action_activate         (GtkAction         *action);
-static void kz_stop_reload_action_connect_proxy    (GtkAction         *action,
-						    GtkWidget         *proxy);
-static void kz_stop_reload_action_disconnect_proxy (GtkAction         *action,
-						    GtkWidget         *proxy);
+static void dispose          (GObject *object);
+static void set_property     (GObject           *object,
+                              guint              prop_id,
+                              const GValue      *value,
+                              GParamSpec        *pspec);
+static void get_property     (GObject           *object,
+                              guint              prop_id,
+                              GValue            *value,
+                              GParamSpec        *pspec);
+
+static void activate         (GtkAction         *action);
+static void connect_proxy    (GtkAction         *action,
+                              GtkWidget         *proxy);
+static void disconnect_proxy (GtkAction         *action,
+                              GtkWidget         *proxy);
 
 static void kz_stop_reload_action_sync_state       (GtkAction  *action,
 				  		    GParamSpec *pspec,
 				  		    GtkWidget  *proxy);
 
-static GtkActionClass *parent_class = NULL;
-
-KZ_OBJECT_GET_TYPE(kz_stop_reload_action, "KzStopReloadAction", KzStopReloadAction,
-		   kz_stop_reload_action_class_init, kz_stop_reload_action_init,
-		   GTK_TYPE_ACTION)
+G_DEFINE_TYPE(KzStopReloadAction, kz_stop_reload_action, GTK_TYPE_ACTION)
 
 static void
 kz_stop_reload_action_class_init (KzStopReloadActionClass *klass)
@@ -75,17 +68,16 @@
 	GObjectClass *object_class;
 	GtkActionClass *action_class;
 
-	parent_class = g_type_class_peek_parent(klass);
 	object_class = G_OBJECT_CLASS(klass);
 	action_class = GTK_ACTION_CLASS(klass);
 
-	object_class->set_property     = kz_stop_reload_action_set_property;
-	object_class->get_property     = kz_stop_reload_action_get_property;
-	object_class->dispose          = kz_stop_reload_action_dispose;
-
-	action_class->activate         = kz_stop_reload_action_activate;
-	action_class->connect_proxy    = kz_stop_reload_action_connect_proxy;
-	action_class->disconnect_proxy = kz_stop_reload_action_disconnect_proxy;
+	object_class->set_property     = set_property;
+	object_class->get_property     = get_property;
+	object_class->dispose          = dispose;
+
+	action_class->activate         = activate;
+	action_class->connect_proxy    = connect_proxy;
+	action_class->disconnect_proxy = disconnect_proxy;
 
 	g_object_class_install_property
 		(object_class,
@@ -121,7 +113,7 @@
 
 
 static void
-kz_stop_reload_action_dispose (GObject *obj)
+dispose (GObject *obj)
 {
 	KzStopReloadActionPrivate *priv = KZ_STOP_RELOAD_ACTION_GET_PRIVATE (obj);
 
@@ -129,16 +121,16 @@
 		g_object_unref(priv->kz);
 	priv->kz = NULL;
 
-	if (G_OBJECT_CLASS(parent_class)->dispose)
-		G_OBJECT_CLASS(parent_class)->dispose(obj);
+	if (G_OBJECT_CLASS(kz_stop_reload_action_parent_class)->dispose)
+		G_OBJECT_CLASS(kz_stop_reload_action_parent_class)->dispose(obj);
 }
 
 
 static void
-kz_stop_reload_action_set_property (GObject         *object,
-				    guint            prop_id,
-				    const GValue    *value,
-				    GParamSpec      *pspec)
+set_property (GObject         *object,
+              guint            prop_id,
+              const GValue    *value,
+              GParamSpec      *pspec)
 {
 	KzStopReloadActionPrivate *priv = KZ_STOP_RELOAD_ACTION_GET_PRIVATE (object);
   
@@ -158,10 +150,10 @@
 
 
 static void
-kz_stop_reload_action_get_property (GObject         *object,
-				    guint            prop_id,
-				    GValue          *value,
-				    GParamSpec      *pspec)
+get_property (GObject         *object,
+              guint            prop_id,
+              GValue          *value,
+              GParamSpec      *pspec)
 {
 	KzStopReloadActionPrivate *priv = KZ_STOP_RELOAD_ACTION_GET_PRIVATE (object);
 
@@ -198,7 +190,7 @@
 
 
 static void
-kz_stop_reload_action_activate (GtkAction *action)
+activate (GtkAction *action)
 {
 	KzWindow *kz;
 	GdkModifierType state = (GdkModifierType)0;
@@ -237,19 +229,19 @@
 
 
 static void
-kz_stop_reload_action_connect_proxy (GtkAction *action, GtkWidget *proxy)
+connect_proxy (GtkAction *action, GtkWidget *proxy)
 {
 	g_signal_connect_object(action, "notify::state",
 				G_CALLBACK(kz_stop_reload_action_sync_state),
 				proxy, 0);
-	(* GTK_ACTION_CLASS (parent_class)->connect_proxy) (action, proxy);
+	(* GTK_ACTION_CLASS (kz_stop_reload_action_parent_class)->connect_proxy) (action, proxy);
 }
 
 
 static void
-kz_stop_reload_action_disconnect_proxy (GtkAction *action, GtkWidget *proxy)
+disconnect_proxy (GtkAction *action, GtkWidget *proxy)
 {
-	GTK_ACTION_CLASS (parent_class)->disconnect_proxy (action, proxy);
+	GTK_ACTION_CLASS (kz_stop_reload_action_parent_class)->disconnect_proxy (action, proxy);
 
 	g_signal_handlers_disconnect_by_func
 			(proxy,
Index: kazehakase/src/actions/kz-zoom-action.c
diff -u kazehakase/src/actions/kz-zoom-action.c:1.14 kazehakase/src/actions/kz-zoom-action.c:1.15
--- kazehakase/src/actions/kz-zoom-action.c:1.14	Mon May  9 10:20:13 2005
+++ kazehakase/src/actions/kz-zoom-action.c	Sat Dec  2 18:50:49 2006
@@ -23,7 +23,6 @@
 
 #include <glib/gi18n.h>
 #include "kazehakase.h"
-#include "gobject-utils.h"
 
 typedef struct _KzZoomActionPrivate KzZoomActionPrivate;
 struct _KzZoomActionPrivate 
@@ -40,28 +39,21 @@
 };
 
 
-static void kz_zoom_action_class_init       (KzZoomActionClass *class);
-static void kz_zoom_action_init             (KzZoomAction      *action);
-static void kz_zoom_action_dispose          (GObject *obj);
-static void kz_zoom_action_set_property     (GObject           *object,
-					     guint              prop_id,
-					     const GValue      *value,
-					     GParamSpec        *pspec);
-static void kz_zoom_action_get_property     (GObject           *object,
-					     guint              prop_id,
-					     GValue            *value,
-					     GParamSpec        *pspec);
+static void dispose          (GObject *obj);
+static void set_property     (GObject           *object,
+                              guint              prop_id,
+                              const GValue      *value,
+                              GParamSpec        *pspec);
+static void get_property     (GObject           *object,
+                              guint              prop_id,
+                              GValue            *value,
+                              GParamSpec        *pspec);
 
-static GtkWidget *kz_zoom_action_create_tool_item (GtkAction  *action);
+static GtkWidget *create_tool_item (GtkAction  *action);
 
 static void cb_spin_value_changed (GtkSpinButton *spin, KzZoomAction *action);
 
-
-static GtkActionClass *parent_class = NULL;
-
-KZ_OBJECT_GET_TYPE(kz_zoom_action, "KzZoomAction", KzZoomAction,
-		   kz_zoom_action_class_init, kz_zoom_action_init,
-		   GTK_TYPE_ACTION)
+G_DEFINE_TYPE(KzZoomAction, kz_zoom_action, GTK_TYPE_ACTION)
 
 static void
 kz_zoom_action_class_init (KzZoomActionClass *klass)
@@ -69,15 +61,14 @@
 	GObjectClass *object_class;
 	GtkActionClass *action_class;
 
-	parent_class = g_type_class_peek_parent(klass);
 	object_class = G_OBJECT_CLASS(klass);
 	action_class = GTK_ACTION_CLASS(klass);
 
-	object_class->set_property     = kz_zoom_action_set_property;
-	object_class->get_property     = kz_zoom_action_get_property;
-	object_class->dispose          = kz_zoom_action_dispose;
+	object_class->set_property     = set_property;
+	object_class->get_property     = get_property;
+	object_class->dispose          = dispose;
 
-	action_class->create_tool_item = kz_zoom_action_create_tool_item;
+	action_class->create_tool_item = create_tool_item;
 
 	g_object_class_install_property
 		(object_class,
@@ -103,7 +94,7 @@
 
 
 static void
-kz_zoom_action_dispose (GObject *obj)
+dispose (GObject *obj)
 {
 	KzZoomActionPrivate *priv = KZ_ZOOM_ACTION_GET_PRIVATE (obj);
 
@@ -112,16 +103,16 @@
 	priv->kz = NULL;
 	priv->spin = NULL;
 
-	if (G_OBJECT_CLASS(parent_class)->dispose)
-		G_OBJECT_CLASS(parent_class)->dispose(obj);
+	if (G_OBJECT_CLASS(kz_zoom_action_parent_class)->dispose)
+		G_OBJECT_CLASS(kz_zoom_action_parent_class)->dispose(obj);
 }
 
 
 static void
-kz_zoom_action_set_property (GObject         *object,
-	 		     guint            prop_id,
-			     const GValue    *value,
-			     GParamSpec      *pspec)
+set_property (GObject         *object,
+              guint            prop_id,
+              const GValue    *value,
+              GParamSpec      *pspec)
 {
 	KzZoomActionPrivate *priv = KZ_ZOOM_ACTION_GET_PRIVATE (object);
 
@@ -138,10 +129,10 @@
 
 
 static void
-kz_zoom_action_get_property (GObject         *object,
-			     guint            prop_id,
-			     GValue          *value,
-			     GParamSpec      *pspec)
+get_property (GObject         *object,
+              guint            prop_id,
+              GValue          *value,
+              GParamSpec      *pspec)
 {
 	KzZoomActionPrivate *priv = KZ_ZOOM_ACTION_GET_PRIVATE (object);
 
@@ -185,7 +176,7 @@
 
 
 static GtkWidget * 
-kz_zoom_action_create_tool_item (GtkAction  *action)
+create_tool_item (GtkAction  *action)
 {
 	KzZoomActionPrivate *priv = KZ_ZOOM_ACTION_GET_PRIVATE (action);
 	GtkWidget *widget, *spin;


More information about the Kazehakase-cvs mailing list
Back to archive index