~ubuntu-branches/ubuntu/maverick/gimp/maverick-updates

« back to all changes in this revision

Viewing changes to app/core/gimpitem.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2005-12-09 19:44:52 UTC
  • Revision ID: james.westby@ubuntu.com-20051209194452-yggpemjlofpjqyf4
Tags: upstream-2.2.9
ImportĀ upstreamĀ versionĀ 2.2.9

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* The GIMP -- an image manipulation program
 
2
 * Copyright (C) 1995 Spencer Kimball and Peter Mattis
 
3
 *
 
4
 * This program is free software; you can redistribute it and/or modify
 
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
 
7
 * (at your option) any later version.
 
8
 *
 
9
 * This program is distributed in the hope that it will be useful,
 
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
 * GNU General Public License for more details.
 
13
 *
 
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.
 
17
 */
 
18
 
 
19
#ifndef __GIMP_ITEM_H__
 
20
#define __GIMP_ITEM_H__
 
21
 
 
22
 
 
23
#include "gimpviewable.h"
 
24
 
 
25
 
 
26
#define GIMP_TYPE_ITEM            (gimp_item_get_type ())
 
27
#define GIMP_ITEM(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_ITEM, GimpItem))
 
28
#define GIMP_ITEM_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_ITEM, GimpItemClass))
 
29
#define GIMP_IS_ITEM(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_ITEM))
 
30
#define GIMP_IS_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_ITEM))
 
31
#define GIMP_ITEM_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_ITEM, GimpItemClass))
 
32
 
 
33
 
 
34
typedef struct _GimpItemClass GimpItemClass;
 
35
 
 
36
struct _GimpItem
 
37
{
 
38
  GimpViewable      parent_instance;
 
39
 
 
40
  gint              ID;                 /*  provides a unique ID     */
 
41
  guint32           tattoo;             /*  provides a permanent ID  */
 
42
 
 
43
  GimpImage        *gimage;             /*  gimage owner             */
 
44
 
 
45
  GimpParasiteList *parasites;          /*  Plug-in parasite data    */
 
46
 
 
47
  gint              width, height;      /*  size in pixels           */
 
48
  gint              offset_x, offset_y; /*  pixel offset in image    */
 
49
 
 
50
  gboolean          visible;            /*  control visibility       */
 
51
  gboolean          linked;             /*  control linkage          */
 
52
 
 
53
  gboolean          floating;           /*  added to an image?       */
 
54
  gboolean          removed;            /*  removed from the image?  */
 
55
};
 
56
 
 
57
struct _GimpItemClass
 
58
{
 
59
  GimpViewableClass  parent_class;
 
60
 
 
61
  /*  signals  */
 
62
  void       (* removed)            (GimpItem      *item);
 
63
  void       (* visibility_changed) (GimpItem      *item);
 
64
  void       (* linked_changed)     (GimpItem      *item);
 
65
 
 
66
  /*  virtual functions  */
 
67
  gboolean   (* is_attached)  (GimpItem               *item);
 
68
  GimpItem * (* duplicate)    (GimpItem               *item,
 
69
                               GType                   new_type,
 
70
                               gboolean                add_alpha);
 
71
  void       (* convert)      (GimpItem               *item,
 
72
                               GimpImage              *dest_image);
 
73
  gboolean   (* rename)       (GimpItem               *item,
 
74
                               const gchar            *new_name,
 
75
                               const gchar            *undo_desc);
 
76
  void       (* translate)    (GimpItem               *item,
 
77
                               gint                    offset_x,
 
78
                               gint                    offset_y,
 
79
                               gboolean                push_undo);
 
80
  void       (* scale)        (GimpItem               *item,
 
81
                               gint                    new_width,
 
82
                               gint                    new_height,
 
83
                               gint                    new_offset_x,
 
84
                               gint                    new_offset_y,
 
85
                               GimpInterpolationType   interpolation_type,
 
86
                               GimpProgress           *progress);
 
87
  void       (* resize)       (GimpItem               *item,
 
88
                               GimpContext            *context,
 
89
                               gint                    new_width,
 
90
                               gint                    new_height,
 
91
                               gint                    offset_x,
 
92
                               gint                    offset_y);
 
93
  void       (* flip)         (GimpItem               *item,
 
94
                               GimpContext            *context,
 
95
                               GimpOrientationType     flip_type,
 
96
                               gdouble                 axis,
 
97
                               gboolean                clip_result);
 
98
  void       (* rotate)       (GimpItem               *item,
 
99
                               GimpContext            *context,
 
100
                               GimpRotationType        rotate_type,
 
101
                               gdouble                 center_x,
 
102
                               gdouble                 center_y,
 
103
                               gboolean                clip_result);
 
104
  void       (* transform)    (GimpItem               *item,
 
105
                               GimpContext            *context,
 
106
                               const GimpMatrix3      *matrix,
 
107
                               GimpTransformDirection  direction,
 
108
                               GimpInterpolationType   interpolation_type,
 
109
                               gboolean                supersample,
 
110
                               gint                    recursion_level,
 
111
                               gboolean                clip_result,
 
112
                               GimpProgress           *progress);
 
113
  gboolean   (* stroke)       (GimpItem               *item,
 
114
                               GimpDrawable           *drawable,
 
115
                               GimpContext            *context,
 
116
                               GimpStrokeDesc         *stroke_desc);
 
117
 
 
118
  const gchar *default_name;
 
119
  const gchar *rename_desc;
 
120
  const gchar *translate_desc;
 
121
  const gchar *scale_desc;
 
122
  const gchar *resize_desc;
 
123
  const gchar *flip_desc;
 
124
  const gchar *rotate_desc;
 
125
  const gchar *transform_desc;
 
126
  const gchar *stroke_desc;
 
127
};
 
128
 
 
129
 
 
130
GType           gimp_item_get_type         (void) G_GNUC_CONST;
 
131
 
 
132
gboolean        gimp_item_is_floating      (const GimpItem *item);
 
133
void            gimp_item_sink             (GimpItem       *item);
 
134
 
 
135
void            gimp_item_removed          (GimpItem       *item);
 
136
gboolean        gimp_item_is_removed       (const GimpItem *item);
 
137
 
 
138
gboolean        gimp_item_is_attached      (GimpItem       *item);
 
139
 
 
140
void            gimp_item_configure        (GimpItem       *item,
 
141
                                            GimpImage      *gimage,
 
142
                                            gint            offset_x,
 
143
                                            gint            offset_y,
 
144
                                            gint            width,
 
145
                                            gint            height,
 
146
                                            const gchar    *name);
 
147
GimpItem      * gimp_item_duplicate        (GimpItem       *item,
 
148
                                            GType           new_type,
 
149
                                            gboolean        add_alpha);
 
150
GimpItem      * gimp_item_convert          (GimpItem       *item,
 
151
                                            GimpImage      *dest_image,
 
152
                                            GType           new_type,
 
153
                                            gboolean        add_alpha);
 
154
 
 
155
gboolean        gimp_item_rename           (GimpItem       *item,
 
156
                                            const gchar    *new_name);
 
157
 
 
158
gint            gimp_item_width            (const GimpItem *item);
 
159
gint            gimp_item_height           (const GimpItem *item);
 
160
void            gimp_item_offsets          (const GimpItem *item,
 
161
                                            gint           *offset_x,
 
162
                                            gint           *offset_y);
 
163
 
 
164
void            gimp_item_translate        (GimpItem       *item,
 
165
                                            gint            offset_x,
 
166
                                            gint            offset_y,
 
167
                                            gboolean        push_undo);
 
168
 
 
169
gboolean        gimp_item_check_scaling    (const GimpItem *item,
 
170
                                            gint            new_width,
 
171
                                            gint            new_height);
 
172
void            gimp_item_scale            (GimpItem       *item,
 
173
                                            gint            new_width,
 
174
                                            gint            new_height,
 
175
                                            gint            new_offset_x,
 
176
                                            gint            new_offset_y,
 
177
                                            GimpInterpolationType  interpolation,
 
178
                                            GimpProgress   *progress);
 
179
gboolean        gimp_item_scale_by_factors (GimpItem       *item,
 
180
                                            gdouble         w_factor,
 
181
                                            gdouble         h_factor,
 
182
                                            GimpInterpolationType interpolation,
 
183
                                            GimpProgress   *progress);
 
184
void            gimp_item_scale_by_origin  (GimpItem       *item,
 
185
                                            gint            new_width,
 
186
                                            gint            new_height,
 
187
                                            GimpInterpolationType interpolation,
 
188
                                            GimpProgress   *progress,
 
189
                                            gboolean        local_origin);
 
190
void            gimp_item_resize           (GimpItem       *item,
 
191
                                            GimpContext    *context,
 
192
                                            gint            new_width,
 
193
                                            gint            new_height,
 
194
                                            gint            offset_x,
 
195
                                            gint            offset_y);
 
196
void            gimp_item_resize_to_image  (GimpItem       *item);
 
197
 
 
198
void            gimp_item_flip             (GimpItem       *item,
 
199
                                            GimpContext    *context,
 
200
                                            GimpOrientationType flip_type,
 
201
                                            gdouble         axis,
 
202
                                            gboolean        flip_result);
 
203
void            gimp_item_rotate           (GimpItem       *item,
 
204
                                            GimpContext    *context,
 
205
                                            GimpRotationType rotate_type,
 
206
                                            gdouble         center_x,
 
207
                                            gdouble         center_y,
 
208
                                            gboolean        flip_result);
 
209
void            gimp_item_transform        (GimpItem       *item,
 
210
                                            GimpContext    *context,
 
211
                                            const GimpMatrix3 *matrix,
 
212
                                            GimpTransformDirection direction,
 
213
                                            GimpInterpolationType interpolation_type,
 
214
                                            gboolean        supersample,
 
215
                                            gint            recursion_level,
 
216
                                            gboolean        clip_result,
 
217
                                            GimpProgress   *progress);
 
218
 
 
219
gboolean        gimp_item_stroke           (GimpItem       *item,
 
220
                                            GimpDrawable   *drawable,
 
221
                                            GimpContext    *context,
 
222
                                            GimpStrokeDesc *stroke_desc,
 
223
                                            gboolean        use_default_values);
 
224
 
 
225
gint            gimp_item_get_ID           (GimpItem       *item);
 
226
GimpItem      * gimp_item_get_by_ID        (Gimp           *gimp,
 
227
                                            gint            id);
 
228
 
 
229
GimpTattoo      gimp_item_get_tattoo       (const GimpItem *item);
 
230
void            gimp_item_set_tattoo       (GimpItem       *item,
 
231
                                            GimpTattoo      tattoo);
 
232
 
 
233
GimpImage     * gimp_item_get_image        (const GimpItem *item);
 
234
void            gimp_item_set_image        (GimpItem       *item,
 
235
                                            GimpImage      *gimage);
 
236
 
 
237
void            gimp_item_parasite_attach  (GimpItem       *item,
 
238
                                            GimpParasite   *parasite);
 
239
void            gimp_item_parasite_detach  (GimpItem       *item,
 
240
                                            const gchar    *name);
 
241
GimpParasite  * gimp_item_parasite_find    (const GimpItem *item,
 
242
                                            const gchar    *name);
 
243
gchar        ** gimp_item_parasite_list    (const GimpItem *item,
 
244
                                            gint           *count);
 
245
 
 
246
gboolean        gimp_item_get_visible      (const GimpItem *item);
 
247
void            gimp_item_set_visible      (GimpItem       *item,
 
248
                                            gboolean        visible,
 
249
                                            gboolean        push_undo);
 
250
 
 
251
void            gimp_item_set_linked       (GimpItem       *item,
 
252
                                            gboolean        linked,
 
253
                                            gboolean        push_undo);
 
254
gboolean        gimp_item_get_linked       (const GimpItem *item);
 
255
 
 
256
 
 
257
#endif /* __GIMP_ITEM_H__ */