Mercurial > geeqie
annotate src/image-load.h @ 1811:f405ec9b696b default tip
Some small logic mistakes
Use boolean operators for booleans and bitwise otherwise only.
| author | mow |
|---|---|
| date | Mon, 10 May 2010 11:33:13 +0000 |
| parents | 956aab097ea7 |
| children |
| rev | line source |
|---|---|
| 9 | 1 /* |
| 196 | 2 * Geeqie |
| 9 | 3 * (C) 2004 John Ellis |
| 1802 | 4 * Copyright (C) 2008 - 2010 The Geeqie Team |
| 9 | 5 * |
| 6 * Author: John Ellis | |
| 7 * | |
| 8 * This software is released under the GNU General Public License (GNU GPL). | |
| 9 * Please read the included file COPYING for more information. | |
| 10 * This software comes with no warranty of any kind, use at your own risk! | |
| 11 */ | |
| 12 | |
| 13 | |
| 14 #ifndef IMAGE_LOAD_H | |
| 15 #define IMAGE_LOAD_H | |
| 16 | |
|
1012
fe82830ab8fd
converted image loader to a GObject and use signals for notification
nadvornik
parents:
1011
diff
changeset
|
17 #define TYPE_IMAGE_LOADER (image_loader_get_type()) |
|
fe82830ab8fd
converted image loader to a GObject and use signals for notification
nadvornik
parents:
1011
diff
changeset
|
18 |
|
fe82830ab8fd
converted image loader to a GObject and use signals for notification
nadvornik
parents:
1011
diff
changeset
|
19 //typedef struct _ImageLoader ImageLoader; |
|
fe82830ab8fd
converted image loader to a GObject and use signals for notification
nadvornik
parents:
1011
diff
changeset
|
20 typedef struct _ImageLoaderClass ImageLoaderClass; |
|
fe82830ab8fd
converted image loader to a GObject and use signals for notification
nadvornik
parents:
1011
diff
changeset
|
21 |
|
fe82830ab8fd
converted image loader to a GObject and use signals for notification
nadvornik
parents:
1011
diff
changeset
|
22 struct _ImageLoader |
|
fe82830ab8fd
converted image loader to a GObject and use signals for notification
nadvornik
parents:
1011
diff
changeset
|
23 { |
|
fe82830ab8fd
converted image loader to a GObject and use signals for notification
nadvornik
parents:
1011
diff
changeset
|
24 GObject parent; |
|
fe82830ab8fd
converted image loader to a GObject and use signals for notification
nadvornik
parents:
1011
diff
changeset
|
25 |
|
fe82830ab8fd
converted image loader to a GObject and use signals for notification
nadvornik
parents:
1011
diff
changeset
|
26 /*< private >*/ |
|
fe82830ab8fd
converted image loader to a GObject and use signals for notification
nadvornik
parents:
1011
diff
changeset
|
27 GdkPixbuf *pixbuf; |
|
fe82830ab8fd
converted image loader to a GObject and use signals for notification
nadvornik
parents:
1011
diff
changeset
|
28 FileData *fd; |
|
fe82830ab8fd
converted image loader to a GObject and use signals for notification
nadvornik
parents:
1011
diff
changeset
|
29 gchar *path; |
|
fe82830ab8fd
converted image loader to a GObject and use signals for notification
nadvornik
parents:
1011
diff
changeset
|
30 |
| 1185 | 31 gsize bytes_read; |
| 32 gsize bytes_total; | |
|
1012
fe82830ab8fd
converted image loader to a GObject and use signals for notification
nadvornik
parents:
1011
diff
changeset
|
33 |
|
1433
b4ad1d201279
Use gboolean where applicable, minor cleanup and indentations fixes.
zas_
parents:
1284
diff
changeset
|
34 gboolean preview; |
|
1012
fe82830ab8fd
converted image loader to a GObject and use signals for notification
nadvornik
parents:
1011
diff
changeset
|
35 |
|
fe82830ab8fd
converted image loader to a GObject and use signals for notification
nadvornik
parents:
1011
diff
changeset
|
36 gint requested_width; |
|
fe82830ab8fd
converted image loader to a GObject and use signals for notification
nadvornik
parents:
1011
diff
changeset
|
37 gint requested_height; |
|
1433
b4ad1d201279
Use gboolean where applicable, minor cleanup and indentations fixes.
zas_
parents:
1284
diff
changeset
|
38 gboolean shrunk; |
|
1012
fe82830ab8fd
converted image loader to a GObject and use signals for notification
nadvornik
parents:
1011
diff
changeset
|
39 |
|
1433
b4ad1d201279
Use gboolean where applicable, minor cleanup and indentations fixes.
zas_
parents:
1284
diff
changeset
|
40 gboolean done; |
| 1523 | 41 guint idle_id; /* event source id */ |
|
1012
fe82830ab8fd
converted image loader to a GObject and use signals for notification
nadvornik
parents:
1011
diff
changeset
|
42 gint idle_priority; |
|
fe82830ab8fd
converted image loader to a GObject and use signals for notification
nadvornik
parents:
1011
diff
changeset
|
43 |
|
fe82830ab8fd
converted image loader to a GObject and use signals for notification
nadvornik
parents:
1011
diff
changeset
|
44 GdkPixbufLoader *loader; |
| 1497 | 45 GError *error; |
|
1012
fe82830ab8fd
converted image loader to a GObject and use signals for notification
nadvornik
parents:
1011
diff
changeset
|
46 |
| 1523 | 47 guint idle_done_id; /* event source id */ |
| 1014 | 48 GList *area_param_list; |
|
1045
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1021
diff
changeset
|
49 GList *area_param_delayed_list; |
|
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1021
diff
changeset
|
50 |
|
1433
b4ad1d201279
Use gboolean where applicable, minor cleanup and indentations fixes.
zas_
parents:
1284
diff
changeset
|
51 gboolean delay_area_ready; |
| 1015 | 52 |
| 53 GMutex *data_mutex; | |
|
1433
b4ad1d201279
Use gboolean where applicable, minor cleanup and indentations fixes.
zas_
parents:
1284
diff
changeset
|
54 gboolean stopping; |
|
b4ad1d201279
Use gboolean where applicable, minor cleanup and indentations fixes.
zas_
parents:
1284
diff
changeset
|
55 gboolean can_destroy; |
| 1021 | 56 GCond *can_destroy_cond; |
| 57 gboolean thread; | |
|
1012
fe82830ab8fd
converted image loader to a GObject and use signals for notification
nadvornik
parents:
1011
diff
changeset
|
58 |
|
fe82830ab8fd
converted image loader to a GObject and use signals for notification
nadvornik
parents:
1011
diff
changeset
|
59 guchar *mapped_file; |
| 1185 | 60 gsize read_buffer_size; |
|
1559
597ed9e9979c
Fix up few warnings (especially on 64bits platforms).
zas_
parents:
1523
diff
changeset
|
61 guint idle_read_loop_count; |
|
1012
fe82830ab8fd
converted image loader to a GObject and use signals for notification
nadvornik
parents:
1011
diff
changeset
|
62 }; |
|
fe82830ab8fd
converted image loader to a GObject and use signals for notification
nadvornik
parents:
1011
diff
changeset
|
63 |
|
fe82830ab8fd
converted image loader to a GObject and use signals for notification
nadvornik
parents:
1011
diff
changeset
|
64 struct _ImageLoaderClass { |
|
fe82830ab8fd
converted image loader to a GObject and use signals for notification
nadvornik
parents:
1011
diff
changeset
|
65 GObjectClass parent; |
|
fe82830ab8fd
converted image loader to a GObject and use signals for notification
nadvornik
parents:
1011
diff
changeset
|
66 |
|
fe82830ab8fd
converted image loader to a GObject and use signals for notification
nadvornik
parents:
1011
diff
changeset
|
67 /* class members */ |
|
fe82830ab8fd
converted image loader to a GObject and use signals for notification
nadvornik
parents:
1011
diff
changeset
|
68 void (*area_ready)(ImageLoader *, guint x, guint y, guint w, guint h, gpointer); |
|
fe82830ab8fd
converted image loader to a GObject and use signals for notification
nadvornik
parents:
1011
diff
changeset
|
69 void (*error)(ImageLoader *, gpointer); |
|
fe82830ab8fd
converted image loader to a GObject and use signals for notification
nadvornik
parents:
1011
diff
changeset
|
70 void (*done)(ImageLoader *, gpointer); |
|
fe82830ab8fd
converted image loader to a GObject and use signals for notification
nadvornik
parents:
1011
diff
changeset
|
71 void (*percent)(ImageLoader *, gdouble, gpointer); |
|
fe82830ab8fd
converted image loader to a GObject and use signals for notification
nadvornik
parents:
1011
diff
changeset
|
72 }; |
|
fe82830ab8fd
converted image loader to a GObject and use signals for notification
nadvornik
parents:
1011
diff
changeset
|
73 |
|
fe82830ab8fd
converted image loader to a GObject and use signals for notification
nadvornik
parents:
1011
diff
changeset
|
74 GType image_loader_get_type(void); |
| 9 | 75 |
| 138 | 76 ImageLoader *image_loader_new(FileData *fd); |
| 77 | |
| 9 | 78 void image_loader_free(ImageLoader *il); |
| 79 | |
|
1045
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1021
diff
changeset
|
80 /* delay area_ready signals */ |
|
1433
b4ad1d201279
Use gboolean where applicable, minor cleanup and indentations fixes.
zas_
parents:
1284
diff
changeset
|
81 void image_loader_delay_area_ready(ImageLoader *il, gboolean enable); |
| 9 | 82 |
| 83 /* Speed up loading when you only need at most width x height size image, | |
| 84 * only the jpeg GdkPixbuf loader benefits from it - so there is no | |
| 85 * guarantee that the image will scale down to the requested size.. | |
| 86 */ | |
| 87 void image_loader_set_requested_size(ImageLoader *il, gint width, gint height); | |
| 88 | |
| 89 void image_loader_set_buffer_size(ImageLoader *il, guint size); | |
| 90 | |
| 91 /* this only has effect if used before image_loader_start() | |
| 92 * default is G_PRIORITY_DEFAULT_IDLE | |
| 93 */ | |
| 94 void image_loader_set_priority(ImageLoader *il, gint priority); | |
| 95 | |
|
1433
b4ad1d201279
Use gboolean where applicable, minor cleanup and indentations fixes.
zas_
parents:
1284
diff
changeset
|
96 gboolean image_loader_start(ImageLoader *il); |
| 9 | 97 |
| 98 | |
| 99 GdkPixbuf *image_loader_get_pixbuf(ImageLoader *il); | |
| 100 gchar *image_loader_get_format(ImageLoader *il); | |
| 101 gdouble image_loader_get_percent(ImageLoader *il); | |
|
1433
b4ad1d201279
Use gboolean where applicable, minor cleanup and indentations fixes.
zas_
parents:
1284
diff
changeset
|
102 gboolean image_loader_get_is_done(ImageLoader *il); |
| 1011 | 103 FileData *image_loader_get_fd(ImageLoader *il); |
|
1433
b4ad1d201279
Use gboolean where applicable, minor cleanup and indentations fixes.
zas_
parents:
1284
diff
changeset
|
104 gboolean image_loader_get_shrunk(ImageLoader *il); |
| 1497 | 105 const gchar *image_loader_get_error(ImageLoader *il); |
| 9 | 106 |
|
1433
b4ad1d201279
Use gboolean where applicable, minor cleanup and indentations fixes.
zas_
parents:
1284
diff
changeset
|
107 gboolean image_load_dimensions(FileData *fd, gint *width, gint *height); |
| 9 | 108 |
| 109 #endif | |
|
1055
1646720364cf
Adding a vim modeline to all files - patch by Klaus Ethgen
nadvornik
parents:
1045
diff
changeset
|
110 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */ |
