[gimp] app: avoid the deprecated and sealed GTK_OBJECT_FLAGS()



commit 46ea1971719aa2bdd02fc5a9f60aee22b21d07be
Author: Michael Natterer <mitch gimp org>
Date:   Mon May 10 17:54:49 2010 +0200

    app: avoid the deprecated and sealed GTK_OBJECT_FLAGS()

 app/widgets/gimptoolbox.c |   24 ++++++++++++++++++++----
 1 files changed, 20 insertions(+), 4 deletions(-)
---
diff --git a/app/widgets/gimptoolbox.c b/app/widgets/gimptoolbox.c
index 8448640..564b751 100644
--- a/app/widgets/gimptoolbox.c
+++ b/app/widgets/gimptoolbox.c
@@ -17,8 +17,6 @@
 
 #include "config.h"
 
-#undef GSEAL_ENABLE
-
 #include <string.h>
 
 #include <gtk/gtk.h>
@@ -94,12 +92,15 @@ struct _GimpToolboxPrivate
   gint               area_columns;
 
   GimpPanedBox      *drag_handler;
+
+  gboolean           in_destruction;
 };
 
 
 static GObject   * gimp_toolbox_constructor             (GType                  type,
                                                          guint                  n_params,
                                                          GObjectConstructParam *params);
+static void        gimp_toolbox_dispose                 (GObject               *object);
 static void        gimp_toolbox_set_property            (GObject               *object,
                                                          guint                  property_id,
                                                          const GValue          *value,
@@ -190,6 +191,7 @@ gimp_toolbox_class_init (GimpToolboxClass *klass)
   GimpDockClass  *dock_class   = GIMP_DOCK_CLASS (klass);
 
   object_class->constructor           = gimp_toolbox_constructor;
+  object_class->dispose               = gimp_toolbox_dispose;
   object_class->set_property          = gimp_toolbox_set_property;
   object_class->get_property          = gimp_toolbox_get_property;
 
@@ -400,6 +402,18 @@ gimp_toolbox_constructor (GType                  type,
 }
 
 static void
+gimp_toolbox_dispose (GObject *object)
+{
+  GimpToolbox *toolbox = GIMP_TOOLBOX (object);
+
+  toolbox->p->in_destruction = TRUE;
+
+  G_OBJECT_CLASS (parent_class)->dispose (object);
+
+  toolbox->p->in_destruction = FALSE;
+}
+
+static void
 gimp_toolbox_set_property (GObject      *object,
                            guint         property_id,
                            const GValue *value,
@@ -779,7 +793,7 @@ gimp_toolbox_book_added (GimpDock     *dock,
 {
   if (GIMP_DOCK_CLASS (gimp_toolbox_parent_class)->book_added)
     GIMP_DOCK_CLASS (gimp_toolbox_parent_class)->book_added (dock, dockbook);
-  
+
   if (g_list_length (gimp_dock_get_dockbooks (dock)) == 1)
     {
       gimp_dock_invalidate_geometry (dock);
@@ -790,11 +804,13 @@ static void
 gimp_toolbox_book_removed (GimpDock     *dock,
                            GimpDockbook *dockbook)
 {
+  GimpToolbox *toolbox = GIMP_TOOLBOX (dock);
+
   if (GIMP_DOCK_CLASS (gimp_toolbox_parent_class)->book_removed)
     GIMP_DOCK_CLASS (gimp_toolbox_parent_class)->book_removed (dock, dockbook);
 
   if (g_list_length (gimp_dock_get_dockbooks (dock)) == 0 &&
-      ! (GTK_OBJECT_FLAGS (dock) & GTK_IN_DESTRUCTION))
+      ! toolbox->p->in_destruction)
     {
       gimp_dock_invalidate_geometry (dock);
     }



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