2005-09-05 Inaki Larranaga <dooteo@euskalgnu.org>
[dia.git] / lib / diainteractiverenderer.c
blob7d132098f82d7e534cb9e0525cf4985752df327f
1 /* Dia -- an diagram creation/manipulation program
2 * Copyright (C) 1998 Alexander Larsson
4 * diainteractiverenderer.c - interface definition, implementation
5 * live in app
6 * Copyright (C) 2002 Hans Breuer (refactoring)
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 #include "diarenderer.h"
25 static void
26 dia_interactive_renderer_iface_init (DiaInteractiveRendererInterface *iface)
28 /* NULL initialization probably already done by GObject */
29 iface->clip_region_clear = NULL;
30 iface->clip_region_add_rect = NULL;
31 iface->draw_pixel_line = NULL;
32 iface->draw_pixel_rect = NULL;
33 iface->fill_pixel_rect = NULL;
34 iface->copy_to_window = NULL;
35 iface->set_size = NULL;
38 GType
39 dia_interactive_renderer_interface_get_type (void)
41 static GType iface_type = 0;
43 if (!iface_type)
45 static const GTypeInfo iface_info =
47 sizeof (DiaInteractiveRendererInterface),
48 (GBaseInitFunc) dia_interactive_renderer_iface_init,
49 (GBaseFinalizeFunc) NULL,
52 iface_type = g_type_register_static (G_TYPE_INTERFACE,
53 "DiaInteractiveRendererInterface",
54 &iface_info,
55 0);
57 g_type_interface_add_prerequisite (iface_type,
58 DIA_TYPE_RENDERER);
61 return iface_type;
65 * Wrapper functions using the above
67 void
68 dia_renderer_set_size (DiaRenderer* renderer, gpointer window,
69 int width, int height)
71 DiaInteractiveRendererInterface *irenderer =
72 DIA_GET_INTERACTIVE_RENDERER_INTERFACE (renderer);
74 g_return_if_fail (irenderer != NULL);
75 g_return_if_fail (irenderer->set_size != NULL);
77 irenderer->set_size (renderer, window, width, height);