[gnumeric] compilation: dead puppy for GtkObjectClass.



commit 0dcfecc356b36b760a6fe2863bb8099443474d3b
Author: Morten Welinder <terra gnome org>
Date:   Wed Apr 13 14:24:58 2011 -0400

    compilation: dead puppy for GtkObjectClass.

 configure.in                        |    1 +
 src/dead-kittens.h                  |   10 ++++++++++
 src/widgets/gnm-dao.c               |   11 ++++++-----
 src/widgets/gnumeric-expr-entry.c   |    9 ++++-----
 src/widgets/gnumeric-text-view.c    |   11 +++++------
 src/widgets/widget-editable-label.c |   10 +++++-----
 src/widgets/widget-font-selector.c  |   10 ++++------
 7 files changed, 35 insertions(+), 27 deletions(-)
---
diff --git a/configure.in b/configure.in
index dddad49..fa6b48f 100644
--- a/configure.in
+++ b/configure.in
@@ -694,6 +694,7 @@ AC_CHECK_FUNCS(gtk_cell_renderer_text_get_background_set gtk_cell_renderer_text_
 AC_CHECK_FUNCS(gtk_dialog_get_content_area gtk_dialog_get_action_area)
 AC_CHECK_FUNCS(gtk_entry_get_text_length gtk_entry_set_icon_from_stock gtk_entry_get_buffer gtk_entry_get_text_area gtk_entry_set_editing_cancelled gtk_entry_get_overwrite_mode)
 AC_CHECK_FUNCS(gtk_layout_get_bin_window)
+AC_CHECK_FUNCS(gtk_object_destroy)
 AC_CHECK_FUNCS(gtk_orientable_set_orientation)
 AC_CHECK_FUNCS(gtk_selection_data_get_data gtk_selection_data_get_length gtk_selection_data_get_target)
 AC_CHECK_FUNCS(gtk_table_get_size)
diff --git a/src/dead-kittens.h b/src/dead-kittens.h
index 8a26d78..ce527de 100644
--- a/src/dead-kittens.h
+++ b/src/dead-kittens.h
@@ -1522,6 +1522,16 @@
   gnm_object_get_bool ((_cr_), "editable")
 #endif
 
+#ifdef HAVE_GTK_OBJECT_DESTROY
+#define gnm_destroy_class(_class_) ((GtkObjectClass *)(_class_))
+#define gnm_destroy_class_chain(_class_,_obj_) gnm_destroy_class(_class_)->destroy((GtkObject*)(_obj_))
+#define gnm_destroy_class_set(_class_,_func_) gnm_destroy_class(_class_)->destroy = ((void (*)(GtkObject*))(_func_))
+#else
+#define gnm_destroy_class(_class_) ((GtkWidgetClass *)(_class_))
+#define gnm_destroy_class_chain(_class_,_obj_) gnm_destroy_class(_class_)->destroy((GtkWidget*)(_obj_))
+#define gnm_destroy_class_set(_class_,_func_) gnm_destroy_class(_class_)->destroy = (_func_)
+#endif
+
 #ifndef HAVE_GTK_DIALOG_GET_ACTION_AREA
 #define gtk_dialog_get_action_area(x) ((x)->action_area)
 #endif
diff --git a/src/widgets/gnm-dao.c b/src/widgets/gnm-dao.c
index b2c1092..413be08 100644
--- a/src/widgets/gnm-dao.c
+++ b/src/widgets/gnm-dao.c
@@ -29,6 +29,7 @@
 #include <goffice/goffice.h>
 #include <gsf/gsf-impl-utils.h>
 #include <glib/gi18n-lib.h>
+#include <dead-kittens.h>
 
 struct  _GnmDao {
 	GtkHBox		box;
@@ -105,22 +106,22 @@ gnm_dao_init (GnmDao *gdao)
 }
 
 static void
-gnm_dao_destroy (GtkObject *object)
+gnm_dao_destroy (GtkWidget *widget)
 {
-	GnmDao *gdao = GNM_DAO (object);
+	GnmDao *gdao = GNM_DAO (widget);
 
 	if (gdao->gui) {
 		g_object_unref (G_OBJECT (gdao->gui));
 		gdao->gui = NULL;
 	}
 
-	((GtkObjectClass *)gnm_dao_parent_class)->destroy (object);
+	gnm_destroy_class_chain (gnm_dao_parent_class, widget);
 }
 
 static void
-gnm_dao_class_init (GtkObjectClass *klass)
+gnm_dao_class_init (GObjectClass *klass)
 {
-	klass->destroy = gnm_dao_destroy;
+	gnm_destroy_class_set (klass, gnm_dao_destroy);
 
 	gnm_dao_parent_class = g_type_class_peek (gtk_hbox_get_type ());
 
diff --git a/src/widgets/gnumeric-expr-entry.c b/src/widgets/gnumeric-expr-entry.c
index a18f261..76d5fbd 100644
--- a/src/widgets/gnumeric-expr-entry.c
+++ b/src/widgets/gnumeric-expr-entry.c
@@ -217,12 +217,12 @@ gee_rangesel_reset (GnmExprEntry *gee)
 }
 
 static void
-gee_destroy (GtkObject *object)
+gee_destroy (GtkWidget *widget)
 {
-	GnmExprEntry *gee = GNM_EXPR_ENTRY (object);
+	GnmExprEntry *gee = GNM_EXPR_ENTRY (widget);
 	gee_remove_update_timer (gee);
 	gee_detach_scg (gee);
-	parent_class->destroy (object);
+	gnm_destroy_class_chain (parent_class, widget);
 }
 
 static void
@@ -1516,7 +1516,6 @@ gee_go_plot_data_editor_init (GogDataEditorClass *iface)
 static void
 gee_class_init (GObjectClass *gobject_class)
 {
-	GtkObjectClass *gtk_object_class = (GtkObjectClass *)gobject_class;
 	GtkWidgetClass *widget_class = (GtkWidgetClass *)gobject_class;
 
 	parent_class = g_type_class_peek_parent (gobject_class);
@@ -1524,7 +1523,7 @@ gee_class_init (GObjectClass *gobject_class)
 	gobject_class->set_property	= gee_set_property;
 	gobject_class->get_property	= gee_get_property;
 	gobject_class->finalize		= gee_finalize;
-	gtk_object_class->destroy	= gee_destroy;
+	gnm_destroy_class_set (gobject_class, gee_destroy);
 	widget_class->mnemonic_activate = gee_mnemonic_activate;
 
 	signals[UPDATE] = g_signal_new ("update",
diff --git a/src/widgets/gnumeric-text-view.c b/src/widgets/gnumeric-text-view.c
index a84723d..3efed3e 100644
--- a/src/widgets/gnumeric-text-view.c
+++ b/src/widgets/gnumeric-text-view.c
@@ -29,6 +29,7 @@
 
 #include <gsf/gsf-impl-utils.h>
 #include <gtk/gtk.h>
+#include <dead-kittens.h>
 
 struct _GnmTextView {
 	GtkVBox	parent;
@@ -271,12 +272,12 @@ gtv_build_button_bold (GtkWidget *tb, GnmTextView *gtv)
 
 /* Object routines */
 
-static GtkObjectClass *parent_class = NULL;
+static GObjectClass *parent_class = NULL;
 
 static void
-gtv_destroy (GtkObject *object)
+gtv_destroy (GtkWidget *widget)
 {
-	parent_class->destroy (object);
+	gnm_destroy_class_chain (parent_class, widget);
 }
 
 
@@ -376,13 +377,11 @@ gtv_init (GnmTextView *gtv)
 static void
 gtv_class_init (GObjectClass *gobject_class)
 {
-	GtkObjectClass *gtk_object_class = (GtkObjectClass *)gobject_class;
-
 	parent_class = g_type_class_peek_parent (gobject_class);
 
 	gobject_class->set_property	= gtv_set_property;
 	gobject_class->get_property	= gtv_get_property;
-	gtk_object_class->destroy	= gtv_destroy;
+	gnm_destroy_class_set (gobject_class, gtv_destroy);
 
 	signals [CHANGED] = g_signal_new ("changed",
 		GNM_TEXT_VIEW_TYPE,
diff --git a/src/widgets/widget-editable-label.c b/src/widgets/widget-editable-label.c
index 7609d5b..d49cdb4 100644
--- a/src/widgets/widget-editable-label.c
+++ b/src/widgets/widget-editable-label.c
@@ -153,13 +153,13 @@ el_entry_activate (GtkEntry *entry, G_GNUC_UNUSED gpointer ignored)
 }
 
 static void
-el_destroy (GtkObject *object)
+el_destroy (GtkWidget *widget)
 {
-	EditableLabel *el = EDITABLE_LABEL (object);
+	EditableLabel *el = EDITABLE_LABEL (widget);
 
 	el_cancel_editing (el);
 
-	((GtkObjectClass *)parent_class)->destroy (object);
+	gnm_destroy_class_chain (parent_class, widget);
 }
 
 static gint
@@ -253,13 +253,13 @@ el_motion_notify (GtkWidget      *widget,
 }
 
 static void
-el_class_init (GtkObjectClass *object_class)
+el_class_init (GObjectClass *object_class)
 {
 	GtkWidgetClass *widget_class;
 
 	parent_class = g_type_class_peek_parent (object_class);
 
-	object_class->destroy = el_destroy;
+	gnm_destroy_class_set (object_class, el_destroy);
 
 	widget_class = (GtkWidgetClass *) object_class;
 	widget_class->button_press_event  = el_button_press_event;
diff --git a/src/widgets/widget-font-selector.c b/src/widgets/widget-font-selector.c
index 227de91..f639bc1 100644
--- a/src/widgets/widget-font-selector.c
+++ b/src/widgets/widget-font-selector.c
@@ -413,9 +413,9 @@ fs_init (FontSelector *fs)
 }
 
 static void
-fs_destroy (GtkObject *object)
+fs_destroy (GtkWidget *widget)
 {
-	FontSelector *fs = FONT_SELECTOR (object);
+	FontSelector *fs = FONT_SELECTOR (widget);
 
 	if (fs->mstyle) {
 		gnm_style_unref (fs->mstyle);
@@ -433,15 +433,13 @@ fs_destroy (GtkObject *object)
 	g_slist_free (fs->font_sizes);
 	fs->font_sizes = NULL;
 
-	((GtkObjectClass *)fs_parent_class)->destroy (object);
+	gnm_destroy_class_chain (fs_parent_class, widget);
 }
 
 static void
 fs_class_init (GObjectClass *klass)
 {
-	GtkObjectClass *gto_class = (GtkObjectClass *) klass;
-
-	gto_class->destroy = fs_destroy;
+	gnm_destroy_class_set (klass, fs_destroy);
 
 	fs_parent_class = g_type_class_peek (gtk_hbox_get_type ());
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]