1 /* ADG - Automatic Drawing Generation
2 * Copyright (C) 2007,2008,2009,2010,2011,2012,2013 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 #if !defined(__ADG_H__)
22 #error "Only <adg.h> can be included directly."
26 #ifndef __ADG_GTK_AREA_H__
27 #define __ADG_GTK_AREA_H__
32 #define ADG_GTK_TYPE_AREA (adg_gtk_area_get_type())
33 #define ADG_GTK_AREA(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), ADG_GTK_TYPE_AREA, AdgGtkArea))
34 #define ADG_GTK_AREA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), ADG_GTK_TYPE_AREA, AdgGtkAreaClass))
35 #define ADG_GTK_IS_AREA(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), ADG_GTK_TYPE_AREA))
36 #define ADG_GTK_IS_AREA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), ADG_GTK_TYPE_AREA))
37 #define ADG_GTK_AREA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), ADG_GTK_TYPE_AREA, AdgGtkAreaClass))
39 typedef struct _AdgGtkArea AdgGtkArea
;
40 typedef struct _AdgGtkAreaClass AdgGtkAreaClass
;
44 GtkDrawingArea parent
;
48 struct _AdgGtkAreaClass
{
50 GtkDrawingAreaClass parent_class
;
54 void (*canvas_changed
) (AdgGtkArea
*area
,
55 AdgCanvas
*old_canvas
);
56 void (*extents_changed
) (AdgGtkArea
*area
,
62 GType
adg_gtk_area_get_type (void) G_GNUC_CONST
;
64 GtkWidget
* adg_gtk_area_new (void);
65 GtkWidget
* adg_gtk_area_new_with_canvas (AdgCanvas
*canvas
);
66 void adg_gtk_area_set_canvas (AdgGtkArea
*area
,
68 AdgCanvas
* adg_gtk_area_get_canvas (AdgGtkArea
*area
);
70 adg_gtk_area_get_extents (AdgGtkArea
*area
);
71 gdouble
adg_gtk_area_get_zoom (AdgGtkArea
*area
);
72 void adg_gtk_area_set_factor (AdgGtkArea
*area
,
74 gdouble
adg_gtk_area_get_factor (AdgGtkArea
*area
);
75 void adg_gtk_area_switch_autozoom (AdgGtkArea
*area
,
77 gboolean
adg_gtk_area_has_autozoom (AdgGtkArea
*area
);
78 void adg_gtk_area_reset (AdgGtkArea
*area
);
79 void adg_gtk_area_canvas_changed (AdgGtkArea
*area
,
80 AdgCanvas
*old_canvas
);
81 void adg_gtk_area_set_render_map (AdgGtkArea
*area
,
82 const cairo_matrix_t
*map
);
83 void adg_gtk_area_transform_render_map
85 const cairo_matrix_t
*transformation
,
86 AdgTransformMode mode
);
88 adg_gtk_area_get_render_map (AdgGtkArea
*area
);
89 void adg_gtk_area_extents_changed (AdgGtkArea
*area
,
96 #endif /* __ADG_GTK_AREA_H__ */