[gimp] app: move code from GtkObject::destroy() to GObject::dispose()



commit 8f9ec0650ffcb025e10eb28f74e9242082921565
Author: Michael Natterer <mitch gimp org>
Date:   Sun Sep 26 22:38:01 2010 +0200

    app: move code from GtkObject::destroy() to GObject::dispose()

 app/widgets/gimpbrushfactoryview.c   |   10 ++--
 app/widgets/gimpcolordisplayeditor.c |   10 ++--
 app/widgets/gimpcoloreditor.c        |   33 ++++++--------
 app/widgets/gimpcolormapeditor.c     |   28 ++++++------
 app/widgets/gimpcolorpanel.c         |   13 +++--
 app/widgets/gimpmessagebox.c         |   71 ++++++++++++++----------------
 app/widgets/gimpoverlaydialog.c      |   14 +++---
 app/widgets/gimppaletteeditor.c      |   16 +++----
 app/widgets/gimppdbdialog.c          |   80 ++++++++++++++-------------------
 app/widgets/gimpprogressbox.c        |   10 ++--
 app/widgets/gimpsizebox.c            |   37 +++++++--------
 app/widgets/gimpthumbbox.c           |   21 ++-------
 app/widgets/gimptooleditor.c         |   59 ++++++++++++-------------
 app/widgets/gimptooloptionseditor.c  |   67 ++++++++++++++--------------
 app/widgets/gimpview.c               |   11 +++--
 app/widgets/gimpviewabledialog.c     |   31 ++++++-------
 16 files changed, 236 insertions(+), 275 deletions(-)
---
diff --git a/app/widgets/gimpbrushfactoryview.c b/app/widgets/gimpbrushfactoryview.c
index 306e0dd..857a9e4 100644
--- a/app/widgets/gimpbrushfactoryview.c
+++ b/app/widgets/gimpbrushfactoryview.c
@@ -39,7 +39,7 @@
 #include "gimp-intl.h"
 
 
-static void   gimp_brush_factory_view_destroy         (GtkObject            *object);
+static void   gimp_brush_factory_view_dispose         (GObject              *object);
 
 static void   gimp_brush_factory_view_select_item     (GimpContainerEditor  *editor,
                                                        GimpViewable         *viewable);
@@ -59,10 +59,10 @@ G_DEFINE_TYPE (GimpBrushFactoryView, gimp_brush_factory_view,
 static void
 gimp_brush_factory_view_class_init (GimpBrushFactoryViewClass *klass)
 {
-  GtkObjectClass           *object_class = GTK_OBJECT_CLASS (klass);
+  GObjectClass             *object_class = G_OBJECT_CLASS (klass);
   GimpContainerEditorClass *editor_class = GIMP_CONTAINER_EDITOR_CLASS (klass);
 
-  object_class->destroy     = gimp_brush_factory_view_destroy;
+  object_class->dispose     = gimp_brush_factory_view_dispose;
 
   editor_class->select_item = gimp_brush_factory_view_select_item;
 }
@@ -94,7 +94,7 @@ gimp_brush_factory_view_init (GimpBrushFactoryView *view)
 }
 
 static void
-gimp_brush_factory_view_destroy (GtkObject *object)
+gimp_brush_factory_view_dispose (GObject *object)
 {
   GimpBrushFactoryView *view   = GIMP_BRUSH_FACTORY_VIEW (object);
   GimpContainerEditor  *editor = GIMP_CONTAINER_EDITOR (object);
@@ -113,7 +113,7 @@ gimp_brush_factory_view_destroy (GtkObject *object)
       view->spacing_changed_handler_id = 0;
     }
 
-  GTK_OBJECT_CLASS (parent_class)->destroy (object);
+  G_OBJECT_CLASS (parent_class)->dispose (object);
 }
 
 GtkWidget *
diff --git a/app/widgets/gimpcolordisplayeditor.c b/app/widgets/gimpcolordisplayeditor.c
index 3b160d6..39cb922 100644
--- a/app/widgets/gimpcolordisplayeditor.c
+++ b/app/widgets/gimpcolordisplayeditor.c
@@ -54,7 +54,7 @@ enum
 };
 
 
-static void   gimp_color_display_editor_destroy        (GtkObject             *object);
+static void   gimp_color_display_editor_dispose        (GObject               *object);
 
 static void   gimp_color_display_editor_add_clicked    (GtkWidget             *widget,
                                                         GimpColorDisplayEditor *editor);
@@ -102,9 +102,9 @@ G_DEFINE_TYPE (GimpColorDisplayEditor, gimp_color_display_editor, GTK_TYPE_VBOX)
 static void
 gimp_color_display_editor_class_init (GimpColorDisplayEditorClass *klass)
 {
-  GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
+  GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
-  object_class->destroy = gimp_color_display_editor_destroy;
+  object_class->dispose = gimp_color_display_editor_dispose;
 }
 
 static void
@@ -326,7 +326,7 @@ gimp_color_display_editor_init (GimpColorDisplayEditor *editor)
 }
 
 static void
-gimp_color_display_editor_destroy (GtkObject *object)
+gimp_color_display_editor_dispose (GObject *object)
 {
   GimpColorDisplayEditor *editor = GIMP_COLOR_DISPLAY_EDITOR (object);
 
@@ -336,7 +336,7 @@ gimp_color_display_editor_destroy (GtkObject *object)
       editor->stack = NULL;
     }
 
-  GTK_OBJECT_CLASS (parent_class)->destroy (object);
+  G_OBJECT_CLASS (parent_class)->dispose (object);
 }
 
 GtkWidget *
diff --git a/app/widgets/gimpcoloreditor.c b/app/widgets/gimpcoloreditor.c
index eb08107..dd85c8a 100644
--- a/app/widgets/gimpcoloreditor.c
+++ b/app/widgets/gimpcoloreditor.c
@@ -53,6 +53,7 @@ enum
 
 static void   gimp_color_editor_docked_iface_init (GimpDockedInterface  *iface);
 
+static void   gimp_color_editor_dispose         (GObject           *object);
 static void   gimp_color_editor_set_property    (GObject           *object,
                                                  guint              property_id,
                                                  const GValue      *value,
@@ -62,8 +63,6 @@ static void   gimp_color_editor_get_property    (GObject           *object,
                                                  GValue            *value,
                                                  GParamSpec        *pspec);
 
-static void   gimp_color_editor_destroy         (GtkObject         *object);
-
 static void   gimp_color_editor_style_set       (GtkWidget         *widget,
                                                  GtkStyle          *prev_style);
 
@@ -110,15 +109,13 @@ static GimpDockedInterface *parent_docked_iface = NULL;
 static void
 gimp_color_editor_class_init (GimpColorEditorClass* klass)
 {
-  GObjectClass   *object_class     = G_OBJECT_CLASS (klass);
-  GtkObjectClass *gtk_object_class = GTK_OBJECT_CLASS (klass);
-  GtkWidgetClass *widget_class     = GTK_WIDGET_CLASS (klass);
+  GObjectClass   *object_class = G_OBJECT_CLASS (klass);
+  GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
 
+  object_class->dispose      = gimp_color_editor_dispose;
   object_class->set_property = gimp_color_editor_set_property;
   object_class->get_property = gimp_color_editor_get_property;
 
-  gtk_object_class->destroy  = gimp_color_editor_destroy;
-
   widget_class->style_set    = gimp_color_editor_style_set;
 
   g_object_class_install_property (object_class, PROP_CONTEXT,
@@ -271,6 +268,17 @@ gimp_color_editor_init (GimpColorEditor *editor)
 }
 
 static void
+gimp_color_editor_dispose (GObject *object)
+{
+  GimpColorEditor *editor = GIMP_COLOR_EDITOR (object);
+
+  if (editor->context)
+    gimp_docked_set_context (GIMP_DOCKED (editor), NULL);
+
+  G_OBJECT_CLASS (parent_class)->dispose (object);
+}
+
+static void
 gimp_color_editor_set_property (GObject      *object,
                                 guint         property_id,
                                 const GValue *value,
@@ -307,17 +315,6 @@ gimp_color_editor_get_property (GObject    *object,
     }
 }
 
-static void
-gimp_color_editor_destroy (GtkObject *object)
-{
-  GimpColorEditor *editor = GIMP_COLOR_EDITOR (object);
-
-  if (editor->context)
-    gimp_docked_set_context (GIMP_DOCKED (editor), NULL);
-
-  GTK_OBJECT_CLASS (parent_class)->destroy (object);
-}
-
 static GtkWidget *
 gimp_color_editor_get_preview (GimpDocked  *docked,
                                GimpContext *context,
diff --git a/app/widgets/gimpcolormapeditor.c b/app/widgets/gimpcolormapeditor.c
index 02d3183..15df61e 100644
--- a/app/widgets/gimpcolormapeditor.c
+++ b/app/widgets/gimpcolormapeditor.c
@@ -73,9 +73,9 @@ enum
 static GObject * gimp_colormap_editor_constructor  (GType               type,
                                                     guint               n_params,
                                                     GObjectConstructParam *params);
-
+static void   gimp_colormap_editor_dispose         (GObject            *object);
 static void   gimp_colormap_editor_finalize        (GObject            *object);
-static void   gimp_colormap_editor_destroy         (GtkObject          *object);
+
 static void   gimp_colormap_editor_unmap           (GtkWidget          *widget);
 
 static void   gimp_colormap_editor_set_image       (GimpImageEditor    *editor,
@@ -130,7 +130,6 @@ static void
 gimp_colormap_editor_class_init (GimpColormapEditorClass* klass)
 {
   GObjectClass         *object_class       = G_OBJECT_CLASS (klass);
-  GtkObjectClass       *gtk_object_class   = GTK_OBJECT_CLASS (klass);
   GtkWidgetClass       *widget_class       = GTK_WIDGET_CLASS (klass);
   GimpImageEditorClass *image_editor_class = GIMP_IMAGE_EDITOR_CLASS (klass);
 
@@ -145,10 +144,9 @@ gimp_colormap_editor_class_init (GimpColormapEditorClass* klass)
                   GDK_TYPE_MODIFIER_TYPE);
 
   object_class->constructor     = gimp_colormap_editor_constructor;
+  object_class->dispose         = gimp_colormap_editor_dispose;
   object_class->finalize        = gimp_colormap_editor_finalize;
 
-  gtk_object_class->destroy     = gimp_colormap_editor_destroy;
-
   widget_class->unmap           = gimp_colormap_editor_unmap;
 
   image_editor_class->set_image = gimp_colormap_editor_set_image;
@@ -253,31 +251,31 @@ gimp_colormap_editor_constructor (GType                  type,
 }
 
 static void
-gimp_colormap_editor_finalize (GObject *object)
+gimp_colormap_editor_dispose (GObject *object)
 {
   GimpColormapEditor *editor = GIMP_COLORMAP_EDITOR (object);
 
-  if (editor->layout)
+  if (editor->color_dialog)
     {
-      g_object_unref (editor->layout);
-      editor->layout = NULL;
+      gtk_widget_destroy (editor->color_dialog);
+      editor->color_dialog = NULL;
     }
 
-  G_OBJECT_CLASS (parent_class)->finalize (object);
+  G_OBJECT_CLASS (parent_class)->dispose (object);
 }
 
 static void
-gimp_colormap_editor_destroy (GtkObject *object)
+gimp_colormap_editor_finalize (GObject *object)
 {
   GimpColormapEditor *editor = GIMP_COLORMAP_EDITOR (object);
 
-  if (editor->color_dialog)
+  if (editor->layout)
     {
-      gtk_widget_destroy (editor->color_dialog);
-      editor->color_dialog = NULL;
+      g_object_unref (editor->layout);
+      editor->layout = NULL;
     }
 
-  GTK_OBJECT_CLASS (parent_class)->destroy (object);
+  G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 
 static void
diff --git a/app/widgets/gimpcolorpanel.c b/app/widgets/gimpcolorpanel.c
index 4cfa379..b77a80f 100644
--- a/app/widgets/gimpcolorpanel.c
+++ b/app/widgets/gimpcolorpanel.c
@@ -33,10 +33,13 @@
 
 /*  local function prototypes  */
 
-static void       gimp_color_panel_destroy         (GtkObject          *object);
+static void       gimp_color_panel_dispose         (GObject            *object);
+
 static gboolean   gimp_color_panel_button_press    (GtkWidget          *widget,
                                                     GdkEventButton     *bevent);
+
 static void       gimp_color_panel_clicked         (GtkButton          *button);
+
 static void       gimp_color_panel_color_changed   (GimpColorButton    *button);
 static GType      gimp_color_panel_get_action_type (GimpColorButton    *button);
 
@@ -54,12 +57,12 @@ G_DEFINE_TYPE (GimpColorPanel, gimp_color_panel, GIMP_TYPE_COLOR_BUTTON)
 static void
 gimp_color_panel_class_init (GimpColorPanelClass *klass)
 {
-  GtkObjectClass       *object_class       = GTK_OBJECT_CLASS (klass);
+  GObjectClass         *object_class       = G_OBJECT_CLASS (klass);
   GtkWidgetClass       *widget_class       = GTK_WIDGET_CLASS (klass);
   GtkButtonClass       *button_class       = GTK_BUTTON_CLASS (klass);
   GimpColorButtonClass *color_button_class = GIMP_COLOR_BUTTON_CLASS (klass);
 
-  object_class->destroy               = gimp_color_panel_destroy;
+  object_class->dispose               = gimp_color_panel_dispose;
 
   widget_class->button_press_event    = gimp_color_panel_button_press;
 
@@ -77,7 +80,7 @@ gimp_color_panel_init (GimpColorPanel *panel)
 }
 
 static void
-gimp_color_panel_destroy (GtkObject *object)
+gimp_color_panel_dispose (GObject *object)
 {
   GimpColorPanel *panel = GIMP_COLOR_PANEL (object);
 
@@ -87,7 +90,7 @@ gimp_color_panel_destroy (GtkObject *object)
       panel->color_dialog = NULL;
     }
 
-  GTK_OBJECT_CLASS (parent_class)->destroy (object);
+  G_OBJECT_CLASS (parent_class)->dispose (object);
 }
 
 static gboolean
diff --git a/app/widgets/gimpmessagebox.c b/app/widgets/gimpmessagebox.c
index 787d37a..79412c0 100644
--- a/app/widgets/gimpmessagebox.c
+++ b/app/widgets/gimpmessagebox.c
@@ -44,8 +44,7 @@ enum
 static GObject * gimp_message_box_constructor   (GType                  type,
                                                  guint                  n_params,
                                                  GObjectConstructParam *params);
-
-static void      gimp_message_box_init          (GimpMessageBox *box);
+static void      gimp_message_box_dispose       (GObject        *object);
 static void      gimp_message_box_finalize      (GObject        *object);
 static void      gimp_message_box_set_property  (GObject        *object,
                                                  guint           property_id,
@@ -55,7 +54,6 @@ static void      gimp_message_box_get_property  (GObject        *object,
                                                  guint           property_id,
                                                  GValue         *value,
                                                  GParamSpec     *pspec);
-static void      gimp_message_box_destroy       (GtkObject      *object);
 
 static void      gimp_message_box_forall        (GtkContainer   *container,
                                                  gboolean        include_internals,
@@ -76,17 +74,16 @@ G_DEFINE_TYPE (GimpMessageBox, gimp_message_box, GTK_TYPE_VBOX)
 static void
 gimp_message_box_class_init (GimpMessageBoxClass *klass)
 {
-  GObjectClass      *object_class     = G_OBJECT_CLASS (klass);
-  GtkObjectClass    *gtk_object_class = GTK_OBJECT_CLASS (klass);
-  GtkWidgetClass    *widget_class     = GTK_WIDGET_CLASS (klass);
-  GtkContainerClass *container_class  = GTK_CONTAINER_CLASS (klass);
+  GObjectClass      *object_class    = G_OBJECT_CLASS (klass);
+  GtkWidgetClass    *widget_class    = GTK_WIDGET_CLASS (klass);
+  GtkContainerClass *container_class = GTK_CONTAINER_CLASS (klass);
 
   object_class->constructor   = gimp_message_box_constructor;
+  object_class->dispose       = gimp_message_box_dispose;
+  object_class->finalize      = gimp_message_box_finalize;
   object_class->set_property  = gimp_message_box_set_property;
   object_class->get_property  = gimp_message_box_get_property;
-  object_class->finalize      = gimp_message_box_finalize;
 
-  gtk_object_class->destroy   = gimp_message_box_destroy;
 
   widget_class->size_request  = gimp_message_box_size_request;
   widget_class->size_allocate = gimp_message_box_size_allocate;
@@ -138,20 +135,6 @@ gimp_message_box_init (GimpMessageBox *box)
   box->label[2] = NULL;
 }
 
-static void
-gimp_message_box_finalize (GObject *object)
-{
-  GimpMessageBox *box = GIMP_MESSAGE_BOX (object);
-
-  if (box->stock_id)
-    {
-      g_free (box->stock_id);
-      box->stock_id = NULL;
-    }
-
-  G_OBJECT_CLASS (parent_class)->finalize (object);
-}
-
 static GObject *
 gimp_message_box_constructor (GType                  type,
                               guint                  n_params,
@@ -180,6 +163,34 @@ gimp_message_box_constructor (GType                  type,
 }
 
 static void
+gimp_message_box_dispose (GObject *object)
+{
+  GimpMessageBox *box = GIMP_MESSAGE_BOX (object);
+
+  if (box->image)
+    {
+      gtk_widget_unparent (box->image);
+      box->image = NULL;
+    }
+
+  G_OBJECT_CLASS (parent_class)->dispose (object);
+}
+
+static void
+gimp_message_box_finalize (GObject *object)
+{
+  GimpMessageBox *box = GIMP_MESSAGE_BOX (object);
+
+  if (box->stock_id)
+    {
+      g_free (box->stock_id);
+      box->stock_id = NULL;
+    }
+
+  G_OBJECT_CLASS (parent_class)->finalize (object);
+}
+
+static void
 gimp_message_box_set_property (GObject      *object,
                                guint         property_id,
                                const GValue *value,
@@ -218,20 +229,6 @@ gimp_message_box_get_property (GObject    *object,
 }
 
 static void
-gimp_message_box_destroy (GtkObject *object)
-{
-  GimpMessageBox *box = GIMP_MESSAGE_BOX (object);
-
-  if (box->image)
-    {
-      gtk_widget_unparent (box->image);
-      box->image = NULL;
-    }
-
-  GTK_OBJECT_CLASS (parent_class)->destroy (object);
-}
-
-static void
 gimp_message_box_size_request (GtkWidget      *widget,
                                GtkRequisition *requisition)
 {
diff --git a/app/widgets/gimpoverlaydialog.c b/app/widgets/gimpoverlaydialog.c
index 24581e4..ba72f66 100644
--- a/app/widgets/gimpoverlaydialog.c
+++ b/app/widgets/gimpoverlaydialog.c
@@ -49,7 +49,7 @@ struct _ResponseData
 };
 
 
-static void       gimp_overlay_dialog_destroy       (GtkObject         *object);
+static void       gimp_overlay_dialog_dispose       (GObject           *object);
 
 static void       gimp_overlay_dialog_size_request  (GtkWidget         *widget,
                                                      GtkRequisition    *requisition);
@@ -78,11 +78,11 @@ static guint signals[LAST_SIGNAL] = { 0, };
 static void
 gimp_overlay_dialog_class_init (GimpOverlayDialogClass *klass)
 {
-  GtkObjectClass    *gtk_object_class = GTK_OBJECT_CLASS (klass);
-  GtkWidgetClass    *widget_class     = GTK_WIDGET_CLASS (klass);
-  GtkContainerClass *container_class  = GTK_CONTAINER_CLASS (klass);
+  GObjectClass      *object_class    = G_OBJECT_CLASS (klass);
+  GtkWidgetClass    *widget_class    = GTK_WIDGET_CLASS (klass);
+  GtkContainerClass *container_class = GTK_CONTAINER_CLASS (klass);
 
-  gtk_object_class->destroy   = gimp_overlay_dialog_destroy;
+  object_class->dispose       = gimp_overlay_dialog_dispose;
 
   widget_class->size_request  = gimp_overlay_dialog_size_request;
   widget_class->size_allocate = gimp_overlay_dialog_size_allocate;
@@ -125,7 +125,7 @@ gimp_overlay_dialog_init (GimpOverlayDialog *dialog)
 }
 
 static void
-gimp_overlay_dialog_destroy (GtkObject *object)
+gimp_overlay_dialog_dispose (GObject *object)
 {
   GimpOverlayDialog *dialog = GIMP_OVERLAY_DIALOG (object);
 
@@ -135,7 +135,7 @@ gimp_overlay_dialog_destroy (GtkObject *object)
       dialog->action_area = NULL;
     }
 
-  GTK_OBJECT_CLASS (parent_class)->destroy (object);
+  G_OBJECT_CLASS (parent_class)->dispose (object);
 }
 
 static void
diff --git a/app/widgets/gimppaletteeditor.c b/app/widgets/gimppaletteeditor.c
index 1faee0d..8dcbe60 100644
--- a/app/widgets/gimppaletteeditor.c
+++ b/app/widgets/gimppaletteeditor.c
@@ -63,8 +63,8 @@ static void   gimp_palette_editor_docked_iface_init (GimpDockedInterface *face);
 static GObject * gimp_palette_editor_constructor   (GType              type,
                                                     guint              n_params,
                                                     GObjectConstructParam *params);
+static void   gimp_palette_editor_dispose          (GObject           *object);
 
-static void   gimp_palette_editor_destroy          (GtkObject         *object);
 static void   gimp_palette_editor_unmap            (GtkWidget         *widget);
 
 static void   gimp_palette_editor_set_data         (GimpDataEditor    *editor,
@@ -139,14 +139,12 @@ static GimpDockedInterface *parent_docked_iface = NULL;
 static void
 gimp_palette_editor_class_init (GimpPaletteEditorClass *klass)
 {
-  GObjectClass        *object_class     = G_OBJECT_CLASS (klass);
-  GtkObjectClass      *gtk_object_class = GTK_OBJECT_CLASS (klass);
-  GtkWidgetClass      *widget_class     = GTK_WIDGET_CLASS (klass);
-  GimpDataEditorClass *editor_class     = GIMP_DATA_EDITOR_CLASS (klass);
+  GObjectClass        *object_class = G_OBJECT_CLASS (klass);
+  GtkWidgetClass      *widget_class = GTK_WIDGET_CLASS (klass);
+  GimpDataEditorClass *editor_class = GIMP_DATA_EDITOR_CLASS (klass);
 
   object_class->constructor = gimp_palette_editor_constructor;
-
-  gtk_object_class->destroy = gimp_palette_editor_destroy;
+  object_class->dispose     = gimp_palette_editor_dispose;
 
   widget_class->unmap       = gimp_palette_editor_unmap;
 
@@ -310,7 +308,7 @@ gimp_palette_editor_constructor (GType                  type,
 }
 
 static void
-gimp_palette_editor_destroy (GtkObject *object)
+gimp_palette_editor_dispose (GObject *object)
 {
   GimpPaletteEditor *editor = GIMP_PALETTE_EDITOR (object);
 
@@ -320,7 +318,7 @@ gimp_palette_editor_destroy (GtkObject *object)
       editor->color_dialog = NULL;
     }
 
-  GTK_OBJECT_CLASS (parent_class)->destroy (object);
+  G_OBJECT_CLASS (parent_class)->dispose (object);
 }
 
 static void
diff --git a/app/widgets/gimppdbdialog.c b/app/widgets/gimppdbdialog.c
index d38e41d..f061705 100644
--- a/app/widgets/gimppdbdialog.c
+++ b/app/widgets/gimppdbdialog.c
@@ -65,8 +65,6 @@ static void      gimp_pdb_dialog_set_property   (GObject            *object,
                                                  const GValue       *value,
                                                  GParamSpec         *pspec);
 
-static void      gimp_pdb_dialog_destroy        (GtkObject          *object);
-
 static void      gimp_pdb_dialog_response       (GtkDialog          *dialog,
                                                  gint                response_id);
 
@@ -113,9 +111,8 @@ gimp_pdb_dialog_get_type (void)
 static void
 gimp_pdb_dialog_class_init (GimpPdbDialogClass *klass)
 {
-  GObjectClass   *object_class     = G_OBJECT_CLASS (klass);
-  GtkObjectClass *gtk_object_class = GTK_OBJECT_CLASS (klass);
-  GtkDialogClass *dialog_class     = GTK_DIALOG_CLASS (klass);
+  GObjectClass   *object_class = G_OBJECT_CLASS (klass);
+  GtkDialogClass *dialog_class = GTK_DIALOG_CLASS (klass);
 
   parent_class = g_type_class_peek_parent (klass);
 
@@ -124,8 +121,6 @@ gimp_pdb_dialog_class_init (GimpPdbDialogClass *klass)
   object_class->set_property = gimp_pdb_dialog_set_property;
   object_class->set_property = gimp_pdb_dialog_set_property;
 
-  gtk_object_class->destroy  = gimp_pdb_dialog_destroy;
-
   dialog_class->response     = gimp_pdb_dialog_response;
 
   klass->run_callback        = NULL;
@@ -223,10 +218,41 @@ gimp_pdb_dialog_constructor (GType                  type,
 static void
 gimp_pdb_dialog_dispose (GObject *object)
 {
-  GimpPdbDialogClass *klass = GIMP_PDB_DIALOG_GET_CLASS (object);
+  GimpPdbDialog      *dialog = GIMP_PDB_DIALOG (object);
+  GimpPdbDialogClass *klass  = GIMP_PDB_DIALOG_GET_CLASS (object);
 
   klass->dialogs = g_list_remove (klass->dialogs, object);
 
+  if (dialog->pdb)
+    {
+      g_object_unref (dialog->pdb);
+      dialog->pdb = NULL;
+    }
+
+  if (dialog->caller_context)
+    {
+      g_object_unref (dialog->caller_context);
+      dialog->caller_context = NULL;
+    }
+
+  if (dialog->context)
+    {
+      g_object_unref (dialog->context);
+      dialog->context = NULL;
+    }
+
+  if (dialog->callback_name)
+    {
+      g_free (dialog->callback_name);
+      dialog->callback_name = NULL;
+    }
+
+  if (dialog->menu_factory)
+    {
+      g_object_unref (dialog->menu_factory);
+      dialog->menu_factory = NULL;
+    }
+
   G_OBJECT_CLASS (parent_class)->dispose (object);
 }
 
@@ -274,44 +300,6 @@ gimp_pdb_dialog_set_property (GObject      *object,
 }
 
 static void
-gimp_pdb_dialog_destroy (GtkObject *object)
-{
-  GimpPdbDialog *dialog = GIMP_PDB_DIALOG (object);
-
-  if (dialog->pdb)
-    {
-      g_object_unref (dialog->pdb);
-      dialog->pdb = NULL;
-    }
-
-  if (dialog->caller_context)
-    {
-      g_object_unref (dialog->caller_context);
-      dialog->caller_context = NULL;
-    }
-
-  if (dialog->context)
-    {
-      g_object_unref (dialog->context);
-      dialog->context = NULL;
-    }
-
-  if (dialog->callback_name)
-    {
-      g_free (dialog->callback_name);
-      dialog->callback_name = NULL;
-    }
-
-  if (dialog->menu_factory)
-    {
-      g_object_unref (dialog->menu_factory);
-      dialog->menu_factory = NULL;
-    }
-
-  GTK_OBJECT_CLASS (parent_class)->destroy (object);
-}
-
-static void
 gimp_pdb_dialog_response (GtkDialog *gtk_dialog,
                           gint       response_id)
 {
diff --git a/app/widgets/gimpprogressbox.c b/app/widgets/gimpprogressbox.c
index b28ac4a..085ac20 100644
--- a/app/widgets/gimpprogressbox.c
+++ b/app/widgets/gimpprogressbox.c
@@ -36,7 +36,7 @@
 
 static void     gimp_progress_box_progress_iface_init (GimpProgressInterface *iface);
 
-static void     gimp_progress_box_destroy            (GtkObject    *object);
+static void     gimp_progress_box_dispose            (GObject      *object);
 
 static GimpProgress *
                 gimp_progress_box_progress_start     (GimpProgress *progress,
@@ -62,9 +62,9 @@ G_DEFINE_TYPE_WITH_CODE (GimpProgressBox, gimp_progress_box, GTK_TYPE_VBOX,
 static void
 gimp_progress_box_class_init (GimpProgressBoxClass *klass)
 {
-  GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
+  GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
-  object_class->destroy = gimp_progress_box_destroy;
+  object_class->dispose = gimp_progress_box_dispose;
 }
 
 static void
@@ -100,11 +100,11 @@ gimp_progress_box_progress_iface_init (GimpProgressInterface *iface)
 }
 
 static void
-gimp_progress_box_destroy (GtkObject *object)
+gimp_progress_box_dispose (GObject *object)
 {
   GimpProgressBox *box = GIMP_PROGRESS_BOX (object);
 
-  GTK_OBJECT_CLASS (parent_class)->destroy (object);
+  G_OBJECT_CLASS (parent_class)->dispose (object);
 
   box->progress = NULL;
 }
diff --git a/app/widgets/gimpsizebox.c b/app/widgets/gimpsizebox.c
index a536e67..f2623b9 100644
--- a/app/widgets/gimpsizebox.c
+++ b/app/widgets/gimpsizebox.c
@@ -70,6 +70,7 @@ static GObject * gimp_size_box_constructor   (GType                  type,
                                               guint                  n_params,
                                               GObjectConstructParam *params);
 
+static void      gimp_size_box_dispose           (GObject         *object);
 static void      gimp_size_box_set_property      (GObject         *object,
                                                   guint            property_id,
                                                   const GValue    *value,
@@ -79,8 +80,6 @@ static void      gimp_size_box_get_property      (GObject         *object,
                                                   GValue          *value,
                                                   GParamSpec      *pspec);
 
-static void      gimp_size_box_destroy           (GtkObject       *object);
-
 static void      gimp_size_box_update_size       (GimpSizeBox     *box);
 static void      gimp_size_box_update_resolution (GimpSizeBox     *box);
 static void      gimp_size_box_chain_toggled     (GimpChainButton *button,
@@ -95,15 +94,13 @@ G_DEFINE_TYPE (GimpSizeBox, gimp_size_box, GTK_TYPE_VBOX)
 static void
 gimp_size_box_class_init (GimpSizeBoxClass *klass)
 {
-  GObjectClass   *object_class     = G_OBJECT_CLASS (klass);
-  GtkObjectClass *gtk_object_class = GTK_OBJECT_CLASS (klass);
+  GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
   object_class->constructor  = gimp_size_box_constructor;
+  object_class->dispose      = gimp_size_box_dispose;
   object_class->set_property = gimp_size_box_set_property;
   object_class->get_property = gimp_size_box_get_property;
 
-  gtk_object_class->destroy  = gimp_size_box_destroy;
-
   g_type_class_add_private (object_class, sizeof (GimpSizeBoxPrivate));
 
   g_object_class_install_property (object_class, PROP_WIDTH,
@@ -303,6 +300,20 @@ gimp_size_box_constructor (GType                  type,
 }
 
 static void
+gimp_size_box_dispose (GObject *object)
+{
+  GimpSizeBox *box = GIMP_SIZE_BOX (object);
+
+  if (box->size_group)
+    {
+      g_object_unref (box->size_group);
+      box->size_group = NULL;
+    }
+
+  G_OBJECT_CLASS (parent_class)->dispose (object);
+}
+
+static void
 gimp_size_box_set_property (GObject      *object,
                             guint         property_id,
                             const GValue *value,
@@ -414,20 +425,6 @@ gimp_size_box_get_property (GObject    *object,
 }
 
 static void
-gimp_size_box_destroy (GtkObject *object)
-{
-  GimpSizeBox *box = GIMP_SIZE_BOX (object);
-
-  if (box->size_group)
-    {
-      g_object_unref (box->size_group);
-      box->size_group = NULL;
-    }
-
-  GTK_OBJECT_CLASS (parent_class)->destroy (object);
-}
-
-static void
 gimp_size_box_update_size (GimpSizeBox *box)
 {
   GimpSizeBoxPrivate *priv = GIMP_SIZE_BOX_GET_PRIVATE (box);
diff --git a/app/widgets/gimpthumbbox.c b/app/widgets/gimpthumbbox.c
index 0fccc31..c600492 100644
--- a/app/widgets/gimpthumbbox.c
+++ b/app/widgets/gimpthumbbox.c
@@ -56,8 +56,6 @@ static void     gimp_thumb_box_progress_iface_init (GimpProgressInterface *iface
 static void     gimp_thumb_box_dispose            (GObject           *object);
 static void     gimp_thumb_box_finalize           (GObject           *object);
 
-static void     gimp_thumb_box_destroy            (GtkObject         *object);
-
 static void     gimp_thumb_box_style_set          (GtkWidget         *widget,
                                                    GtkStyle          *prev_style);
 
@@ -109,15 +107,12 @@ G_DEFINE_TYPE_WITH_CODE (GimpThumbBox, gimp_thumb_box, GTK_TYPE_FRAME,
 static void
 gimp_thumb_box_class_init (GimpThumbBoxClass *klass)
 {
-  GObjectClass   *object_class     = G_OBJECT_CLASS (klass);
-  GtkObjectClass *gtk_object_class = GTK_OBJECT_CLASS (klass);
-  GtkWidgetClass *widget_class     = GTK_WIDGET_CLASS (klass);
+  GObjectClass   *object_class = G_OBJECT_CLASS (klass);
+  GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
 
   object_class->dispose     = gimp_thumb_box_dispose;
   object_class->finalize    = gimp_thumb_box_finalize;
 
-  gtk_object_class->destroy = gimp_thumb_box_destroy;
-
   widget_class->style_set   = gimp_thumb_box_style_set;
 }
 
@@ -153,6 +148,8 @@ gimp_thumb_box_dispose (GObject *object)
     }
 
   G_OBJECT_CLASS (parent_class)->dispose (object);
+
+  box->progress = NULL;
 }
 
 static void
@@ -172,16 +169,6 @@ gimp_thumb_box_finalize (GObject *object)
 }
 
 static void
-gimp_thumb_box_destroy (GtkObject *object)
-{
-  GimpThumbBox *box = GIMP_THUMB_BOX (object);
-
-  GTK_OBJECT_CLASS (parent_class)->destroy (object);
-
-  box->progress = NULL;
-}
-
-static void
 gimp_thumb_box_style_set (GtkWidget *widget,
                           GtkStyle  *prev_style)
 {
diff --git a/app/widgets/gimptooleditor.c b/app/widgets/gimptooleditor.c
index f8db17e..a52af04 100644
--- a/app/widgets/gimptooleditor.c
+++ b/app/widgets/gimptooleditor.c
@@ -67,7 +67,7 @@ struct _GimpToolEditorPrivate
 };
 
 
-static void   gimp_tool_editor_destroy     (GtkObject             *object);
+static void   gimp_tool_editor_dispose     (GObject               *object);
 static void   gimp_tool_editor_finalize    (GObject               *object);
 
 static void   gimp_tool_editor_visible_notify
@@ -116,13 +116,12 @@ G_DEFINE_TYPE (GimpToolEditor, gimp_tool_editor, GIMP_TYPE_CONTAINER_TREE_VIEW)
 static void
 gimp_tool_editor_class_init (GimpToolEditorClass *klass)
 {
-  GObjectClass   *object_class     = G_OBJECT_CLASS (klass);
-  GtkObjectClass *gtk_object_class = GTK_OBJECT_CLASS (klass);
+  GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
-  g_type_class_add_private (klass, sizeof (GimpToolEditorPrivate));
+  object_class->dispose  = gimp_tool_editor_dispose;
+  object_class->finalize = gimp_tool_editor_finalize;
 
-  object_class->finalize     = gimp_tool_editor_finalize;
-  gtk_object_class->destroy  = gimp_tool_editor_destroy;
+  g_type_class_add_private (klass, sizeof (GimpToolEditorPrivate));
 }
 
 static void
@@ -148,6 +147,30 @@ gimp_tool_editor_init (GimpToolEditor *tool_editor)
 }
 
 static void
+gimp_tool_editor_dispose (GObject *object)
+{
+  GimpToolEditorPrivate *priv = GIMP_TOOL_EDITOR_GET_PRIVATE (object);
+
+  if (priv->visible_handler_id)
+    {
+      gimp_container_remove_handler (priv->container,
+                                     priv->visible_handler_id);
+      priv->visible_handler_id = 0;
+    }
+
+  priv->context      = NULL;
+  priv->container    = NULL;
+
+  priv->raise_button = NULL;
+  priv->lower_button = NULL;
+  priv->reset_button = NULL;
+
+  priv->scrolled     = NULL;
+
+  G_OBJECT_CLASS (parent_class)->dispose (object);
+}
+
+static void
 gimp_tool_editor_finalize (GObject *object)
 {
   GimpToolEditor *tool_editor;
@@ -180,30 +203,6 @@ gimp_tool_editor_finalize (GObject *object)
   G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 
-static void
-gimp_tool_editor_destroy (GtkObject *object)
-{
-  GimpToolEditorPrivate *priv = GIMP_TOOL_EDITOR_GET_PRIVATE (object);
-
-  if (priv->visible_handler_id)
-    {
-      gimp_container_remove_handler (priv->container,
-                                     priv->visible_handler_id);
-      priv->visible_handler_id = 0;
-    }
-
-  priv->context      = NULL;
-  priv->container    = NULL;
-
-  priv->raise_button = NULL;
-  priv->lower_button = NULL;
-  priv->reset_button = NULL;
-
-  priv->scrolled     = NULL;
-
-  GTK_OBJECT_CLASS (parent_class)->destroy (object);
-}
-
 GtkWidget *
 gimp_tool_editor_new (GimpContainer *container,
                       GimpContext   *context,
diff --git a/app/widgets/gimptooloptionseditor.c b/app/widgets/gimptooloptionseditor.c
index def6264..dd709c7 100644
--- a/app/widgets/gimptooloptionseditor.c
+++ b/app/widgets/gimptooloptionseditor.c
@@ -76,6 +76,7 @@ static void        gimp_tool_options_editor_docked_iface_init (GimpDockedInterfa
 static GObject   * gimp_tool_options_editor_constructor       (GType                  type,
                                                                guint                  n_params,
                                                                GObjectConstructParam *params);
+static void        gimp_tool_options_editor_dispose           (GObject               *object);
 static void        gimp_tool_options_editor_set_property      (GObject               *object,
                                                                guint                  property_id,
                                                                const GValue          *value,
@@ -84,7 +85,7 @@ static void        gimp_tool_options_editor_get_property      (GObject
                                                                guint                  property_id,
                                                                GValue                *value,
                                                                GParamSpec            *pspec);
-static void        gimp_tool_options_editor_destroy           (GtkObject             *object);
+
 static GtkWidget * gimp_tool_options_editor_get_preview       (GimpDocked            *docked,
                                                                GimpContext           *context,
                                                                GtkIconSize            size);
@@ -122,15 +123,13 @@ G_DEFINE_TYPE_WITH_CODE (GimpToolOptionsEditor, gimp_tool_options_editor,
 static void
 gimp_tool_options_editor_class_init (GimpToolOptionsEditorClass *klass)
 {
-  GObjectClass   *object_class     = G_OBJECT_CLASS (klass);
-  GtkObjectClass *gtk_object_class = GTK_OBJECT_CLASS (klass);
+  GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
   object_class->constructor  = gimp_tool_options_editor_constructor;
+  object_class->dispose      = gimp_tool_options_editor_dispose;
   object_class->set_property = gimp_tool_options_editor_set_property;
   object_class->get_property = gimp_tool_options_editor_get_property;
 
-  gtk_object_class->destroy  = gimp_tool_options_editor_destroy;
-
   g_object_class_install_property (object_class, PROP_GIMP,
                                    g_param_spec_object ("gimp",
                                                         NULL, NULL,
@@ -260,6 +259,35 @@ gimp_tool_options_editor_constructor (GType                  type,
 }
 
 static void
+gimp_tool_options_editor_dispose (GObject *object)
+{
+  GimpToolOptionsEditor *editor = GIMP_TOOL_OPTIONS_EDITOR (object);
+
+  if (editor->p->options_vbox)
+    {
+      GList *options;
+      GList *list;
+
+      options =
+        gtk_container_get_children (GTK_CONTAINER (editor->p->options_vbox));
+
+      for (list = options; list; list = g_list_next (list))
+        {
+          g_object_ref (list->data);
+          gtk_container_remove (GTK_CONTAINER (editor->p->options_vbox),
+                                GTK_WIDGET (list->data));
+        }
+
+      g_list_free (options);
+      editor->p->options_vbox = NULL;
+    }
+
+  gimp_tool_options_editor_save_presets (editor);
+
+  G_OBJECT_CLASS (parent_class)->dispose (object);
+}
+
+static void
 gimp_tool_options_editor_set_property (GObject      *object,
                                        guint         property_id,
                                        const GValue *value,
@@ -299,35 +327,6 @@ gimp_tool_options_editor_get_property (GObject    *object,
     }
 }
 
-static void
-gimp_tool_options_editor_destroy (GtkObject *object)
-{
-  GimpToolOptionsEditor *editor = GIMP_TOOL_OPTIONS_EDITOR (object);
-
-  if (editor->p->options_vbox)
-    {
-      GList *options;
-      GList *list;
-
-      options =
-        gtk_container_get_children (GTK_CONTAINER (editor->p->options_vbox));
-
-      for (list = options; list; list = g_list_next (list))
-        {
-          g_object_ref (list->data);
-          gtk_container_remove (GTK_CONTAINER (editor->p->options_vbox),
-                                GTK_WIDGET (list->data));
-        }
-
-      g_list_free (options);
-      editor->p->options_vbox = NULL;
-    }
-
-  gimp_tool_options_editor_save_presets (editor);
-
-  GTK_OBJECT_CLASS (parent_class)->destroy (object);
-}
-
 static GtkWidget *
 gimp_tool_options_editor_get_preview (GimpDocked   *docked,
                                       GimpContext  *context,
diff --git a/app/widgets/gimpview.c b/app/widgets/gimpview.c
index 1a22157..823cc9c 100644
--- a/app/widgets/gimpview.c
+++ b/app/widgets/gimpview.c
@@ -52,7 +52,8 @@ enum
 };
 
 
-static void        gimp_view_destroy              (GtkObject        *object);
+static void        gimp_view_dispose              (GObject          *object);
+
 static void        gimp_view_realize              (GtkWidget        *widget);
 static void        gimp_view_unrealize            (GtkWidget        *widget);
 static void        gimp_view_map                  (GtkWidget        *widget);
@@ -96,7 +97,7 @@ static guint view_signals[LAST_SIGNAL] = { 0 };
 static void
 gimp_view_class_init (GimpViewClass *klass)
 {
-  GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
+  GObjectClass   *object_class = G_OBJECT_CLASS (klass);
   GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
 
   view_signals[SET_VIEWABLE] =
@@ -137,7 +138,7 @@ gimp_view_class_init (GimpViewClass *klass)
                   gimp_marshal_VOID__VOID,
                   G_TYPE_NONE, 0);
 
-  object_class->destroy              = gimp_view_destroy;
+  object_class->dispose              = gimp_view_dispose;
 
   widget_class->activate_signal      = view_signals[CLICKED];
   widget_class->realize              = gimp_view_realize;
@@ -183,7 +184,7 @@ gimp_view_init (GimpView *view)
 }
 
 static void
-gimp_view_destroy (GtkObject *object)
+gimp_view_dispose (GObject *object)
 {
   GimpView *view = GIMP_VIEW (object);
 
@@ -196,7 +197,7 @@ gimp_view_destroy (GtkObject *object)
       view->renderer = NULL;
     }
 
-  GTK_OBJECT_CLASS (parent_class)->destroy (object);
+  G_OBJECT_CLASS (parent_class)->dispose (object);
 }
 
 static void
diff --git a/app/widgets/gimpviewabledialog.c b/app/widgets/gimpviewabledialog.c
index 86f366e..5ce929e 100644
--- a/app/widgets/gimpviewabledialog.c
+++ b/app/widgets/gimpviewabledialog.c
@@ -49,6 +49,7 @@ enum
 };
 
 
+static void   gimp_viewable_dialog_dispose      (GObject            *object);
 static void   gimp_viewable_dialog_set_property (GObject            *object,
                                                  guint               property_id,
                                                  const GValue       *value,
@@ -58,8 +59,6 @@ static void   gimp_viewable_dialog_get_property (GObject            *object,
                                                  GValue             *value,
                                                  GParamSpec         *pspec);
 
-static void   gimp_viewable_dialog_destroy      (GtkObject          *object);
-
 static void   gimp_viewable_dialog_name_changed (GimpObject         *object,
                                                  GimpViewableDialog *dialog);
 static void   gimp_viewable_dialog_close        (GimpViewableDialog *dialog);
@@ -73,11 +72,9 @@ G_DEFINE_TYPE (GimpViewableDialog, gimp_viewable_dialog, GIMP_TYPE_DIALOG)
 static void
 gimp_viewable_dialog_class_init (GimpViewableDialogClass *klass)
 {
-  GtkObjectClass *gtk_object_class = GTK_OBJECT_CLASS (klass);
-  GObjectClass   *object_class     = G_OBJECT_CLASS (klass);
-
-  gtk_object_class->destroy  = gimp_viewable_dialog_destroy;
+  GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
+  object_class->dispose      = gimp_viewable_dialog_dispose;
   object_class->get_property = gimp_viewable_dialog_get_property;
   object_class->set_property = gimp_viewable_dialog_set_property;
 
@@ -155,6 +152,17 @@ gimp_viewable_dialog_init (GimpViewableDialog *dialog)
 }
 
 static void
+gimp_viewable_dialog_dispose (GObject *object)
+{
+  GimpViewableDialog *dialog = GIMP_VIEWABLE_DIALOG (object);
+
+  if (dialog->view)
+    gimp_viewable_dialog_set_viewable (dialog, NULL, NULL);
+
+  G_OBJECT_CLASS (parent_class)->dispose (object);
+}
+
+static void
 gimp_viewable_dialog_set_property (GObject      *object,
                                    guint         property_id,
                                    const GValue *value,
@@ -230,17 +238,6 @@ gimp_viewable_dialog_get_property (GObject    *object,
     }
 }
 
-static void
-gimp_viewable_dialog_destroy (GtkObject *object)
-{
-  GimpViewableDialog *dialog = GIMP_VIEWABLE_DIALOG (object);
-
-  if (dialog->view)
-    gimp_viewable_dialog_set_viewable (dialog, NULL, NULL);
-
-  GTK_OBJECT_CLASS (parent_class)->destroy (object);
-}
-
 GtkWidget *
 gimp_viewable_dialog_new (GimpViewable *viewable,
                           GimpContext  *context,



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