1
/* vi:set et ai sw=2 sts=2 ts=2: */
3
* Copyright (c) 2009 Jannis Pohlmann <jannis@xfce.org>
5
* This library is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU Library General Public
7
* License as published by the Free Software Foundation; either
8
* version 2 of the License, or (at your option) any later version.
10
* This library is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU Library General Public License for more details.
15
* You should have received a copy of the GNU Library General
16
* Public License along with this library; if not, write to the
17
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18
* Boston, MA 02110-1301, USA.
26
#include <glib-object.h>
28
#include <gdk-pixbuf/gdk-pixbuf.h>
30
#include <tumbler/tumbler.h>
32
#include <jpeg-thumbnailer/jpeg-thumbnailer-provider.h>
33
#include <jpeg-thumbnailer/jpeg-thumbnailer.h>
37
static void jpeg_thumbnailer_provider_thumbnailer_provider_init (TumblerThumbnailerProviderIface *iface);
38
static GList *jpeg_thumbnailer_provider_get_thumbnailers (TumblerThumbnailerProvider *provider);
42
struct _JPEGThumbnailerProviderClass
44
GObjectClass __parent__;
47
struct _JPEGThumbnailerProvider
54
G_DEFINE_DYNAMIC_TYPE_EXTENDED (JPEGThumbnailerProvider,
55
jpeg_thumbnailer_provider,
58
TUMBLER_ADD_INTERFACE (TUMBLER_TYPE_THUMBNAILER_PROVIDER,
59
jpeg_thumbnailer_provider_thumbnailer_provider_init));
64
jpeg_thumbnailer_provider_register (TumblerProviderPlugin *plugin)
66
jpeg_thumbnailer_provider_register_type (G_TYPE_MODULE (plugin));
72
jpeg_thumbnailer_provider_class_init (JPEGThumbnailerProviderClass *klass)
74
GObjectClass *gobject_class;
76
gobject_class = G_OBJECT_CLASS (klass);
82
jpeg_thumbnailer_provider_class_finalize (JPEGThumbnailerProviderClass *klass)
89
jpeg_thumbnailer_provider_thumbnailer_provider_init (TumblerThumbnailerProviderIface *iface)
91
iface->get_thumbnailers = jpeg_thumbnailer_provider_get_thumbnailers;
97
jpeg_thumbnailer_provider_init (JPEGThumbnailerProvider *provider)
104
jpeg_thumbnailer_provider_get_thumbnailers (TumblerThumbnailerProvider *provider)
106
JPEGThumbnailer *thumbnailer;
107
const gchar *mime_types[] = { "image/jpeg", NULL };
108
GList *thumbnailers = NULL;
111
/* determine which URI schemes are supported by GIO */
112
uri_schemes = tumbler_util_get_supported_uri_schemes ();
114
/* create the pixbuf thumbnailer */
115
thumbnailer = g_object_new (TYPE_JPEG_THUMBNAILER,
116
"uri-schemes", uri_schemes, "mime-types", mime_types,
119
/* free URI schemes and MIME types */
120
g_strfreev (uri_schemes);
122
/* add the thumbnailer to the list */
123
thumbnailers = g_list_append (thumbnailers, thumbnailer);