add GError parameter to gimp_image_add_{channel,layer,vectors}() and

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

	* app/core/gimpimage.[ch]: add GError parameter to
	gimp_image_add_{channel,layer,vectors}() and remove calls to
	g_warning(). Changed checks to be possible failures at all.

	* app/widgets/gimpitemtreeview.h (GimpAddItemFunc): add the GError
	here too.

	* 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/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.c
	* app/widgets/gimplayertreeview.c
	* app/widgets/gimptoolbox-dnd.c
	* app/widgets/gimpvectorstreeview.c
	* app/xcf/xcf-load.c: pass a NULL error.

	* tools/pdbgen/pdb/image.pdb
	* tools/pdbgen/pdb/paths.pdb: pass the error.

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


svn path=/trunk/; revision=26963
This commit is contained in:
Michael Natterer 2008-09-17 08:27:35 +00:00 committed by Michael Natterer
parent 086a067673
commit b0dab70de8
30 changed files with 153 additions and 104 deletions

View File

@ -1,3 +1,41 @@
2008-09-17 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage.[ch]: add GError parameter to
gimp_image_add_{channel,layer,vectors}() and remove calls to
g_warning(). Changed checks to be possible failures at all.
* app/widgets/gimpitemtreeview.h (GimpAddItemFunc): add the GError
here too.
* 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/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.c
* app/widgets/gimplayertreeview.c
* app/widgets/gimptoolbox-dnd.c
* app/widgets/gimpvectorstreeview.c
* app/xcf/xcf-load.c: pass a NULL error.
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/paths.pdb: pass the error.
* app/pdb/image-cmds.c
* app/pdb/paths-cmds.c: regenerated.
2008-09-16 Sven Neumann <sven@gimp.org>
* configure.in: bumped version to 2.5.5.

View File

@ -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);
gimp_image_add_channel (image, new_channel, -1, NULL);
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);
gimp_image_add_channel (image, new_channel, -1, NULL);
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);
gimp_image_add_channel (options->image, new_channel, -1, NULL);
gimp_image_flush (options->image);
}

View File

@ -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);
gimp_image_add_layer (image, layer, -1, NULL);
gimp_image_flush (image);
}

View File

@ -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);
gimp_image_add_layer (image, new_layer, -1, NULL);
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);
gimp_image_add_layer (image, layer, -1, NULL);
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);
gimp_image_add_layer (image, new_layer, -1, NULL);
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);
gimp_image_add_vectors (image, vectors, -1, NULL);
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);
gimp_image_add_vectors (image, new_vectors, -1, NULL);
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);
gimp_image_add_layer (dialog->image, layer, -1, NULL);
gimp_image_flush (dialog->image);
}

View File

@ -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);
gimp_image_add_vectors (image, new_vectors, -1, NULL);
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);
gimp_image_add_vectors (image, new_vectors, -1, NULL);
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);
gimp_image_add_vectors (options->image, new_vectors, -1, NULL);
gimp_image_flush (options->image);
}

View File

@ -272,7 +272,7 @@ gimp_edit_paste (GimpImage *image,
if (drawable)
floating_sel_attach (layer, drawable);
else
gimp_image_add_layer (image, layer, 0);
gimp_image_add_layer (image, layer, 0, NULL);
/* 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);
gimp_image_add_layer (image, layer, 0, NULL);
gimp_image_undo_enable (image);

View File

@ -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++);
gimp_image_add_layer (new_image, new_layer, count++, NULL);
}
/* 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++);
gimp_image_add_channel (new_image, new_channel, count++, NULL);
}
/* 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++);
gimp_image_add_vectors (new_image, new_vectors, count++, NULL);
}
/* Copy the selection mask */

View File

@ -276,7 +276,7 @@ gimp_image_merge_visible_vectors (GimpImage *image,
g_slist_free (merge_list);
gimp_image_add_vectors (image, target_vectors, pos);
gimp_image_add_vectors (image, target_vectors, pos, NULL);
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);
gimp_image_add_layer (image, merge_layer, position, NULL);
}
else
{
/* Add the layer to the image */
gimp_image_add_layer (image, merge_layer,
gimp_container_num_children (image->layers) - position + 1);
gimp_container_num_children (image->layers) - position + 1, NULL);
}
/* set the name after the original layers have been removed so we

View File

@ -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);
gimp_image_add_channel (image, mask, 0, NULL);
gimp_image_undo_group_end (image);
}

View File

@ -2852,9 +2852,10 @@ gimp_image_get_vectors_by_name (const GimpImage *image,
}
gboolean
gimp_image_add_layer (GimpImage *image,
GimpLayer *layer,
gint position)
gimp_image_add_layer (GimpImage *image,
GimpLayer *layer,
gint position,
GError **error)
{
GimpLayer *active_layer;
GimpLayer *floating_sel;
@ -2862,17 +2863,13 @@ 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 (layer)->image != NULL &&
GIMP_ITEM (layer)->image != image)
if (gimp_item_get_image (GIMP_ITEM (layer)) != image)
{
g_warning ("%s: attempting to add layer to wrong image.", G_STRFUNC);
return FALSE;
}
if (gimp_container_have (image->layers, GIMP_OBJECT (layer)))
{
g_warning ("%s: trying to add layer to image twice.", G_STRFUNC);
g_set_error (error, 0, 0,
_("Attempting to add layer to wrong image."));
return FALSE;
}
@ -2880,8 +2877,9 @@ gimp_image_add_layer (GimpImage *image,
if (floating_sel && gimp_layer_is_floating_sel (layer))
{
g_warning ("%s: trying to add floating layer to image which alyready "
"has a floating selection.", G_STRFUNC);
g_set_error (error, 0, 0,
_("Trying to add floating layer to image which alyready "
"has a floating selection."));
return FALSE;
}
@ -3085,7 +3083,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);
gimp_image_add_layer (image, GIMP_LAYER (new_item), position, NULL);
position++;
}
@ -3214,25 +3212,22 @@ gimp_image_position_layer (GimpImage *image,
}
gboolean
gimp_image_add_channel (GimpImage *image,
GimpChannel *channel,
gint position)
gimp_image_add_channel (GimpImage *image,
GimpChannel *channel,
gint position,
GError **error)
{
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 (channel)->image != NULL &&
GIMP_ITEM (channel)->image != image)
if (gimp_item_get_image (GIMP_ITEM (channel)) != image)
{
g_warning ("%s: attempting to add channel to wrong image.", G_STRFUNC);
return FALSE;
}
if (gimp_container_have (image->channels, GIMP_OBJECT (channel)))
{
g_warning ("%s: trying to add channel to image twice.", G_STRFUNC);
g_set_error (error, 0, 0,
_("Attempting to add channel to wrong image."));
return FALSE;
}
@ -3449,25 +3444,22 @@ gimp_image_position_channel (GimpImage *image,
}
gboolean
gimp_image_add_vectors (GimpImage *image,
GimpVectors *vectors,
gint position)
gimp_image_add_vectors (GimpImage *image,
GimpVectors *vectors,
gint position,
GError **error)
{
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 (vectors)->image != NULL &&
GIMP_ITEM (vectors)->image != image)
if (gimp_item_get_image (GIMP_ITEM (vectors)) != image)
{
g_warning ("%s: attempting to add vectors to wrong image.", G_STRFUNC);
return FALSE;
}
if (gimp_container_have (image->vectors, GIMP_OBJECT (vectors)))
{
g_warning ("%s: trying to add vectors to image twice.", G_STRFUNC);
g_set_error (error, 0, 0,
_("Attempting to add vectors to wrong image."));
return FALSE;
}

View File

@ -458,7 +458,8 @@ GimpVectors * gimp_image_get_vectors_by_name (const GimpImage *image,
gboolean gimp_image_add_layer (GimpImage *image,
GimpLayer *layer,
gint position);
gint position,
GError **error);
void gimp_image_remove_layer (GimpImage *image,
GimpLayer *layer);
@ -489,7 +490,8 @@ gboolean gimp_image_position_layer (GimpImage *image,
gboolean gimp_image_add_channel (GimpImage *image,
GimpChannel *channel,
gint position);
gint position,
GError **error);
void gimp_image_remove_channel (GimpImage *image,
GimpChannel *channel);
@ -511,7 +513,8 @@ gboolean gimp_image_position_channel (GimpImage *image,
gboolean gimp_image_add_vectors (GimpImage *image,
GimpVectors *vectors,
gint position);
gint position,
GError **error);
void gimp_image_remove_vectors (GimpImage *image,
GimpVectors *vectors);

View File

@ -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);
gimp_image_add_layer (image, layer, 0, NULL);
/* store the affected area from the drawable in the backing store */
floating_sel_rigor (layer, TRUE);

View File

@ -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);
gimp_image_add_channel (image, new_channel, -1, NULL);
return new_channel;
}

View File

@ -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);
gimp_image_add_layer (image, layer, 0, NULL);
gimp_image_undo_enable (image);
gimp_image_clean_all (image);

View File

@ -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);
gimp_image_add_layer (image, new_layer, -1, NULL);
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);
gimp_image_add_vectors (image, new_vectors, -1, NULL);
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);
gimp_image_add_layer (dest_image, new_layer, -1, NULL);
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);
gimp_image_add_layer (image, new_layer, -1, NULL);
gimp_image_undo_group_end (image);

View File

@ -868,7 +868,8 @@ image_add_layer_invoker (GimpProcedure *procedure,
GIMP_IMAGE_TYPE_BASE_TYPE (gimp_drawable_type (GIMP_DRAWABLE (layer))),
error))
{
success = gimp_image_add_layer (image, layer, MAX (position, -1));
success = gimp_image_add_layer (image, layer, MAX (position, -1),
error);
}
else
{
@ -1058,7 +1059,8 @@ image_add_channel_invoker (GimpProcedure *procedure,
{
if (gimp_pdb_item_is_floating (GIMP_ITEM (channel), error))
{
success = gimp_image_add_channel (image, channel, MAX (position, -1));
success = gimp_image_add_channel (image, channel, MAX (position, -1),
error);
}
else
{
@ -1200,7 +1202,8 @@ image_add_vectors_invoker (GimpProcedure *procedure,
{
if (gimp_pdb_item_is_floating (GIMP_ITEM (vectors), error))
{
success = gimp_image_add_vectors (image, vectors, MAX (position, -1));
success = gimp_image_add_vectors (image, vectors, MAX (position, -1),
error);
}
else
{

View File

@ -303,7 +303,7 @@ path_set_points_invoker (GimpProcedure *procedure,
g_free (points);
if (vectors)
gimp_image_add_vectors (image, vectors, 0);
success = gimp_image_add_vectors (image, vectors, 0, error);
else
success = FALSE;
}

View File

@ -118,12 +118,16 @@ 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)
gimp_image_add_layer (image, layer, -1);
/* Otherwise, instantiate the text as the new floating selection */
{
/* If the drawable is NULL, create a new layer */
gimp_image_add_layer (image, layer, -1, NULL);
}
else
floating_sel_attach (layer, drawable);
{
/* Otherwise, instantiate the text as the new floating selection */
floating_sel_attach (layer, drawable);
}
/* end the group undo */
gimp_image_undo_group_end (image);

View File

@ -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);
gimp_image_add_vectors (text_tool->image, vectors, -1, NULL);
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);
gimp_image_add_vectors (text_tool->image, vectors, -1, NULL);
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);
gimp_image_add_layer (image, layer, -1, NULL);
if (text_tool->text_box_fixed)
{

View File

@ -303,7 +303,7 @@ gimp_vector_tool_button_press (GimpTool *tool,
vector_tool->undo_motion = TRUE;
gimp_image_add_vectors (display->image, vectors, -1);
gimp_image_add_vectors (display->image, vectors, -1, NULL);
gimp_image_flush (display->image);
gimp_vector_tool_set_vectors (vector_tool, vectors);

View File

@ -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);
gimp_image_add_vectors (image, vectors, position, NULL);
gimp_vectors_freeze (vectors);
if (ret_vectors)

View File

@ -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);
item_view_class->add_item (item_view->image, new_item, index, NULL);
gimp_image_flush (item_view->image);
return;
}
@ -261,7 +261,8 @@ 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);
gimp_image_add_channel (item_view->image, GIMP_CHANNEL (new_item), index,
NULL);
gimp_image_flush (item_view->image);
}
@ -320,7 +321,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);
gimp_image_add_channel (image, new_channel, -1, NULL);
gimp_image_undo_group_end (image);

View File

@ -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);
item_view_class->add_item (item_view->image, new_item, dest_index, NULL);
}
else if (dest_viewable)
{

View File

@ -37,7 +37,8 @@ typedef void (* GimpReorderItemFunc) (GimpImage *image,
const gchar *undo_desc);
typedef void (* GimpAddItemFunc) (GimpImage *image,
GimpItem *item,
gint index);
gint index,
GError **error);
typedef void (* GimpRemoveItemFunc) (GimpImage *image,
GimpItem *item);
typedef GimpItem * (* GimpNewItemFunc) (GimpImage *image);

View File

@ -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);
gimp_image_add_layer (item_view->image, GIMP_LAYER (new_item), index, NULL);
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);
gimp_image_add_layer (image, new_layer, index, NULL);
gimp_image_flush (image);
}
@ -840,7 +840,7 @@ gimp_layer_tree_view_item_new (GimpImage *image)
gimp_image_base_type_with_alpha (image),
_("Empty Layer"), 1.0, GIMP_NORMAL_MODE);
gimp_image_add_layer (image, new_layer, -1);
gimp_image_add_layer (image, new_layer, -1, NULL);
gimp_image_undo_group_end (image);

View File

@ -223,7 +223,7 @@ gimp_toolbox_drop_drawable (GtkWidget *widget,
gimp_layer_set_opacity (new_layer, GIMP_OPACITY_OPAQUE, FALSE);
gimp_layer_set_lock_alpha (new_layer, FALSE, FALSE);
gimp_image_add_layer (new_image, new_layer, 0);
gimp_image_add_layer (new_image, new_layer, 0, NULL);
gimp_image_undo_enable (new_image);
@ -309,7 +309,7 @@ gimp_toolbox_drop_component (GtkWidget *widget,
gimp_object_take_name (GIMP_OBJECT (new_layer),
g_strdup_printf (_("%s Channel Copy"), desc));
gimp_image_add_layer (new_image, new_layer, 0);
gimp_image_add_layer (new_image, new_layer, 0, NULL);
gimp_image_undo_enable (new_image);
@ -358,7 +358,7 @@ gimp_toolbox_drop_pixbuf (GtkWidget *widget,
_("Dropped Buffer"),
GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE);
gimp_image_add_layer (new_image, new_layer, 0);
gimp_image_add_layer (new_image, new_layer, 0, NULL);
gimp_image_undo_enable (new_image);

View File

@ -252,7 +252,7 @@ gimp_vectors_tree_view_item_new (GimpImage *image)
new_vectors = gimp_vectors_new (image, _("Empty Path"));
gimp_image_add_vectors (image, new_vectors, -1);
gimp_image_add_vectors (image, new_vectors, -1, NULL);
return GIMP_ITEM (new_vectors);
}

View File

@ -201,7 +201,8 @@ xcf_load_image (Gimp *gimp,
/* add the layer to the image if its not the floating selection */
if (layer != info->floating_sel)
gimp_image_add_layer (image, layer,
gimp_container_num_children (image->layers));
gimp_container_num_children (image->layers),
NULL);
/* restore the saved position so we'll be ready to
* read the next offset.
@ -242,7 +243,8 @@ xcf_load_image (Gimp *gimp,
/* add the channel to the image if its not the selection */
if (channel != gimp_image_get_mask (image))
gimp_image_add_channel (image, channel,
gimp_container_num_children (image->channels));
gimp_container_num_children (image->channels),
NULL);
/* restore the saved position so we'll be ready to
* read the next offset.
@ -1625,7 +1627,8 @@ xcf_load_old_path (XcfInfo *info,
gimp_item_set_tattoo (GIMP_ITEM (vectors), tattoo);
gimp_image_add_vectors (image, vectors,
gimp_container_num_children (image->vectors));
gimp_container_num_children (image->vectors),
NULL);
return TRUE;
}
@ -1814,7 +1817,8 @@ xcf_load_vector (XcfInfo *info,
}
gimp_image_add_vectors (image, vectors,
gimp_container_num_children (image->vectors));
gimp_container_num_children (image->vectors),
NULL);
return TRUE;
}

View File

@ -959,7 +959,8 @@ HELP
GIMP_IMAGE_TYPE_BASE_TYPE (gimp_drawable_type (GIMP_DRAWABLE (layer))),
error))
{
success = gimp_image_add_layer (image, layer, MAX (position, -1));
success = gimp_image_add_layer (image, layer, MAX (position, -1),
error);
}
else
{
@ -1163,7 +1164,8 @@ HELP
{
if (gimp_pdb_item_is_floating (GIMP_ITEM (channel), error))
{
success = gimp_image_add_channel (image, channel, MAX (position, -1));
success = gimp_image_add_channel (image, channel, MAX (position, -1),
error);
}
else
{
@ -1227,7 +1229,8 @@ HELP
{
if (gimp_pdb_item_is_floating (GIMP_ITEM (vectors), error))
{
success = gimp_image_add_vectors (image, vectors, MAX (position, -1));
success = gimp_image_add_vectors (image, vectors, MAX (position, -1),
error);
}
else
{

View File

@ -242,7 +242,7 @@ sub path_set_points {
g_free (points);
if (vectors)
gimp_image_add_vectors (image, vectors, 0);
success = gimp_image_add_vectors (image, vectors, 0, error);
else
success = FALSE;
}