]> www.fi.muni.cz Git - evince.git/blob - libdocument/ev-async-renderer.c
[libdocument] Add ev_document_get_uri()
[evince.git] / libdocument / ev-async-renderer.c
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; c-indent-level: 8 -*- */
2 /*
3  *  Copyright (C) 2004 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  */
20
21 #include "config.h"
22
23 #include "ev-async-renderer.h"
24 #include "ev-document.h"
25
26 enum
27 {
28         RENDER_FINISHED,
29         LAST_SIGNAL
30 };
31
32 static guint signals[LAST_SIGNAL] = { 0 };
33
34 EV_DEFINE_INTERFACE (EvAsyncRenderer, ev_async_renderer, 0)
35
36 static void
37 ev_async_renderer_class_init (EvAsyncRendererIface *klass)
38 {
39         static gboolean initialized = FALSE;
40
41         if (!initialized) {
42                 signals[RENDER_FINISHED] =
43                         g_signal_new ("render_finished",
44                                       EV_TYPE_ASYNC_RENDERER,
45                                       G_SIGNAL_RUN_LAST,
46                                       G_STRUCT_OFFSET (EvAsyncRendererIface, render_finished),
47                                       NULL, NULL,
48                                       g_cclosure_marshal_VOID__OBJECT,
49                                       G_TYPE_NONE,
50                                       1,
51                                       GDK_TYPE_PIXBUF);
52                 initialized = TRUE;
53         }
54 }
55
56 void
57 ev_async_renderer_render_pixbuf (EvAsyncRenderer *async_renderer,
58                                  int              page,
59                                  double           scale,
60                                  int              rotation)
61 {
62         EvAsyncRendererIface *iface = EV_ASYNC_RENDERER_GET_IFACE (async_renderer);
63
64         iface->render_pixbuf (async_renderer, page, scale, rotation);
65 }