~ubuntu-branches/ubuntu/vivid/gimp/vivid

« back to all changes in this revision

Viewing changes to app/core/gimpimage-flip.c

  • Committer: Package Import Robot
  • Author(s): Jordi Mallach
  • Date: 2012-05-08 18:50:03 UTC
  • mto: (1.1.26) (0.5.1 experimental)
  • mto: This revision was merged to the branch mainline in revision 71.
  • Revision ID: package-import@ubuntu.com-20120508185003-tltkvbaysf8d2426
ImportĀ upstreamĀ versionĀ 2.8.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* GIMP - The GNU Image Manipulation Program
2
2
 * Copyright (C) 1995 Spencer Kimball and Peter Mattis
3
3
 *
4
 
 * This program is free software; you can redistribute it and/or modify
 
4
 * This program is free software: you can redistribute it and/or modify
5
5
 * it under the terms of the GNU General Public License as published by
6
 
 * the Free Software Foundation; either version 2 of the License, or
 
6
 * the Free Software Foundation; either version 3 of the License, or
7
7
 * (at your option) any later version.
8
8
 *
9
9
 * This program is distributed in the hope that it will be useful,
12
12
 * GNU General Public License for more details.
13
13
 *
14
14
 * You should have received a copy of the GNU General Public License
15
 
 * along with this program; if not, write to the Free Software
16
 
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
15
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
16
 */
18
17
 
19
18
#include "config.h"
20
19
 
21
 
#include <glib-object.h>
 
20
#include <gegl.h>
22
21
 
23
22
#include "core-types.h"
24
23
 
25
24
#include "gimp.h"
 
25
#include "gimpcontainer.h"
26
26
#include "gimpcontext.h"
27
27
#include "gimpguide.h"
28
28
#include "gimpimage.h"
32
32
#include "gimpimage-undo.h"
33
33
#include "gimpimage-undo-push.h"
34
34
#include "gimpitem.h"
35
 
#include "gimplist.h"
36
35
#include "gimpprogress.h"
37
36
#include "gimpsamplepoint.h"
38
37
 
69
68
      return;
70
69
    }
71
70
 
72
 
  progress_max = (image->channels->num_children +
73
 
                  image->layers->num_children   +
74
 
                  image->vectors->num_children  +
 
71
  progress_max = (gimp_container_get_n_children (gimp_image_get_channels (image)) +
 
72
                  gimp_container_get_n_children (gimp_image_get_layers (image))   +
 
73
                  gimp_container_get_n_children (gimp_image_get_vectors (image))  +
75
74
                  1 /* selection */);
76
75
 
77
76
  gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_IMAGE_FLIP, NULL);
78
77
 
79
78
  /*  Flip all channels  */
80
 
  for (list = GIMP_LIST (image->channels)->list;
 
79
  for (list = gimp_image_get_channel_iter (image);
81
80
       list;
82
81
       list = g_list_next (list))
83
82
    {
90
89
    }
91
90
 
92
91
  /*  Flip all vectors  */
93
 
  for (list = GIMP_LIST (image->vectors)->list;
 
92
  for (list = gimp_image_get_vectors_iter (image);
94
93
       list;
95
94
       list = g_list_next (list))
96
95
    {
110
109
    gimp_progress_set_value (progress, progress_current++ / progress_max);
111
110
 
112
111
  /*  Flip all layers  */
113
 
  for (list = GIMP_LIST (image->layers)->list;
 
112
  for (list = gimp_image_get_layer_iter (image);
114
113
       list;
115
114
       list = g_list_next (list))
116
115
    {
123
122
    }
124
123
 
125
124
  /*  Flip all Guides  */
126
 
  for (list = gimp_image_get_guides (image); list; list = g_list_next (list))
 
125
  for (list = gimp_image_get_guides (image);
 
126
       list;
 
127
       list = g_list_next (list))
127
128
    {
128
129
      GimpGuide *guide    = list->data;
129
130
      gint       position = gimp_guide_get_position (guide);
150
151
    }
151
152
 
152
153
  /*  Flip all sample points  */
153
 
  for (list = gimp_image_get_sample_points (image); list; list = g_list_next (list))
 
154
  for (list = gimp_image_get_sample_points (image);
 
155
       list;
 
156
       list = g_list_next (list))
154
157
    {
155
158
      GimpSamplePoint *sample_point = list->data;
156
159