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



Author: mitch
Date: Sun Nov  2 20:46:57 2008
New Revision: 27524
URL: http://svn.gnome.org/viewvc/gimp?rev=27524&view=rev

Log:
2008-11-02  Michael Natterer  <mitch gimp org>

	* app/core/gimpimage.[ch]: add new functions
	gimp_image_get_layer_iter(), channel_iter() and vectors_iter()
	which return the GList inside the resp. GimpList.

	* app/actions/channels-actions.c
	* app/actions/layers-actions.c
	* app/actions/vectors-actions.c
	* app/core/gimpimage-convert.c
	* app/core/gimpimage-crop.c
	* app/core/gimpimage-duplicate.c
	* app/core/gimpimage-flip.c
	* app/core/gimpimage-item-list.c
	* app/core/gimpimage-merge.c
	* app/core/gimpimage-resize.c
	* app/core/gimpimage-rotate.c
	* app/core/gimpimage-scale.c
	* app/core/gimpimage.c
	* app/core/gimpimage.h
	* app/core/gimpprojection-construct.c
	* app/display/gimpdisplayshell-draw.c
	* app/file/file-open.c
	* app/tools/gimpaligntool.c
	* app/tools/gimpdrawtool.c
	* app/vectors/gimpvectors-compat.c
	* app/vectors/gimpvectors-export.c
	* app/widgets/gimplayertreeview.c
	* app/xcf/xcf-save.c
	* tools/pdbgen/pdb/image.pdb: use the new functions instead of
	peeking both into the image and the list. Remove inclusions of
	"gimplist.h" or change them into "gimpcontainer.h" if needed.

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



Modified:
   trunk/ChangeLog
   trunk/app/actions/channels-actions.c
   trunk/app/actions/layers-actions.c
   trunk/app/actions/vectors-actions.c
   trunk/app/core/gimpimage-convert.c
   trunk/app/core/gimpimage-crop.c
   trunk/app/core/gimpimage-duplicate.c
   trunk/app/core/gimpimage-flip.c
   trunk/app/core/gimpimage-item-list.c
   trunk/app/core/gimpimage-merge.c
   trunk/app/core/gimpimage-resize.c
   trunk/app/core/gimpimage-rotate.c
   trunk/app/core/gimpimage-scale.c
   trunk/app/core/gimpimage.c
   trunk/app/core/gimpimage.h
   trunk/app/core/gimpprojection-construct.c
   trunk/app/display/gimpdisplayshell-draw.c
   trunk/app/file/file-open.c
   trunk/app/pdb/image-cmds.c
   trunk/app/tools/gimpaligntool.c
   trunk/app/tools/gimpdrawtool.c
   trunk/app/vectors/gimpvectors-compat.c
   trunk/app/vectors/gimpvectors-export.c
   trunk/app/widgets/gimplayertreeview.c
   trunk/app/xcf/xcf-save.c
   trunk/tools/pdbgen/pdb/image.pdb

Modified: trunk/app/actions/channels-actions.c
==============================================================================
--- trunk/app/actions/channels-actions.c	(original)
+++ trunk/app/actions/channels-actions.c	Sun Nov  2 20:46:57 2008
@@ -26,7 +26,6 @@
 #include "actions-types.h"
 
 #include "core/gimpimage.h"
-#include "core/gimplist.h"
 
 #include "widgets/gimpactiongroup.h"
 #include "widgets/gimpcomponenteditor.h"
@@ -145,7 +144,7 @@
 channels_actions_update (GimpActionGroup *group,
                          gpointer         data)
 {
-  GimpImage   *image    = action_data_get_image (data);
+  GimpImage   *image     = action_data_get_image (data);
   GimpChannel *channel   = NULL;
   gboolean     fs        = FALSE;
   gboolean     component = FALSE;
@@ -169,7 +168,7 @@
             {
               GList *list;
 
-              list = g_list_find (GIMP_LIST (image->channels)->list, channel);
+              list = g_list_find (gimp_image_get_channel_iter (image), channel);
 
               if (list)
                 {

Modified: trunk/app/actions/layers-actions.c
==============================================================================
--- trunk/app/actions/layers-actions.c	(original)
+++ trunk/app/actions/layers-actions.c	Sun Nov  2 20:46:57 2008
@@ -28,7 +28,6 @@
 #include "core/gimpimage.h"
 #include "core/gimplayer.h"
 #include "core/gimplayermask.h"
-#include "core/gimplist.h"
 
 #include "text/gimptextlayer.h"
 
@@ -467,7 +466,7 @@
 layers_actions_update (GimpActionGroup *group,
                        gpointer         data)
 {
-  GimpImage     *image     = action_data_get_image (data);
+  GimpImage     *image      = action_data_get_image (data);
   GimpLayer     *layer      = NULL;
   GimpLayerMask *mask       = NULL;     /*  layer mask             */
   gboolean       fs         = FALSE;    /*  floating sel           */
@@ -497,7 +496,7 @@
           lock_alpha = gimp_layer_get_lock_alpha (layer);
           alpha      = gimp_drawable_has_alpha (GIMP_DRAWABLE (layer));
 
-          list = g_list_find (GIMP_LIST (image->layers)->list, layer);
+          list = g_list_find (gimp_image_get_layer_iter (image), layer);
 
           if (list)
             {

Modified: trunk/app/actions/vectors-actions.c
==============================================================================
--- trunk/app/actions/vectors-actions.c	(original)
+++ trunk/app/actions/vectors-actions.c	Sun Nov  2 20:46:57 2008
@@ -27,7 +27,6 @@
 
 #include "core/gimpchannel.h"
 #include "core/gimpimage.h"
-#include "core/gimplist.h"
 
 #include "widgets/gimpactiongroup.h"
 #include "widgets/gimphelp-ids.h"
@@ -237,7 +236,7 @@
 vectors_actions_update (GimpActionGroup *group,
                         gpointer         data)
 {
-  GimpImage   *image     = action_data_get_image (data);
+  GimpImage   *image      = action_data_get_image (data);
   GimpVectors *vectors    = NULL;
   gint         n_vectors  = 0;
   gboolean     mask_empty = TRUE;
@@ -263,7 +262,7 @@
           visible = gimp_item_get_visible (item);
           linked  = gimp_item_get_linked  (item);
 
-          list = g_list_find (GIMP_LIST (image->vectors)->list, vectors);
+          list = g_list_find (gimp_image_get_vectors_iter (image), vectors);
 
           if (list)
             {

Modified: trunk/app/core/gimpimage-convert.c
==============================================================================
--- trunk/app/core/gimpimage-convert.c	(original)
+++ trunk/app/core/gimpimage-convert.c	Sun Nov  2 20:46:57 2008
@@ -145,13 +145,13 @@
 #include "base/tile-manager.h"
 
 #include "gimp.h"
+#include "gimpcontainer.h"
 #include "gimpdrawable.h"
 #include "gimpdrawable-convert.h"
 #include "gimpimage.h"
 #include "gimpimage-colormap.h"
 #include "gimpimage-undo.h"
 #include "gimpimage-undo-push.h"
-#include "gimplist.h"
 #include "gimplayer.h"
 #include "gimplayer-floating-sel.h"
 #include "gimppalette.h"
@@ -798,7 +798,7 @@
 
   gimp_set_busy (image->gimp);
 
-  n_layers = g_list_length (GIMP_LIST (image->layers)->list);
+  n_layers = gimp_container_num_children (GIMP_CONTAINER (image->layers));
 
   switch (new_type)
     {
@@ -870,7 +870,7 @@
           num_found_cols = 0;
 
           /*  Build the histogram  */
-          for (list = GIMP_LIST (image->layers)->list, nth_layer = 0;
+          for (list = gimp_image_get_layer_iter (image), nth_layer = 0;
                list;
                list = g_list_next (list), nth_layer++)
             {
@@ -955,7 +955,7 @@
   if (quantobj)
     quantobj->n_layers = n_layers;
 
-  for (list = GIMP_LIST (image->layers)->list, nth_layer = 0;
+  for (list = gimp_image_get_layer_iter (image), nth_layer = 0;
        list;
        list = g_list_next (list), nth_layer++)
     {
@@ -1031,7 +1031,7 @@
                             remap_table, &num_entries);
 
           /*  Convert all layers  */
-          for (list = GIMP_LIST (image->layers)->list;
+          for (list = gimp_image_get_layer_iter (image);
                list;
                list = g_list_next (list))
             {

Modified: trunk/app/core/gimpimage-crop.c
==============================================================================
--- trunk/app/core/gimpimage-crop.c	(original)
+++ trunk/app/core/gimpimage-crop.c	Sun Nov  2 20:46:57 2008
@@ -36,7 +36,6 @@
 #include "gimpimage-undo.h"
 #include "gimpimage-undo-push.h"
 #include "gimplayer.h"
-#include "gimplist.h"
 #include "gimppickable.h"
 #include "gimpsamplepoint.h"
 
@@ -147,7 +146,7 @@
                     NULL);
 
       /*  Resize all channels  */
-      for (list = GIMP_LIST (image->channels)->list;
+      for (list = gimp_image_get_channel_iter (image);
            list;
            list = g_list_next (list))
         {
@@ -157,7 +156,7 @@
         }
 
       /*  Resize all vectors  */
-      for (list = GIMP_LIST (image->vectors)->list;
+      for (list = gimp_image_get_vectors_iter (image);
            list;
            list = g_list_next (list))
         {
@@ -171,7 +170,7 @@
                         width, height, -x1, -y1);
 
       /*  crop all layers  */
-      list = GIMP_LIST (image->layers)->list;
+      list = gimp_image_get_layer_iter (image);
 
       while (list)
         {

Modified: trunk/app/core/gimpimage-duplicate.c
==============================================================================
--- trunk/app/core/gimpimage-duplicate.c	(original)
+++ trunk/app/core/gimpimage-duplicate.c	Sun Nov  2 20:46:57 2008
@@ -37,7 +37,6 @@
 #include "gimpimage-sample-points.h"
 #include "gimplayer.h"
 #include "gimplayer-floating-sel.h"
-#include "gimplist.h"
 #include "gimpparasitelist.h"
 #include "gimpsamplepoint.h"
 
@@ -105,7 +104,7 @@
     }
 
   /*  Copy the layers  */
-  for (list = GIMP_LIST (image->layers)->list, count = 0;
+  for (list = gimp_image_get_layer_iter (image), count = 0;
        list;
        list = g_list_next (list))
     {
@@ -141,7 +140,7 @@
     }
 
   /*  Copy the channels  */
-  for (list = GIMP_LIST (image->channels)->list, count = 0;
+  for (list = gimp_image_get_channel_iter (image), count = 0;
        list;
        list = g_list_next (list))
     {
@@ -166,7 +165,7 @@
     }
 
   /*  Copy any vectors  */
-  for (list = GIMP_LIST (image->vectors)->list, count = 0;
+  for (list = gimp_image_get_vectors_iter (image), count = 0;
        list;
        list = g_list_next (list))
     {

Modified: trunk/app/core/gimpimage-flip.c
==============================================================================
--- trunk/app/core/gimpimage-flip.c	(original)
+++ trunk/app/core/gimpimage-flip.c	Sun Nov  2 20:46:57 2008
@@ -23,6 +23,7 @@
 #include "core-types.h"
 
 #include "gimp.h"
+#include "gimpcontainer.h"
 #include "gimpcontext.h"
 #include "gimpguide.h"
 #include "gimpimage.h"
@@ -32,7 +33,6 @@
 #include "gimpimage-undo.h"
 #include "gimpimage-undo-push.h"
 #include "gimpitem.h"
-#include "gimplist.h"
 #include "gimpprogress.h"
 #include "gimpsamplepoint.h"
 
@@ -69,15 +69,15 @@
       return;
     }
 
-  progress_max = (image->channels->num_children +
-                  image->layers->num_children   +
-                  image->vectors->num_children  +
+  progress_max = (gimp_container_num_children (image->channels) +
+                  gimp_container_num_children (image->layers)   +
+                  gimp_container_num_children (image->vectors)  +
                   1 /* selection */);
 
   gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_IMAGE_FLIP, NULL);
 
   /*  Flip all channels  */
-  for (list = GIMP_LIST (image->channels)->list;
+  for (list = gimp_image_get_channel_iter (image);
        list;
        list = g_list_next (list))
     {
@@ -90,7 +90,7 @@
     }
 
   /*  Flip all vectors  */
-  for (list = GIMP_LIST (image->vectors)->list;
+  for (list = gimp_image_get_vectors_iter (image);
        list;
        list = g_list_next (list))
     {
@@ -110,7 +110,7 @@
     gimp_progress_set_value (progress, progress_current++ / progress_max);
 
   /*  Flip all layers  */
-  for (list = GIMP_LIST (image->layers)->list;
+  for (list = gimp_image_get_layer_iter (image);
        list;
        list = g_list_next (list))
     {

Modified: trunk/app/core/gimpimage-item-list.c
==============================================================================
--- trunk/app/core/gimpimage-item-list.c	(original)
+++ trunk/app/core/gimpimage-item-list.c	Sun Nov  2 20:46:57 2008
@@ -27,7 +27,6 @@
 #include "gimpimage-item-list.h"
 #include "gimpimage-undo.h"
 #include "gimpitem.h"
-#include "gimplist.h"
 #include "gimpprogress.h"
 
 #include "gimp-intl.h"
@@ -172,7 +171,7 @@
 
   if (type & GIMP_ITEM_TYPE_LAYERS)
     {
-      for (list = GIMP_LIST (image->layers)->list;
+      for (list = gimp_image_get_layer_iter (image);
            list;
            list = g_list_next (list))
         {
@@ -185,7 +184,7 @@
 
   if (type & GIMP_ITEM_TYPE_CHANNELS)
     {
-      for (list = GIMP_LIST (image->channels)->list;
+      for (list = gimp_image_get_channel_iter (image);
            list;
            list = g_list_next (list))
         {
@@ -198,7 +197,7 @@
 
   if (type & GIMP_ITEM_TYPE_VECTORS)
     {
-      for (list = GIMP_LIST (image->vectors)->list;
+      for (list = gimp_image_get_vectors_iter (image);
            list;
            list = g_list_next (list))
         {

Modified: trunk/app/core/gimpimage-merge.c
==============================================================================
--- trunk/app/core/gimpimage-merge.c	(original)
+++ trunk/app/core/gimpimage-merge.c	Sun Nov  2 20:46:57 2008
@@ -35,6 +35,7 @@
 #include "vectors/gimpvectors.h"
 
 #include "gimp.h"
+#include "gimpcontainer.h"
 #include "gimpcontext.h"
 #include "gimpimage.h"
 #include "gimpimage-colorhash.h"
@@ -43,7 +44,6 @@
 #include "gimplayer.h"
 #include "gimplayer-floating-sel.h"
 #include "gimplayermask.h"
-#include "gimplist.h"
 #include "gimpmarshal.h"
 #include "gimpparasitelist.h"
 #include "gimpundostack.h"
@@ -81,7 +81,7 @@
       had_floating_sel = TRUE;
     }
 
-  for (list = GIMP_LIST (image->layers)->list;
+  for (list = gimp_image_get_layer_iter (image);
        list;
        list = g_list_next (list))
     {
@@ -151,7 +151,7 @@
   if (gimp_image_floating_sel (image))
     floating_sel_anchor (image->floating_sel);
 
-  for (list = GIMP_LIST (image->layers)->list;
+  for (list = gimp_image_get_layer_iter (image);
        list;
        list = g_list_next (list))
     {
@@ -186,7 +186,7 @@
   g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
   g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
 
-  for (list = GIMP_LIST (image->layers)->list, layer_list = NULL;
+  for (list = gimp_image_get_layer_iter (image), layer_list = NULL;
        list && !layer_list;
        list = g_list_next (list))
     {
@@ -236,7 +236,7 @@
   g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
   g_return_val_if_fail (error == NULL || *error == NULL, NULL);
 
-  for (list = GIMP_LIST (image->vectors)->list;
+  for (list = gimp_image_get_vectors_iter (image);
        list;
        list = g_list_next (list))
     {
@@ -584,7 +584,7 @@
   /*  if the type is flatten, remove all the remaining layers  */
   if (merge_type == GIMP_FLATTEN_IMAGE)
     {
-      list = GIMP_LIST (image->layers)->list;
+      list = gimp_image_get_layer_iter (image);
       while (list)
         {
           layer = list->data;

Modified: trunk/app/core/gimpimage-resize.c
==============================================================================
--- trunk/app/core/gimpimage-resize.c	(original)
+++ trunk/app/core/gimpimage-resize.c	Sun Nov  2 20:46:57 2008
@@ -23,6 +23,7 @@
 #include "core-types.h"
 
 #include "gimp.h"
+#include "gimpcontainer.h"
 #include "gimpchannel.h"
 #include "gimpcontext.h"
 #include "gimpguide.h"
@@ -34,7 +35,6 @@
 #include "gimpimage-undo.h"
 #include "gimpimage-undo-push.h"
 #include "gimplayer.h"
-#include "gimplist.h"
 #include "gimpprogress.h"
 #include "gimpsamplepoint.h"
 
@@ -79,9 +79,9 @@
 
   gimp_set_busy (image->gimp);
 
-  progress_max = (image->channels->num_children +
-                  image->layers->num_children   +
-                  image->vectors->num_children  +
+  progress_max = (gimp_container_num_children (image->channels) +
+                  gimp_container_num_children (image->layers)   +
+                  gimp_container_num_children (image->vectors)  +
                   1 /* selection */);
 
   g_object_freeze_notify (G_OBJECT (image));
@@ -111,7 +111,7 @@
                 NULL);
 
   /*  Resize all channels  */
-  for (list = GIMP_LIST (image->channels)->list;
+  for (list = gimp_image_get_channel_iter (image);
        list;
        list = g_list_next (list))
     {
@@ -125,7 +125,7 @@
     }
 
   /*  Resize all vectors  */
-  for (list = GIMP_LIST (image->vectors)->list;
+  for (list = gimp_image_get_vectors_iter (image);
        list;
        list = g_list_next (list))
     {
@@ -146,7 +146,7 @@
     gimp_progress_set_value (progress, progress_current++ / progress_max);
 
   /*  Reposition all layers  */
-  for (list = GIMP_LIST (image->layers)->list;
+  for (list = gimp_image_get_layer_iter (image);
        list;
        list = g_list_next (list))
     {
@@ -241,7 +241,7 @@
                              GimpContext  *context,
                              GimpProgress *progress)
 {
-  GList    *list = GIMP_LIST (image->layers)->list;
+  GList    *list = gimp_image_get_layer_iter (image);
   GimpItem *item;
   gint      min_x, max_x;
   gint      min_y, max_y;

Modified: trunk/app/core/gimpimage-rotate.c
==============================================================================
--- trunk/app/core/gimpimage-rotate.c	(original)
+++ trunk/app/core/gimpimage-rotate.c	Sun Nov  2 20:46:57 2008
@@ -23,6 +23,7 @@
 #include "core-types.h"
 
 #include "gimp.h"
+#include "gimpcontainer.h"
 #include "gimpcontext.h"
 #include "gimpguide.h"
 #include "gimpimage.h"
@@ -32,7 +33,6 @@
 #include "gimpimage-undo.h"
 #include "gimpimage-undo-push.h"
 #include "gimpitem.h"
-#include "gimplist.h"
 #include "gimpprogress.h"
 #include "gimpsamplepoint.h"
 
@@ -79,9 +79,9 @@
   center_x              = previous_image_width  / 2.0;
   center_y              = previous_image_height / 2.0;
 
-  progress_max = (image->channels->num_children +
-                  image->layers->num_children   +
-                  image->vectors->num_children  +
+  progress_max = (gimp_container_num_children (image->channels) +
+                  gimp_container_num_children (image->layers)   +
+                  gimp_container_num_children (image->vectors)  +
                   1 /* selection */);
 
   g_object_freeze_notify (G_OBJECT (image));
@@ -114,7 +114,7 @@
     }
 
   /*  Rotate all channels  */
-  for (list = GIMP_LIST (image->channels)->list;
+  for (list = gimp_image_get_channel_iter (image);
        list;
        list = g_list_next (list))
     {
@@ -130,7 +130,7 @@
     }
 
   /*  Rotate all vectors  */
-  for (list = GIMP_LIST (image->vectors)->list;
+  for (list = gimp_image_get_vectors_iter (image);
        list;
        list = g_list_next (list))
     {
@@ -167,7 +167,7 @@
   }
 
   /*  Rotate all layers  */
-  for (list = GIMP_LIST (image->layers)->list;
+  for (list = gimp_image_get_layer_iter (image);
        list;
        list = g_list_next (list))
     {

Modified: trunk/app/core/gimpimage-scale.c
==============================================================================
--- trunk/app/core/gimpimage-scale.c	(original)
+++ trunk/app/core/gimpimage-scale.c	Sun Nov  2 20:46:57 2008
@@ -25,6 +25,7 @@
 #include "base/tile-manager.h"
 
 #include "gimp.h"
+#include "gimpcontainer.h"
 #include "gimpguide.h"
 #include "gimpimage.h"
 #include "gimpimage-guides.h"
@@ -34,7 +35,6 @@
 #include "gimpimage-undo.h"
 #include "gimpimage-undo-push.h"
 #include "gimplayer.h"
-#include "gimplist.h"
 #include "gimpprogress.h"
 #include "gimpprojection.h"
 #include "gimpsamplepoint.h"
@@ -71,9 +71,9 @@
 
   sub_progress = gimp_sub_progress_new (progress);
 
-  progress_steps = (image->channels->num_children +
-                    image->layers->num_children   +
-                    image->vectors->num_children  +
+  progress_steps = (gimp_container_num_children (image->channels) +
+                    gimp_container_num_children (image->layers)   +
+                    gimp_container_num_children (image->vectors)  +
                     1 /* selection */);
 
   g_object_freeze_notify (G_OBJECT (image));
@@ -104,7 +104,7 @@
                 NULL);
 
   /*  Scale all channels  */
-  for (list = GIMP_LIST (image->channels)->list;
+  for (list = gimp_image_get_channel_iter (image);
        list;
        list = g_list_next (list))
     {
@@ -119,7 +119,7 @@
     }
 
   /*  Scale all vectors  */
-  for (list = GIMP_LIST (image->vectors)->list;
+  for (list = gimp_image_get_vectors_iter (image);
        list;
        list = g_list_next (list))
     {
@@ -142,7 +142,7 @@
                    interpolation_type, sub_progress);
 
   /*  Scale all layers  */
-  for (list = GIMP_LIST (image->layers)->list;
+  for (list = gimp_image_get_layer_iter (image);
        list;
        list = g_list_next (list))
     {
@@ -331,7 +331,7 @@
   if (new_size > current_size && new_size > max_memsize)
     return GIMP_IMAGE_SCALE_TOO_BIG;
 
-  for (list = GIMP_LIST (image->layers)->list;
+  for (list = gimp_image_get_layer_iter (image);
        list;
        list = g_list_next (list))
     {

Modified: trunk/app/core/gimpimage.c
==============================================================================
--- trunk/app/core/gimpimage.c	(original)
+++ trunk/app/core/gimpimage.c	Sun Nov  2 20:46:57 2008
@@ -1067,7 +1067,9 @@
                           (GFunc) gimp_viewable_size_changed,
                           NULL);
 
-  for (list = GIMP_LIST (image->layers)->list; list; list = g_list_next (list))
+  for (list = gimp_image_get_layer_iter (image);
+       list;
+       list = g_list_next (list))
     {
       GimpLayerMask *mask = gimp_layer_get_mask (GIMP_LAYER (list->data));
 
@@ -2376,7 +2378,7 @@
   g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
 
   /* Check that the layer tattoos don't overlap with channel or vector ones */
-  for (list = GIMP_LIST (image->layers)->list;
+  for (list = gimp_image_get_layer_iter (image);
        list;
        list = g_list_next (list))
     {
@@ -2394,7 +2396,7 @@
     }
 
   /* Now check that the channel and vectors tattoos don't overlap */
-  for (list = GIMP_LIST (image->channels)->list;
+  for (list = gimp_image_get_channel_iter (image);
        list;
        list = g_list_next (list))
     {
@@ -2409,7 +2411,7 @@
     }
 
   /* Find the max tattoo value in the vectors */
-  for (list = GIMP_LIST (image->vectors)->list;
+  for (list = gimp_image_get_vectors_iter (image);
        list;
        list = g_list_next (list))
     {
@@ -2510,6 +2512,30 @@
   return image->vectors;
 }
 
+GList *
+gimp_image_get_layer_iter (const GimpImage *image)
+{
+  g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
+
+  return GIMP_LIST (image->layers)->list;
+}
+
+GList *
+gimp_image_get_channel_iter (const GimpImage *image)
+{
+  g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
+
+  return GIMP_LIST (image->channels)->list;
+}
+
+GList *
+gimp_image_get_vectors_iter (const GimpImage *image)
+{
+  g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
+
+  return GIMP_LIST (image->vectors)->list;
+}
+
 GimpDrawable *
 gimp_image_get_active_drawable (const GimpImage *image)
 {
@@ -3654,7 +3680,7 @@
 
   g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
 
-  for (list = GIMP_LIST (image->layers)->list;
+  for (list = gimp_image_get_layer_iter (image);
        list;
        list = g_list_next (list))
     {

Modified: trunk/app/core/gimpimage.h
==============================================================================
--- trunk/app/core/gimpimage.h	(original)
+++ trunk/app/core/gimpimage.h	Sun Nov  2 20:46:57 2008
@@ -416,6 +416,10 @@
 GimpContainer * gimp_image_get_channels          (const GimpImage    *image);
 GimpContainer * gimp_image_get_vectors           (const GimpImage    *image);
 
+GList         * gimp_image_get_layer_iter        (const GimpImage    *image);
+GList         * gimp_image_get_channel_iter      (const GimpImage    *image);
+GList         * gimp_image_get_vectors_iter      (const GimpImage    *image);
+
 GimpDrawable  * gimp_image_get_active_drawable   (const GimpImage    *image);
 GimpLayer     * gimp_image_get_active_layer      (const GimpImage    *image);
 GimpChannel   * gimp_image_get_active_channel    (const GimpImage    *image);

Modified: trunk/app/core/gimpprojection-construct.c
==============================================================================
--- trunk/app/core/gimpprojection-construct.c	(original)
+++ trunk/app/core/gimpprojection-construct.c	Sun Nov  2 20:46:57 2008
@@ -34,7 +34,6 @@
 #include "gimplayer.h"
 #include "gimplayer-floating-sel.h"
 #include "gimplayermask.h"
-#include "gimplist.h"
 #include "gimpprojection.h"
 #include "gimpprojection-construct.h"
 
@@ -214,7 +213,7 @@
 
   reverse_list = NULL;
 
-  for (list = GIMP_LIST (proj->image->layers)->list;
+  for (list = gimp_image_get_layer_iter (proj->image);
        list;
        list = g_list_next (list))
     {
@@ -329,7 +328,7 @@
   GList *reverse_list = NULL;
 
   /*  reverse the channel list  */
-  for (list = GIMP_LIST (proj->image->channels)->list;
+  for (list = gimp_image_get_channel_iter (proj->image);
        list;
        list = g_list_next (list))
     {
@@ -387,7 +386,7 @@
   GList    *list;
   gboolean  coverage = FALSE;
 
-  for (list = GIMP_LIST (proj->image->layers)->list;
+  for (list = gimp_image_get_layer_iter (proj->image);
        list;
        list = g_list_next (list))
     {

Modified: trunk/app/display/gimpdisplayshell-draw.c
==============================================================================
--- trunk/app/display/gimpdisplayshell-draw.c	(original)
+++ trunk/app/display/gimpdisplayshell-draw.c	Sun Nov  2 20:46:57 2008
@@ -35,7 +35,6 @@
 #include "core/gimpimage.h"
 #include "core/gimpimage-guides.h"
 #include "core/gimpimage-sample-points.h"
-#include "core/gimplist.h"
 #include "core/gimpprojection.h"
 #include "core/gimpsamplepoint.h"
 
@@ -538,7 +537,7 @@
     {
       GList *list;
 
-      for (list = GIMP_LIST (shell->display->image->vectors)->list;
+      for (list = gimp_image_get_vectors_iter (shell->display->image);
            list;
            list = list->next)
         {

Modified: trunk/app/file/file-open.c
==============================================================================
--- trunk/app/file/file-open.c	(original)
+++ trunk/app/file/file-open.c	Sun Nov  2 20:46:57 2008
@@ -411,7 +411,7 @@
 
       gimp_image_undo_disable (new_image);
 
-      for (list = GIMP_LIST (gimp_image_get_layers (new_image))->list;
+      for (list = gimp_image_get_layer_iter (new_image);
            list;
            list = g_list_next (list))
         {

Modified: trunk/app/pdb/image-cmds.c
==============================================================================
--- trunk/app/pdb/image-cmds.c	(original)
+++ trunk/app/pdb/image-cmds.c	Sun Nov  2 20:46:57 2008
@@ -560,7 +560,7 @@
 
   if (success)
     {
-      GList *list = GIMP_LIST (image->layers)->list;
+      GList *list = gimp_image_get_layer_iter (image);
 
       num_layers = g_list_length (list);
 
@@ -605,7 +605,7 @@
 
   if (success)
     {
-      GList *list = GIMP_LIST (image->channels)->list;
+      GList *list = gimp_image_get_channel_iter (image);
 
       num_channels = g_list_length (list);
 
@@ -650,7 +650,7 @@
 
   if (success)
     {
-      GList *list = GIMP_LIST (image->vectors)->list;
+      GList *list = gimp_image_get_vectors_iter (image);
 
       num_vectors = g_list_length (list);
 

Modified: trunk/app/tools/gimpaligntool.c
==============================================================================
--- trunk/app/tools/gimpaligntool.c	(original)
+++ trunk/app/tools/gimpaligntool.c	Sun Nov  2 20:46:57 2008
@@ -35,7 +35,6 @@
 #include "core/gimpimage-guides.h"
 #include "core/gimpimage-undo.h"
 #include "core/gimplayer.h"
-#include "core/gimplist.h"
 
 #include "vectors/gimpvectors.h"
 
@@ -400,7 +399,7 @@
       gint   Y1    = MAX (coords->y, align_tool->y0);
       GList *list;
 
-      for (list = GIMP_LIST (image->layers)->list;
+      for (list = gimp_image_get_layer_iter (image);
            list;
            list = g_list_next (list))
         {
@@ -1121,7 +1120,7 @@
 
   g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
 
-  for (list = GIMP_LIST (image->layers)->list;
+  for (list = gimp_image_get_layer_iter (image);
        list;
        list = g_list_next (list))
     {

Modified: trunk/app/tools/gimpdrawtool.c
==============================================================================
--- trunk/app/tools/gimpdrawtool.c	(original)
+++ trunk/app/tools/gimpdrawtool.c	Sun Nov  2 20:46:57 2008
@@ -30,7 +30,6 @@
 #include "base/boundary.h"
 
 #include "core/gimpimage.h"
-#include "core/gimplist.h"
 
 #include "vectors/gimpanchor.h"
 #include "vectors/gimpstroke.h"
@@ -1645,7 +1644,7 @@
   if (ret_stroke)        *ret_stroke         = NULL;
   if (ret_vectors)       *ret_vectors        = NULL;
 
-  for (list = GIMP_LIST (display->image->vectors)->list;
+  for (list = gimp_image_get_vectors_iter (display->image);
        list;
        list = g_list_next (list))
     {

Modified: trunk/app/vectors/gimpvectors-compat.c
==============================================================================
--- trunk/app/vectors/gimpvectors-compat.c	(original)
+++ trunk/app/vectors/gimpvectors-compat.c	Sun Nov  2 20:46:57 2008
@@ -26,7 +26,6 @@
 #include "vectors-types.h"
 
 #include "core/gimpimage.h"
-#include "core/gimplist.h"
 
 #include "gimpanchor.h"
 #include "gimpbezierstroke.h"
@@ -132,7 +131,7 @@
 
   g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
 
-  for (list = GIMP_LIST (image->vectors)->list;
+  for (list = gimp_image_get_vectors_iter (image);
        list;
        list = g_list_next (list))
     {

Modified: trunk/app/vectors/gimpvectors-export.c
==============================================================================
--- trunk/app/vectors/gimpvectors-export.c	(original)
+++ trunk/app/vectors/gimpvectors-export.c	Sun Nov  2 20:46:57 2008
@@ -30,7 +30,6 @@
 
 #include "core/gimpimage.h"
 #include "core/gimpitem.h"
-#include "core/gimplist.h"
 #include "core/gimpunit.h"
 
 #include "gimpanchor.h"
@@ -150,8 +149,12 @@
     {
       GList *list;
 
-      for (list = GIMP_LIST (image->vectors)->list; list; list = list->next)
-        gimp_vectors_export_path (GIMP_VECTORS (list->data), str);
+      for (list = gimp_image_get_vectors_iter (image);
+           list;
+           list = list->next)
+        {
+          gimp_vectors_export_path (GIMP_VECTORS (list->data), str);
+        }
     }
 
   g_string_append (str, "</svg>\n");

Modified: trunk/app/widgets/gimplayertreeview.c
==============================================================================
--- trunk/app/widgets/gimplayertreeview.c	(original)
+++ trunk/app/widgets/gimplayertreeview.c	Sun Nov  2 20:46:57 2008
@@ -37,7 +37,6 @@
 #include "core/gimplayer.h"
 #include "core/gimplayermask.h"
 #include "core/gimplayer-floating-sel.h"
-#include "core/gimplist.h"
 #include "core/gimpimage.h"
 #include "core/gimpimage-undo.h"
 #include "core/gimpitemundo.h"
@@ -876,7 +875,7 @@
     {
       GList *list;
 
-      for (list = GIMP_LIST (image->layers)->list;
+      for (list = gimp_image_get_layer_iter (image);
            list;
            list = g_list_next (list))
         {

Modified: trunk/app/xcf/xcf-save.c
==============================================================================
--- trunk/app/xcf/xcf-save.c	(original)
+++ trunk/app/xcf/xcf-save.c	Sun Nov  2 20:46:57 2008
@@ -33,6 +33,7 @@
 #include "base/tile-manager-private.h"
 
 #include "core/gimp.h"
+#include "core/gimpcontainer.h"
 #include "core/gimpchannel.h"
 #include "core/gimpdrawable.h"
 #include "core/gimpgrid.h"
@@ -45,7 +46,6 @@
 #include "core/gimplayer.h"
 #include "core/gimplayer-floating-sel.h"
 #include "core/gimplayermask.h"
-#include "core/gimplist.h"
 #include "core/gimpparasitelist.h"
 #include "core/gimpprogress.h"
 #include "core/gimpsamplepoint.h"
@@ -186,7 +186,7 @@
   if (gimp_image_get_colormap (image))
     save_version = 1;  /* need version 1 for colormaps */
 
-  for (list = GIMP_LIST (image->layers)->list;
+  for (list = gimp_image_get_layer_iter (image);
        list && save_version < 2;
        list = g_list_next (list))
     {
@@ -286,7 +286,7 @@
                                  info->cp + (n_layers + n_channels + 2) * 4,
                                  error));
 
-  for (list = GIMP_LIST (image->layers)->list;
+  for (list = gimp_image_get_layer_iter (image);
        list;
        list = g_list_next (list))
     {
@@ -328,7 +328,7 @@
   saved_pos = info->cp;
   xcf_check_error (xcf_seek_end (info, error));
 
-  list = GIMP_LIST (image->channels)->list;
+  list = gimp_image_get_channel_iter (image);
 
   while (list || have_selection)
     {
@@ -1622,7 +1622,7 @@
   xcf_write_int32_check_error (info, &active_index, 1);
   xcf_write_int32_check_error (info, &num_paths,    1);
 
-  for (list = GIMP_LIST (image->vectors)->list;
+  for (list = gimp_image_get_vectors_iter (image);
        list;
        list = g_list_next (list))
     {
@@ -1734,7 +1734,7 @@
   xcf_write_int32_check_error (info, &active_index, 1);
   xcf_write_int32_check_error (info, &num_paths,    1);
 
-  for (list = GIMP_LIST (image->vectors)->list;
+  for (list = gimp_image_get_vectors_iter (image);
        list;
        list = g_list_next (list))
     {

Modified: trunk/tools/pdbgen/pdb/image.pdb
==============================================================================
--- trunk/tools/pdbgen/pdb/image.pdb	(original)
+++ trunk/tools/pdbgen/pdb/image.pdb	Sun Nov  2 20:46:57 2008
@@ -476,7 +476,7 @@
     %invoke = (
 	code => <<'CODE'
 {
-  GList *list = GIMP_LIST (image->layers)->list;
+  GList *list = gimp_image_get_layer_iter (image);
 
   num_layers = g_list_length (list);
 
@@ -520,7 +520,7 @@
     %invoke = (
 	code => <<'CODE'
 {
-  GList *list = GIMP_LIST (image->channels)->list;
+  GList *list = gimp_image_get_channel_iter (image);
 
   num_channels = g_list_length (list);
 
@@ -562,7 +562,7 @@
     %invoke = (
 	code => <<'CODE'
 {
-  GList *list = GIMP_LIST (image->vectors)->list;
+  GList *list = gimp_image_get_vectors_iter (image);
 
   num_vectors = g_list_length (list);
 



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