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 <font-thumbnailer/font-thumbnailer-provider.h>
33
#include <font-thumbnailer/font-thumbnailer.h>
37
static void font_thumbnailer_provider_thumbnailer_provider_init (TumblerThumbnailerProviderIface *iface);
38
static GList *font_thumbnailer_provider_get_thumbnailers (TumblerThumbnailerProvider *provider);
42
struct _FontThumbnailerProviderClass
44
GObjectClass __parent__;
47
struct _FontThumbnailerProvider
54
G_DEFINE_DYNAMIC_TYPE_EXTENDED (FontThumbnailerProvider,
55
font_thumbnailer_provider,
58
TUMBLER_ADD_INTERFACE (TUMBLER_TYPE_THUMBNAILER_PROVIDER,
59
font_thumbnailer_provider_thumbnailer_provider_init));
64
font_thumbnailer_provider_register (TumblerProviderPlugin *plugin)
66
font_thumbnailer_provider_register_type (G_TYPE_MODULE (plugin));
72
font_thumbnailer_provider_class_init (FontThumbnailerProviderClass *klass)
74
GObjectClass *gobject_class;
76
gobject_class = G_OBJECT_CLASS (klass);
82
font_thumbnailer_provider_class_finalize (FontThumbnailerProviderClass *klass)
89
font_thumbnailer_provider_thumbnailer_provider_init (TumblerThumbnailerProviderIface *iface)
91
iface->get_thumbnailers = font_thumbnailer_provider_get_thumbnailers;
97
font_thumbnailer_provider_init (FontThumbnailerProvider *provider)
104
font_thumbnailer_provider_get_thumbnailers (TumblerThumbnailerProvider *provider)
106
static const gchar *mime_types[] =
108
"application/x-font-otf",
109
"application/x-font-pcf",
110
"application/x-font-ttf",
111
"application/x-font-type1",
114
FontThumbnailer *thumbnailer;
115
GList *thumbnailers = NULL;
118
/* determine the URI schemes supported by GIO */
119
uri_schemes = tumbler_util_get_supported_uri_schemes ();
121
/* create the pixbuf thumbnailer */
122
thumbnailer = g_object_new (TYPE_FONT_THUMBNAILER,
123
"uri-schemes", uri_schemes, "mime-types", mime_types,
126
/* add the thumbnailer to the list */
127
thumbnailers = g_list_append (thumbnailers, thumbnailer);
129
/* free URI schemes */
130
g_strfreev (uri_schemes);