-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathfile.h
188 lines (143 loc) · 4.37 KB
/
file.h
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
/*
* Copyright (c) Stephan Arts 2006-2012 <[email protected]>
*
* 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 __RISTRETTO_FILE_H__
#define __RISTRETTO_FILE_H__
#include <gtk/gtk.h>
#include <libexif/exif-data.h>
G_BEGIN_DECLS
typedef enum
{
RSTTO_IMAGE_ORIENT_NONE = 1,
RSTTO_IMAGE_ORIENT_FLIP_HORIZONTAL,
RSTTO_IMAGE_ORIENT_180,
RSTTO_IMAGE_ORIENT_FLIP_VERTICAL,
RSTTO_IMAGE_ORIENT_FLIP_TRANSPOSE,
RSTTO_IMAGE_ORIENT_90,
RSTTO_IMAGE_ORIENT_FLIP_TRANSVERSE,
RSTTO_IMAGE_ORIENT_270,
RSTTO_IMAGE_ORIENT_NOT_DETERMINED,
} RsttoImageOrientation;
typedef enum
{
RSTTO_SCALE_NONE = -2,
RSTTO_SCALE_LIMIT_TO_VIEW,
RSTTO_SCALE_FIT_TO_VIEW,
RSTTO_SCALE_REAL_SIZE
} RsttoScale;
typedef enum
{
RSTTO_THUMBNAIL_FLAVOR_NORMAL,
RSTTO_THUMBNAIL_FLAVOR_LARGE,
RSTTO_THUMBNAIL_FLAVOR_X_LARGE,
RSTTO_THUMBNAIL_FLAVOR_XX_LARGE,
RSTTO_THUMBNAIL_FLAVOR_COUNT
} RsttoThumbnailFlavor;
typedef enum
{
RSTTO_THUMBNAIL_SIZE_VERY_SMALL,
RSTTO_THUMBNAIL_SIZE_SMALLER,
RSTTO_THUMBNAIL_SIZE_SMALL,
RSTTO_THUMBNAIL_SIZE_NORMAL,
RSTTO_THUMBNAIL_SIZE_LARGE,
RSTTO_THUMBNAIL_SIZE_LARGER,
RSTTO_THUMBNAIL_SIZE_VERY_LARGE,
RSTTO_THUMBNAIL_SIZE_COUNT,
} RsttoThumbnailSize;
typedef enum
{
RSTTO_THUMBNAIL_STATE_UNPROCESSED,
RSTTO_THUMBNAIL_STATE_IN_PROCESS,
RSTTO_THUMBNAIL_STATE_PROCESSED,
RSTTO_THUMBNAIL_STATE_ERROR
} RsttoThumbnailState;
#define RSTTO_TYPE_FILE rstto_file_get_type ()
G_DECLARE_FINAL_TYPE (RsttoFile, rstto_file, RSTTO, FILE, GObject)
typedef struct _RsttoFilePrivate RsttoFilePrivate;
struct _RsttoFile
{
GObject parent;
RsttoFilePrivate *priv;
};
RsttoFile *
rstto_file_new (GFile *file);
gboolean
rstto_file_is_valid (RsttoFile *r_file);
GFile *
rstto_file_get_file (RsttoFile *r_file);
const gchar *
rstto_file_get_display_name (RsttoFile *r_file);
const gchar *
rstto_file_get_path (RsttoFile *r_file);
const gchar *
rstto_file_get_uri (RsttoFile *r_file);
const gchar *
rstto_file_get_collate_key (RsttoFile *r_file);
const gchar *
rstto_file_get_content_type (RsttoFile *r_file);
void
rstto_file_set_content_type (RsttoFile *r_file,
const gchar *type);
void
rstto_file_set_thumbnail_state (RsttoFile *r_file,
RsttoThumbnailFlavor flavor,
RsttoThumbnailState state);
void
rstto_file_set_is_thumbnail (RsttoFile *r_file,
gboolean is_thumbnail);
const GdkPixbuf *
rstto_file_get_thumbnail (RsttoFile *r_file,
RsttoThumbnailSize size);
guint64
rstto_file_get_modified_time (RsttoFile *r_file);
goffset
rstto_file_get_size (RsttoFile *r_file);
ExifEntry *
rstto_file_get_exif (RsttoFile *r_file,
ExifTag id);
RsttoImageOrientation
rstto_file_get_orientation (RsttoFile *r_file);
void
rstto_file_set_orientation (RsttoFile *r_file,
RsttoImageOrientation orientation);
gdouble
rstto_file_get_scale (RsttoFile *r_file);
void
rstto_file_set_scale (RsttoFile *r_file,
gdouble scale);
RsttoScale
rstto_file_get_auto_scale (RsttoFile *r_file);
void
rstto_file_set_auto_scale (RsttoFile *r_file,
RsttoScale auto_scale);
gdouble
rstto_file_get_h_adjustment (RsttoFile *r_file);
gdouble
rstto_file_get_v_adjustment (RsttoFile *r_file);
void
rstto_file_set_h_adjustment (RsttoFile *r_file,
gdouble h_adjust);
void
rstto_file_set_v_adjustment (RsttoFile *r_file,
gdouble v_adjust);
gboolean
rstto_file_has_exif (RsttoFile *r_file);
void
rstto_file_changed (RsttoFile *r_file);
G_END_DECLS
#endif /* __RISTRETTO_FILE_H__ */