1
/* The GIMP -- an image manipulation program
2
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
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.
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.
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.
19
#ifndef __GIMP_ITEM_H__
20
#define __GIMP_ITEM_H__
23
#include "gimpviewable.h"
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))
34
typedef struct _GimpItemClass GimpItemClass;
38
GimpViewable parent_instance;
40
gint ID; /* provides a unique ID */
41
guint32 tattoo; /* provides a permanent ID */
43
GimpImage *gimage; /* gimage owner */
45
GimpParasiteList *parasites; /* Plug-in parasite data */
47
gint width, height; /* size in pixels */
48
gint offset_x, offset_y; /* pixel offset in image */
50
gboolean visible; /* control visibility */
51
gboolean linked; /* control linkage */
53
gboolean floating; /* added to an image? */
54
gboolean removed; /* removed from the image? */
59
GimpViewableClass parent_class;
62
void (* removed) (GimpItem *item);
63
void (* visibility_changed) (GimpItem *item);
64
void (* linked_changed) (GimpItem *item);
66
/* virtual functions */
67
gboolean (* is_attached) (GimpItem *item);
68
GimpItem * (* duplicate) (GimpItem *item,
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,
80
void (* scale) (GimpItem *item,
85
GimpInterpolationType interpolation_type,
86
GimpProgress *progress);
87
void (* resize) (GimpItem *item,
93
void (* flip) (GimpItem *item,
95
GimpOrientationType flip_type,
97
gboolean clip_result);
98
void (* rotate) (GimpItem *item,
100
GimpRotationType rotate_type,
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);
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;
130
GType gimp_item_get_type (void) G_GNUC_CONST;
132
gboolean gimp_item_is_floating (const GimpItem *item);
133
void gimp_item_sink (GimpItem *item);
135
void gimp_item_removed (GimpItem *item);
136
gboolean gimp_item_is_removed (const GimpItem *item);
138
gboolean gimp_item_is_attached (GimpItem *item);
140
void gimp_item_configure (GimpItem *item,
147
GimpItem * gimp_item_duplicate (GimpItem *item,
150
GimpItem * gimp_item_convert (GimpItem *item,
151
GimpImage *dest_image,
155
gboolean gimp_item_rename (GimpItem *item,
156
const gchar *new_name);
158
gint gimp_item_width (const GimpItem *item);
159
gint gimp_item_height (const GimpItem *item);
160
void gimp_item_offsets (const GimpItem *item,
164
void gimp_item_translate (GimpItem *item,
169
gboolean gimp_item_check_scaling (const GimpItem *item,
172
void gimp_item_scale (GimpItem *item,
177
GimpInterpolationType interpolation,
178
GimpProgress *progress);
179
gboolean gimp_item_scale_by_factors (GimpItem *item,
182
GimpInterpolationType interpolation,
183
GimpProgress *progress);
184
void gimp_item_scale_by_origin (GimpItem *item,
187
GimpInterpolationType interpolation,
188
GimpProgress *progress,
189
gboolean local_origin);
190
void gimp_item_resize (GimpItem *item,
191
GimpContext *context,
196
void gimp_item_resize_to_image (GimpItem *item);
198
void gimp_item_flip (GimpItem *item,
199
GimpContext *context,
200
GimpOrientationType flip_type,
202
gboolean flip_result);
203
void gimp_item_rotate (GimpItem *item,
204
GimpContext *context,
205
GimpRotationType rotate_type,
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);
219
gboolean gimp_item_stroke (GimpItem *item,
220
GimpDrawable *drawable,
221
GimpContext *context,
222
GimpStrokeDesc *stroke_desc,
223
gboolean use_default_values);
225
gint gimp_item_get_ID (GimpItem *item);
226
GimpItem * gimp_item_get_by_ID (Gimp *gimp,
229
GimpTattoo gimp_item_get_tattoo (const GimpItem *item);
230
void gimp_item_set_tattoo (GimpItem *item,
233
GimpImage * gimp_item_get_image (const GimpItem *item);
234
void gimp_item_set_image (GimpItem *item,
237
void gimp_item_parasite_attach (GimpItem *item,
238
GimpParasite *parasite);
239
void gimp_item_parasite_detach (GimpItem *item,
241
GimpParasite * gimp_item_parasite_find (const GimpItem *item,
243
gchar ** gimp_item_parasite_list (const GimpItem *item,
246
gboolean gimp_item_get_visible (const GimpItem *item);
247
void gimp_item_set_visible (GimpItem *item,
251
void gimp_item_set_linked (GimpItem *item,
254
gboolean gimp_item_get_linked (const GimpItem *item);
257
#endif /* __GIMP_ITEM_H__ */