app/channel_cmds.c app/layer_cmds.c libgimp/gimpchannel_pdb.c

2000-12-28  Sven Neumann  <sven@gimp.org>

	* app/channel_cmds.c
	* app/layer_cmds.c
	* libgimp/gimpchannel_pdb.c
	* libgimp/gimplayer_pdb.c
	* plug-ins/common/warp.c
	* plug-ins/gap/gap_exchange_image.c
	* plug-ins/gap/gap_range_ops.c
	* plug-ins/perl/examples/bricks
	* plug-ins/perl/examples/glowing_steel
	* tools/pdbgen/pdb/channel.pdb
	* tools/pdbgen/pdb/layer.pdb:

	Two of the gimp-perl scripts used to call gimp_layer_delete() after
	gimp_image_remove_layer(). This will fail since the layer is already
	scheduled for destruction by removing it from the associated image or
	by deleting that image. It is thus dangerous and superfluous to export
	this feature through the PDB. The gimp_layer_delete() is hereby
	obsolete and does nothing any longer. I have removed the code calling
	it from all over the place (it was commented out in almost all places).

	The PDB help for gimp_channel_delete() now explicetly tells the user
	about the proper usage of the procedure.
This commit is contained in:
Sven Neumann 2000-12-27 23:49:17 +00:00 committed by Sven Neumann
parent 7355ee111c
commit 243c5f4929
12 changed files with 48 additions and 41 deletions

View File

@ -1,3 +1,28 @@
2000-12-28 Sven Neumann <sven@gimp.org>
* app/channel_cmds.c
* app/layer_cmds.c
* libgimp/gimpchannel_pdb.c
* libgimp/gimplayer_pdb.c
* plug-ins/common/warp.c
* plug-ins/gap/gap_exchange_image.c
* plug-ins/gap/gap_range_ops.c
* plug-ins/perl/examples/bricks
* plug-ins/perl/examples/glowing_steel
* tools/pdbgen/pdb/channel.pdb
* tools/pdbgen/pdb/layer.pdb:
Two of the gimp-perl scripts used to call gimp_layer_delete() after
gimp_image_remove_layer(). This will fail since the layer is already
scheduled for destruction by removing it from the associated image or
by deleting that image. It is thus dangerous and superfluous to export
this feature through the PDB. The gimp_layer_delete() is hereby
obsolete and does nothing any longer. I have removed the code calling
it from all over the place (it was commented out in almost all places).
The PDB help for gimp_channel_delete() now explicetly tells the user
about the proper usage of the procedure.
2000-12-28 Michael Natterer <mitch@gimp.org>
* app/bezier_select.[ch]

View File

@ -255,7 +255,7 @@ static ProcRecord channel_delete_proc =
{
"gimp_channel_delete",
"Delete a channel.",
"This procedure deletes the specified channel. This does not need to be done if a gimage containing this channel was already deleted.",
"This procedure deletes the specified channel. This must not be done if the gimage containing this channel was already deleted or if the channel was already removed from the image. The only case in which this procedure is useful is if you want to get rid of a channel which has not yet been added to an image.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",

View File

@ -546,9 +546,6 @@ layer_delete_invoker (Argument *args)
if (layer == NULL)
success = FALSE;
if (success)
layer_delete (layer);
return procedural_db_return_args (&layer_delete_proc, success);
}
@ -565,7 +562,7 @@ static ProcRecord layer_delete_proc =
{
"gimp_layer_delete",
"Delete a layer.",
"This procedure deletes the specified layer. This does not need to be done if a gimage containing this layer was already deleted.",
"This procedure is obsolete and does nothing. Layers are automatically deleted when removed from an image or if the associated image is destroyed.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",

View File

@ -119,8 +119,11 @@ gimp_channel_copy (gint32 channel_ID)
*
* Delete a channel.
*
* This procedure deletes the specified channel. This does not need to
* be done if a gimage containing this channel was already deleted.
* This procedure deletes the specified channel. This must not be done
* if the gimage containing this channel was already deleted or if the
* channel was already removed from the image. The only case in which
* this procedure is useful is if you want to get rid of a channel
* which has not yet been added to an image.
*
* Returns: TRUE on success.
*/

View File

@ -247,8 +247,9 @@ gimp_layer_resize (gint32 layer_ID,
*
* Delete a layer.
*
* This procedure deletes the specified layer. This does not need to be
* done if a gimage containing this layer was already deleted.
* This procedure is obsolete and does nothing. Layers are
* automatically deleted when removed from an image or if the
* associated image is destroyed.
*
* Returns: TRUE on success.
*/

View File

@ -381,24 +381,13 @@ run (gchar *name,
values[0].data.d_status = status;
image_ID = gimp_layer_get_image_id(map_x->id);
gimp_image_delete(image_ID);
gimp_displays_flush();
/*
if (display_diff_map == FALSE) {
gimp_layer_delete(map_x->id);
gimp_layer_delete(map_y->id);
} else {
image_ID = gimp_layer_get_image_id(drawable->id);
gimp_image_undo_disable(image_ID);
gimp_image_undo_enable(image_ID);
}
*/
image_ID = gimp_layer_get_image_id (map_x->id);
gimp_drawable_detach (map_x);
gimp_drawable_detach (map_y);
gimp_image_delete (image_ID);
if (run_mode != GIMP_RUN_NONINTERACTIVE)
gimp_displays_flush ();
}

View File

@ -404,7 +404,6 @@ p_replace_img(gint32 image_id, gint32 src_image_id)
{
l_channel_id = l_channels_list[l_idx];
gimp_image_remove_channel(image_id, l_channel_id);
gimp_channel_delete(l_channel_id);
}
if(l_channels_list) { g_free (l_channels_list); }
@ -470,7 +469,6 @@ p_replace_img(gint32 image_id, gint32 src_image_id)
{
if(gap_debug) printf("GAP-DEBUG: p_replace_img del layer_id=%d \n", (int)l_layer_id);
gimp_image_remove_layer(image_id, l_layer_id);
/* gimp_layer_delete(l_layer_id); */ /* did crash in gimp 1.0.2 ?? and in 1.1 too */
}
}
@ -482,7 +480,6 @@ p_replace_img(gint32 image_id, gint32 src_image_id)
/* now delete the (old) background layer */
if(gap_debug) printf("GAP-DEBUG: p_replace_img del (old bg) layer_id=%d \n", (int)l_old_bg_layer_id);
gimp_image_remove_layer(image_id, l_old_bg_layer_id);
/* gimp_layer_delete(l_old_bg_layer_id); */ /* did crash in gimp 1.0.2 ?? and in 1.1 too */
}
if (l_layers_list) { g_free (l_layers_list); }

View File

@ -1583,13 +1583,6 @@ p_frames_layer_del(t_anim_info *ainfo_ptr,
/* remove and delete requested layer */
gimp_image_remove_layer(l_tmp_image_id, l_tmp_layer_id);
/* gimp_layer_delete(l_tmp_layer_id); */ /* gives sigsegv ERROR */
/* A: gimp_image_remove_layer does automatic delete
* if layer is not attched to any image
* B: gimp_layer_delete has a BUG
*/
/* save current frame */
l_rc = p_save_named_frame(l_tmp_image_id, ainfo_ptr->new_filename);
}

View File

@ -112,8 +112,8 @@ sub do_bricks {
gimp_floating_sel_anchor(gimp_image_floating_selection($image));
gimp_image_add_layer_mask($image,$layerb,$mask);
gimp_selection_none($image);
gimp_image_remove_layer ($border); gimp_layer_delete ($border);
gimp_image_remove_layer ($layer); gimp_layer_delete ($layer);
gimp_image_remove_layer ($border);
gimp_image_remove_layer ($layer);
gimp_image_remove_layer_mask ($image,$layerb,0);
gimp_channel_ops_offset ($layerpat,1,0,-1,-1);
gimp_channel_ops_offset ($layerb,1,0,-1,-1);

View File

@ -200,7 +200,6 @@ sub perl_fu_brushed_metal {
gimp_layer_set_offsets($float, $x1+$length, $y1+$length);
gimp_floating_sel_anchor($float);
gimp_image_remove_layer($image,$templ);
# gimp_layer_delete($templ);
gimp_undo_push_group_end($image);

View File

@ -175,8 +175,11 @@ sub channel_delete {
$blurb = 'Delete a channel.';
$help = <<'HELP';
This procedure deletes the specified channel. This does not need to be done if
a gimage containing this channel was already deleted.
This procedure deletes the specified channel. This must not be done if the
gimage containing this channel was already deleted or if the channel was
already removed from the image. The only case in which this procedure is
useful is if you want to get rid of a channel which has not yet been
added to an image.
HELP
&std_pdb_misc;

View File

@ -338,8 +338,8 @@ sub layer_delete {
$blurb = 'Delete a layer.';
$help = <<'HELP';
This procedure deletes the specified layer. This does not need to be done if
a gimage containing this layer was already deleted.
This procedure is obsolete and does nothing. Layers are automatically deleted
when removed from an image or if the associated image is destroyed.
HELP
&std_pdb_misc;
@ -347,7 +347,7 @@ HELP
@inargs = ( &layer_arg );
$inargs[0]->{desc} .= ' to delete';
%invoke = ( code => 'layer_delete (layer);' );
%invoke = ();
}
sub layer_translate {