]> www.fi.muni.cz Git - evince.git/blob - backend/ev-document.c
Move viewer directory to backend/ directory, rename EvViewer to
[evince.git] / backend / ev-document.c
1 /*
2  *  Copyright (C) 2004 Marco Pesenti Gritti
3  *
4  *  This program is free software; you can redistribute it and/or modify
5  *  it under the terms of the GNU General Public License as published by
6  *  the Free Software Foundation; either version 2, or (at your option)
7  *  any later version.
8  *
9  *  This program is distributed in the hope that it will be useful,
10  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  *  GNU General Public License for more details.
13  *
14  *  You should have received a copy of the GNU General Public License
15  *  along with this program; if not, write to the Free Software
16  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17  *
18  */
19
20 #include "config.h"
21
22 #include "ev-document.h"
23
24 static void ev_document_base_init (gpointer g_class);
25
26 GType
27 ev_document_get_type (void)
28 {
29         static GType type = 0;
30
31         if (G_UNLIKELY (type == 0))
32         {
33                 static const GTypeInfo our_info =
34                 {
35                         sizeof (EvDocumentIface),
36                         ev_document_base_init,
37                         NULL,
38                 };
39
40                 type = g_type_register_static (G_TYPE_INTERFACE,
41                                                "EvDocument",
42                                                &our_info, (GTypeFlags)0);
43         }
44
45         return type;
46 }
47
48 static void
49 ev_document_base_init (gpointer g_class)
50 {
51 }
52
53 void
54 ev_document_load (EvDocument  *document,
55                   const char  *uri,
56                   GError      *error)
57 {
58         EvDocumentIface *iface = EV_DOCUMENT_GET_IFACE (document);
59         iface->load (document, uri);
60 }
61
62 int
63 ev_document_get_n_pages (EvDocument  *document)
64 {
65         EvDocumentIface *iface = EV_DOCUMENT_GET_IFACE (document);
66         return iface->get_n_pages (document);
67 }
68
69 void
70 ev_document_set_page (EvDocument  *document,
71                       int          page)
72 {
73         EvDocumentIface *iface = EV_DOCUMENT_GET_IFACE (document);
74         iface->set_page (document, page);
75 }
76
77 void
78 ev_document_set_target (EvDocument  *document,
79                         GdkDrawable *target)
80 {
81         EvDocumentIface *iface = EV_DOCUMENT_GET_IFACE (document);
82         iface->set_target (document, target);
83 }
84
85 void
86 ev_document_set_page_rect (EvDocument  *document,
87                            int          x,
88                            int          y,
89                            int          width,
90                            int          height)
91 {
92         EvDocumentIface *iface = EV_DOCUMENT_GET_IFACE (document);
93         iface->set_page_rect (document, x, y, width, height);
94 }
95
96 void
97 ev_document_render (EvDocument  *document,
98                     int          clip_x,
99                     int          clip_y,
100                     int          clip_width,
101                     int          clip_height)
102 {
103         EvDocumentIface *iface = EV_DOCUMENT_GET_IFACE (document);
104         iface->render (document, clip_x, clip_y, clip_width, clip_height);
105 }