]> www.fi.muni.cz Git - evince.git/blob - libdocument/ev-file-exporter.c
9b2bc6933ee732f2ce9d08051078fb8fb92e5ead
[evince.git] / libdocument / ev-file-exporter.c
1 /* this file is part of evince, a gnome document viewer
2  *
3  *  Copyright (C) 2004 Martin Kretzschmar
4  *
5  *  Author:
6  *    Martin Kretzschmar <martink@gnome.org>
7  *
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.
12  *
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.
17  *
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.
21  */
22
23 #include "ev-file-exporter.h"
24
25 GType
26 ev_file_exporter_get_type (void)
27 {
28         static GType type = 0;
29
30         if (G_UNLIKELY (type == 0)) {
31                 const GTypeInfo our_info =
32                 {
33                         sizeof (EvFileExporterIface),
34                         NULL,
35                         NULL,
36                 };
37
38                 type = g_type_register_static (G_TYPE_INTERFACE,
39                                                "EvFileExporter",
40                                                &our_info, (GTypeFlags)0);
41         }
42
43         return type;
44 }
45
46 void
47 ev_file_exporter_begin (EvFileExporter        *exporter,
48                         EvFileExporterContext *fc)
49 {
50         EvFileExporterIface *iface = EV_FILE_EXPORTER_GET_IFACE (exporter);
51
52         iface->begin (exporter, fc);
53 }
54
55 void
56 ev_file_exporter_begin_page (EvFileExporter *exporter)
57 {
58         EvFileExporterIface *iface = EV_FILE_EXPORTER_GET_IFACE (exporter);
59
60         if (iface->begin_page)
61                 iface->begin_page (exporter);
62 }
63
64 void
65 ev_file_exporter_do_page (EvFileExporter  *exporter,
66                           EvRenderContext *rc)
67 {
68         EvFileExporterIface *iface = EV_FILE_EXPORTER_GET_IFACE (exporter);
69
70         iface->do_page (exporter, rc);
71 }
72
73 void
74 ev_file_exporter_end_page (EvFileExporter *exporter)
75 {
76         EvFileExporterIface *iface = EV_FILE_EXPORTER_GET_IFACE (exporter);
77         
78         if (iface->end_page)
79                 iface->end_page (exporter);
80 }
81
82 void
83 ev_file_exporter_end (EvFileExporter *exporter)
84 {
85         EvFileExporterIface *iface = EV_FILE_EXPORTER_GET_IFACE (exporter);
86
87         iface->end (exporter);
88 }
89
90 EvFileExporterCapabilities
91 ev_file_exporter_get_capabilities (EvFileExporter *exporter)
92 {
93         EvFileExporterIface *iface = EV_FILE_EXPORTER_GET_IFACE (exporter);
94
95         return iface->get_capabilities (exporter);
96 }