~ubuntu-branches/ubuntu/oneiric/evince/oneiric-updates

« back to all changes in this revision

Viewing changes to libdocument/ev-async-renderer.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2007-01-10 19:35:11 UTC
  • mto: (1.3.1 experimental) (52.1.1 hardy-proposed)
  • mto: This revision was merged to the branch mainline in revision 20.
  • Revision ID: james.westby@ubuntu.com-20070110193511-yjrnndv8e8wv03yy
Tags: upstream-0.7.1
ImportĀ upstreamĀ versionĀ 0.7.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
 
25
static void ev_async_renderer_class_init (gpointer g_class);
 
26
 
 
27
enum
 
28
{
 
29
        RENDER_FINISHED,
 
30
        LAST_SIGNAL
 
31
};
 
32
 
 
33
static guint signals[LAST_SIGNAL] = { 0 };
 
34
 
 
35
GType
 
36
ev_async_renderer_get_type (void)
 
37
{
 
38
        static GType type = 0;
 
39
 
 
40
        if (G_UNLIKELY (type == 0))
 
41
        {
 
42
                const GTypeInfo our_info =
 
43
                {
 
44
                        sizeof (EvAsyncRendererIface),
 
45
                        NULL,
 
46
                        NULL,
 
47
                        (GClassInitFunc)ev_async_renderer_class_init
 
48
                };
 
49
 
 
50
                type = g_type_register_static (G_TYPE_INTERFACE,
 
51
                                               "EvAsyncRenderer",
 
52
                                               &our_info, (GTypeFlags)0);
 
53
        }
 
54
 
 
55
        return type;
 
56
}
 
57
 
 
58
static void
 
59
ev_async_renderer_class_init (gpointer g_class)
 
60
{
 
61
        signals[RENDER_FINISHED] =
 
62
                g_signal_new ("render_finished",
 
63
                              EV_TYPE_ASYNC_RENDERER,
 
64
                              G_SIGNAL_RUN_LAST,
 
65
                              G_STRUCT_OFFSET (EvAsyncRendererIface, render_finished),
 
66
                              NULL, NULL,
 
67
                              g_cclosure_marshal_VOID__OBJECT,
 
68
                              G_TYPE_NONE,
 
69
                              1,
 
70
                              GDK_TYPE_PIXBUF);
 
71
}
 
72
 
 
73
void
 
74
ev_async_renderer_render_pixbuf (EvAsyncRenderer *async_renderer,
 
75
                                 int              page,
 
76
                                 double           scale,
 
77
                                 int              rotation)
 
78
{
 
79
        EvAsyncRendererIface *iface = EV_ASYNC_RENDERER_GET_IFACE (async_renderer);
 
80
 
 
81
        iface->render_pixbuf (async_renderer, page, scale, rotation);
 
82
}