diff --git a/acinclude.m4 b/acinclude.m4 index 66e79d1..a281478 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -297,3 +297,25 @@ AC_MSG_CHECKING([whether to build the freedesktop.org cache plugin]) AM_CONDITIONAL([TUMBLER_XDG_CACHE], [test x"$ac_tumbler_xdg_cache" = x"yes"]) AC_MSG_RESULT([$ac_tumbler_xdg_cache]) ]) + +dnl TUMBLER_WEBP_THUMBNAILER() +dnl +dnl Check whether to build and install the libwebp thumbnailer plugin. +dnl +AC_DEFUN([TUMBLER_WEBP_THUMBNAILER], +[ +AC_ARG_ENABLE([webp-thumbnailer], [AC_HELP_STRING([--disable-webp-thumbnailer], [Don't build the WEBP image thumbnailer plugin])], + [ac_tumbler_webp_thumbnailer=$enableval], [ac_tumbler_webp_thumbnailer=yes]) +if test x"$ac_tumbler_webp_thumbnailer" = x"yes"; then + dnl Check for gdk-pixbuf + PKG_CHECK_MODULES([GDK_PIXBUF], [gdk-pixbuf-2.0 >= 2.22], + [ + dnl Check for libwebp + PKG_CHECK_MODULES([LIBWEBP], [libwebp >= 0.4.3], [], [ac_tumbler_webp_thumbnailer=no]) + ], [ac_tumbler_webp_thumbnailer=no]) +fi + +AC_MSG_CHECKING([whether to build the WEBP image thumbnailer plugin]) +AM_CONDITIONAL([TUMBLER_WEBP_THUMBNAILER], [test x"$ac_tumbler_webp_thumbnailer" = x"yes"]) +AC_MSG_RESULT([$ac_tumbler_webp_thumbnailer]) +]) diff --git a/configure.ac b/configure.ac index a8dc277..d28be10 100644 --- a/configure.ac +++ b/configure.ac @@ -162,6 +162,7 @@ TUMBLER_ODF_THUMBNAILER() TUMBLER_POPPLER_THUMBNAILER() TUMBLER_RAW_THUMBNAILER() TUMBLER_XDG_CACHE() +TUMBLER_WEBP_THUMBNAILER() dnl *********************************** dnl *** Check for debugging support *** @@ -196,6 +197,7 @@ plugins/odf-thumbnailer/Makefile plugins/poppler-thumbnailer/Makefile plugins/raw-thumbnailer/Makefile plugins/xdg-cache/Makefile +plugins/webp-thumbnailer/Makefile po/Makefile.in tumbler/Makefile tumbler/tumbler-1.pc @@ -263,4 +265,9 @@ echo " * Freedesktop.org cache plugin: yes" else echo " * Freedesktop.org cache plugin: no" fi +if test x"$ac_tumbler_webp_thumbnailer" = x"yes"; then +echo " * WEBP thumbnailer plugin using libwebp: yes" +else +echo " * WEBP thumbnailer plugin using libwebp: no" +fi echo diff --git a/plugins/Makefile.am b/plugins/Makefile.am index f2c9f5f..f0bdfc5 100644 --- a/plugins/Makefile.am +++ b/plugins/Makefile.am @@ -27,4 +27,6 @@ SUBDIRS = \ odf-thumbnailer \ poppler-thumbnailer \ raw-thumbnailer \ - xdg-cache + xdg-cache \ + webp-thumbnailer + diff --git a/plugins/webp-thumbnailer/Makefile.am b/plugins/webp-thumbnailer/Makefile.am new file mode 100644 index 0000000..8f5af9c --- /dev/null +++ b/plugins/webp-thumbnailer/Makefile.am @@ -0,0 +1,65 @@ +# vi:set ts=8 sw=8 noet ai nocindent: +# - +# Copyright (c) 2011 Nick Schermer +# Copyright (c) 2012 Jannis Pohlmann +# +# 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. + +if TUMBLER_WEBP_THUMBNAILER + +tumbler_plugindir = $(libdir)/tumbler-$(TUMBLER_VERSION_API)/plugins +tumbler_plugin_LTLIBRARIES = \ + tumbler-webp-thumbnailer.la + +tumbler_webp_thumbnailer_la_SOURCES = \ + webp-thumbnailer-plugin.c \ + webp-thumbnailer-provider.c \ + webp-thumbnailer-provider.h \ + webp-thumbnailer.c \ + webp-thumbnailer.h + +tumbler_webp_thumbnailer_la_CFLAGS = \ + -I$(top_builddir) \ + -I$(top_builddir)/plugins \ + -I$(top_srcdir) \ + -I$(top_srcdir)/plugins \ + -DG_LOG_DOMAIN=\"tumbler-webp-thumbnailer\" \ + -DPACKAGE_LOCALE_DIR=\"$(localedir)\" \ + $(GDK_PIXBUF_CFLAGS) \ + $(GIO_CFLAGS) \ + $(GLIB_CFLAGS) \ + $(LIBWEBP_CFLAGS) \ + $(PLATFORM_CFLAGS) \ + $(PLATFORM_CPPFLAGS) + +tumbler_webp_thumbnailer_la_LDFLAGS = \ + -avoid-version \ + -export-dynamic \ + -module \ + $(PLATFORM_LDFLAGS) + +tumbler_webp_thumbnailer_la_LIBADD = \ + $(top_builddir)/tumbler/libtumbler-$(TUMBLER_VERSION_API).la \ + $(GDK_PIXBUF_LIBS) \ + $(GIO_LIBS) \ + $(GLIB_LIBS) \ + $(LIBWEBP_LIBS) \ + -lm + +tumbler_webp_thumbnailer_la_DEPENDENCIES = \ + $(top_builddir)/tumbler/libtumbler-$(TUMBLER_VERSION_API).la + +endif diff --git a/plugins/webp-thumbnailer/webp-thumbnailer-plugin.c b/plugins/webp-thumbnailer/webp-thumbnailer-plugin.c new file mode 100644 index 0000000..ea64bfa --- /dev/null +++ b/plugins/webp-thumbnailer/webp-thumbnailer-plugin.c @@ -0,0 +1,91 @@ +/* vi:set et ai sw=2 sts=2 ts=2: */ +/*- + * Copyright (c) 2009 Jannis Pohlmann + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 Library General Public License for more details. + * + * You should have received a copy of the GNU Library General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include + +#include + +#include "webp-thumbnailer-provider.h" +#include "webp-thumbnailer.h" + + + +G_MODULE_EXPORT void tumbler_plugin_initialize (TumblerProviderPlugin *plugin); +G_MODULE_EXPORT void tumbler_plugin_shutdown (void); +G_MODULE_EXPORT void tumbler_plugin_get_types (const GType **types, + gint *n_types); + + + +static GType type_list[1]; + + + +void +tumbler_plugin_initialize (TumblerProviderPlugin *plugin) +{ + const gchar *mismatch; + + /* verify that the tumbler versions are compatible */ + mismatch = tumbler_check_version (TUMBLER_MAJOR_VERSION, TUMBLER_MINOR_VERSION, + TUMBLER_MICRO_VERSION); + if (G_UNLIKELY (mismatch != NULL)) + { + g_warning (_("Version mismatch: %s"), mismatch); + return; + } + +#ifdef DEBUG + g_print ("Initializing the Tumbler WEBP Thumbnailer plugin\n"); +#endif + + /* register the types provided by this plugin */ + webp_thumbnailer_register (plugin); + webp_thumbnailer_provider_register (plugin); + + /* set up the plugin provider type list */ + type_list[0] = TYPE_WEBP_THUMBNAILER_PROVIDER; +} + + + +void +tumbler_plugin_shutdown (void) +{ +#ifdef DEBUG + g_print ("Shutting down the Tumbler WEBP Thumbnailer plugin\n"); +#endif +} + + + +void +tumbler_plugin_get_types (const GType **types, + gint *n_types) +{ + *types = type_list; + *n_types = G_N_ELEMENTS (type_list); +} diff --git a/plugins/webp-thumbnailer/webp-thumbnailer-provider.c b/plugins/webp-thumbnailer/webp-thumbnailer-provider.c new file mode 100644 index 0000000..228a7e0 --- /dev/null +++ b/plugins/webp-thumbnailer/webp-thumbnailer-provider.c @@ -0,0 +1,119 @@ +/* vi:set et ai sw=2 sts=2 ts=2: */ +/*- + * Copyright (c) 2009 Jannis Pohlmann + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 Library General Public License for more details. + * + * You should have received a copy of the GNU Library General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include + +/* #include */ + +#include + +#include "webp-thumbnailer-provider.h" +#include "webp-thumbnailer.h" + + + +static void webp_thumbnailer_provider_thumbnailer_provider_init (TumblerThumbnailerProviderIface *iface); +static GList *webp_thumbnailer_provider_get_thumbnailers (TumblerThumbnailerProvider *provider); + + + +struct _WebpThumbnailerProviderClass +{ + GObjectClass __parent__; +}; + +struct _WebpThumbnailerProvider +{ + GObject __parent__; +}; + + + +G_DEFINE_DYNAMIC_TYPE_EXTENDED (WebpThumbnailerProvider, + webp_thumbnailer_provider, + G_TYPE_OBJECT, + 0, + TUMBLER_ADD_INTERFACE (TUMBLER_TYPE_THUMBNAILER_PROVIDER, + webp_thumbnailer_provider_thumbnailer_provider_init)); + + + +void +webp_thumbnailer_provider_register (TumblerProviderPlugin *plugin) +{ + webp_thumbnailer_provider_register_type (G_TYPE_MODULE (plugin)); +} + + + +static void +webp_thumbnailer_provider_class_init (WebpThumbnailerProviderClass *klass) +{ +} + + + +static void +webp_thumbnailer_provider_class_finalize (WebpThumbnailerProviderClass *klass) +{ +} + + + +static void +webp_thumbnailer_provider_thumbnailer_provider_init (TumblerThumbnailerProviderIface *iface) +{ + iface->get_thumbnailers = webp_thumbnailer_provider_get_thumbnailers; +} + + + +static void +webp_thumbnailer_provider_init (WebpThumbnailerProvider *provider) +{ +} + + + +static GList * +webp_thumbnailer_provider_get_thumbnailers (TumblerThumbnailerProvider *provider) +{ + WebpThumbnailer *thumbnailer; + GList *thumbnailers = NULL; + static const gchar *uri_schemes[] = { "file", NULL }; + const gchar *mime_types[] = { "image/webp", NULL }; + + + /* create the webp thumbnailer */ + thumbnailer = g_object_new (TYPE_WEBP_THUMBNAILER, + "uri-schemes", uri_schemes, + "mime-types", mime_types, + NULL); + + /* add the thumbnailer to the list */ + thumbnailers = g_list_append (thumbnailers, thumbnailer); + + return thumbnailers; +} diff --git a/plugins/webp-thumbnailer/webp-thumbnailer-provider.h b/plugins/webp-thumbnailer/webp-thumbnailer-provider.h new file mode 100644 index 0000000..616ecc4 --- /dev/null +++ b/plugins/webp-thumbnailer/webp-thumbnailer-provider.h @@ -0,0 +1,43 @@ +/* vi:set et ai sw=2 sts=2 ts=2: */ +/*- + * Copyright (c) 2009 Jannis Pohlmann + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 Library General Public License for more details. + * + * You should have received a copy of the GNU Library General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#ifndef __WEBP_THUMBNAILER_PROVIDER_H__ +#define __WEBP_THUMBNAILER_PROVIDER_H__ + +#include + +G_BEGIN_DECLS + +#define TYPE_WEBP_THUMBNAILER_PROVIDER (webp_thumbnailer_provider_get_type ()) +#define WEBP_THUMBNAILER_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_WEBP_THUMBNAILER_PROVIDER, WebpThumbnailerProvider)) +#define WEBP_THUMBNAILER_PROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_WEBP_THUMBNAILER_PROVIDER, WebpThumbnailerProviderClass)) +#define IS_WEBP_THUMBNAILER_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_WEBP_THUMBNAILER_PROVIDER)) +#define IS_WEBP_THUMBNAILER_PROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_WEBP_THUMBNAILER_PROVIDER) +#define WEBP_THUMBNAILER_PROVIDER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_WEBP_THUMBNAILER_PROVIDER, WebpThumbnailerProviderClass)) + +typedef struct _WebpThumbnailerProviderClass WebpThumbnailerProviderClass; +typedef struct _WebpThumbnailerProvider WebpThumbnailerProvider; + +GType webp_thumbnailer_provider_get_type (void) G_GNUC_CONST; +void webp_thumbnailer_provider_register (TumblerProviderPlugin *plugin); + +G_END_DECLS + +#endif /* !__WEBP_THUMBNAILER_PROVIDER_H__ */ diff --git a/plugins/webp-thumbnailer/webp-thumbnailer.c b/plugins/webp-thumbnailer/webp-thumbnailer.c new file mode 100644 index 0000000..a640c32 --- /dev/null +++ b/plugins/webp-thumbnailer/webp-thumbnailer.c @@ -0,0 +1,313 @@ +/* vi:set et ai sw=2 sts=2 ts=2: */ +/*- + * Copyright (c) 2009 Jannis Pohlmann + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 Library General Public License for more details. + * + * You should have received a copy of the GNU Library General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include /* from the libwebp library */ +#include /* for pixbuf handling */ + +#include "webp-thumbnailer.h" + + +static void webp_thumbnailer_create (TumblerAbstractThumbnailer *thumbnailer, + GCancellable *cancellable, + TumblerFileInfo *info); + + + +struct _WebpThumbnailerClass +{ + TumblerAbstractThumbnailerClass __parent__; +}; + +struct _WebpThumbnailer +{ + TumblerAbstractThumbnailer __parent__; +}; + + + +G_DEFINE_DYNAMIC_TYPE (WebpThumbnailer, + webp_thumbnailer, + TUMBLER_TYPE_ABSTRACT_THUMBNAILER); + + + +void +webp_thumbnailer_register (TumblerProviderPlugin *plugin) +{ + webp_thumbnailer_register_type (G_TYPE_MODULE (plugin)); +} + + + +static void +webp_thumbnailer_class_init (WebpThumbnailerClass *klass) +{ + TumblerAbstractThumbnailerClass *abstractthumbnailer_class; + + abstractthumbnailer_class = TUMBLER_ABSTRACT_THUMBNAILER_CLASS (klass); + abstractthumbnailer_class->create = webp_thumbnailer_create; +} + + + +static void +webp_thumbnailer_class_finalize (WebpThumbnailerClass *klass) +{ +} + + + +static void +webp_thumbnailer_init (WebpThumbnailer *thumbnailer) +{ +} + + + +/* create the thumbnail - based on: + https://github.com/aruiz/webp-pixbuf-loader/blob/master/io-webp.c */ + +static void +destroy_data (guchar *pixels, gpointer data) +{ + g_free (pixels); +} + + /* Shared library entry point */ +static GdkPixbuf * +gdk_pixbuf__webp_image_load (FILE *f, GError **error) +{ + GdkPixbuf * volatile pixbuf = NULL; + guint32 data_size; + guint8 *out; + gint w, h, ok; + gpointer data; + WebPBitstreamFeatures features; + gboolean use_alpha = TRUE; + + /* Get data size */ + fseek (f, 0, SEEK_END); + data_size = ftell(f); + fseek (f, 0, SEEK_SET); + + /* Get data */ + data = g_malloc (data_size); + ok = (fread (data, data_size, 1, f) == 1); + if (!ok) { + g_set_error (error, + GDK_PIXBUF_ERROR, + GDK_PIXBUF_ERROR_FAILED, + "Failed to read file"); + return FALSE; + } + + /* Take the safe route and only disable the alpha channel when + we're sure that there is not any. */ + if (WebPGetFeatures (data, data_size, &features) == VP8_STATUS_OK + && features.has_alpha == FALSE) { + use_alpha = FALSE; + } + + if (use_alpha) { + out = WebPDecodeRGBA (data, data_size, &w, &h); + } else { + out = WebPDecodeRGB (data, data_size, &w, &h); + } + g_free (data); + + if (!out) { + g_set_error (error, + GDK_PIXBUF_ERROR, + GDK_PIXBUF_ERROR_FAILED, + "Cannot create WebP decoder."); + return FALSE; + } + + pixbuf = gdk_pixbuf_new_from_data ((const guchar *)out, + GDK_COLORSPACE_RGB, + use_alpha, + 8, + w, h, + w * (use_alpha ? 4 : 3), + destroy_data, + NULL); + + if (!pixbuf) { + g_set_error (error, + GDK_PIXBUF_ERROR, + GDK_PIXBUF_ERROR_FAILED, + "Failed to decode image"); + return FALSE; + } + return pixbuf; +} + + +static GdkPixbuf* +scale_pixbuf (GdkPixbuf *source, + gint dest_width, + gint dest_height) +{ + gdouble wratio; + gdouble hratio; + gint source_width; + gint source_height; + + /* determine source pixbuf dimensions */ + source_width = gdk_pixbuf_get_width (source); + source_height = gdk_pixbuf_get_height (source); + + /* don't do anything if there is no need to resize */ + if (source_width <= dest_width && source_height <= dest_height) + return g_object_ref (source); + + /* determine which axis needs to be scaled down more */ + wratio = (gdouble) source_width / (gdouble) dest_width; + hratio = (gdouble) source_height / (gdouble) dest_height; + + /* adjust the other axis */ + if (hratio > wratio) + dest_width = rint (source_width / hratio); + else + dest_height = rint (source_height / wratio); + + /* scale the pixbuf down to the desired size */ + return gdk_pixbuf_scale_simple (source, MAX (dest_width, 1), + MAX (dest_height, 1), + GDK_INTERP_BILINEAR); +} + + +static void +webp_thumbnailer_create (TumblerAbstractThumbnailer *thumbnailer, + GCancellable *cancellable, + TumblerFileInfo *info) +{ + TumblerThumbnailFlavor *flavor; + TumblerImageData data; + TumblerThumbnail *thumbnail; + const gchar *uri; + gchar *path; + GdkPixbuf *pixbuf = NULL; + GError *error = NULL; + GFile *file; + gint height; + gint width; + GdkPixbuf *scaled; + FILE *fp; + + g_return_if_fail (IS_WEBP_THUMBNAILER (thumbnailer)); + g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); + g_return_if_fail (TUMBLER_IS_FILE_INFO (info)); + + /* do nothing if cancelled */ + if (g_cancellable_is_cancelled (cancellable)) + return; + + uri = tumbler_file_info_get_uri (info); + file = g_file_new_for_uri (uri); + + thumbnail = tumbler_file_info_get_thumbnail (info); + g_assert (thumbnail != NULL); + + flavor = tumbler_thumbnail_get_flavor (thumbnail); + g_assert (flavor != NULL); + + tumbler_thumbnail_flavor_get_size (flavor, &width, &height); + + /* load the webp file into a pixbuf */ + path = g_file_get_path (file); + if (path != NULL && g_path_is_absolute (path)) + { + /* create FILE * */ + fp = fopen(path, "r"); + if (fp) + { + pixbuf = gdk_pixbuf__webp_image_load(fp, &error); + if (pixbuf == NULL) + { + g_set_error_literal (&error, TUMBLER_ERROR, TUMBLER_ERROR_NO_CONTENT, + _("Thumbnail could not be inferred from file contents")); + } + fclose(fp); + } + } + else + { + g_set_error_literal (&error, TUMBLER_ERROR, TUMBLER_ERROR_UNSUPPORTED, + _("Only local files are supported")); + } + + g_free (path); + g_object_unref (file); + + if (pixbuf != NULL) + { + scaled = scale_pixbuf (pixbuf, width, height); + g_object_unref (pixbuf); + pixbuf = scaled; + + data.data = gdk_pixbuf_get_pixels (pixbuf); + data.has_alpha = gdk_pixbuf_get_has_alpha (pixbuf); + data.bits_per_sample = gdk_pixbuf_get_bits_per_sample (pixbuf); + data.width = gdk_pixbuf_get_width (pixbuf); + data.height = gdk_pixbuf_get_height (pixbuf); + data.rowstride = gdk_pixbuf_get_rowstride (pixbuf); + data.colorspace = (TumblerColorspace) gdk_pixbuf_get_colorspace (pixbuf); + + tumbler_thumbnail_save_image_data (thumbnail, &data, + tumbler_file_info_get_mtime (info), + NULL, &error); + } + + if (error != NULL) + { + g_signal_emit_by_name (thumbnailer, "error", uri, error->code, error->message); + g_error_free (error); + } + else + { + g_signal_emit_by_name (thumbnailer, "ready", uri); + g_object_unref (pixbuf); + } + g_object_unref (flavor); + g_object_unref (thumbnail); + +} diff --git a/plugins/webp-thumbnailer/webp-thumbnailer.h b/plugins/webp-thumbnailer/webp-thumbnailer.h new file mode 100644 index 0000000..334097a --- /dev/null +++ b/plugins/webp-thumbnailer/webp-thumbnailer.h @@ -0,0 +1,45 @@ +/* vi:set et ai sw=2 sts=2 ts=2: */ +/*- + * Copyright (c) 2009 Jannis Pohlmann + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 Library General Public License for more details. + * + * You should have received a copy of the GNU Library General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#ifndef __WEBP_THUMBNAILER_H__ +#define __WEBP_THUMBNAILER_H__ + +#include + +G_BEGIN_DECLS + +#define TYPE_WEBP_THUMBNAILER (webp_thumbnailer_get_type ()) +#define WEBP_THUMBNAILER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_WEBP_THUMBNAILER, WebpThumbnailer)) +#define WEBP_THUMBNAILER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_WEBP_THUMBNAILER, WebpThumbnailerClass)) +#define IS_WEBP_THUMBNAILER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_WEBP_THUMBNAILER)) +#define IS_WEBP_THUMBNAILER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_WEBP_THUMBNAILER) +#define WEBP_THUMBNAILER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_WEBP_THUMBNAILER, WebpThumbnailerClass)) + + + +typedef struct _WebpThumbnailerClass WebpThumbnailerClass; +typedef struct _WebpThumbnailer WebpThumbnailer; + +GType webp_thumbnailer_get_type (void) G_GNUC_CONST; +void webp_thumbnailer_register (TumblerProviderPlugin *plugin); + +G_END_DECLS + +#endif /* !__WEBP_THUMBNAILER_H__ */