1 /* this file is part of evince, a gnome document viewer
3 * Copyright (C) 2005 Jonathan Blandford <jrb@gnome.org>
5 * Evince is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * Evince is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
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.
21 #include "ev-render-context.h"
23 static void ev_render_context_init (EvRenderContext *rc);
24 static void ev_render_context_class_init (EvRenderContextClass *class);
27 G_DEFINE_TYPE (EvRenderContext, ev_render_context, G_TYPE_OBJECT);
29 static void ev_render_context_init (EvRenderContext *rc) { /* Do Nothing */ }
32 ev_render_context_dispose (GObject *object)
36 rc = (EvRenderContext *) object;
39 g_object_unref (rc->page);
43 (* G_OBJECT_CLASS (ev_render_context_parent_class)->dispose) (object);
47 ev_render_context_class_init (EvRenderContextClass *class)
51 oclass = G_OBJECT_CLASS (class);
53 oclass->dispose = ev_render_context_dispose;
57 ev_render_context_new (EvPage *page,
63 rc = (EvRenderContext *) g_object_new (EV_TYPE_RENDER_CONTEXT, NULL);
65 rc->page = page ? g_object_ref (page) : NULL;
66 rc->rotation = rotation;
73 ev_render_context_set_page (EvRenderContext *rc,
76 g_return_if_fail (rc != NULL);
77 g_return_if_fail (EV_IS_PAGE (page));
80 g_object_unref (rc->page);
81 rc->page = g_object_ref (page);
85 ev_render_context_set_rotation (EvRenderContext *rc,
88 g_return_if_fail (rc != NULL);
90 rc->rotation = rotation;
94 ev_render_context_set_scale (EvRenderContext *rc,
97 g_return_if_fail (rc != NULL);