1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
|
/* Eye Of Gnome - Image
*
* Copyright (C) 2007 The Free Software Foundation
*
* Author: Lucas Rocha <lucasr@gnome.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef __EOG_IMAGE_H__
#define __EOG_IMAGE_H__
#include "eog-jobs.h"
#include "eog-window.h"
#include "eog-transform.h"
#include "eog-image-save-info.h"
#include "eog-enums.h"
#include <glib.h>
#include <glib-object.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#ifdef HAVE_EXIF
#include <libexif/exif-data.h>
#include "eog-exif-util.h"
#endif
#ifdef HAVE_LCMS
#include <lcms2.h>
#endif
#ifdef HAVE_RSVG
#include <librsvg/rsvg.h>
#endif
G_BEGIN_DECLS
#ifndef __EOG_IMAGE_DECLR__
#define __EOG_IMAGE_DECLR__
typedef struct _EogImage EogImage;
#endif
typedef struct _EogImageClass EogImageClass;
typedef struct _EogImagePrivate EogImagePrivate;
#define EOG_TYPE_IMAGE (eog_image_get_type ())
#define EOG_IMAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), EOG_TYPE_IMAGE, EogImage))
#define EOG_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), EOG_TYPE_IMAGE, EogImageClass))
#define EOG_IS_IMAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), EOG_TYPE_IMAGE))
#define EOG_IS_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), EOG_TYPE_IMAGE))
#define EOG_IMAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), EOG_TYPE_IMAGE, EogImageClass))
typedef enum {
EOG_IMAGE_ERROR_SAVE_NOT_LOCAL,
EOG_IMAGE_ERROR_NOT_LOADED,
EOG_IMAGE_ERROR_NOT_SAVED,
EOG_IMAGE_ERROR_VFS,
EOG_IMAGE_ERROR_FILE_EXISTS,
EOG_IMAGE_ERROR_TMP_FILE_FAILED,
EOG_IMAGE_ERROR_GENERIC,
EOG_IMAGE_ERROR_UNKNOWN
} EogImageError;
#define EOG_IMAGE_ERROR eog_image_error_quark ()
typedef enum {
EOG_IMAGE_STATUS_UNKNOWN,
EOG_IMAGE_STATUS_LOADING,
EOG_IMAGE_STATUS_LOADED,
EOG_IMAGE_STATUS_SAVING,
EOG_IMAGE_STATUS_FAILED
} EogImageStatus;
typedef enum {
EOG_IMAGE_METADATA_NOT_READ,
EOG_IMAGE_METADATA_NOT_AVAILABLE,
EOG_IMAGE_METADATA_READY
} EogImageMetadataStatus;
struct _EogImage {
GObject parent;
EogImagePrivate *priv;
};
struct _EogImageClass {
GObjectClass parent_class;
void (* changed) (EogImage *img);
void (* size_prepared) (EogImage *img,
int width,
int height);
void (* thumbnail_changed) (EogImage *img);
void (* save_progress) (EogImage *img,
gfloat progress);
void (* next_frame) (EogImage *img,
gint delay);
void (* file_changed) (EogImage *img);
};
GType eog_image_get_type (void) G_GNUC_CONST;
GQuark eog_image_error_quark (void);
EogImage *eog_image_new_file (GFile *file, const gchar *caption);
gboolean eog_image_load (EogImage *img,
EogImageData data2read,
EogJob *job,
GError **error);
void eog_image_cancel_load (EogImage *img);
gboolean eog_image_has_data (EogImage *img,
EogImageData data);
void eog_image_data_ref (EogImage *img);
void eog_image_data_unref (EogImage *img);
void eog_image_set_thumbnail (EogImage *img,
GdkPixbuf *pixbuf);
gboolean eog_image_save_as_by_info (EogImage *img,
EogImageSaveInfo *source,
EogImageSaveInfo *target,
GError **error);
gboolean eog_image_save_by_info (EogImage *img,
EogImageSaveInfo *source,
GError **error);
GdkPixbuf* eog_image_get_pixbuf (EogImage *img);
GdkPixbuf* eog_image_get_thumbnail (EogImage *img);
void eog_image_get_size (EogImage *img,
gint *width,
gint *height);
goffset eog_image_get_bytes (EogImage *img);
gboolean eog_image_is_modified (EogImage *img);
void eog_image_modified (EogImage *img);
const gchar* eog_image_get_caption (EogImage *img);
const gchar *eog_image_get_collate_key (EogImage *img);
#if HAVE_EXIF
ExifData* eog_image_get_exif_info (EogImage *img);
#endif
gpointer eog_image_get_xmp_info (EogImage *img);
GFile* eog_image_get_file (EogImage *img);
gchar* eog_image_get_uri_for_display (EogImage *img);
EogImageStatus eog_image_get_status (EogImage *img);
EogImageMetadataStatus eog_image_get_metadata_status (EogImage *img);
void eog_image_transform (EogImage *img,
EogTransform *trans,
EogJob *job);
void eog_image_autorotate (EogImage *img);
#ifdef HAVE_LCMS
cmsHPROFILE eog_image_get_profile (EogImage *img);
void eog_image_apply_display_profile (EogImage *img,
cmsHPROFILE display_profile);
#endif
void eog_image_undo (EogImage *img);
GList *eog_image_get_supported_mime_types (void);
gboolean eog_image_is_supported_mime_type (const char *mime_type);
gboolean eog_image_is_animation (EogImage *img);
gboolean eog_image_start_animation (EogImage *img);
#ifdef HAVE_RSVG
gboolean eog_image_is_svg (EogImage *img);
RsvgHandle *eog_image_get_svg (EogImage *img);
#endif
EogTransform *eog_image_get_transform (EogImage *img);
EogTransform *eog_image_get_autorotate_transform (EogImage *img);
gboolean eog_image_is_jpeg (EogImage *img);
void eog_image_file_changed (EogImage *img);
gboolean eog_image_is_file_changed (EogImage *img);
gboolean eog_image_is_file_writable (EogImage *img);
gboolean eog_image_is_multipaged (EogImage *img);
G_END_DECLS
#endif /* __EOG_IMAGE_H__ */
|