[AdgLDim] Hardcoded outside arrows implementation
[adg.git] / adg / adg-canvas.c
blob4e594effd3db8246dd7b85ad6f74be328cba7985
1 /* ADG - Automatic Drawing Generation
2 * Copyright (C) 2007,2008,2009 Nicola Fontana <ntd at entidi.it>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
21 /**
22 * SECTION:adg-canvas
23 * @short_description: The drawing container
25 * This container represents the object where the rendering process draws. All
26 * the drawing must have a canvas, and only one, as master parent (as all the
27 * #GtkWidget must have a #GtkWindow).
29 * Internally, the target is mantained as a #cairo_t context pointer.
32 /**
33 * AdgCanvas:
35 * All fields are private and should not be used directly.
36 * Use its public methods instead.
37 **/
40 #include "adg-canvas.h"
41 #include "adg-canvas-private.h"
42 #include "adg-intl.h"
45 G_DEFINE_TYPE(AdgCanvas, adg_canvas, ADG_TYPE_CONTAINER);
48 static void
49 adg_canvas_class_init(AdgCanvasClass *klass)
51 g_type_class_add_private(klass, sizeof(AdgCanvasPrivate));
54 static void
55 adg_canvas_init(AdgCanvas *canvas)
57 AdgCanvasPrivate *data = G_TYPE_INSTANCE_GET_PRIVATE(canvas,
58 ADG_TYPE_CANVAS,
59 AdgCanvasPrivate);
61 canvas->data = data;
65 /**
66 * adg_canvas_new:
68 * Creates a new empty canvas object.
70 * Returns: the canvas
71 **/
72 AdgCanvas *
73 adg_canvas_new(void)
75 return g_object_new(ADG_TYPE_CANVAS, NULL);