summaryrefslogtreecommitdiff
path: root/tumbler/tumbler-thumbnailer.h
diff options
context:
space:
mode:
authorJannis Pohlmann <jannis@xfce.org>2009-05-17 22:10:57 +0200
committerJannis Pohlmann <jannis@xfce.org>2009-05-17 22:10:57 +0200
commit74dfcce3515f3e9852570a1a01faa5d997c63f6d (patch)
treeac6657c76916bcb7ff93ff152bf50b602cde8e8c /tumbler/tumbler-thumbnailer.h
parentabdd96f4ac9e04da0d58b2dfd144d661fdd02095 (diff)
downloadtumbler-74dfcce3515f3e9852570a1a01faa5d997c63f6d.tar.gz
Introduce interfaces and classes for built-in thumbnailers.
This commit introduces the TumblerThumbnailer interface which is supposed to be implemented twice, once for built-in thumbnailers that run in the same process as tumbler itself, and once for specialized thumbnailers which talk to tumbler over D-Bus. TumblerThumbnailer provides a function for creating a thumbnail plus "ready" and "error" signals. Their signatures may still change though. TumblerBuiltinThumbnailer is a new class for built-in thumbnailers. It is a little similar to ExoSimpleJob in that it allows built-in thumbnailers to be created by defining a create function and a list of mime types. Also new is tumbler_pixbuf_thumbnailer_new() which creates a pixbuf thumbnailer. It's just a skeleton for now. TumblerRegistry now has a method tumbler_registry_add() for adding a new TumblerThumbnailer to the registry. Last but not least, there's tumbler-marshal.list for custom marshallers now.
Diffstat (limited to 'tumbler/tumbler-thumbnailer.h')
-rw-r--r--tumbler/tumbler-thumbnailer.h62
1 files changed, 62 insertions, 0 deletions
diff --git a/tumbler/tumbler-thumbnailer.h b/tumbler/tumbler-thumbnailer.h
new file mode 100644
index 0000000..2301471
--- /dev/null
+++ b/tumbler/tumbler-thumbnailer.h
@@ -0,0 +1,62 @@
+/* vi:set et ai sw=2 sts=2 ts=2: */
+/*-
+ * Copyright (c) 2009 Jannis Pohlmann <jannis@xfce.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 __TUMBLER_THUMBNAILER_H__
+#define __TUMBLER_THUMBNAILER_H__
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+#define TUMBLER_TYPE_THUMBNAILER (tumbler_thumbnailer_get_type ())
+#define TUMBLER_THUMBNAILER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUMBLER_TYPE_THUMBNAILER, TumblerThumbnailer))
+#define TUMBLER_IS_THUMBNAILER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUMBLER_TYPE_THUMBNAILER))
+#define TUMBLER_THUMBNAILER_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TUMBLER_TYPE_THUMBNAILER, TumblerThumbnailerIface))
+
+typedef struct _TumblerThumbnailer TumblerThumbnailer;
+typedef struct _TumblerThumbnailerIface TumblerThumbnailerIface;
+
+struct _TumblerThumbnailerIface
+{
+ GTypeInterface __parent__;
+
+ /* signals */
+ void (*ready) (TumblerThumbnailer *thumbnailer,
+ const gchar *uri);
+ void (*error) (TumblerThumbnailer *thumbnailer,
+ const gchar *failed_uri,
+ gint error_code,
+ const gchar *message);
+
+ /* virtual methods */
+ void (*create) (TumblerThumbnailer *thumbnailer,
+ const gchar *uri,
+ const gchar *mime_hint);
+};
+
+GType tumbler_thumbnailer_get_type (void) G_GNUC_CONST;
+
+void tumbler_thumbnailer_create (TumblerThumbnailer *thumbnailer,
+ const gchar *uri,
+ const gchar *mime_hint);
+
+G_END_DECLS
+
+#endif /* !__TUMBLER_THUMBNAILER_H__ */