summaryrefslogtreecommitdiff
path: root/tumbler/tumbler-file-info.h
diff options
context:
space:
mode:
authorJannis Pohlmann <jannis@xfce.org>2009-10-27 03:13:42 +0100
committerJannis Pohlmann <jannis@xfce.org>2009-10-27 03:13:42 +0100
commitae5d1fcdbd406efa945a9ff631991bc08b1fa31e (patch)
tree378f5aea375c541221a62fe6ed468c383d6c0dcc /tumbler/tumbler-file-info.h
parent7a1e43d0806ec976eb2872209affb3d8a0dad7d0 (diff)
downloadtumbler-ae5d1fcdbd406efa945a9ff631991bc08b1fa31e.tar.gz
Massive refactoring to support flavors properly.
Refactor the entire code to use TumblerFileInfo instead of separate URI/MIME/flavor arrays. We now support flavors which means that applications can request "normal" and "large" thumbnails and thus have more control over what is created. This simplifies the code in a lot of places. We now use a real GObject class called TumblerThumbnailFlavor instead of a fixed-size enum. Cache backends can return as many flavors as they want, each consisting of a name, a width and a height. As a consequence, we can also get rid of the configure flags to enable/disable normal, large and cropped thumbnails. The default cache plugin shipped with Tumbler only supports "normal" (128x128px) and "large" (256x256px). Optimize the code a little bit. We now load the TunarFileInfo and ThunarThumbnail only *once* for each URI instead of loading them once in the scheduler and again in thumbnailer plugins. This needs careful testing. I might have introduced a few memory leaks here and there, plus new bugs... you never know.
Diffstat (limited to 'tumbler/tumbler-file-info.h')
-rw-r--r--tumbler/tumbler-file-info.h31
1 files changed, 22 insertions, 9 deletions
diff --git a/tumbler/tumbler-file-info.h b/tumbler/tumbler-file-info.h
index a30f7b6..a1330c3 100644
--- a/tumbler/tumbler-file-info.h
+++ b/tumbler/tumbler-file-info.h
@@ -27,6 +27,8 @@
#include <gio/gio.h>
+#include <tumbler/tumbler-thumbnail.h>
+
G_BEGIN_DECLS;
#define TUMBLER_TYPE_FILE_INFO (tumbler_file_info_get_type ())
@@ -39,16 +41,27 @@ G_BEGIN_DECLS;
typedef struct _TumblerFileInfoClass TumblerFileInfoClass;
typedef struct _TumblerFileInfo TumblerFileInfo;
-GType tumbler_file_info_get_type (void) G_GNUC_CONST;
+GType tumbler_file_info_get_type (void) G_GNUC_CONST;
+
+TumblerFileInfo *tumbler_file_info_new (const gchar *uri,
+ const gchar *mime_type,
+ TumblerThumbnailFlavor *flavor) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT;
+gboolean tumbler_file_info_load (TumblerFileInfo *info,
+ GCancellable *cancellable,
+ GError **error);
+const gchar *tumbler_file_info_get_uri (TumblerFileInfo *info);
+const gchar *tumbler_file_info_get_mime_type (TumblerFileInfo *info);
+guint64 tumbler_file_info_get_mtime (TumblerFileInfo *info);
+gboolean tumbler_file_info_needs_update (TumblerFileInfo *info);
+TumblerThumbnail *tumbler_file_info_get_thumbnail (TumblerFileInfo *info) G_GNUC_WARN_UNUSED_RESULT;
-TumblerFileInfo *tumbler_file_info_new (const gchar *uri) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT;
-gboolean tumbler_file_info_load (TumblerFileInfo *info,
- GCancellable *cancellable,
- GError **error);
-const gchar *tumbler_file_info_get_uri (TumblerFileInfo *info);
-guint64 tumbler_file_info_get_mtime (TumblerFileInfo *info);
-gboolean tumbler_file_info_needs_update (TumblerFileInfo *info);
-GList *tumbler_file_info_get_thumbnails (TumblerFileInfo *info);
+TumblerFileInfo **tumbler_file_info_array_new_with_flavor (const gchar *const *uris,
+ const gchar *const *mime_types,
+ TumblerThumbnailFlavor *flavor,
+ guint *length) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT;
+TumblerFileInfo **tumbler_file_info_array_copy (TumblerFileInfo **infos,
+ guint length) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT;
+void tumbler_file_info_array_free (TumblerFileInfo **infos);
G_END_DECLS;