diff --git a/ChangeLog b/ChangeLog index 0d60f7d833..c8de0d0bea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,41 @@ +2001-01-29 Michael Natterer + + * app/pdb/Makefile.am + * app/pdb/pdb_glue.h: new file which contains the stuff that makes + PDB code generation easier but is ugly when used in the app + (see my comment in the log below). + + Contains: + gimp_drawable_[layer|layer_mask|channel]() + [channel|gimp_layer]_[set|get]_[name|tattoo]() + + * app/channel.[ch] + * app/channels_dialog.c + * app/gimpdrawable.h + * app/gimpimage.c + * app/gimplayermask.h + * app/layer.c + * app/layer.h + * app/toolbox.c + * app/undo.c + * app/xcf.c + * app/pdb/channel_cmds.c + * app/pdb/drawable_cmds.c + * app/pdb/layer_cmds.c + * app/pdb/selection_cmds.c + * app/tools/bezier_select.c + * app/tools/bucket_fill.c + * app/tools/by_color_select.c + * app/tools/ellipse_select.c + * app/tools/free_select.c + * app/tools/fuzzy_select.c + * app/tools/iscissors.c + * app/tools/rect_select.c + * tools/pdbgen/pdb/channel.pdb + * tools/pdbgen/pdb/drawable.pdb + * tools/pdbgen/pdb/layer.pdb + * tools/pdbgen/pdb/selection.pdb: changed accordingly. + 2001-01-29 Sven Neumann * AUTHORS diff --git a/app/channel.c b/app/channel.c index 87c2eeb595..174b27dc3e 100644 --- a/app/channel.c +++ b/app/channel.c @@ -208,19 +208,6 @@ channel_copy (const Channel *channel) return new_channel; } -void -channel_set_name (Channel *channel, - const gchar *name) -{ - gimp_object_set_name (GIMP_OBJECT (channel), name); -} - -const gchar * -channel_get_name (const Channel *channel) -{ - return gimp_object_get_name (GIMP_OBJECT (channel)); -} - void channel_set_color (Channel *channel, const GimpRGB *color) @@ -262,17 +249,6 @@ channel_set_opacity (Channel *channel, channel->color.a = opacity / 100.0; } -void -channel_delete (Channel *channel) -{ - /* Channels are normally deleted by removing them from the associated - image. The only case where channel_delete() is useful is if you want - to remove a floating channel object that has not been added to an - image yet. We use gtk_object_sink() for this reason here. - */ - gtk_object_sink (GTK_OBJECT (channel)); -} - static void gimp_channel_destroy (GtkObject *object) { @@ -546,19 +522,6 @@ channel_preview_private (Channel *channel, } } -Tattoo -channel_get_tattoo (const Channel *channel) -{ - return gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)); -} - -void -channel_set_tattoo (Channel *channel, - Tattoo value) -{ - gimp_drawable_set_tattoo (GIMP_DRAWABLE (channel), value); -} - /******************************/ /* selection mask functions */ /******************************/ @@ -1635,7 +1598,7 @@ channel_translate (Channel *mask, copy_region (&srcPR, &destPR); /* free the temporary mask */ - channel_delete (tmp_mask); + gtk_object_unref (GTK_OBJECT (tmp_mask)); } /* calculate new bounds */ diff --git a/app/channel.h b/app/channel.h index 0006a7b3f0..9bd6a4b739 100644 --- a/app/channel.h +++ b/app/channel.h @@ -96,10 +96,6 @@ Channel * channel_new (GimpImage *gimage, const GimpRGB *color); Channel * channel_copy (const Channel *channel); -const gchar * channel_get_name (const Channel *channel); -void channel_set_name (Channel *channel, - const gchar *name); - gint channel_get_opacity (const Channel *channel); void channel_set_opacity (Channel *channel, gint opacity); @@ -108,7 +104,6 @@ const GimpRGB * channel_get_color (const Channel *channel); void channel_set_color (Channel *channel, const GimpRGB *color); -void channel_delete (Channel *channel); void channel_scale (Channel *channel, gint new_width, gint new_height); @@ -126,10 +121,6 @@ TempBuf * channel_preview (Channel *channel, gint width, gint height); -Tattoo channel_get_tattoo (const Channel *channel); -void channel_set_tattoo (Channel *channel, - Tattoo value); - /* selection mask functions */ Channel * channel_new_mask (GimpImage *gimage, diff --git a/app/channels_dialog.c b/app/channels_dialog.c index 4ba16fa071..45a3d4c5d8 100644 --- a/app/channels_dialog.c +++ b/app/channels_dialog.c @@ -1094,8 +1094,8 @@ channels_dialog_add_channel_to_sel_callback (GtkWidget *widget, gpointer data) { GimpImage *gimage; - Channel *active_channel; - Channel *new_channel; + Channel *active_channel; + Channel *new_channel; if (!channelsD || !(gimage = channelsD->gimage)) return; @@ -1108,7 +1108,7 @@ channels_dialog_add_channel_to_sel_callback (GtkWidget *widget, CHANNEL_OP_ADD, 0, 0); /* off x/y */ gimage_mask_load (gimage, new_channel); - channel_delete (new_channel); + gtk_object_unref (GTK_OBJECT (new_channel)); gdisplays_flush (); } } @@ -1118,8 +1118,8 @@ channels_dialog_sub_channel_from_sel_callback (GtkWidget *widget, gpointer data) { GimpImage *gimage; - Channel *active_channel; - Channel *new_channel; + Channel *active_channel; + Channel *new_channel; if (!channelsD || !(gimage = channelsD->gimage)) return; @@ -1132,7 +1132,7 @@ channels_dialog_sub_channel_from_sel_callback (GtkWidget *widget, CHANNEL_OP_SUB, 0, 0); /* off x/y */ gimage_mask_load (gimage, new_channel); - channel_delete (new_channel); + gtk_object_unref (GTK_OBJECT (new_channel)); gdisplays_flush (); } } @@ -1142,8 +1142,8 @@ channels_dialog_intersect_channel_with_sel_callback (GtkWidget *widget, gpointer data) { GimpImage *gimage; - Channel *active_channel; - Channel *new_channel; + Channel *active_channel; + Channel *new_channel; if (!channelsD || !(gimage = channelsD->gimage)) return; @@ -1156,7 +1156,7 @@ channels_dialog_intersect_channel_with_sel_callback (GtkWidget *widget, CHANNEL_OP_INTERSECT, 0, 0); /* off x/y */ gimage_mask_load (gimage, new_channel); - channel_delete (new_channel); + gtk_object_unref (GTK_OBJECT (new_channel)); gdisplays_flush (); } } diff --git a/app/core/gimpchannel-combine.c b/app/core/gimpchannel-combine.c index 87c2eeb595..174b27dc3e 100644 --- a/app/core/gimpchannel-combine.c +++ b/app/core/gimpchannel-combine.c @@ -208,19 +208,6 @@ channel_copy (const Channel *channel) return new_channel; } -void -channel_set_name (Channel *channel, - const gchar *name) -{ - gimp_object_set_name (GIMP_OBJECT (channel), name); -} - -const gchar * -channel_get_name (const Channel *channel) -{ - return gimp_object_get_name (GIMP_OBJECT (channel)); -} - void channel_set_color (Channel *channel, const GimpRGB *color) @@ -262,17 +249,6 @@ channel_set_opacity (Channel *channel, channel->color.a = opacity / 100.0; } -void -channel_delete (Channel *channel) -{ - /* Channels are normally deleted by removing them from the associated - image. The only case where channel_delete() is useful is if you want - to remove a floating channel object that has not been added to an - image yet. We use gtk_object_sink() for this reason here. - */ - gtk_object_sink (GTK_OBJECT (channel)); -} - static void gimp_channel_destroy (GtkObject *object) { @@ -546,19 +522,6 @@ channel_preview_private (Channel *channel, } } -Tattoo -channel_get_tattoo (const Channel *channel) -{ - return gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)); -} - -void -channel_set_tattoo (Channel *channel, - Tattoo value) -{ - gimp_drawable_set_tattoo (GIMP_DRAWABLE (channel), value); -} - /******************************/ /* selection mask functions */ /******************************/ @@ -1635,7 +1598,7 @@ channel_translate (Channel *mask, copy_region (&srcPR, &destPR); /* free the temporary mask */ - channel_delete (tmp_mask); + gtk_object_unref (GTK_OBJECT (tmp_mask)); } /* calculate new bounds */ diff --git a/app/core/gimpchannel-combine.h b/app/core/gimpchannel-combine.h index 0006a7b3f0..9bd6a4b739 100644 --- a/app/core/gimpchannel-combine.h +++ b/app/core/gimpchannel-combine.h @@ -96,10 +96,6 @@ Channel * channel_new (GimpImage *gimage, const GimpRGB *color); Channel * channel_copy (const Channel *channel); -const gchar * channel_get_name (const Channel *channel); -void channel_set_name (Channel *channel, - const gchar *name); - gint channel_get_opacity (const Channel *channel); void channel_set_opacity (Channel *channel, gint opacity); @@ -108,7 +104,6 @@ const GimpRGB * channel_get_color (const Channel *channel); void channel_set_color (Channel *channel, const GimpRGB *color); -void channel_delete (Channel *channel); void channel_scale (Channel *channel, gint new_width, gint new_height); @@ -126,10 +121,6 @@ TempBuf * channel_preview (Channel *channel, gint width, gint height); -Tattoo channel_get_tattoo (const Channel *channel); -void channel_set_tattoo (Channel *channel, - Tattoo value); - /* selection mask functions */ Channel * channel_new_mask (GimpImage *gimage, diff --git a/app/core/gimpchannel.c b/app/core/gimpchannel.c index 87c2eeb595..174b27dc3e 100644 --- a/app/core/gimpchannel.c +++ b/app/core/gimpchannel.c @@ -208,19 +208,6 @@ channel_copy (const Channel *channel) return new_channel; } -void -channel_set_name (Channel *channel, - const gchar *name) -{ - gimp_object_set_name (GIMP_OBJECT (channel), name); -} - -const gchar * -channel_get_name (const Channel *channel) -{ - return gimp_object_get_name (GIMP_OBJECT (channel)); -} - void channel_set_color (Channel *channel, const GimpRGB *color) @@ -262,17 +249,6 @@ channel_set_opacity (Channel *channel, channel->color.a = opacity / 100.0; } -void -channel_delete (Channel *channel) -{ - /* Channels are normally deleted by removing them from the associated - image. The only case where channel_delete() is useful is if you want - to remove a floating channel object that has not been added to an - image yet. We use gtk_object_sink() for this reason here. - */ - gtk_object_sink (GTK_OBJECT (channel)); -} - static void gimp_channel_destroy (GtkObject *object) { @@ -546,19 +522,6 @@ channel_preview_private (Channel *channel, } } -Tattoo -channel_get_tattoo (const Channel *channel) -{ - return gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)); -} - -void -channel_set_tattoo (Channel *channel, - Tattoo value) -{ - gimp_drawable_set_tattoo (GIMP_DRAWABLE (channel), value); -} - /******************************/ /* selection mask functions */ /******************************/ @@ -1635,7 +1598,7 @@ channel_translate (Channel *mask, copy_region (&srcPR, &destPR); /* free the temporary mask */ - channel_delete (tmp_mask); + gtk_object_unref (GTK_OBJECT (tmp_mask)); } /* calculate new bounds */ diff --git a/app/core/gimpchannel.h b/app/core/gimpchannel.h index 0006a7b3f0..9bd6a4b739 100644 --- a/app/core/gimpchannel.h +++ b/app/core/gimpchannel.h @@ -96,10 +96,6 @@ Channel * channel_new (GimpImage *gimage, const GimpRGB *color); Channel * channel_copy (const Channel *channel); -const gchar * channel_get_name (const Channel *channel); -void channel_set_name (Channel *channel, - const gchar *name); - gint channel_get_opacity (const Channel *channel); void channel_set_opacity (Channel *channel, gint opacity); @@ -108,7 +104,6 @@ const GimpRGB * channel_get_color (const Channel *channel); void channel_set_color (Channel *channel, const GimpRGB *color); -void channel_delete (Channel *channel); void channel_scale (Channel *channel, gint new_width, gint new_height); @@ -126,10 +121,6 @@ TempBuf * channel_preview (Channel *channel, gint width, gint height); -Tattoo channel_get_tattoo (const Channel *channel); -void channel_set_tattoo (Channel *channel, - Tattoo value); - /* selection mask functions */ Channel * channel_new_mask (GimpImage *gimage, diff --git a/app/core/gimpdrawable.h b/app/core/gimpdrawable.h index 55f05e43ed..70d635a60c 100644 --- a/app/core/gimpdrawable.h +++ b/app/core/gimpdrawable.h @@ -23,12 +23,6 @@ #include "gimpobject.h" -/* PDB stuff */ -#define gimp_drawable_layer GIMP_IS_LAYER -#define gimp_drawable_layer_mask GIMP_IS_LAYER_MASK -#define gimp_drawable_channel GIMP_IS_CHANNEL - - #define GIMP_TYPE_DRAWABLE (gimp_drawable_get_type ()) #define GIMP_DRAWABLE(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_DRAWABLE, GimpDrawable)) #define GIMP_IS_DRAWABLE(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_DRAWABLE)) diff --git a/app/core/gimpimage-guides.c b/app/core/gimpimage-guides.c index be6ad5684e..a733e7d312 100644 --- a/app/core/gimpimage-guides.c +++ b/app/core/gimpimage-guides.c @@ -1413,7 +1413,7 @@ gimp_image_set_tattoo_state (GimpImage *gimage, Tattoo ctattoo; channel = (Channel *) channels->data; - ctattoo = channel_get_tattoo (channel); + ctattoo = gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)); if (ctattoo > maxval) maxval = ctattoo; /* Now check path an't got this tattoo */ @@ -2250,7 +2250,7 @@ gimp_image_get_channel_by_tattoo (const GimpImage *gimage, { channel = (Channel *) channels->data; - if (channel_get_tattoo (channel) == tattoo) + if (gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)) == tattoo) return channel; } diff --git a/app/core/gimpimage-merge.c b/app/core/gimpimage-merge.c index be6ad5684e..a733e7d312 100644 --- a/app/core/gimpimage-merge.c +++ b/app/core/gimpimage-merge.c @@ -1413,7 +1413,7 @@ gimp_image_set_tattoo_state (GimpImage *gimage, Tattoo ctattoo; channel = (Channel *) channels->data; - ctattoo = channel_get_tattoo (channel); + ctattoo = gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)); if (ctattoo > maxval) maxval = ctattoo; /* Now check path an't got this tattoo */ @@ -2250,7 +2250,7 @@ gimp_image_get_channel_by_tattoo (const GimpImage *gimage, { channel = (Channel *) channels->data; - if (channel_get_tattoo (channel) == tattoo) + if (gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)) == tattoo) return channel; } diff --git a/app/core/gimpimage-projection.c b/app/core/gimpimage-projection.c index be6ad5684e..a733e7d312 100644 --- a/app/core/gimpimage-projection.c +++ b/app/core/gimpimage-projection.c @@ -1413,7 +1413,7 @@ gimp_image_set_tattoo_state (GimpImage *gimage, Tattoo ctattoo; channel = (Channel *) channels->data; - ctattoo = channel_get_tattoo (channel); + ctattoo = gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)); if (ctattoo > maxval) maxval = ctattoo; /* Now check path an't got this tattoo */ @@ -2250,7 +2250,7 @@ gimp_image_get_channel_by_tattoo (const GimpImage *gimage, { channel = (Channel *) channels->data; - if (channel_get_tattoo (channel) == tattoo) + if (gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)) == tattoo) return channel; } diff --git a/app/core/gimpimage-resize.c b/app/core/gimpimage-resize.c index be6ad5684e..a733e7d312 100644 --- a/app/core/gimpimage-resize.c +++ b/app/core/gimpimage-resize.c @@ -1413,7 +1413,7 @@ gimp_image_set_tattoo_state (GimpImage *gimage, Tattoo ctattoo; channel = (Channel *) channels->data; - ctattoo = channel_get_tattoo (channel); + ctattoo = gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)); if (ctattoo > maxval) maxval = ctattoo; /* Now check path an't got this tattoo */ @@ -2250,7 +2250,7 @@ gimp_image_get_channel_by_tattoo (const GimpImage *gimage, { channel = (Channel *) channels->data; - if (channel_get_tattoo (channel) == tattoo) + if (gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)) == tattoo) return channel; } diff --git a/app/core/gimpimage-scale.c b/app/core/gimpimage-scale.c index be6ad5684e..a733e7d312 100644 --- a/app/core/gimpimage-scale.c +++ b/app/core/gimpimage-scale.c @@ -1413,7 +1413,7 @@ gimp_image_set_tattoo_state (GimpImage *gimage, Tattoo ctattoo; channel = (Channel *) channels->data; - ctattoo = channel_get_tattoo (channel); + ctattoo = gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)); if (ctattoo > maxval) maxval = ctattoo; /* Now check path an't got this tattoo */ @@ -2250,7 +2250,7 @@ gimp_image_get_channel_by_tattoo (const GimpImage *gimage, { channel = (Channel *) channels->data; - if (channel_get_tattoo (channel) == tattoo) + if (gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)) == tattoo) return channel; } diff --git a/app/core/gimpimage-undo-push.c b/app/core/gimpimage-undo-push.c index 2f5bb22a9b..9e0c7f9556 100644 --- a/app/core/gimpimage-undo-push.c +++ b/app/core/gimpimage-undo-push.c @@ -1439,7 +1439,9 @@ undo_push_layer (GimpImage *gimage, /* if this is a remove layer, delete the layer */ if (type == LAYER_REMOVE_UNDO) gtk_object_unref (GTK_OBJECT (lu->layer)); + g_free (lu); + return FALSE; } } @@ -1797,7 +1799,7 @@ undo_push_channel (GimpImage *gimage, else { if (type == CHANNEL_REMOVE_UNDO) - channel_delete (cu->channel); + gtk_object_unref (GTK_OBJECT (cu->channel)); g_free (cu); return FALSE; } @@ -1870,7 +1872,7 @@ undo_free_channel (UndoState state, */ if ((state == REDO && type == CHANNEL_ADD_UNDO) || (state == UNDO && type == CHANNEL_REMOVE_UNDO)) - channel_delete (cu->channel); + gtk_object_unref (GTK_OBJECT (cu->channel)); g_free (cu); } diff --git a/app/core/gimpimage.c b/app/core/gimpimage.c index be6ad5684e..a733e7d312 100644 --- a/app/core/gimpimage.c +++ b/app/core/gimpimage.c @@ -1413,7 +1413,7 @@ gimp_image_set_tattoo_state (GimpImage *gimage, Tattoo ctattoo; channel = (Channel *) channels->data; - ctattoo = channel_get_tattoo (channel); + ctattoo = gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)); if (ctattoo > maxval) maxval = ctattoo; /* Now check path an't got this tattoo */ @@ -2250,7 +2250,7 @@ gimp_image_get_channel_by_tattoo (const GimpImage *gimage, { channel = (Channel *) channels->data; - if (channel_get_tattoo (channel) == tattoo) + if (gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)) == tattoo) return channel; } diff --git a/app/core/gimplayer.c b/app/core/gimplayer.c index 72bfd4de06..b8d09c1881 100644 --- a/app/core/gimplayer.c +++ b/app/core/gimplayer.c @@ -75,7 +75,7 @@ static TempBuf * gimp_layer_mask_preview_private (GimpLayer *layer, gint height); -static GimpDrawableClass *parent_class = NULL; +static GimpDrawableClass *parent_class = NULL; GtkType @@ -505,17 +505,6 @@ gimp_layer_create_mask (GimpLayer *layer, return mask; } -void -gimp_layer_delete (GimpLayer *layer) -{ - /* Layers are normally deleted by removing them from the associated - image. The only case where layer_delete() is useful is if you want - to remove a floating layer object that has not been added to an - image yet. We use gtk_object_sink() for this reason here. - */ - gtk_object_sink (GTK_OBJECT (layer)); -} - static void gimp_layer_destroy (GtkObject *object) { diff --git a/app/core/gimplayer.h b/app/core/gimplayer.h index cc31813b21..0cad27fe2b 100644 --- a/app/core/gimplayer.h +++ b/app/core/gimplayer.h @@ -23,13 +23,6 @@ #include "gimpdrawable.h" -/* PDB stuff */ -#define gimp_layer_set_name(l,n) gimp_object_set_name(GIMP_OBJECT(l),(n)) -#define gimp_layer_get_name(l) gimp_object_get_name(GIMP_OBJECT(l)) -#define gimp_layer_set_tattoo(l,t) gimp_drawable_set_tattoo(GIMP_DRAWABLE(l),(t)) -#define gimp_layer_get_tattoo(l) gimp_drawable_get_tattoo(GIMP_DRAWABLE(l)) - - #define GIMP_TYPE_LAYER (gimp_layer_get_type ()) #define GIMP_LAYER(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_LAYER, GimpLayer)) #define GIMP_LAYER_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GIMP_TYPE_LAYER, GimpLayerClass)) @@ -116,7 +109,6 @@ GimpLayerMask * gimp_layer_create_mask (GimpLayer *layer, AddMaskType add_mask_type); GimpLayerMask * gimp_layer_add_mask (GimpLayer *layer, GimpLayerMask *mask); -void gimp_layer_delete (GimpLayer *layer); void gimp_layer_apply_mask (GimpLayer *layer, MaskApplyMode mode); void gimp_layer_translate (GimpLayer *layer, diff --git a/app/core/gimplayermask.h b/app/core/gimplayermask.h index 7e9bd6303e..7f1dfed69b 100644 --- a/app/core/gimplayermask.h +++ b/app/core/gimplayermask.h @@ -75,4 +75,3 @@ GimpLayer * gimp_layer_mask_get_layer (GimpLayerMask *layer_mask); #endif /* __GIMP_LAYER_MASK_H__ */ - diff --git a/app/core/gimpprojection-construct.c b/app/core/gimpprojection-construct.c index be6ad5684e..a733e7d312 100644 --- a/app/core/gimpprojection-construct.c +++ b/app/core/gimpprojection-construct.c @@ -1413,7 +1413,7 @@ gimp_image_set_tattoo_state (GimpImage *gimage, Tattoo ctattoo; channel = (Channel *) channels->data; - ctattoo = channel_get_tattoo (channel); + ctattoo = gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)); if (ctattoo > maxval) maxval = ctattoo; /* Now check path an't got this tattoo */ @@ -2250,7 +2250,7 @@ gimp_image_get_channel_by_tattoo (const GimpImage *gimage, { channel = (Channel *) channels->data; - if (channel_get_tattoo (channel) == tattoo) + if (gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)) == tattoo) return channel; } diff --git a/app/gimpchannel.c b/app/gimpchannel.c index 87c2eeb595..174b27dc3e 100644 --- a/app/gimpchannel.c +++ b/app/gimpchannel.c @@ -208,19 +208,6 @@ channel_copy (const Channel *channel) return new_channel; } -void -channel_set_name (Channel *channel, - const gchar *name) -{ - gimp_object_set_name (GIMP_OBJECT (channel), name); -} - -const gchar * -channel_get_name (const Channel *channel) -{ - return gimp_object_get_name (GIMP_OBJECT (channel)); -} - void channel_set_color (Channel *channel, const GimpRGB *color) @@ -262,17 +249,6 @@ channel_set_opacity (Channel *channel, channel->color.a = opacity / 100.0; } -void -channel_delete (Channel *channel) -{ - /* Channels are normally deleted by removing them from the associated - image. The only case where channel_delete() is useful is if you want - to remove a floating channel object that has not been added to an - image yet. We use gtk_object_sink() for this reason here. - */ - gtk_object_sink (GTK_OBJECT (channel)); -} - static void gimp_channel_destroy (GtkObject *object) { @@ -546,19 +522,6 @@ channel_preview_private (Channel *channel, } } -Tattoo -channel_get_tattoo (const Channel *channel) -{ - return gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)); -} - -void -channel_set_tattoo (Channel *channel, - Tattoo value) -{ - gimp_drawable_set_tattoo (GIMP_DRAWABLE (channel), value); -} - /******************************/ /* selection mask functions */ /******************************/ @@ -1635,7 +1598,7 @@ channel_translate (Channel *mask, copy_region (&srcPR, &destPR); /* free the temporary mask */ - channel_delete (tmp_mask); + gtk_object_unref (GTK_OBJECT (tmp_mask)); } /* calculate new bounds */ diff --git a/app/gimpchannel.h b/app/gimpchannel.h index 0006a7b3f0..9bd6a4b739 100644 --- a/app/gimpchannel.h +++ b/app/gimpchannel.h @@ -96,10 +96,6 @@ Channel * channel_new (GimpImage *gimage, const GimpRGB *color); Channel * channel_copy (const Channel *channel); -const gchar * channel_get_name (const Channel *channel); -void channel_set_name (Channel *channel, - const gchar *name); - gint channel_get_opacity (const Channel *channel); void channel_set_opacity (Channel *channel, gint opacity); @@ -108,7 +104,6 @@ const GimpRGB * channel_get_color (const Channel *channel); void channel_set_color (Channel *channel, const GimpRGB *color); -void channel_delete (Channel *channel); void channel_scale (Channel *channel, gint new_width, gint new_height); @@ -126,10 +121,6 @@ TempBuf * channel_preview (Channel *channel, gint width, gint height); -Tattoo channel_get_tattoo (const Channel *channel); -void channel_set_tattoo (Channel *channel, - Tattoo value); - /* selection mask functions */ Channel * channel_new_mask (GimpImage *gimage, diff --git a/app/gimpdrawable.h b/app/gimpdrawable.h index 55f05e43ed..70d635a60c 100644 --- a/app/gimpdrawable.h +++ b/app/gimpdrawable.h @@ -23,12 +23,6 @@ #include "gimpobject.h" -/* PDB stuff */ -#define gimp_drawable_layer GIMP_IS_LAYER -#define gimp_drawable_layer_mask GIMP_IS_LAYER_MASK -#define gimp_drawable_channel GIMP_IS_CHANNEL - - #define GIMP_TYPE_DRAWABLE (gimp_drawable_get_type ()) #define GIMP_DRAWABLE(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_DRAWABLE, GimpDrawable)) #define GIMP_IS_DRAWABLE(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_DRAWABLE)) diff --git a/app/gimpimage.c b/app/gimpimage.c index be6ad5684e..a733e7d312 100644 --- a/app/gimpimage.c +++ b/app/gimpimage.c @@ -1413,7 +1413,7 @@ gimp_image_set_tattoo_state (GimpImage *gimage, Tattoo ctattoo; channel = (Channel *) channels->data; - ctattoo = channel_get_tattoo (channel); + ctattoo = gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)); if (ctattoo > maxval) maxval = ctattoo; /* Now check path an't got this tattoo */ @@ -2250,7 +2250,7 @@ gimp_image_get_channel_by_tattoo (const GimpImage *gimage, { channel = (Channel *) channels->data; - if (channel_get_tattoo (channel) == tattoo) + if (gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)) == tattoo) return channel; } diff --git a/app/gimplayer.c b/app/gimplayer.c index 72bfd4de06..b8d09c1881 100644 --- a/app/gimplayer.c +++ b/app/gimplayer.c @@ -75,7 +75,7 @@ static TempBuf * gimp_layer_mask_preview_private (GimpLayer *layer, gint height); -static GimpDrawableClass *parent_class = NULL; +static GimpDrawableClass *parent_class = NULL; GtkType @@ -505,17 +505,6 @@ gimp_layer_create_mask (GimpLayer *layer, return mask; } -void -gimp_layer_delete (GimpLayer *layer) -{ - /* Layers are normally deleted by removing them from the associated - image. The only case where layer_delete() is useful is if you want - to remove a floating layer object that has not been added to an - image yet. We use gtk_object_sink() for this reason here. - */ - gtk_object_sink (GTK_OBJECT (layer)); -} - static void gimp_layer_destroy (GtkObject *object) { diff --git a/app/gimplayer.h b/app/gimplayer.h index cc31813b21..0cad27fe2b 100644 --- a/app/gimplayer.h +++ b/app/gimplayer.h @@ -23,13 +23,6 @@ #include "gimpdrawable.h" -/* PDB stuff */ -#define gimp_layer_set_name(l,n) gimp_object_set_name(GIMP_OBJECT(l),(n)) -#define gimp_layer_get_name(l) gimp_object_get_name(GIMP_OBJECT(l)) -#define gimp_layer_set_tattoo(l,t) gimp_drawable_set_tattoo(GIMP_DRAWABLE(l),(t)) -#define gimp_layer_get_tattoo(l) gimp_drawable_get_tattoo(GIMP_DRAWABLE(l)) - - #define GIMP_TYPE_LAYER (gimp_layer_get_type ()) #define GIMP_LAYER(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_LAYER, GimpLayer)) #define GIMP_LAYER_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GIMP_TYPE_LAYER, GimpLayerClass)) @@ -116,7 +109,6 @@ GimpLayerMask * gimp_layer_create_mask (GimpLayer *layer, AddMaskType add_mask_type); GimpLayerMask * gimp_layer_add_mask (GimpLayer *layer, GimpLayerMask *mask); -void gimp_layer_delete (GimpLayer *layer); void gimp_layer_apply_mask (GimpLayer *layer, MaskApplyMode mode); void gimp_layer_translate (GimpLayer *layer, diff --git a/app/gimplayermask.h b/app/gimplayermask.h index 7e9bd6303e..7f1dfed69b 100644 --- a/app/gimplayermask.h +++ b/app/gimplayermask.h @@ -75,4 +75,3 @@ GimpLayer * gimp_layer_mask_get_layer (GimpLayerMask *layer_mask); #endif /* __GIMP_LAYER_MASK_H__ */ - diff --git a/app/gui/channels-dialog.c b/app/gui/channels-dialog.c index 4ba16fa071..45a3d4c5d8 100644 --- a/app/gui/channels-dialog.c +++ b/app/gui/channels-dialog.c @@ -1094,8 +1094,8 @@ channels_dialog_add_channel_to_sel_callback (GtkWidget *widget, gpointer data) { GimpImage *gimage; - Channel *active_channel; - Channel *new_channel; + Channel *active_channel; + Channel *new_channel; if (!channelsD || !(gimage = channelsD->gimage)) return; @@ -1108,7 +1108,7 @@ channels_dialog_add_channel_to_sel_callback (GtkWidget *widget, CHANNEL_OP_ADD, 0, 0); /* off x/y */ gimage_mask_load (gimage, new_channel); - channel_delete (new_channel); + gtk_object_unref (GTK_OBJECT (new_channel)); gdisplays_flush (); } } @@ -1118,8 +1118,8 @@ channels_dialog_sub_channel_from_sel_callback (GtkWidget *widget, gpointer data) { GimpImage *gimage; - Channel *active_channel; - Channel *new_channel; + Channel *active_channel; + Channel *new_channel; if (!channelsD || !(gimage = channelsD->gimage)) return; @@ -1132,7 +1132,7 @@ channels_dialog_sub_channel_from_sel_callback (GtkWidget *widget, CHANNEL_OP_SUB, 0, 0); /* off x/y */ gimage_mask_load (gimage, new_channel); - channel_delete (new_channel); + gtk_object_unref (GTK_OBJECT (new_channel)); gdisplays_flush (); } } @@ -1142,8 +1142,8 @@ channels_dialog_intersect_channel_with_sel_callback (GtkWidget *widget, gpointer data) { GimpImage *gimage; - Channel *active_channel; - Channel *new_channel; + Channel *active_channel; + Channel *new_channel; if (!channelsD || !(gimage = channelsD->gimage)) return; @@ -1156,7 +1156,7 @@ channels_dialog_intersect_channel_with_sel_callback (GtkWidget *widget, CHANNEL_OP_INTERSECT, 0, 0); /* off x/y */ gimage_mask_load (gimage, new_channel); - channel_delete (new_channel); + gtk_object_unref (GTK_OBJECT (new_channel)); gdisplays_flush (); } } diff --git a/app/gui/toolbox.c b/app/gui/toolbox.c index 06ab14f733..9e8a971de6 100644 --- a/app/gui/toolbox.c +++ b/app/gui/toolbox.c @@ -765,8 +765,8 @@ toolbox_drag_drop (GtkWidget *widget, gimp_drawable_set_gimage (GIMP_DRAWABLE (new_layer), new_gimage); - gimp_layer_set_name (GIMP_LAYER (new_layer), - gimp_object_get_name (GIMP_OBJECT (drawable))); + gimp_object_set_name (GIMP_OBJECT (new_layer), + gimp_object_get_name (GIMP_OBJECT (drawable))); if (layer) { diff --git a/app/layer.c b/app/layer.c index 72bfd4de06..b8d09c1881 100644 --- a/app/layer.c +++ b/app/layer.c @@ -75,7 +75,7 @@ static TempBuf * gimp_layer_mask_preview_private (GimpLayer *layer, gint height); -static GimpDrawableClass *parent_class = NULL; +static GimpDrawableClass *parent_class = NULL; GtkType @@ -505,17 +505,6 @@ gimp_layer_create_mask (GimpLayer *layer, return mask; } -void -gimp_layer_delete (GimpLayer *layer) -{ - /* Layers are normally deleted by removing them from the associated - image. The only case where layer_delete() is useful is if you want - to remove a floating layer object that has not been added to an - image yet. We use gtk_object_sink() for this reason here. - */ - gtk_object_sink (GTK_OBJECT (layer)); -} - static void gimp_layer_destroy (GtkObject *object) { diff --git a/app/layer.h b/app/layer.h index cc31813b21..0cad27fe2b 100644 --- a/app/layer.h +++ b/app/layer.h @@ -23,13 +23,6 @@ #include "gimpdrawable.h" -/* PDB stuff */ -#define gimp_layer_set_name(l,n) gimp_object_set_name(GIMP_OBJECT(l),(n)) -#define gimp_layer_get_name(l) gimp_object_get_name(GIMP_OBJECT(l)) -#define gimp_layer_set_tattoo(l,t) gimp_drawable_set_tattoo(GIMP_DRAWABLE(l),(t)) -#define gimp_layer_get_tattoo(l) gimp_drawable_get_tattoo(GIMP_DRAWABLE(l)) - - #define GIMP_TYPE_LAYER (gimp_layer_get_type ()) #define GIMP_LAYER(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_LAYER, GimpLayer)) #define GIMP_LAYER_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GIMP_TYPE_LAYER, GimpLayerClass)) @@ -116,7 +109,6 @@ GimpLayerMask * gimp_layer_create_mask (GimpLayer *layer, AddMaskType add_mask_type); GimpLayerMask * gimp_layer_add_mask (GimpLayer *layer, GimpLayerMask *mask); -void gimp_layer_delete (GimpLayer *layer); void gimp_layer_apply_mask (GimpLayer *layer, MaskApplyMode mode); void gimp_layer_translate (GimpLayer *layer, diff --git a/app/pdb/Makefile.am b/app/pdb/Makefile.am index 70d2f2ada5..89c4d03285 100644 --- a/app/pdb/Makefile.am +++ b/app/pdb/Makefile.am @@ -3,6 +3,7 @@ noinst_LTLIBRARIES = libapppdb.la libapppdb_la_SOURCES = \ + pdb_glue.h \ internal_procs.c \ internal_procs.h \ procedural_db.c \ diff --git a/app/pdb/channel_cmds.c b/app/pdb/channel_cmds.c index 35a6d57dcd..213311ce2d 100644 --- a/app/pdb/channel_cmds.c +++ b/app/pdb/channel_cmds.c @@ -29,6 +29,7 @@ #include "channel.h" #include "drawable.h" #include "gimpimage.h" +#include "pdb_glue.h" #include "libgimpcolor/gimpcolor.h" @@ -249,7 +250,7 @@ channel_delete_invoker (Argument *args) success = FALSE; if (success) - channel_delete (channel); + gtk_object_sink (GTK_OBJECT (channel)); return procedural_db_return_args (&channel_delete_proc, success); } diff --git a/app/pdb/drawable_cmds.c b/app/pdb/drawable_cmds.c index 1292f25070..3c9cbcae41 100644 --- a/app/pdb/drawable_cmds.c +++ b/app/pdb/drawable_cmds.c @@ -31,6 +31,7 @@ #include "drawable.h" #include "gimplayermask.h" #include "layer.h" +#include "pdb_glue.h" #include "temp_buf.h" #include "tile.h" #include "tile_manager.h" diff --git a/app/pdb/layer_cmds.c b/app/pdb/layer_cmds.c index b663654e14..f2f7ae8b4a 100644 --- a/app/pdb/layer_cmds.c +++ b/app/pdb/layer_cmds.c @@ -31,6 +31,7 @@ #include "floating_sel.h" #include "gimpimage.h" #include "layer.h" +#include "pdb_glue.h" #include "undo.h" static ProcRecord layer_new_proc; @@ -554,7 +555,7 @@ layer_delete_invoker (Argument *args) success = FALSE; if (success) - gimp_layer_delete (layer); + gtk_object_sink (GTK_OBJECT (layer)); return procedural_db_return_args (&layer_delete_proc, success); } diff --git a/app/pdb/pdb_glue.h b/app/pdb/pdb_glue.h new file mode 100644 index 0000000000..9ede3995b9 --- /dev/null +++ b/app/pdb/pdb_glue.h @@ -0,0 +1,38 @@ +/* The GIMP -- an image manipulation program + * Copyright (C) 1995 Spencer Kimball and Peter Mattis + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef __PDB_GLUE_H__ +#define __PDB_GLUE_H__ + + +#define gimp_drawable_layer GIMP_IS_LAYER +#define gimp_drawable_layer_mask GIMP_IS_LAYER_MASK +#define gimp_drawable_channel GIMP_IS_CHANNEL + +#define gimp_layer_set_name(l,n) gimp_object_set_name(GIMP_OBJECT(l),(n)) +#define gimp_layer_get_name(l) gimp_object_get_name(GIMP_OBJECT(l)) +#define gimp_layer_set_tattoo(l,t) gimp_drawable_set_tattoo(GIMP_DRAWABLE(l),(t)) +#define gimp_layer_get_tattoo(l) gimp_drawable_get_tattoo(GIMP_DRAWABLE(l)) + +#define channel_set_name(c,n) gimp_object_set_name(GIMP_OBJECT(c),(n)) +#define channel_get_name(c) gimp_object_get_name(GIMP_OBJECT(c)) +#define channel_set_tattoo(c,t) gimp_drawable_set_tattoo(GIMP_DRAWABLE(c),(t)) +#define channel_get_tattoo(c) gimp_drawable_get_tattoo(GIMP_DRAWABLE(c)) + + +#endif /* __PDB_GLUE_H__ */ diff --git a/app/pdb/selection_cmds.c b/app/pdb/selection_cmds.c index 2d85949408..368c4a1da5 100644 --- a/app/pdb/selection_cmds.c +++ b/app/pdb/selection_cmds.c @@ -1009,7 +1009,7 @@ selection_combine_invoker (Argument *args) operation, 0, 0); /* off x/y */ gimage_mask_load (gimage, new_channel); - channel_delete (new_channel); + gtk_object_unref (GTK_OBJECT (new_channel)); } else success = FALSE; diff --git a/app/toolbox.c b/app/toolbox.c index 06ab14f733..9e8a971de6 100644 --- a/app/toolbox.c +++ b/app/toolbox.c @@ -765,8 +765,8 @@ toolbox_drag_drop (GtkWidget *widget, gimp_drawable_set_gimage (GIMP_DRAWABLE (new_layer), new_gimage); - gimp_layer_set_name (GIMP_LAYER (new_layer), - gimp_object_get_name (GIMP_OBJECT (drawable))); + gimp_object_set_name (GIMP_OBJECT (new_layer), + gimp_object_get_name (GIMP_OBJECT (drawable))); if (layer) { diff --git a/app/tools/bezier_select.c b/app/tools/bezier_select.c index 349b17b36a..3a09996bfa 100644 --- a/app/tools/bezier_select.c +++ b/app/tools/bezier_select.c @@ -2448,7 +2448,7 @@ bezier_convert (BezierSelect *bezier_sel, /* destroy previous mask */ if (bezier_sel->mask) { - channel_delete (bezier_sel->mask); + gtk_object_unref (GTK_OBJECT (bezier_sel->mask)); bezier_sel->mask = NULL; } diff --git a/app/tools/bucket_fill.c b/app/tools/bucket_fill.c index 2ef2bed561..cca7337c6a 100644 --- a/app/tools/bucket_fill.c +++ b/app/tools/bucket_fill.c @@ -500,7 +500,7 @@ bucket_fill (GimpImage *gimage, /* free the mask */ if (mask) - channel_delete (mask); + gtk_object_unref (GTK_OBJECT (mask)); if (new_buf) temp_buf_free (pat_buf); diff --git a/app/tools/by_color_select.c b/app/tools/by_color_select.c index 6e5dc668ca..658c730212 100644 --- a/app/tools/by_color_select.c +++ b/app/tools/by_color_select.c @@ -367,7 +367,7 @@ by_color_select (GImage *gimage, channel_combine_mask (gimp_image_get_mask (gimage), new_mask, op, off_x, off_y); - channel_delete (new_mask); + gtk_object_unref (GTK_OBJECT (new_mask)); } /* by_color select action functions */ diff --git a/app/tools/ellipse_select.c b/app/tools/ellipse_select.c index 227e9b670e..c51d602404 100644 --- a/app/tools/ellipse_select.c +++ b/app/tools/ellipse_select.c @@ -76,14 +76,14 @@ ellipse_select (GimpImage *gimage, feather_radius, feather_radius, op, 0, 0); - channel_delete (new_mask); + gtk_object_unref (GTK_OBJECT (new_mask)); } else if (op == SELECTION_INTERSECT) { new_mask = channel_new_mask (gimage, gimage->width, gimage->height); channel_combine_ellipse (new_mask, CHANNEL_OP_ADD, x, y, w, h, antialias); channel_combine_mask (gimp_image_get_mask (gimage), new_mask, op, 0, 0); - channel_delete (new_mask); + gtk_object_unref (GTK_OBJECT (new_mask)); } else channel_combine_ellipse (gimp_image_get_mask (gimage), op, diff --git a/app/tools/free_select.c b/app/tools/free_select.c index 39173a724d..d8f2808b91 100644 --- a/app/tools/free_select.c +++ b/app/tools/free_select.c @@ -166,7 +166,8 @@ free_select (GImage *gimage, else channel_combine_mask (gimp_image_get_mask (gimage), mask, op, 0, 0); - channel_delete (mask); + + gtk_object_unref (GTK_OBJECT (mask)); } } diff --git a/app/tools/fuzzy_select.c b/app/tools/fuzzy_select.c index b77d4e1e03..e64ef681e1 100644 --- a/app/tools/fuzzy_select.c +++ b/app/tools/fuzzy_select.c @@ -391,8 +391,7 @@ fuzzy_select (GImage *gimage, channel_combine_mask (gimp_image_get_mask (gimage), fuzzy_mask, op, off_x, off_y); - /* free the fuzzy region struct */ - channel_delete (fuzzy_mask); + gtk_object_unref (GTK_OBJECT (fuzzy_mask)); fuzzy_mask = NULL; } diff --git a/app/tools/gimpbucketfilltool.c b/app/tools/gimpbucketfilltool.c index 2ef2bed561..cca7337c6a 100644 --- a/app/tools/gimpbucketfilltool.c +++ b/app/tools/gimpbucketfilltool.c @@ -500,7 +500,7 @@ bucket_fill (GimpImage *gimage, /* free the mask */ if (mask) - channel_delete (mask); + gtk_object_unref (GTK_OBJECT (mask)); if (new_buf) temp_buf_free (pat_buf); diff --git a/app/tools/gimpbycolorselecttool.c b/app/tools/gimpbycolorselecttool.c index 6e5dc668ca..658c730212 100644 --- a/app/tools/gimpbycolorselecttool.c +++ b/app/tools/gimpbycolorselecttool.c @@ -367,7 +367,7 @@ by_color_select (GImage *gimage, channel_combine_mask (gimp_image_get_mask (gimage), new_mask, op, off_x, off_y); - channel_delete (new_mask); + gtk_object_unref (GTK_OBJECT (new_mask)); } /* by_color select action functions */ diff --git a/app/tools/gimpellipseselecttool.c b/app/tools/gimpellipseselecttool.c index 227e9b670e..c51d602404 100644 --- a/app/tools/gimpellipseselecttool.c +++ b/app/tools/gimpellipseselecttool.c @@ -76,14 +76,14 @@ ellipse_select (GimpImage *gimage, feather_radius, feather_radius, op, 0, 0); - channel_delete (new_mask); + gtk_object_unref (GTK_OBJECT (new_mask)); } else if (op == SELECTION_INTERSECT) { new_mask = channel_new_mask (gimage, gimage->width, gimage->height); channel_combine_ellipse (new_mask, CHANNEL_OP_ADD, x, y, w, h, antialias); channel_combine_mask (gimp_image_get_mask (gimage), new_mask, op, 0, 0); - channel_delete (new_mask); + gtk_object_unref (GTK_OBJECT (new_mask)); } else channel_combine_ellipse (gimp_image_get_mask (gimage), op, diff --git a/app/tools/gimpfreeselecttool.c b/app/tools/gimpfreeselecttool.c index 39173a724d..d8f2808b91 100644 --- a/app/tools/gimpfreeselecttool.c +++ b/app/tools/gimpfreeselecttool.c @@ -166,7 +166,8 @@ free_select (GImage *gimage, else channel_combine_mask (gimp_image_get_mask (gimage), mask, op, 0, 0); - channel_delete (mask); + + gtk_object_unref (GTK_OBJECT (mask)); } } diff --git a/app/tools/gimpfuzzyselecttool.c b/app/tools/gimpfuzzyselecttool.c index b77d4e1e03..e64ef681e1 100644 --- a/app/tools/gimpfuzzyselecttool.c +++ b/app/tools/gimpfuzzyselecttool.c @@ -391,8 +391,7 @@ fuzzy_select (GImage *gimage, channel_combine_mask (gimp_image_get_mask (gimage), fuzzy_mask, op, off_x, off_y); - /* free the fuzzy region struct */ - channel_delete (fuzzy_mask); + gtk_object_unref (GTK_OBJECT (fuzzy_mask)); fuzzy_mask = NULL; } diff --git a/app/tools/gimpiscissorstool.c b/app/tools/gimpiscissorstool.c index 54a0eeddff..70a99eb133 100644 --- a/app/tools/gimpiscissorstool.c +++ b/app/tools/gimpiscissorstool.c @@ -549,7 +549,7 @@ iscissors_convert (Iscissors *iscissors, } if (iscissors->mask) - channel_delete (iscissors->mask); + gtk_object_unref (GTK_OBJECT (iscissors->mask)); iscissors->mask = scan_converter_to_channel (sc, gdisp->gimage); scan_converter_free (sc); @@ -1139,8 +1139,10 @@ iscissors_reset (Iscissors *iscissors) /* free mask */ if (iscissors->mask) - channel_delete (iscissors->mask); - iscissors->mask = NULL; + { + gtk_object_unref (GTK_OBJECT (iscissors->mask)); + iscissors->mask = NULL; + } /* free the gradient map */ if (iscissors->gradient_map) diff --git a/app/tools/gimprectselecttool.c b/app/tools/gimprectselecttool.c index c220614ac6..5b459841c2 100644 --- a/app/tools/gimprectselecttool.c +++ b/app/tools/gimprectselecttool.c @@ -104,14 +104,14 @@ rect_select (GimpImage *gimage, feather_radius, feather_radius, op, 0, 0); - channel_delete (new_mask); + gtk_object_unref (GTK_OBJECT (new_mask)); } else if (op == SELECTION_INTERSECT) { new_mask = channel_new_mask (gimage, gimage->width, gimage->height); channel_combine_rect (new_mask, CHANNEL_OP_ADD, x, y, w, h); channel_combine_mask (gimp_image_get_mask (gimage), new_mask, op, 0, 0); - channel_delete (new_mask); + gtk_object_unref (GTK_OBJECT (new_mask)); } else channel_combine_rect (gimp_image_get_mask (gimage), op, x, y, w, h); diff --git a/app/tools/gimpregionselecttool.c b/app/tools/gimpregionselecttool.c index b77d4e1e03..e64ef681e1 100644 --- a/app/tools/gimpregionselecttool.c +++ b/app/tools/gimpregionselecttool.c @@ -391,8 +391,7 @@ fuzzy_select (GImage *gimage, channel_combine_mask (gimp_image_get_mask (gimage), fuzzy_mask, op, off_x, off_y); - /* free the fuzzy region struct */ - channel_delete (fuzzy_mask); + gtk_object_unref (GTK_OBJECT (fuzzy_mask)); fuzzy_mask = NULL; } diff --git a/app/tools/iscissors.c b/app/tools/iscissors.c index 54a0eeddff..70a99eb133 100644 --- a/app/tools/iscissors.c +++ b/app/tools/iscissors.c @@ -549,7 +549,7 @@ iscissors_convert (Iscissors *iscissors, } if (iscissors->mask) - channel_delete (iscissors->mask); + gtk_object_unref (GTK_OBJECT (iscissors->mask)); iscissors->mask = scan_converter_to_channel (sc, gdisp->gimage); scan_converter_free (sc); @@ -1139,8 +1139,10 @@ iscissors_reset (Iscissors *iscissors) /* free mask */ if (iscissors->mask) - channel_delete (iscissors->mask); - iscissors->mask = NULL; + { + gtk_object_unref (GTK_OBJECT (iscissors->mask)); + iscissors->mask = NULL; + } /* free the gradient map */ if (iscissors->gradient_map) diff --git a/app/tools/rect_select.c b/app/tools/rect_select.c index c220614ac6..5b459841c2 100644 --- a/app/tools/rect_select.c +++ b/app/tools/rect_select.c @@ -104,14 +104,14 @@ rect_select (GimpImage *gimage, feather_radius, feather_radius, op, 0, 0); - channel_delete (new_mask); + gtk_object_unref (GTK_OBJECT (new_mask)); } else if (op == SELECTION_INTERSECT) { new_mask = channel_new_mask (gimage, gimage->width, gimage->height); channel_combine_rect (new_mask, CHANNEL_OP_ADD, x, y, w, h); channel_combine_mask (gimp_image_get_mask (gimage), new_mask, op, 0, 0); - channel_delete (new_mask); + gtk_object_unref (GTK_OBJECT (new_mask)); } else channel_combine_rect (gimp_image_get_mask (gimage), op, x, y, w, h); diff --git a/app/undo.c b/app/undo.c index 2f5bb22a9b..9e0c7f9556 100644 --- a/app/undo.c +++ b/app/undo.c @@ -1439,7 +1439,9 @@ undo_push_layer (GimpImage *gimage, /* if this is a remove layer, delete the layer */ if (type == LAYER_REMOVE_UNDO) gtk_object_unref (GTK_OBJECT (lu->layer)); + g_free (lu); + return FALSE; } } @@ -1797,7 +1799,7 @@ undo_push_channel (GimpImage *gimage, else { if (type == CHANNEL_REMOVE_UNDO) - channel_delete (cu->channel); + gtk_object_unref (GTK_OBJECT (cu->channel)); g_free (cu); return FALSE; } @@ -1870,7 +1872,7 @@ undo_free_channel (UndoState state, */ if ((state == REDO && type == CHANNEL_ADD_UNDO) || (state == UNDO && type == CHANNEL_REMOVE_UNDO)) - channel_delete (cu->channel); + gtk_object_unref (GTK_OBJECT (cu->channel)); g_free (cu); } diff --git a/app/widgets/gimptoolbox.c b/app/widgets/gimptoolbox.c index 06ab14f733..9e8a971de6 100644 --- a/app/widgets/gimptoolbox.c +++ b/app/widgets/gimptoolbox.c @@ -765,8 +765,8 @@ toolbox_drag_drop (GtkWidget *widget, gimp_drawable_set_gimage (GIMP_DRAWABLE (new_layer), new_gimage); - gimp_layer_set_name (GIMP_LAYER (new_layer), - gimp_object_get_name (GIMP_OBJECT (drawable))); + gimp_object_set_name (GIMP_OBJECT (new_layer), + gimp_object_get_name (GIMP_OBJECT (drawable))); if (layer) { diff --git a/app/xcf.c b/app/xcf.c index 8e5a39fd47..0e6c158882 100644 --- a/app/xcf.c +++ b/app/xcf.c @@ -2148,7 +2148,7 @@ xcf_load_channel_props (XcfInfo *info, info->active_channel = channel; break; case PROP_SELECTION: - channel_delete (gimage->selection_mask); + gtk_object_unref (GTK_OBJECT (gimage->selection_mask)); gimage->selection_mask = channel; channel->boundary_known = FALSE; channel->bounds_known = FALSE; @@ -2352,7 +2352,7 @@ xcf_load_channel (XcfInfo *info, /* read in the hierarchy */ xcf_seek_pos (info, hierarchy_offset); - if (!xcf_load_hierarchy (info, GIMP_DRAWABLE(channel)->tiles)) + if (!xcf_load_hierarchy (info, GIMP_DRAWABLE (channel)->tiles)) goto error; /* attach the floating selection... */ @@ -2361,13 +2361,13 @@ xcf_load_channel (XcfInfo *info, GimpLayer *floating_sel; floating_sel = info->floating_sel; - floating_sel_attach (floating_sel, GIMP_DRAWABLE(channel)); + floating_sel_attach (floating_sel, GIMP_DRAWABLE (channel)); } return channel; error: - channel_delete (channel); + gtk_object_unref (GTK_OBJECT (channel)); return NULL; } diff --git a/app/xcf/xcf.c b/app/xcf/xcf.c index 8e5a39fd47..0e6c158882 100644 --- a/app/xcf/xcf.c +++ b/app/xcf/xcf.c @@ -2148,7 +2148,7 @@ xcf_load_channel_props (XcfInfo *info, info->active_channel = channel; break; case PROP_SELECTION: - channel_delete (gimage->selection_mask); + gtk_object_unref (GTK_OBJECT (gimage->selection_mask)); gimage->selection_mask = channel; channel->boundary_known = FALSE; channel->bounds_known = FALSE; @@ -2352,7 +2352,7 @@ xcf_load_channel (XcfInfo *info, /* read in the hierarchy */ xcf_seek_pos (info, hierarchy_offset); - if (!xcf_load_hierarchy (info, GIMP_DRAWABLE(channel)->tiles)) + if (!xcf_load_hierarchy (info, GIMP_DRAWABLE (channel)->tiles)) goto error; /* attach the floating selection... */ @@ -2361,13 +2361,13 @@ xcf_load_channel (XcfInfo *info, GimpLayer *floating_sel; floating_sel = info->floating_sel; - floating_sel_attach (floating_sel, GIMP_DRAWABLE(channel)); + floating_sel_attach (floating_sel, GIMP_DRAWABLE (channel)); } return channel; error: - channel_delete (channel); + gtk_object_unref (GTK_OBJECT (channel)); return NULL; } diff --git a/tools/pdbgen/pdb/channel.pdb b/tools/pdbgen/pdb/channel.pdb index 521bacaabe..59259b825a 100644 --- a/tools/pdbgen/pdb/channel.pdb +++ b/tools/pdbgen/pdb/channel.pdb @@ -210,7 +210,7 @@ HELP @inargs = ( &channel_arg ); $inargs[0]->{desc} .= ' to delete'; - %invoke = ( code => 'channel_delete (channel);' ); + %invoke = ( code => 'gtk_object_sink (GTK_OBJECT (channel));' ); } sub channel_combine_masks { @@ -278,7 +278,7 @@ HELP $date = '1998'; CODE -@headers = qw("channel.h"); +@headers = qw("channel.h" "pdb_glue.h"); unshift @procs, qw(channel_new channel_copy channel_delete channel_combine_masks); diff --git a/tools/pdbgen/pdb/drawable.pdb b/tools/pdbgen/pdb/drawable.pdb index 966fa194e5..4a0363ea96 100644 --- a/tools/pdbgen/pdb/drawable.pdb +++ b/tools/pdbgen/pdb/drawable.pdb @@ -499,8 +499,8 @@ CODE ); } -@headers = qw("gimplayermask.h" "drawable.h" "tile.h" "tile_manager.h" - "temp_buf.h"); +@headers = qw("gimplayermask.h" "drawable.h" "pdb_glue.h" "tile.h" + "tile_manager.h" "temp_buf.h"); @procs = qw(drawable_merge_shadow drawable_fill drawable_update drawable_mask_bounds drawable_image drawable_type diff --git a/tools/pdbgen/pdb/layer.pdb b/tools/pdbgen/pdb/layer.pdb index 89f938d954..eb4338e157 100644 --- a/tools/pdbgen/pdb/layer.pdb +++ b/tools/pdbgen/pdb/layer.pdb @@ -352,7 +352,7 @@ HELP @inargs = ( &layer_arg ); $inargs[0]->{desc} .= ' to delete'; - %invoke = ( code => 'gimp_layer_delete (layer);' ); + %invoke = ( code => 'gtk_object_sink (GTK_OBJECT (layer));' ); } sub layer_translate { @@ -543,7 +543,7 @@ HELP $date = '1998'; CODE -@headers = qw("layer.h" "gimpimage.h"); +@headers = qw("layer.h" "gimpimage.h" "pdb_glue.h"); unshift @procs, qw(layer_new layer_copy layer_create_mask layer_scale layer_resize layer_delete layer_translate layer_add_alpha diff --git a/tools/pdbgen/pdb/selection.pdb b/tools/pdbgen/pdb/selection.pdb index eb9e004013..8467302fbd 100644 --- a/tools/pdbgen/pdb/selection.pdb +++ b/tools/pdbgen/pdb/selection.pdb @@ -372,7 +372,7 @@ HELP operation, 0, 0); /* off x/y */ gimage_mask_load (gimage, new_channel); - channel_delete (new_channel); + gtk_object_unref (GTK_OBJECT (new_channel)); } else success = FALSE;