]> www.fi.muni.cz Git - evince.git/blob - backend/ev-document.h
0059fd43c91685d28e60b58ce821d9ab725bf5c8
[evince.git] / backend / ev-document.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; c-indent-level: 8 -*- */
2 /*
3  *  Copyright (C) 2000-2003 Marco Pesenti Gritti
4  *
5  *  This program is free software; you can redistribute it and/or modify
6  *  it under the terms of the GNU General Public License as published by
7  *  the Free Software Foundation; either version 2, or (at your option)
8  *  any later version.
9  *
10  *  This program 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 General Public License for more details.
14  *
15  *  You should have received a copy of the GNU General Public License
16  *  along with this program; if not, write to the Free Software
17  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18  *
19  *  $Id$
20  */
21
22 #ifndef EV_DOCUMENT_H
23 #define EV_DOCUMENT_H
24
25 #include <glib-object.h>
26 #include <glib.h>
27 #include <gdk/gdk.h>
28
29 G_BEGIN_DECLS
30
31 #define EV_TYPE_DOCUMENT            (ev_document_get_type ())
32 #define EV_DOCUMENT(o)              (G_TYPE_CHECK_INSTANCE_CAST ((o), EV_TYPE_DOCUMENT, EvDocument))
33 #define EV_DOCUMENT_IFACE(k)        (G_TYPE_CHECK_CLASS_CAST((k), EV_TYPE_DOCUMENT, EvDocumentIface))
34 #define EV_IS_DOCUMENT(o)           (G_TYPE_CHECK_INSTANCE_TYPE ((o), EV_TYPE_DOCUMENT))
35 #define EV_IS_DOCUMENT_IFACE(k)     (G_TYPE_CHECK_CLASS_TYPE ((k), EV_TYPE_DOCUMENT))
36 #define EV_DOCUMENT_GET_IFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), EV_TYPE_DOCUMENT, EvDocumentIface))
37
38 typedef struct _EvDocument      EvDocument;
39 typedef struct _EvDocumentIface EvDocumentIface;
40
41 struct _EvDocumentIface
42 {
43         GTypeInterface base_iface;
44
45         /* Signals */
46         void        (* changed)         (EvDocument *document);
47
48         /* Methods  */
49         gboolean    (* load)            (EvDocument *document,
50                                          const char *uri,
51                                          GError    **error);
52         int         (* get_n_pages)     (EvDocument *document);
53         void        (* set_page)        (EvDocument  *document,
54                                          int          page);
55         int         (* get_page)        (EvDocument  *document);
56         void        (* set_target)      (EvDocument  *document,
57                                          GdkDrawable *target);
58         void        (* set_scale)       (EvDocument  *document,
59                                          double       scale);
60         void        (* set_page_offset) (EvDocument  *document,
61                                          int          x,
62                                          int          y);
63         void        (* get_page_size)   (EvDocument  *document,
64                                          int         *width,
65                                          int         *height);
66         void        (* render)          (EvDocument  *document,
67                                          int          clip_x,
68                                          int          clip_y,
69                                          int          clip_width,
70                                          int          clip_height);
71 };
72
73 GType ev_document_get_type (void);
74
75 gboolean ev_document_load            (EvDocument   *document,
76                                       const char   *uri,
77                                       GError      **error);
78 int      ev_document_get_n_pages     (EvDocument   *document);
79 void     ev_document_set_page        (EvDocument   *document,
80                                       int           page);
81 int      ev_document_get_page        (EvDocument   *document);
82 void     ev_document_set_target      (EvDocument   *document,
83                                       GdkDrawable  *target);
84 void     ev_document_set_scale       (EvDocument   *document,
85                                       double        scale);
86 void     ev_document_set_page_offset (EvDocument   *document,
87                                       int           x,
88                                       int           y);
89 void     ev_document_get_page_size   (EvDocument   *document,
90                                       int          *width,
91                                       int          *height);
92 void     ev_document_render          (EvDocument   *document,
93                                       int           clip_x,
94                                       int           clip_y,
95                                       int           clip_width,
96                                       int           clip_height);
97 void     ev_document_changed         (EvDocument *document);
98
99 G_END_DECLS
100
101 #endif