[gimp] libgimp: implement GObject::dispose() instead of GtkObject::destroy()
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] libgimp: implement GObject::dispose() instead of GtkObject::destroy()
- Date: Fri, 15 Oct 2010 10:04:53 +0000 (UTC)
commit 38999b7dd44887d7d3446052761c42064447c660
Author: Michael Natterer <mitch gimp org>
Date: Fri Oct 15 12:04:36 2010 +0200
libgimp: implement GObject::dispose() instead of GtkObject::destroy()
libgimp/gimpaspectpreview.c | 53 ++++++++++++++++++---------------------
libgimp/gimpdrawablepreview.c | 55 +++++++++++++++++++---------------------
2 files changed, 51 insertions(+), 57 deletions(-)
---
diff --git a/libgimp/gimpaspectpreview.c b/libgimp/gimpaspectpreview.c
index 2adf888..d16167a 100644
--- a/libgimp/gimpaspectpreview.c
+++ b/libgimp/gimpaspectpreview.c
@@ -57,8 +57,7 @@ typedef struct
static GObject * gimp_aspect_preview_constructor (GType type,
guint n_params,
GObjectConstructParam *params);
-
-
+static void gimp_aspect_preview_dispose (GObject *object);
static void gimp_aspect_preview_get_property (GObject *object,
guint property_id,
GValue *value,
@@ -67,7 +66,7 @@ static void gimp_aspect_preview_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
-static void gimp_aspect_preview_destroy (GtkObject *object);
+
static void gimp_aspect_preview_style_set (GtkWidget *widget,
GtkStyle *prev_style);
static void gimp_aspect_preview_draw (GimpPreview *preview);
@@ -99,17 +98,15 @@ static gint gimp_aspect_preview_counter = 0;
static void
gimp_aspect_preview_class_init (GimpAspectPreviewClass *klass)
{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
- GtkObjectClass *gtk_object_class = GTK_OBJECT_CLASS (klass);
- GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
- GimpPreviewClass *preview_class = GIMP_PREVIEW_CLASS (klass);
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+ GimpPreviewClass *preview_class = GIMP_PREVIEW_CLASS (klass);
object_class->constructor = gimp_aspect_preview_constructor;
+ object_class->dispose = gimp_aspect_preview_dispose;
object_class->get_property = gimp_aspect_preview_get_property;
object_class->set_property = gimp_aspect_preview_set_property;
- gtk_object_class->destroy = gimp_aspect_preview_destroy;
-
widget_class->style_set = gimp_aspect_preview_style_set;
preview_class->draw = gimp_aspect_preview_draw;
@@ -164,6 +161,25 @@ gimp_aspect_preview_constructor (GType type,
}
static void
+gimp_aspect_preview_dispose (GObject *object)
+{
+ const gchar *data_name = g_object_get_data (G_OBJECT (object),
+ "gimp-aspect-preview-data-name");
+
+ if (data_name)
+ {
+ GimpPreview *preview = GIMP_PREVIEW (object);
+ PreviewSettings settings;
+
+ settings.update = gimp_preview_get_update (preview);
+
+ gimp_set_data (data_name, &settings, sizeof (PreviewSettings));
+ }
+
+ G_OBJECT_CLASS (parent_class)->dispose (object);
+}
+
+static void
gimp_aspect_preview_get_property (GObject *object,
guint property_id,
GValue *value,
@@ -205,25 +221,6 @@ gimp_aspect_preview_set_property (GObject *object,
}
static void
-gimp_aspect_preview_destroy (GtkObject *object)
-{
- const gchar *data_name = g_object_get_data (G_OBJECT (object),
- "gimp-aspect-preview-data-name");
-
- if (data_name)
- {
- GimpPreview *preview = GIMP_PREVIEW (object);
- PreviewSettings settings;
-
- settings.update = gimp_preview_get_update (preview);
-
- gimp_set_data (data_name, &settings, sizeof (PreviewSettings));
- }
-
- GTK_OBJECT_CLASS (parent_class)->destroy (object);
-}
-
-static void
gimp_aspect_preview_style_set (GtkWidget *widget,
GtkStyle *prev_style)
{
diff --git a/libgimp/gimpdrawablepreview.c b/libgimp/gimpdrawablepreview.c
index f69c0d2..a472653 100644
--- a/libgimp/gimpdrawablepreview.c
+++ b/libgimp/gimpdrawablepreview.c
@@ -59,7 +59,7 @@ typedef struct
static GObject * gimp_drawable_preview_constructor (GType type,
guint n_params,
GObjectConstructParam *params);
-
+static void gimp_drawable_preview_dispose (GObject *object);
static void gimp_drawable_preview_get_property (GObject *object,
guint property_id,
GValue *value,
@@ -68,7 +68,6 @@ static void gimp_drawable_preview_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
-static void gimp_drawable_preview_destroy (GtkObject *object);
static void gimp_drawable_preview_style_set (GtkWidget *widget,
GtkStyle *prev_style);
@@ -97,17 +96,15 @@ static gint gimp_drawable_preview_counter = 0;
static void
gimp_drawable_preview_class_init (GimpDrawablePreviewClass *klass)
{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
- GtkObjectClass *gtk_object_class = GTK_OBJECT_CLASS (klass);
- GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
- GimpPreviewClass *preview_class = GIMP_PREVIEW_CLASS (klass);
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+ GimpPreviewClass *preview_class = GIMP_PREVIEW_CLASS (klass);
object_class->constructor = gimp_drawable_preview_constructor;
+ object_class->dispose = gimp_drawable_preview_dispose;
object_class->get_property = gimp_drawable_preview_get_property;
object_class->set_property = gimp_drawable_preview_set_property;
- gtk_object_class->destroy = gimp_drawable_preview_destroy;
-
widget_class->style_set = gimp_drawable_preview_style_set;
preview_class->draw = gimp_drawable_preview_draw_original;
@@ -163,6 +160,27 @@ gimp_drawable_preview_constructor (GType type,
}
static void
+gimp_drawable_preview_dispose (GObject *object)
+{
+ const gchar *data_name = g_object_get_data (G_OBJECT (object),
+ "gimp-drawable-preview-data-name");
+
+ if (data_name)
+ {
+ GimpPreview *preview = GIMP_PREVIEW (object);
+ PreviewSettings settings;
+
+ settings.x = preview->xoff + preview->xmin;
+ settings.y = preview->yoff + preview->ymin;
+ settings.update = gimp_preview_get_update (preview);
+
+ gimp_set_data (data_name, &settings, sizeof (PreviewSettings));
+ }
+
+ G_OBJECT_CLASS (parent_class)->dispose (object);
+}
+
+static void
gimp_drawable_preview_get_property (GObject *object,
guint property_id,
GValue *value,
@@ -205,27 +223,6 @@ gimp_drawable_preview_set_property (GObject *object,
}
static void
-gimp_drawable_preview_destroy (GtkObject *object)
-{
- const gchar *data_name = g_object_get_data (G_OBJECT (object),
- "gimp-drawable-preview-data-name");
-
- if (data_name)
- {
- GimpPreview *preview = GIMP_PREVIEW (object);
- PreviewSettings settings;
-
- settings.x = preview->xoff + preview->xmin;
- settings.y = preview->yoff + preview->ymin;
- settings.update = gimp_preview_get_update (preview);
-
- gimp_set_data (data_name, &settings, sizeof (PreviewSettings));
- }
-
- GTK_OBJECT_CLASS (parent_class)->destroy (object);
-}
-
-static void
gimp_drawable_preview_style_set (GtkWidget *widget,
GtkStyle *prev_style)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]