Commit 68c21b49 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

Revert the change which adds GError parameters to

2008-09-17  Michael Natterer  <mitch@gimp.org>

	Revert the change which adds GError parameters to
	gimp_image_add_{channel,layer,vectors}():

	* app/actions/channels-commands.c
	* app/actions/edit-commands.c
	* app/actions/layers-commands.c
	* app/actions/vectors-commands.c
	* app/core/gimp-edit.c
	* app/core/gimpimage-duplicate.c
	* app/core/gimpimage-merge.c
	* app/core/gimpimage-quick-mask.c
	* app/core/gimpimage.[ch]
	* app/core/gimplayer-floating-sel.c
	* app/core/gimpselection.c
	* app/core/gimptemplate.c
	* app/display/gimpdisplayshell-dnd.c
	* app/text/gimptext-compat.c
	* app/tools/gimptexttool.c
	* app/tools/gimpvectortool.c
	* app/vectors/gimpvectors-import.c
	* app/widgets/gimpchanneltreeview.c
	* app/widgets/gimpitemtreeview.[ch]
	* app/widgets/gimplayertreeview.c
	* app/widgets/gimptoolbox-dnd.c
	* app/widgets/gimpvectorstreeview.c
	* app/xcf/xcf-load.c: revert.

	Instead, fix it at the PDB level:

	* app/core/gimpimage.c: turn the "added to wrong image" warning
	into a g_return_val_if_fail() assertion.

	* app/pdb/gimppdb-utils.[ch] (gimp_pdb_item_is_floating): add a
	"dest_image" parameter and fail if the passed item is not for this
	image.

	* tools/pdbgen/pdb/image.pdb
	* tools/pdbgen/pdb/layer.pdb
	* tools/pdbgen/pdb/paths.pdb: pass the dest image to
	gimp_pdb_item_is_floating().

	* app/pdb/image-cmds.c
	* app/pdb/layer-cmds.c
	* app/pdb/paths-cmds.c: regenerated.


svn path=/trunk/; revision=26970
parent ed0d0a19
2008-09-17 Michael Natterer <mitch@gimp.org>
Revert the change which adds GError parameters to
gimp_image_add_{channel,layer,vectors}():
* app/actions/channels-commands.c
* app/actions/edit-commands.c
* app/actions/layers-commands.c
* app/actions/vectors-commands.c
* app/core/gimp-edit.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-merge.c
* app/core/gimpimage-quick-mask.c
* app/core/gimpimage.[ch]
* app/core/gimplayer-floating-sel.c
* app/core/gimpselection.c
* app/core/gimptemplate.c
* app/display/gimpdisplayshell-dnd.c
* app/text/gimptext-compat.c
* app/tools/gimptexttool.c
* app/tools/gimpvectortool.c
* app/vectors/gimpvectors-import.c
* app/widgets/gimpchanneltreeview.c
* app/widgets/gimpitemtreeview.[ch]
* app/widgets/gimplayertreeview.c
* app/widgets/gimptoolbox-dnd.c
* app/widgets/gimpvectorstreeview.c
* app/xcf/xcf-load.c: revert.
Instead, fix it at the PDB level:
* app/core/gimpimage.c: turn the "added to wrong image" warning
into a g_return_val_if_fail() assertion.
* app/pdb/gimppdb-utils.[ch] (gimp_pdb_item_is_floating): add a
"dest_image" parameter and fail if the passed item is not for this
image.
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/layer.pdb
* tools/pdbgen/pdb/paths.pdb: pass the dest image to
gimp_pdb_item_is_floating().
* app/pdb/image-cmds.c
* app/pdb/layer-cmds.c
* app/pdb/paths-cmds.c: regenerated.
2008-09-17 Sven Neumann <sven@gimp.org>
* plug-ins/script-fu/script-fu-scripts.c (script_fu_load_script):
......
......@@ -166,7 +166,7 @@ channels_new_last_vals_cmd_callback (GtkAction *action,
action_data_get_context (data),
GIMP_TRANSPARENT_FILL);
gimp_image_add_channel (image, new_channel, -1, NULL);
gimp_image_add_channel (image, new_channel, -1);
gimp_image_undo_group_end (image);
......@@ -262,7 +262,7 @@ channels_duplicate_cmd_callback (GtkAction *action,
G_TYPE_FROM_INSTANCE (channel)));
}
gimp_image_add_channel (image, new_channel, -1, NULL);
gimp_image_add_channel (image, new_channel, -1);
gimp_image_flush (image);
}
......@@ -356,7 +356,7 @@ channels_new_channel_response (GtkWidget *widget,
GIMP_TRANSPARENT_FILL);
}
gimp_image_add_channel (options->image, new_channel, -1, NULL);
gimp_image_add_channel (options->image, new_channel, -1);
gimp_image_flush (options->image);
}
......
......@@ -339,7 +339,7 @@ edit_paste_as_new_layer_cmd_callback (GtkAction *action,
GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE);
g_object_unref (buffer);
gimp_image_add_layer (image, layer, -1, NULL);
gimp_image_add_layer (image, layer, -1);
gimp_image_flush (image);
}
......
......@@ -328,7 +328,7 @@ layers_new_last_vals_cmd_callback (GtkAction *action,
layer_fill_type);
gimp_item_translate (GIMP_ITEM (new_layer), off_x, off_y, FALSE);
gimp_image_add_layer (image, new_layer, -1, NULL);
gimp_image_add_layer (image, new_layer, -1);
gimp_image_undo_group_end (image);
......@@ -351,7 +351,7 @@ layers_new_from_visible_cmd_callback (GtkAction *action,
gimp_image_base_type_with_alpha (image),
_("Visible"),
GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE);
gimp_image_add_layer (image, layer, -1, NULL);
gimp_image_add_layer (image, layer, -1);
gimp_image_flush (image);
}
......@@ -438,7 +438,7 @@ layers_duplicate_cmd_callback (GtkAction *action,
new_layer = GIMP_LAYER (gimp_item_duplicate (GIMP_ITEM (layer),
G_TYPE_FROM_INSTANCE (layer)));
gimp_image_add_layer (image, new_layer, -1, NULL);
gimp_image_add_layer (image, new_layer, -1);
gimp_image_flush (image);
}
......@@ -517,7 +517,7 @@ layers_text_to_vectors_cmd_callback (GtkAction *action,
gimp_item_offsets (GIMP_ITEM (layer), &x, &y);
gimp_item_translate (GIMP_ITEM (vectors), x, y, FALSE);
gimp_image_add_vectors (image, vectors, -1, NULL);
gimp_image_add_vectors (image, vectors, -1);
gimp_image_set_active_vectors (image, vectors);
gimp_image_flush (image);
......@@ -545,7 +545,7 @@ layers_text_along_vectors_cmd_callback (GtkAction *action,
gimp_item_set_visible (GIMP_ITEM (new_vectors), TRUE, FALSE);
gimp_image_add_vectors (image, new_vectors, -1, NULL);
gimp_image_add_vectors (image, new_vectors, -1);
gimp_image_set_active_vectors (image, new_vectors);
gimp_image_flush (image);
......@@ -961,7 +961,7 @@ layers_new_layer_response (GtkWidget *widget,
gimp_drawable_fill_by_type (GIMP_DRAWABLE (layer),
dialog->context,
layer_fill_type);
gimp_image_add_layer (dialog->image, layer, -1, NULL);
gimp_image_add_layer (dialog->image, layer, -1);
gimp_image_flush (dialog->image);
}
......
......@@ -187,7 +187,7 @@ vectors_new_last_vals_cmd_callback (GtkAction *action,
new_vectors = gimp_vectors_new (image,
vectors_name ? vectors_name : _("New Path"));
gimp_image_add_vectors (image, new_vectors, -1, NULL);
gimp_image_add_vectors (image, new_vectors, -1);
gimp_image_flush (image);
}
......@@ -251,7 +251,7 @@ vectors_duplicate_cmd_callback (GtkAction *action,
new_vectors = GIMP_VECTORS (gimp_item_duplicate (GIMP_ITEM (vectors),
G_TYPE_FROM_INSTANCE (vectors)));
gimp_image_add_vectors (image, new_vectors, -1, NULL);
gimp_image_add_vectors (image, new_vectors, -1);
gimp_image_flush (image);
}
......@@ -603,7 +603,7 @@ vectors_new_vectors_response (GtkWidget *widget,
new_vectors = gimp_vectors_new (options->image, vectors_name);
gimp_image_add_vectors (options->image, new_vectors, -1, NULL);
gimp_image_add_vectors (options->image, new_vectors, -1);
gimp_image_flush (options->image);
}
......
......@@ -272,7 +272,7 @@ gimp_edit_paste (GimpImage *image,
if (drawable)
floating_sel_attach (layer, drawable);
else
gimp_image_add_layer (image, layer, 0, NULL);
gimp_image_add_layer (image, layer, 0);
/* end the group undo */
gimp_image_undo_group_end (image);
......@@ -332,7 +332,7 @@ gimp_edit_paste_as_new (Gimp *gimp,
return NULL;
}
gimp_image_add_layer (image, layer, 0, NULL);
gimp_image_add_layer (image, layer, 0);
gimp_image_undo_enable (image);
......
......@@ -137,7 +137,7 @@ gimp_image_duplicate (GimpImage *image)
new_floating_sel_drawable = GIMP_DRAWABLE (new_layer);
if (floating_layer != new_layer)
gimp_image_add_layer (new_image, new_layer, count++, NULL);
gimp_image_add_layer (new_image, new_layer, count++);
}
/* Copy the channels */
......@@ -162,7 +162,7 @@ gimp_image_duplicate (GimpImage *image)
if (floating_sel_drawable == GIMP_DRAWABLE (channel))
new_floating_sel_drawable = GIMP_DRAWABLE (new_channel);
gimp_image_add_channel (new_image, new_channel, count++, NULL);
gimp_image_add_channel (new_image, new_channel, count++);
}
/* Copy any vectors */
......@@ -184,7 +184,7 @@ gimp_image_duplicate (GimpImage *image)
if (gimp_image_get_active_vectors (image) == vectors)
active_vectors = new_vectors;
gimp_image_add_vectors (new_image, new_vectors, count++, NULL);
gimp_image_add_vectors (new_image, new_vectors, count++);
}
/* Copy the selection mask */
......
......@@ -276,7 +276,7 @@ gimp_image_merge_visible_vectors (GimpImage *image,
g_slist_free (merge_list);
gimp_image_add_vectors (image, target_vectors, pos, NULL);
gimp_image_add_vectors (image, target_vectors, pos);
gimp_unset_busy (image->gimp);
gimp_image_undo_group_end (image);
......@@ -593,13 +593,13 @@ gimp_image_merge_layers (GimpImage *image,
gimp_image_remove_layer (image, layer);
}
gimp_image_add_layer (image, merge_layer, position, NULL);
gimp_image_add_layer (image, merge_layer, position);
}
else
{
/* Add the layer to the image */
gimp_image_add_layer (image, merge_layer,
gimp_container_num_children (image->layers) - position + 1, NULL);
gimp_container_num_children (image->layers) - position + 1);
}
/* set the name after the original layers have been removed so we
......
......@@ -117,7 +117,7 @@ gimp_image_set_quick_mask_state (GimpImage *image,
if (image->quick_mask_inverted)
gimp_channel_invert (mask, FALSE);
gimp_image_add_channel (image, mask, 0, NULL);
gimp_image_add_channel (image, mask, 0);
gimp_image_undo_group_end (image);
}
......
......@@ -2852,10 +2852,9 @@ gimp_image_get_vectors_by_name (const GimpImage *image,
}
gboolean
gimp_image_add_layer (GimpImage *image,
GimpLayer *layer,
gint position,
GError **error)
gimp_image_add_layer (GimpImage *image,
GimpLayer *layer,
gint position)
{
GimpLayer *active_layer;
GimpLayer *floating_sel;
......@@ -2864,25 +2863,11 @@ gimp_image_add_layer (GimpImage *image,
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
g_return_val_if_fail (GIMP_IS_LAYER (layer), FALSE);
g_return_val_if_fail (g_object_is_floating (layer), FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
if (gimp_item_get_image (GIMP_ITEM (layer)) != image)
{
g_set_error (error, 0, 0,
_("Attempting to add layer to wrong image."));
return FALSE;
}
g_return_val_if_fail (gimp_item_get_image (GIMP_ITEM (layer)) == image,
FALSE);
floating_sel = gimp_image_floating_sel (image);
if (floating_sel && gimp_layer_is_floating_sel (layer))
{
g_set_error (error, 0, 0,
_("Trying to add floating layer to image which alyready "
"has a floating selection."));
return FALSE;
}
active_layer = gimp_image_get_active_layer (image);
old_has_alpha = gimp_image_has_alpha (image);
......@@ -3083,7 +3068,7 @@ gimp_image_add_layers (GimpImage *image,
gimp_item_translate (new_item, offset_x, offset_y, FALSE);
gimp_image_add_layer (image, GIMP_LAYER (new_item), position, NULL);
gimp_image_add_layer (image, GIMP_LAYER (new_item), position);
position++;
}
......@@ -3212,24 +3197,17 @@ gimp_image_position_layer (GimpImage *image,
}
gboolean
gimp_image_add_channel (GimpImage *image,
GimpChannel *channel,
gint position,
GError **error)
gimp_image_add_channel (GimpImage *image,
GimpChannel *channel,
gint position)
{
GimpChannel *active_channel;
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
g_return_val_if_fail (GIMP_IS_CHANNEL (channel), FALSE);
g_return_val_if_fail (g_object_is_floating (channel), FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
if (gimp_item_get_image (GIMP_ITEM (channel)) != image)
{
g_set_error (error, 0, 0,
_("Attempting to add channel to wrong image."));
return FALSE;
}
g_return_val_if_fail (gimp_item_get_image (GIMP_ITEM (channel)) == image,
FALSE);
active_channel = gimp_image_get_active_channel (image);
......@@ -3444,24 +3422,17 @@ gimp_image_position_channel (GimpImage *image,
}
gboolean
gimp_image_add_vectors (GimpImage *image,
GimpVectors *vectors,
gint position,
GError **error)
gimp_image_add_vectors (GimpImage *image,
GimpVectors *vectors,
gint position)
{
GimpVectors *active_vectors;
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
g_return_val_if_fail (GIMP_IS_VECTORS (vectors), FALSE);
g_return_val_if_fail (g_object_is_floating (vectors), FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
if (gimp_item_get_image (GIMP_ITEM (vectors)) != image)
{
g_set_error (error, 0, 0,
_("Attempting to add vectors to wrong image."));
return FALSE;
}
g_return_val_if_fail (gimp_item_get_image (GIMP_ITEM (vectors)) == image,
FALSE);
active_vectors = gimp_image_get_active_vectors (image);
......
......@@ -458,8 +458,7 @@ GimpVectors * gimp_image_get_vectors_by_name (const GimpImage *image,
gboolean gimp_image_add_layer (GimpImage *image,
GimpLayer *layer,
gint position,
GError **error);
gint position);
void gimp_image_remove_layer (GimpImage *image,
GimpLayer *layer);
......@@ -490,8 +489,7 @@ gboolean gimp_image_position_layer (GimpImage *image,
gboolean gimp_image_add_channel (GimpImage *image,
GimpChannel *channel,
gint position,
GError **error);
gint position);
void gimp_image_remove_channel (GimpImage *image,
GimpChannel *channel);
......@@ -513,8 +511,7 @@ gboolean gimp_image_position_channel (GimpImage *image,
gboolean gimp_image_add_vectors (GimpImage *image,
GimpVectors *vectors,
gint position,
GError **error);
gint position);
void gimp_image_remove_vectors (GimpImage *image,
GimpVectors *vectors);
......
......@@ -79,7 +79,7 @@ floating_sel_attach (GimpLayer *layer,
gimp_drawable_bytes (drawable));
/* add the layer to the image */
gimp_image_add_layer (image, layer, 0, NULL);
gimp_image_add_layer (image, layer, 0);
/* store the affected area from the drawable in the backing store */
floating_sel_rigor (layer, TRUE);
......
......@@ -587,7 +587,7 @@ gimp_selection_save (GimpChannel *selection)
/* saved selections are not visible by default */
gimp_item_set_visible (GIMP_ITEM (new_channel), FALSE, FALSE);
gimp_image_add_channel (image, new_channel, -1, NULL);
gimp_image_add_channel (image, new_channel, -1);
return new_channel;
}
......
......@@ -406,7 +406,7 @@ gimp_template_create_image (Gimp *gimp,
gimp_drawable_fill_by_type (GIMP_DRAWABLE (layer),
context, template->fill_type);
gimp_image_add_layer (image, layer, 0, NULL);
gimp_image_add_layer (image, layer, 0);
gimp_image_undo_enable (image);
gimp_image_clean_all (image);
......
......@@ -254,7 +254,7 @@ gimp_display_shell_drop_drawable (GtkWidget *widget,
gimp_item_set_visible (new_item, TRUE, FALSE);
gimp_item_set_linked (new_item, FALSE, FALSE);
gimp_image_add_layer (image, new_layer, -1, NULL);
gimp_image_add_layer (image, new_layer, -1);
gimp_image_undo_group_end (image);
......@@ -294,7 +294,7 @@ gimp_display_shell_drop_vectors (GtkWidget *widget,
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_EDIT_PASTE,
_("Drop New Path"));
gimp_image_add_vectors (image, new_vectors, -1, NULL);
gimp_image_add_vectors (image, new_vectors, -1);
gimp_image_undo_group_end (image);
......@@ -574,7 +574,7 @@ gimp_display_shell_drop_component (GtkWidget *widget,
gimp_item_translate (new_item, off_x, off_y, FALSE);
gimp_image_add_layer (dest_image, new_layer, -1, NULL);
gimp_image_add_layer (dest_image, new_layer, -1);
gimp_image_undo_group_end (dest_image);
......@@ -660,7 +660,7 @@ gimp_display_shell_drop_pixbuf (GtkWidget *widget,
gimp_item_translate (new_item, off_x, off_y, FALSE);
}
gimp_image_add_layer (image, new_layer, -1, NULL);
gimp_image_add_layer (image, new_layer, -1);
gimp_image_undo_group_end (image);
......
......@@ -299,34 +299,46 @@ gimp_pdb_item_is_attached (GimpItem *item,
g_return_val_if_fail (GIMP_IS_ITEM (item), FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
if (gimp_item_is_attached (item))
return TRUE;
g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
_("Item '%s' (%d) can not be used because it has not "
"been added to an image"),
gimp_object_get_name (GIMP_OBJECT (item)),
gimp_item_get_ID (item));
if (! gimp_item_is_attached (item))
{
g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
_("Item '%s' (%d) can not be used because it has not "
"been added to an image"),
gimp_object_get_name (GIMP_OBJECT (item)),
gimp_item_get_ID (item));
return FALSE;
}
return FALSE;
return TRUE;
}
gboolean
gimp_pdb_item_is_floating (GimpItem *item,
GimpImage *dest_image,
GError **error)
{
g_return_val_if_fail (GIMP_IS_ITEM (item), FALSE);
g_return_val_if_fail (GIMP_IS_IMAGE (dest_image), FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
if (g_object_is_floating (item))
return TRUE;
g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
_("Item '%s' (%d) has already been added to an image"),
gimp_object_get_name (GIMP_OBJECT (item)),
gimp_item_get_ID (item));
if (! g_object_is_floating (item))
{
g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
_("Item '%s' (%d) has already been added to an image"),
gimp_object_get_name (GIMP_OBJECT (item)),
gimp_item_get_ID (item));
return FALSE;
}
else if (gimp_item_get_image (item) != dest_image)
{
g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT,
_("Trying to add item '%s' (%d) to wrong image"),
gimp_object_get_name (GIMP_OBJECT (item)),
gimp_item_get_ID (item));
return FALSE;
}
return FALSE;
return TRUE;
}
gboolean
......
......@@ -52,6 +52,7 @@ GimpPaintInfo * gimp_pdb_get_paint_info (Gimp *gimp,
gboolean gimp_pdb_item_is_attached (GimpItem *item,
GError **error);
gboolean gimp_pdb_item_is_floating (GimpItem *item,
GimpImage *dest_image,
GError **error);
gboolean gimp_pdb_layer_is_text_layer (GimpLayer *layer,
GError **error);
......
......@@ -863,13 +863,12 @@ image_add_layer_invoker (GimpProcedure *procedure,
if (success)
{
if (gimp_pdb_item_is_floating (GIMP_ITEM (layer), error) &&
if (gimp_pdb_item_is_floating (GIMP_ITEM (layer), image, error) &&
gimp_pdb_image_is_base_type (image,
GIMP_IMAGE_TYPE_BASE_TYPE (gimp_drawable_type (GIMP_DRAWABLE (layer))),
error))
{
success = gimp_image_add_layer (image, layer, MAX (position, -1),
error);
success = gimp_image_add_layer (image, layer, MAX (position, -1));
}
else
{
......@@ -1057,10 +1056,9 @@ image_add_channel_invoker (GimpProcedure *procedure,
if (success)
{
if (gimp_pdb_item_is_floating (GIMP_ITEM (channel), error))
if (gimp_pdb_item_is_floating (GIMP_ITEM (channel), image, error))
{
success = gimp_image_add_channel (image, channel, MAX (position, -1),
error);
success = gimp_image_add_channel (image, channel, MAX (position, -1));
}
else
{
......@@ -1200,10 +1198,9 @@ image_add_vectors_invoker (GimpProcedure *procedure,
if (success)
{
if (gimp_pdb_item_is_floating (GIMP_ITEM (vectors), error))
if (gimp_pdb_item_is_floating (GIMP_ITEM (vectors), image, error))
{
success = gimp_image_add_vectors (image, vectors, MAX (position, -1),
error);
success = gimp_image_add_vectors (image, vectors, MAX (position, -1));
}
else
{
......@@ -1493,7 +1490,7 @@ image_add_layer_mask_invoker (GimpProcedure *procedure,
if (success)
{
if (gimp_pdb_item_is_floating (GIMP_ITEM (mask), error))
if (gimp_pdb_item_is_floating (GIMP_ITEM (mask), image, error))
success = (gimp_layer_add_mask (layer, mask, TRUE, error) == mask);
else
success = FALSE;
......
......@@ -550,7 +550,9 @@ layer_add_mask_invoker (GimpProcedure *procedure,
if (success)
{
if (gimp_pdb_item_is_floating (GIMP_ITEM (mask), error))
if (gimp_pdb_item_is_floating (GIMP_ITEM (mask),
gimp_item_get_image (GIMP_ITEM (layer)),
error))
success = (gimp_layer_add_mask (layer, mask, TRUE, error) == mask);
else
success = FALSE;
......
......@@ -303,7 +303,7 @@ path_set_points_invoker (GimpProcedure *procedure,
g_free (points);
if (vectors)
success = gimp_image_add_vectors (image, vectors, 0, error);
success = gimp_image_add_vectors (image, vectors, 0);
else
success = FALSE;
}
......
......@@ -118,16 +118,12 @@ text_render (GimpImage *image,
if (! gimp_channel_is_empty (gimp_image_get_mask (image)))
gimp_channel_clear (gimp_image_get_mask (image), NULL, TRUE);
/* If the drawable is NULL, create a new layer */
if (drawable == NULL)
{
/* If the drawable is NULL, create a new layer */
gimp_image_add_layer (image, layer, -1, NULL);
}
gimp_image_add_layer (image, layer, -1);
/* Otherwise, instantiate the text as the new floating selection */
else
{
/* Otherwise, instantiate the text as the new floating selection */
floating_sel_attach (layer, drawable);
}
floating_sel_attach (layer, drawable);
/* end the group undo */
gimp_image_undo_group_end (image);
......
......@@ -803,7 +803,7 @@ gimp_text_tool_create_vectors (GimpTextTool *text_tool)
gimp_item_translate (GIMP_ITEM (vectors), x, y, FALSE);
}
gimp_image_add_vectors (text_tool->image, vectors, -1, NULL);
gimp_image_add_vectors (text_tool->image, vectors, -1);
gimp_image_flush (text_tool->image);
}
......@@ -829,7 +829,7 @@ gimp_text_tool_create_vectors_warped (GimpTextTool *text_tool)
gimp_vectors_warp_vectors (vectors0, vectors, 0.5 * box_height);
gimp_image_add_vectors (text_tool->image, vectors, -1, NULL);
gimp_image_add_vectors (text_tool->image, vectors, -1);
gimp_image_set_active_vectors (text_tool->image, vectors);
gimp_item_set_visible (GIMP_ITEM (vectors), TRUE, FALSE);
......@@ -892,7 +892,7 @@ gimp_text_tool_create_layer (GimpTextTool *text_tool,
GIMP_ITEM (layer)->offset_x = text_tool->x1;
GIMP_ITEM (layer)->offset_y = text_tool->y1;
gimp_image_add_layer (image, layer, -1, NULL);
gimp_image_add_layer (image, layer, -1);
if (text_tool->text_box_fixed)
{
......
......@@ -303,7 +303,7 @@ gimp_vector_tool_button_press (GimpTool *tool,
vector_tool->undo_motion = TRUE;
gimp_image_add_vectors (display->image, vectors, -1, NULL);
gimp_image_add_vectors (display->image, vectors, -1);
gimp_image_flush (display->image);
gimp_vector_tool_set_vectors (vector_tool, vectors);
......
......@@ -305,7 +305,7 @@ gimp_vectors_import (GimpImage *image,
vectors = gimp_vectors_new (image,
((merge || !path->id) ?
_("Imported Path") : path->id));
gimp_image_add_vectors (image, vectors, position, NULL);
gimp_image_add_vectors (image, vectors, position);
gimp_vectors_freeze (vectors);
if (ret_vectors)
......
......@@ -211,7 +211,7 @@ gimp_channel_tree_view_drop_viewable (GimpContainerTreeView *tree_view,
gimp_item_set_linked (new_item, FALSE, FALSE);
item_view_class->add_item (item_view->image, new_item, index, NULL);
item_view_class->add_item (item_view->image, new_item, index);
gimp_image_flush (item_view->image);
return;
}
......@@ -261,8 +261,7 @@ gimp_channel_tree_view_drop_component (GimpContainerTreeView *tree_view,
if (src_image != item_view->image)
GIMP_ITEM_GET_CLASS (new_item)->convert (new_item, item_view->image);
gimp_image_add_channel (item_view->image, GIMP_CHANNEL (new_item), index,
NULL);
gimp_image_add_channel (item_view->image, GIMP_CHANNEL (new_item), index);
gimp_image_flush (item_view->image);
}
......@@ -321,7 +320,7 @@ gimp_channel_tree_view_item_new (GimpImage *image)
gimp_image_get_height (image),
_("Empty Channel"), &color);
gimp_image_add_channel (image, new_channel, -1, NULL);
gimp_image_add_channel (image, new_channel, -1);
gimp_image_undo_group_end (image);
......
......@@ -734,7 +734,7 @@ gimp_item_tree_view_drop_viewable (GimpContainerTreeView *tree_view,
gimp_item_set_linked (new_item, FALSE, FALSE);
item_view_class->add_item (item_view->image, new_item, dest_index, NULL);
item_view_class->add_item (item_view->image, new_item, dest_index);
}
else if (dest_viewable)
{
......
......@@ -37,8 +37,7 @@ typedef void (* GimpReorderItemFunc) (GimpImage *image,
const gchar *undo_desc);
typedef void (* GimpAddItemFunc) (GimpImage *image,
GimpItem *item,
gint index,
GError **error);
gint index);
typedef void (* GimpRemoveItemFunc) (GimpImage *image,
GimpItem *item);
typedef GimpItem * (* GimpNewItemFunc) (GimpImage *image);
......
......@@ -772,7 +772,7 @@ gimp_layer_tree_view_drop_component (GimpContainerTreeView *tree_view,
gimp_object_take_name (GIMP_OBJECT (new_item),
g_strdup_printf (_("%s Channel Copy"), desc));
gimp_image_add_layer (item_view->image, GIMP_LAYER (new_item), index, NULL);
gimp_image_add_layer (item_view->image, GIMP_LAYER (new_item), index);
gimp_image_flush (item_view->image);
}
......@@ -801,7 +801,7 @@ gimp_layer_tree_view_drop_pixbuf (GimpContainerTreeView *tree_view,
_("Dropped Buffer"),
GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE);
gimp_image_add_layer (image, new_layer, index, NULL);