gimp r26963 - in trunk: . app/actions app/core app/display app/pdb app/text app/tools app/vectors app/widgets app/xcf tools/pdbgen/pdb



Author: mitch
Date: Wed Sep 17 08:27:35 2008
New Revision: 26963
URL: http://svn.gnome.org/viewvc/gimp?rev=26963&view=rev

Log:
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.



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/image-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/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 08:27:35 2008
@@ -166,7 +166,7 @@
                               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 @@
                                            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 @@
                                       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);
     }
 

Modified: trunk/app/actions/edit-commands.c
==============================================================================
--- trunk/app/actions/edit-commands.c	(original)
+++ trunk/app/actions/edit-commands.c	Wed Sep 17 08:27:35 2008
@@ -339,7 +339,7 @@
                                          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);
     }

Modified: trunk/app/actions/layers-commands.c
==============================================================================
--- trunk/app/actions/layers-commands.c	(original)
+++ trunk/app/actions/layers-commands.c	Wed Sep 17 08:27:35 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);
+  gimp_image_add_layer (image, new_layer, -1, NULL);
 
   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);
+  gimp_image_add_layer (image, layer, -1, NULL);
 
   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);
+  gimp_image_add_layer (image, new_layer, -1, NULL);
 
   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);
+      gimp_image_add_vectors (image, vectors, -1, NULL);
       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);
+      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 @@
           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);
         }

Modified: trunk/app/actions/vectors-commands.c
==============================================================================
--- trunk/app/actions/vectors-commands.c	(original)
+++ trunk/app/actions/vectors-commands.c	Wed Sep 17 08:27:35 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);
+  gimp_image_add_vectors (image, new_vectors, -1, NULL);
 
   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);
+  gimp_image_add_vectors (image, new_vectors, -1, NULL);
   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);
+      gimp_image_add_vectors (options->image, new_vectors, -1, NULL);
 
       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 08:27:35 2008
@@ -272,7 +272,7 @@
   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 @@
       return NULL;
     }
 
-  gimp_image_add_layer (image, layer, 0);
+  gimp_image_add_layer (image, layer, 0, NULL);
 
   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 08:27:35 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++);
+        gimp_image_add_layer (new_image, new_layer, count++, NULL);
     }
 
   /*  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++);
+      gimp_image_add_channel (new_image, new_channel, count++, NULL);
     }
 
   /*  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++);
+      gimp_image_add_vectors (new_image, new_vectors, count++, NULL);
     }
 
   /*  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 08:27:35 2008
@@ -276,7 +276,7 @@
 
       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_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

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 08:27:35 2008
@@ -117,7 +117,7 @@
           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);
         }

Modified: trunk/app/core/gimpimage.c
==============================================================================
--- trunk/app/core/gimpimage.c	(original)
+++ trunk/app/core/gimpimage.c	Wed Sep 17 08:27:35 2008
@@ -2852,9 +2852,10 @@
 }
 
 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 @@
 
   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)
-    {
-      g_warning ("%s: attempting to add layer to wrong image.", G_STRFUNC);
-      return FALSE;
-    }
-
-  if (gimp_container_have (image->layers, GIMP_OBJECT (layer)))
+  if (gimp_item_get_image (GIMP_ITEM (layer)) != image)
     {
-      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 @@
 
   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_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 @@
 }
 
 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)
-    {
-      g_warning ("%s: attempting to add channel to wrong image.", G_STRFUNC);
-      return FALSE;
-    }
-
-  if (gimp_container_have (image->channels, GIMP_OBJECT (channel)))
+  if (gimp_item_get_image (GIMP_ITEM (channel)) != image)
     {
-      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 @@
 }
 
 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)
-    {
-      g_warning ("%s: attempting to add vectors to wrong image.", G_STRFUNC);
-      return FALSE;
-    }
-
-  if (gimp_container_have (image->vectors, GIMP_OBJECT (vectors)))
+  if (gimp_item_get_image (GIMP_ITEM (vectors)) != image)
     {
-      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;
     }
 

Modified: trunk/app/core/gimpimage.h
==============================================================================
--- trunk/app/core/gimpimage.h	(original)
+++ trunk/app/core/gimpimage.h	Wed Sep 17 08:27:35 2008
@@ -458,7 +458,8 @@
 
 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_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_add_vectors           (GimpImage          *image,
                                                   GimpVectors        *vectors,
-                                                  gint                position);
+                                                  gint                position,
+                                                  GError            **error);
 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 08:27:35 2008
@@ -79,7 +79,7 @@
                                               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);

Modified: trunk/app/core/gimpselection.c
==============================================================================
--- trunk/app/core/gimpselection.c	(original)
+++ trunk/app/core/gimpselection.c	Wed Sep 17 08:27:35 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);
+  gimp_image_add_channel (image, new_channel, -1, NULL);
 
   return new_channel;
 }

Modified: trunk/app/core/gimptemplate.c
==============================================================================
--- trunk/app/core/gimptemplate.c	(original)
+++ trunk/app/core/gimptemplate.c	Wed Sep 17 08:27:35 2008
@@ -406,7 +406,7 @@
   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);

Modified: trunk/app/display/gimpdisplayshell-dnd.c
==============================================================================
--- trunk/app/display/gimpdisplayshell-dnd.c	(original)
+++ trunk/app/display/gimpdisplayshell-dnd.c	Wed Sep 17 08:27:35 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);
+      gimp_image_add_layer (image, new_layer, -1, NULL);
 
       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);
+      gimp_image_add_vectors (image, new_vectors, -1, NULL);
 
       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);
+      gimp_image_add_layer (dest_image, new_layer, -1, NULL);
 
       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);
+      gimp_image_add_layer (image, new_layer, -1, NULL);
 
       gimp_image_undo_group_end (image);
 

Modified: trunk/app/pdb/image-cmds.c
==============================================================================
--- trunk/app/pdb/image-cmds.c	(original)
+++ trunk/app/pdb/image-cmds.c	Wed Sep 17 08:27:35 2008
@@ -868,7 +868,8 @@
                                        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 @@
     {
       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 @@
     {
       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
         {

Modified: trunk/app/pdb/paths-cmds.c
==============================================================================
--- trunk/app/pdb/paths-cmds.c	(original)
+++ trunk/app/pdb/paths-cmds.c	Wed Sep 17 08:27:35 2008
@@ -303,7 +303,7 @@
           g_free (points);
 
           if (vectors)
-            gimp_image_add_vectors (image, vectors, 0);
+            success = gimp_image_add_vectors (image, vectors, 0, error);
           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 08:27:35 2008
@@ -118,12 +118,16 @@
   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);

Modified: trunk/app/tools/gimptexttool.c
==============================================================================
--- trunk/app/tools/gimptexttool.c	(original)
+++ trunk/app/tools/gimptexttool.c	Wed Sep 17 08:27:35 2008
@@ -803,7 +803,7 @@
       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_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_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)
     {

Modified: trunk/app/tools/gimpvectortool.c
==============================================================================
--- trunk/app/tools/gimpvectortool.c	(original)
+++ trunk/app/tools/gimpvectortool.c	Wed Sep 17 08:27:35 2008
@@ -303,7 +303,7 @@
 
       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);

Modified: trunk/app/vectors/gimpvectors-import.c
==============================================================================
--- trunk/app/vectors/gimpvectors-import.c	(original)
+++ trunk/app/vectors/gimpvectors-import.c	Wed Sep 17 08:27:35 2008
@@ -305,7 +305,7 @@
                   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)

Modified: trunk/app/widgets/gimpchanneltreeview.c
==============================================================================
--- trunk/app/widgets/gimpchanneltreeview.c	(original)
+++ trunk/app/widgets/gimpchanneltreeview.c	Wed Sep 17 08:27:35 2008
@@ -211,7 +211,7 @@
 
       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 @@
   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_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);
 

Modified: trunk/app/widgets/gimpitemtreeview.c
==============================================================================
--- trunk/app/widgets/gimpitemtreeview.c	(original)
+++ trunk/app/widgets/gimpitemtreeview.c	Wed Sep 17 08:27:35 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);
+      item_view_class->add_item (item_view->image, new_item, dest_index, NULL);
     }
   else if (dest_viewable)
     {

Modified: trunk/app/widgets/gimpitemtreeview.h
==============================================================================
--- trunk/app/widgets/gimpitemtreeview.h	(original)
+++ trunk/app/widgets/gimpitemtreeview.h	Wed Sep 17 08:27:35 2008
@@ -37,7 +37,8 @@
                                                   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);

Modified: trunk/app/widgets/gimplayertreeview.c
==============================================================================
--- trunk/app/widgets/gimplayertreeview.c	(original)
+++ trunk/app/widgets/gimplayertreeview.c	Wed Sep 17 08:27:35 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);
+  gimp_image_add_layer (item_view->image, GIMP_LAYER (new_item), index, NULL);
   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);
+  gimp_image_add_layer (image, new_layer, index, NULL);
   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);
+  gimp_image_add_layer (image, new_layer, -1, NULL);
 
   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 08:27:35 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);
+  gimp_image_add_layer (new_image, new_layer, 0, NULL);
 
   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);
+  gimp_image_add_layer (new_image, new_layer, 0, NULL);
 
   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);
+  gimp_image_add_layer (new_image, new_layer, 0, NULL);
 
   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 08:27:35 2008
@@ -252,7 +252,7 @@
 
   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);
 }

Modified: trunk/app/xcf/xcf-load.c
==============================================================================
--- trunk/app/xcf/xcf-load.c	(original)
+++ trunk/app/xcf/xcf-load.c	Wed Sep 17 08:27:35 2008
@@ -201,7 +201,8 @@
       /* 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 @@
       /* 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 @@
     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 @@
     }
 
   gimp_image_add_vectors (image, vectors,
-                          gimp_container_num_children (image->vectors));
+                          gimp_container_num_children (image->vectors),
+                          NULL);
 
   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 08:27:35 2008
@@ -959,7 +959,8 @@
 				   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 @@
 {
   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 @@
 {
   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
     {

Modified: trunk/tools/pdbgen/pdb/paths.pdb
==============================================================================
--- trunk/tools/pdbgen/pdb/paths.pdb	(original)
+++ trunk/tools/pdbgen/pdb/paths.pdb	Wed Sep 17 08:27:35 2008
@@ -242,7 +242,7 @@
       g_free (points);
 
       if (vectors)
-        gimp_image_add_vectors (image, vectors, 0);
+        success = gimp_image_add_vectors (image, vectors, 0, error);
       else
         success = FALSE;
     }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]