1 /* this file is part of evince, a gnome document viewer
3 * Copyright (C) 2004 Martin Kretzschmar
6 * Martin Kretzschmar <martink@gnome.org>
8 * Evince is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * Evince is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
23 #include "ev-file-exporter.h"
26 ev_file_exporter_get_type (void)
28 static GType type = 0;
30 if (G_UNLIKELY (type == 0)) {
31 const GTypeInfo our_info =
33 sizeof (EvFileExporterIface),
38 type = g_type_register_static (G_TYPE_INTERFACE,
40 &our_info, (GTypeFlags)0);
47 ev_file_exporter_format_supported (EvFileExporter *exporter,
48 EvFileExporterFormat format)
50 EvFileExporterIface *iface = EV_FILE_EXPORTER_GET_IFACE (exporter);
52 if (format < EV_FILE_FORMAT_PS ||
53 format > EV_FILE_FORMAT_PDF)
56 return iface->format_supported (exporter, format);
60 ev_file_exporter_begin (EvFileExporter *exporter,
61 EvFileExporterFormat format,
62 const gchar *filename,
69 EvFileExporterIface *iface = EV_FILE_EXPORTER_GET_IFACE (exporter);
71 g_return_if_fail (ev_file_exporter_format_supported (exporter, format));
73 iface->begin (exporter, format, filename, first_page, last_page,
74 paper_width, paper_height, duplex);
78 ev_file_exporter_do_page (EvFileExporter *exporter, EvRenderContext *rc)
80 EvFileExporterIface *iface = EV_FILE_EXPORTER_GET_IFACE (exporter);
82 iface->do_page (exporter, rc);
86 ev_file_exporter_end (EvFileExporter *exporter)
88 EvFileExporterIface *iface = EV_FILE_EXPORTER_GET_IFACE (exporter);
90 iface->end (exporter);