gimp r26970 - in trunk: . app/actions app/core app/display app/pdb app/text app/tools app/vectors app/widgets app/xcf tools/pdbgen/pdb
- From: mitch svn gnome org
- To: svn-commits-list gnome org
- Subject: gimp r26970 - in trunk: . app/actions app/core app/display app/pdb app/text app/tools app/vectors app/widgets app/xcf tools/pdbgen/pdb
- Date: Wed, 17 Sep 2008 11:41:55 +0000 (UTC)
Author: mitch
Date: Wed Sep 17 11:41:54 2008
New Revision: 26970
URL: http://svn.gnome.org/viewvc/gimp?rev=26970&view=rev
Log:
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.
Modified:
trunk/ChangeLog
trunk/app/actions/channels-commands.c
trunk/app/actions/edit-commands.c
trunk/app/actions/layers-commands.c
trunk/app/actions/vectors-commands.c
trunk/app/core/gimp-edit.c
trunk/app/core/gimpimage-duplicate.c
trunk/app/core/gimpimage-merge.c
trunk/app/core/gimpimage-quick-mask.c
trunk/app/core/gimpimage.c
trunk/app/core/gimpimage.h
trunk/app/core/gimplayer-floating-sel.c
trunk/app/core/gimpselection.c
trunk/app/core/gimptemplate.c
trunk/app/display/gimpdisplayshell-dnd.c
trunk/app/pdb/gimppdb-utils.c
trunk/app/pdb/gimppdb-utils.h
trunk/app/pdb/image-cmds.c
trunk/app/pdb/layer-cmds.c
trunk/app/pdb/paths-cmds.c
trunk/app/text/gimptext-compat.c
trunk/app/tools/gimptexttool.c
trunk/app/tools/gimpvectortool.c
trunk/app/vectors/gimpvectors-import.c
trunk/app/widgets/gimpchanneltreeview.c
trunk/app/widgets/gimpitemtreeview.c
trunk/app/widgets/gimpitemtreeview.h
trunk/app/widgets/gimplayertreeview.c
trunk/app/widgets/gimptoolbox-dnd.c
trunk/app/widgets/gimpvectorstreeview.c
trunk/app/xcf/xcf-load.c
trunk/tools/pdbgen/pdb/image.pdb
trunk/tools/pdbgen/pdb/layer.pdb
trunk/tools/pdbgen/pdb/paths.pdb
Modified: trunk/app/actions/channels-commands.c
==============================================================================
--- trunk/app/actions/channels-commands.c (original)
+++ trunk/app/actions/channels-commands.c Wed Sep 17 11:41:54 2008
@@ -166,7 +166,7 @@
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 @@
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 @@
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);
}
Modified: trunk/app/actions/edit-commands.c
==============================================================================
--- trunk/app/actions/edit-commands.c (original)
+++ trunk/app/actions/edit-commands.c Wed Sep 17 11:41:54 2008
@@ -339,7 +339,7 @@
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);
}
Modified: trunk/app/actions/layers-commands.c
==============================================================================
--- trunk/app/actions/layers-commands.c (original)
+++ trunk/app/actions/layers-commands.c Wed Sep 17 11:41:54 2008
@@ -328,7 +328,7 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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);
}
Modified: trunk/app/actions/vectors-commands.c
==============================================================================
--- trunk/app/actions/vectors-commands.c (original)
+++ trunk/app/actions/vectors-commands.c Wed Sep 17 11:41:54 2008
@@ -187,7 +187,7 @@
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 @@
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 @@
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);
}
Modified: trunk/app/core/gimp-edit.c
==============================================================================
--- trunk/app/core/gimp-edit.c (original)
+++ trunk/app/core/gimp-edit.c Wed Sep 17 11:41:54 2008
@@ -272,7 +272,7 @@
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 @@
return NULL;
}
- gimp_image_add_layer (image, layer, 0, NULL);
+ gimp_image_add_layer (image, layer, 0);
gimp_image_undo_enable (image);
Modified: trunk/app/core/gimpimage-duplicate.c
==============================================================================
--- trunk/app/core/gimpimage-duplicate.c (original)
+++ trunk/app/core/gimpimage-duplicate.c Wed Sep 17 11:41:54 2008
@@ -137,7 +137,7 @@
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 @@
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 @@
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 */
Modified: trunk/app/core/gimpimage-merge.c
==============================================================================
--- trunk/app/core/gimpimage-merge.c (original)
+++ trunk/app/core/gimpimage-merge.c Wed Sep 17 11:41:54 2008
@@ -276,7 +276,7 @@
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_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
Modified: trunk/app/core/gimpimage-quick-mask.c
==============================================================================
--- trunk/app/core/gimpimage-quick-mask.c (original)
+++ trunk/app/core/gimpimage-quick-mask.c Wed Sep 17 11:41:54 2008
@@ -117,7 +117,7 @@
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);
}
Modified: trunk/app/core/gimpimage.c
==============================================================================
--- trunk/app/core/gimpimage.c (original)
+++ trunk/app/core/gimpimage.c Wed Sep 17 11:41:54 2008
@@ -2852,10 +2852,9 @@
}
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 @@
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_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 @@
}
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 @@
}
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);
Modified: trunk/app/core/gimpimage.h
==============================================================================
--- trunk/app/core/gimpimage.h (original)
+++ trunk/app/core/gimpimage.h Wed Sep 17 11:41:54 2008
@@ -458,8 +458,7 @@
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_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_add_vectors (GimpImage *image,
GimpVectors *vectors,
- gint position,
- GError **error);
+ gint position);
void gimp_image_remove_vectors (GimpImage *image,
GimpVectors *vectors);
Modified: trunk/app/core/gimplayer-floating-sel.c
==============================================================================
--- trunk/app/core/gimplayer-floating-sel.c (original)
+++ trunk/app/core/gimplayer-floating-sel.c Wed Sep 17 11:41:54 2008
@@ -79,7 +79,7 @@
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);
Modified: trunk/app/core/gimpselection.c
==============================================================================
--- trunk/app/core/gimpselection.c (original)
+++ trunk/app/core/gimpselection.c Wed Sep 17 11:41:54 2008
@@ -587,7 +587,7 @@
/* 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;
}
Modified: trunk/app/core/gimptemplate.c
==============================================================================
--- trunk/app/core/gimptemplate.c (original)
+++ trunk/app/core/gimptemplate.c Wed Sep 17 11:41:54 2008
@@ -406,7 +406,7 @@
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);
Modified: trunk/app/display/gimpdisplayshell-dnd.c
==============================================================================
--- trunk/app/display/gimpdisplayshell-dnd.c (original)
+++ trunk/app/display/gimpdisplayshell-dnd.c Wed Sep 17 11:41:54 2008
@@ -254,7 +254,7 @@
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_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_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_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);
Modified: trunk/app/pdb/gimppdb-utils.c
==============================================================================
--- trunk/app/pdb/gimppdb-utils.c (original)
+++ trunk/app/pdb/gimppdb-utils.c Wed Sep 17 11:41:54 2008
@@ -299,34 +299,46 @@
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
Modified: trunk/app/pdb/gimppdb-utils.h
==============================================================================
--- trunk/app/pdb/gimppdb-utils.h (original)
+++ trunk/app/pdb/gimppdb-utils.h Wed Sep 17 11:41:54 2008
@@ -52,6 +52,7 @@
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);
Modified: trunk/app/pdb/image-cmds.c
==============================================================================
--- trunk/app/pdb/image-cmds.c (original)
+++ trunk/app/pdb/image-cmds.c Wed Sep 17 11:41:54 2008
@@ -863,13 +863,12 @@
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 @@
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 @@
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 @@
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;
Modified: trunk/app/pdb/layer-cmds.c
==============================================================================
--- trunk/app/pdb/layer-cmds.c (original)
+++ trunk/app/pdb/layer-cmds.c Wed Sep 17 11:41:54 2008
@@ -550,7 +550,9 @@
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;
Modified: trunk/app/pdb/paths-cmds.c
==============================================================================
--- trunk/app/pdb/paths-cmds.c (original)
+++ trunk/app/pdb/paths-cmds.c Wed Sep 17 11:41:54 2008
@@ -303,7 +303,7 @@
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;
}
Modified: trunk/app/text/gimptext-compat.c
==============================================================================
--- trunk/app/text/gimptext-compat.c (original)
+++ trunk/app/text/gimptext-compat.c Wed Sep 17 11:41:54 2008
@@ -118,16 +118,12 @@
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);
Modified: trunk/app/tools/gimptexttool.c
==============================================================================
--- trunk/app/tools/gimptexttool.c (original)
+++ trunk/app/tools/gimptexttool.c Wed Sep 17 11:41:54 2008
@@ -803,7 +803,7 @@
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_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_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)
{
Modified: trunk/app/tools/gimpvectortool.c
==============================================================================
--- trunk/app/tools/gimpvectortool.c (original)
+++ trunk/app/tools/gimpvectortool.c Wed Sep 17 11:41:54 2008
@@ -303,7 +303,7 @@
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);
Modified: trunk/app/vectors/gimpvectors-import.c
==============================================================================
--- trunk/app/vectors/gimpvectors-import.c (original)
+++ trunk/app/vectors/gimpvectors-import.c Wed Sep 17 11:41:54 2008
@@ -305,7 +305,7 @@
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)
Modified: trunk/app/widgets/gimpchanneltreeview.c
==============================================================================
--- trunk/app/widgets/gimpchanneltreeview.c (original)
+++ trunk/app/widgets/gimpchanneltreeview.c Wed Sep 17 11:41:54 2008
@@ -211,7 +211,7 @@
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 @@
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_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);
Modified: trunk/app/widgets/gimpitemtreeview.c
==============================================================================
--- trunk/app/widgets/gimpitemtreeview.c (original)
+++ trunk/app/widgets/gimpitemtreeview.c Wed Sep 17 11:41:54 2008
@@ -734,7 +734,7 @@
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)
{
Modified: trunk/app/widgets/gimpitemtreeview.h
==============================================================================
--- trunk/app/widgets/gimpitemtreeview.h (original)
+++ trunk/app/widgets/gimpitemtreeview.h Wed Sep 17 11:41:54 2008
@@ -37,8 +37,7 @@
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);
Modified: trunk/app/widgets/gimplayertreeview.c
==============================================================================
--- trunk/app/widgets/gimplayertreeview.c (original)
+++ trunk/app/widgets/gimplayertreeview.c Wed Sep 17 11:41:54 2008
@@ -772,7 +772,7 @@
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 @@
_("Dropped Buffer"),
GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE);
- gimp_image_add_layer (image, new_layer, index, NULL);
+ gimp_image_add_layer (image, new_layer, index);
gimp_image_flush (image);
}
@@ -840,7 +840,7 @@
gimp_image_base_type_with_alpha (image),
_("Empty Layer"), 1.0, GIMP_NORMAL_MODE);
- gimp_image_add_layer (image, new_layer, -1, NULL);
+ gimp_image_add_layer (image, new_layer, -1);
gimp_image_undo_group_end (image);
Modified: trunk/app/widgets/gimptoolbox-dnd.c
==============================================================================
--- trunk/app/widgets/gimptoolbox-dnd.c (original)
+++ trunk/app/widgets/gimptoolbox-dnd.c Wed Sep 17 11:41:54 2008
@@ -223,7 +223,7 @@
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, NULL);
+ gimp_image_add_layer (new_image, new_layer, 0);
gimp_image_undo_enable (new_image);
@@ -309,7 +309,7 @@
gimp_object_take_name (GIMP_OBJECT (new_layer),
g_strdup_printf (_("%s Channel Copy"), desc));
- gimp_image_add_layer (new_image, new_layer, 0, NULL);
+ gimp_image_add_layer (new_image, new_layer, 0);
gimp_image_undo_enable (new_image);
@@ -358,7 +358,7 @@
_("Dropped Buffer"),
GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE);
- gimp_image_add_layer (new_image, new_layer, 0, NULL);
+ gimp_image_add_layer (new_image, new_layer, 0);
gimp_image_undo_enable (new_image);
Modified: trunk/app/widgets/gimpvectorstreeview.c
==============================================================================
--- trunk/app/widgets/gimpvectorstreeview.c (original)
+++ trunk/app/widgets/gimpvectorstreeview.c Wed Sep 17 11:41:54 2008
@@ -252,7 +252,7 @@
new_vectors = gimp_vectors_new (image, _("Empty Path"));
- gimp_image_add_vectors (image, new_vectors, -1, NULL);
+ gimp_image_add_vectors (image, new_vectors, -1);
return GIMP_ITEM (new_vectors);
}
Modified: trunk/app/xcf/xcf-load.c
==============================================================================
--- trunk/app/xcf/xcf-load.c (original)
+++ trunk/app/xcf/xcf-load.c Wed Sep 17 11:41:54 2008
@@ -201,8 +201,7 @@
/* 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),
- NULL);
+ gimp_container_num_children (image->layers));
/* restore the saved position so we'll be ready to
* read the next offset.
@@ -243,8 +242,7 @@
/* 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),
- NULL);
+ gimp_container_num_children (image->channels));
/* restore the saved position so we'll be ready to
* read the next offset.
@@ -1627,8 +1625,7 @@
gimp_item_set_tattoo (GIMP_ITEM (vectors), tattoo);
gimp_image_add_vectors (image, vectors,
- gimp_container_num_children (image->vectors),
- NULL);
+ gimp_container_num_children (image->vectors));
return TRUE;
}
@@ -1817,8 +1814,7 @@
}
gimp_image_add_vectors (image, vectors,
- gimp_container_num_children (image->vectors),
- NULL);
+ gimp_container_num_children (image->vectors));
return TRUE;
}
Modified: trunk/tools/pdbgen/pdb/image.pdb
==============================================================================
--- trunk/tools/pdbgen/pdb/image.pdb (original)
+++ trunk/tools/pdbgen/pdb/image.pdb Wed Sep 17 11:41:54 2008
@@ -954,13 +954,12 @@
$invoke{code} = <<'CODE';
{
- 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
{
@@ -1016,7 +1015,7 @@
%invoke = (
code => <<'CODE'
{
- 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;
@@ -1162,10 +1161,9 @@
%invoke = (
code => <<'CODE'
{
- 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
{
@@ -1227,10 +1225,9 @@
$invoke{code} = <<'CODE';
{
- 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
{
Modified: trunk/tools/pdbgen/pdb/layer.pdb
==============================================================================
--- trunk/tools/pdbgen/pdb/layer.pdb (original)
+++ trunk/tools/pdbgen/pdb/layer.pdb Wed Sep 17 11:41:54 2008
@@ -276,7 +276,9 @@
%invoke = (
code => <<'CODE'
{
- 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;
Modified: trunk/tools/pdbgen/pdb/paths.pdb
==============================================================================
--- trunk/tools/pdbgen/pdb/paths.pdb (original)
+++ trunk/tools/pdbgen/pdb/paths.pdb Wed Sep 17 11:41:54 2008
@@ -242,7 +242,7 @@
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;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]