[AdgGtkArea] Improved zoom handling and added adg_gtk_area_get_zoom()
[adg.git] / src / adg-gtk / adg-gtk-area.h
blob7e082677463607e9774e712c46ccd12885c36548
1 /* ADG - Automatic Drawing Generation
2 * Copyright (C) 2007,2008,2009,2010 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_GTK_H__)
22 #error "Only <adg-gtk.h> can be included directly."
23 #endif
26 #ifndef __ADG_GTK_AREA_H__
27 #define __ADG_GTK_AREA_H__
30 G_BEGIN_DECLS
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;
42 struct _AdgGtkArea {
43 /*< private >*/
44 GtkDrawingArea parent;
45 gpointer data;
48 struct _AdgGtkAreaClass {
49 /*< private >*/
50 GtkDrawingAreaClass parent_class;
51 /*< public >*/
52 /* Virtual Table */
53 void (*canvas_changed) (AdgGtkArea *area);
54 void (*extents_changed) (AdgGtkArea *area,
55 const CpmlExtents
56 *old_extents);
60 GType adg_gtk_area_get_type (void) G_GNUC_CONST;
62 GtkWidget * adg_gtk_area_new (void);
63 GtkWidget * adg_gtk_area_new_with_canvas (AdgCanvas *canvas);
64 void adg_gtk_area_set_canvas (AdgGtkArea *area,
65 AdgCanvas *canvas);
66 AdgCanvas * adg_gtk_area_get_canvas (AdgGtkArea *area);
67 const CpmlExtents *
68 adg_gtk_area_get_extents (AdgGtkArea *area);
69 gdouble adg_gtk_area_get_zoom (AdgGtkArea *area);
70 void adg_gtk_area_set_factor (AdgGtkArea *area,
71 gdouble factor);
72 gdouble adg_gtk_area_get_factor (AdgGtkArea *area);
73 void adg_gtk_area_switch_autozoom (AdgGtkArea *area,
74 gboolean state);
75 gboolean adg_gtk_area_has_autozoom (AdgGtkArea *area);
76 void adg_gtk_area_canvas_changed (AdgGtkArea *area,
77 AdgCanvas *old_canvas);
78 void adg_gtk_area_extents_changed (AdgGtkArea *area,
79 const CpmlExtents
80 *old_extents);
82 G_END_DECLS
85 #endif /* __ADG_GTK_AREA_H__ */