mirror of https://github.com/GNOME/gimp.git
add new functions gimp_image_get_layer_iter(), channel_iter() and
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. svn path=/trunk/; revision=27524
This commit is contained in:
parent
c14c84ba63
commit
d1ca165b4e
35
ChangeLog
35
ChangeLog
|
@ -1,3 +1,38 @@
|
|||
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.
|
||||
|
||||
2008-11-02 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/core/gimpdrawablestack.[ch]: add "update" signal with the
|
||||
|
|
|
@ -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 @@ void
|
|||
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 @@ channels_actions_update (GimpActionGroup *group,
|
|||
{
|
||||
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)
|
||||
{
|
||||
|
|
|
@ -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 @@ void
|
|||
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 @@ layers_actions_update (GimpActionGroup *group,
|
|||
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)
|
||||
{
|
||||
|
|
|
@ -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 @@ void
|
|||
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 @@ vectors_actions_update (GimpActionGroup *group,
|
|||
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)
|
||||
{
|
||||
|
|
|
@ -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_image_convert (GimpImage *image,
|
|||
|
||||
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 @@ gimp_image_convert (GimpImage *image,
|
|||
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 @@ gimp_image_convert (GimpImage *image,
|
|||
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 @@ gimp_image_convert (GimpImage *image,
|
|||
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))
|
||||
{
|
||||
|
|
|
@ -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 @@ gimp_image_crop (GimpImage *image,
|
|||
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 @@ gimp_image_crop (GimpImage *image,
|
|||
}
|
||||
|
||||
/* 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 @@ gimp_image_crop (GimpImage *image,
|
|||
width, height, -x1, -y1);
|
||||
|
||||
/* crop all layers */
|
||||
list = GIMP_LIST (image->layers)->list;
|
||||
list = gimp_image_get_layer_iter (image);
|
||||
|
||||
while (list)
|
||||
{
|
||||
|
|
|
@ -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 @@ gimp_image_duplicate (GimpImage *image)
|
|||
}
|
||||
|
||||
/* 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 @@ gimp_image_duplicate (GimpImage *image)
|
|||
}
|
||||
|
||||
/* 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 @@ gimp_image_duplicate (GimpImage *image)
|
|||
}
|
||||
|
||||
/* 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))
|
||||
{
|
||||
|
|
|
@ -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 @@ gimp_image_flip (GimpImage *image,
|
|||
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 @@ gimp_image_flip (GimpImage *image,
|
|||
}
|
||||
|
||||
/* 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_image_flip (GimpImage *image,
|
|||
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))
|
||||
{
|
||||
|
|
|
@ -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 @@ gimp_image_item_list_get_list (const GimpImage *image,
|
|||
|
||||
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 @@ gimp_image_item_list_get_list (const GimpImage *image,
|
|||
|
||||
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 @@ gimp_image_item_list_get_list (const GimpImage *image,
|
|||
|
||||
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))
|
||||
{
|
||||
|
|
|
@ -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 @@ gimp_image_merge_visible_layers (GimpImage *image,
|
|||
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 @@ gimp_image_flatten (GimpImage *image,
|
|||
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 @@ gimp_image_merge_down (GimpImage *image,
|
|||
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 @@ gimp_image_merge_visible_vectors (GimpImage *image,
|
|||
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 @@ gimp_image_merge_layers (GimpImage *image,
|
|||
/* 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;
|
||||
|
|
|
@ -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_image_resize_with_layers (GimpImage *image,
|
|||
|
||||
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 @@ gimp_image_resize_with_layers (GimpImage *image,
|
|||
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 @@ gimp_image_resize_with_layers (GimpImage *image,
|
|||
}
|
||||
|
||||
/* 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_image_resize_with_layers (GimpImage *image,
|
|||
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 @@ gimp_image_resize_to_layers (GimpImage *image,
|
|||
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;
|
||||
|
|
|
@ -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 @@ gimp_image_rotate (GimpImage *image,
|
|||
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 @@ gimp_image_rotate (GimpImage *image,
|
|||
}
|
||||
|
||||
/* 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 @@ gimp_image_rotate (GimpImage *image,
|
|||
}
|
||||
|
||||
/* 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 @@ gimp_image_rotate (GimpImage *image,
|
|||
}
|
||||
|
||||
/* Rotate all layers */
|
||||
for (list = GIMP_LIST (image->layers)->list;
|
||||
for (list = gimp_image_get_layer_iter (image);
|
||||
list;
|
||||
list = g_list_next (list))
|
||||
{
|
||||
|
|
|
@ -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 @@ gimp_image_scale (GimpImage *image,
|
|||
|
||||
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 @@ gimp_image_scale (GimpImage *image,
|
|||
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 @@ gimp_image_scale (GimpImage *image,
|
|||
}
|
||||
|
||||
/* 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 @@ gimp_image_scale (GimpImage *image,
|
|||
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 @@ gimp_image_scale_check (const GimpImage *image,
|
|||
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))
|
||||
{
|
||||
|
|
|
@ -1067,7 +1067,9 @@ gimp_image_size_changed (GimpViewable *viewable)
|
|||
(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 @@ gimp_image_set_tattoo_state (GimpImage *image,
|
|||
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 @@ gimp_image_set_tattoo_state (GimpImage *image,
|
|||
}
|
||||
|
||||
/* 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 @@ gimp_image_set_tattoo_state (GimpImage *image,
|
|||
}
|
||||
|
||||
/* 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 @@ gimp_image_get_vectors (const GimpImage *image)
|
|||
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 @@ gimp_image_pick_correlate_layer (const GimpImage *image,
|
|||
|
||||
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))
|
||||
{
|
||||
|
|
|
@ -416,6 +416,10 @@ GimpContainer * gimp_image_get_layers (const GimpImage *image);
|
|||
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);
|
||||
|
|
|
@ -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 @@ gimp_projection_construct_layers (GimpProjection *proj,
|
|||
|
||||
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 @@ gimp_projection_construct_channels (GimpProjection *proj,
|
|||
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 @@ gimp_projection_initialize (GimpProjection *proj,
|
|||
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))
|
||||
{
|
||||
|
|
|
@ -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 @@ gimp_display_shell_draw_vectors (const GimpDisplayShell *shell)
|
|||
{
|
||||
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)
|
||||
{
|
||||
|
|
|
@ -411,7 +411,7 @@ file_open_layers (Gimp *gimp,
|
|||
|
||||
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))
|
||||
{
|
||||
|
|
|
@ -560,7 +560,7 @@ image_get_layers_invoker (GimpProcedure *procedure,
|
|||
|
||||
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 @@ image_get_channels_invoker (GimpProcedure *procedure,
|
|||
|
||||
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 @@ image_get_vectors_invoker (GimpProcedure *procedure,
|
|||
|
||||
if (success)
|
||||
{
|
||||
GList *list = GIMP_LIST (image->vectors)->list;
|
||||
GList *list = gimp_image_get_vectors_iter (image);
|
||||
|
||||
num_vectors = g_list_length (list);
|
||||
|
||||
|
|
|
@ -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 @@ gimp_align_tool_button_release (GimpTool *tool,
|
|||
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 @@ select_layer_by_coords (GimpImage *image,
|
|||
|
||||
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))
|
||||
{
|
||||
|
|
|
@ -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 @@ gimp_draw_tool_on_vectors (GimpDrawTool *draw_tool,
|
|||
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))
|
||||
{
|
||||
|
|
|
@ -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 @@ gimp_vectors_compat_is_compatible (GimpImage *image)
|
|||
|
||||
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))
|
||||
{
|
||||
|
|
|
@ -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 @@ gimp_vectors_export (const GimpImage *image,
|
|||
{
|
||||
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");
|
||||
|
|
|
@ -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 @@ gimp_layer_tree_view_floating_selection_changed (GimpImage *image,
|
|||
{
|
||||
GList *list;
|
||||
|
||||
for (list = GIMP_LIST (image->layers)->list;
|
||||
for (list = gimp_image_get_layer_iter (image);
|
||||
list;
|
||||
list = g_list_next (list))
|
||||
{
|
||||
|
|
|
@ -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 @@ xcf_save_choose_format (XcfInfo *info,
|
|||
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 @@ xcf_save_image (XcfInfo *info,
|
|||
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 @@ xcf_save_image (XcfInfo *info,
|
|||
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_save_old_paths (XcfInfo *info,
|
|||
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_save_vectors (XcfInfo *info,
|
|||
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))
|
||||
{
|
||||
|
|
|
@ -476,7 +476,7 @@ HELP
|
|||
%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 @@ HELP
|
|||
%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 @@ HELP
|
|||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
GList *list = GIMP_LIST (image->vectors)->list;
|
||||
GList *list = gimp_image_get_vectors_iter (image);
|
||||
|
||||
num_vectors = g_list_length (list);
|
||||
|
||||
|
|
Loading…
Reference in New Issue