From 33e2d154956abe171e7fdd16053b0ad25dc27694 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 27 Sep 2010 13:47:54 -0400 Subject: [PATCH] Adapt to GtkObject removal in GTK3 The destroy signal has been moved to GtkWidget, so change the class_init functions of MetaFrames and MetaAccelLabel to match. https://bugzilla.gnome.org/show_bug.cgi?id=630671 --- src/ui/frames.c | 22 +++++++++++++++++++--- src/ui/menu.c | 4 ++-- src/ui/metaaccellabel.c | 20 ++++++++++++++++++-- 3 files changed, 39 insertions(+), 7 deletions(-) diff --git a/src/ui/frames.c b/src/ui/frames.c index 1e638c1f2..88781223a 100644 --- a/src/ui/frames.c +++ b/src/ui/frames.c @@ -48,7 +48,11 @@ #define DEFAULT_INNER_BUTTON_BORDER 3 +#ifdef USE_GTK3 +static void meta_frames_destroy (GtkWidget *object); +#else static void meta_frames_destroy (GtkObject *object); +#endif static void meta_frames_finalize (GObject *object); static void meta_frames_style_set (GtkWidget *widget, GtkStyle *prev_style); @@ -137,16 +141,19 @@ static void meta_frames_class_init (MetaFramesClass *class) { GObjectClass *gobject_class; - GtkObjectClass *object_class; GtkWidgetClass *widget_class; gobject_class = G_OBJECT_CLASS (class); - object_class = (GtkObjectClass*) class; widget_class = (GtkWidgetClass*) class; gobject_class->constructor = meta_frames_constructor; gobject_class->finalize = meta_frames_finalize; - object_class->destroy = meta_frames_destroy; + +#ifdef USE_GTK3 + widget_class->destroy = meta_frames_destroy; +#else + GTK_OBJECT_CLASS (class)->destroy = meta_frames_destroy; +#endif widget_class->style_set = meta_frames_style_set; @@ -232,8 +239,13 @@ listify_func (gpointer key, gpointer value, gpointer data) *listp = g_slist_prepend (*listp, value); } +#ifdef USE_GTK3 +static void +meta_frames_destroy (GtkWidget *object) +#else static void meta_frames_destroy (GtkObject *object) +#endif { GSList *winlist; GSList *tmp; @@ -257,7 +269,11 @@ meta_frames_destroy (GtkObject *object) } g_slist_free (winlist); +#ifdef USE_GTK3 + GTK_WIDGET_CLASS (meta_frames_parent_class)->destroy (object); +#else GTK_OBJECT_CLASS (meta_frames_parent_class)->destroy (object); +#endif } static void diff --git a/src/ui/menu.c b/src/ui/menu.c index 54dc14b93..d3bfd358d 100644 --- a/src/ui/menu.c +++ b/src/ui/menu.c @@ -448,7 +448,7 @@ meta_window_menu_new (MetaFrames *frames, "workspace", GINT_TO_POINTER (j)); - g_signal_connect_data (GTK_OBJECT (submi), + g_signal_connect_data (G_OBJECT (submi), "activate", G_CALLBACK (activate_cb), md, @@ -475,7 +475,7 @@ meta_window_menu_new (MetaFrames *frames, md->menu = menu; md->op = menuitem.op; - g_signal_connect_data (GTK_OBJECT (mi), + g_signal_connect_data (G_OBJECT (mi), "activate", G_CALLBACK (activate_cb), md, diff --git a/src/ui/metaaccellabel.c b/src/ui/metaaccellabel.c index 134cbe007..28ef80e64 100644 --- a/src/ui/metaaccellabel.c +++ b/src/ui/metaaccellabel.c @@ -40,7 +40,11 @@ #include "gtk-compat.h" #include "gdk2-drawing-utils.h" +#ifdef USE_GTK3 +static void meta_accel_label_destroy (GtkWidget *object); +#else static void meta_accel_label_destroy (GtkObject *object); +#endif static void meta_accel_label_finalize (GObject *object); static void meta_accel_label_size_request (GtkWidget *widget, GtkRequisition *requisition); @@ -61,12 +65,15 @@ static void meta_accel_label_class_init (MetaAccelLabelClass *class) { GObjectClass *gobject_class = G_OBJECT_CLASS (class); - GtkObjectClass *object_class = GTK_OBJECT_CLASS (class); GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class); gobject_class->finalize = meta_accel_label_finalize; - object_class->destroy = meta_accel_label_destroy; +#ifdef USE_GTK3 + widget_class->destroy = meta_accel_label_destroy; +#else + GTK_OBJECT_CLASS (class)->destroy = meta_accel_label_destroy; +#endif widget_class->size_request = meta_accel_label_size_request; #ifdef USE_GTK3 @@ -166,8 +173,13 @@ meta_accel_label_new_with_mnemonic (const gchar *string) return GTK_WIDGET (accel_label); } +#ifdef USE_GTK3 +static void +meta_accel_label_destroy (GtkWidget *object) +#else static void meta_accel_label_destroy (GtkObject *object) +#endif { MetaAccelLabel *accel_label = META_ACCEL_LABEL (object); @@ -178,7 +190,11 @@ meta_accel_label_destroy (GtkObject *object) accel_label->accel_mods = 0; accel_label->accel_key = 0; +#ifdef USE_GTK3 + GTK_WIDGET_CLASS (meta_accel_label_parent_class)->destroy (object); +#else GTK_OBJECT_CLASS (meta_accel_label_parent_class)->destroy (object); +#endif } static void