doc: update copyright line for 2021
[adg.git] / src / adg / adg-gtk-area.h
blobeb31df773090254c758dd3729cd2a3f78fd82b01
1 /* ADG - Automatic Drawing Generation
2 * Copyright (C) 2007-2021 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."
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;
47 struct _AdgGtkAreaClass {
48 /*< private >*/
49 GtkDrawingAreaClass parent_class;
51 /*< public >*/
52 /* Signals */
53 void (*canvas_changed) (AdgGtkArea *area,
54 AdgCanvas *old_canvas);
55 void (*extents_changed) (AdgGtkArea *area,
56 const CpmlExtents
57 *old_extents);
61 GType adg_gtk_area_get_type (void);
63 GtkWidget * adg_gtk_area_new (void);
64 GtkWidget * adg_gtk_area_new_with_canvas (AdgCanvas *canvas);
65 void adg_gtk_area_set_canvas (AdgGtkArea *area,
66 AdgCanvas *canvas);
67 AdgCanvas * adg_gtk_area_get_canvas (AdgGtkArea *area);
68 const CpmlExtents *
69 adg_gtk_area_get_extents (AdgGtkArea *area);
70 gdouble adg_gtk_area_get_zoom (AdgGtkArea *area);
71 void adg_gtk_area_set_factor (AdgGtkArea *area,
72 gdouble factor);
73 gdouble adg_gtk_area_get_factor (AdgGtkArea *area);
74 void adg_gtk_area_switch_autozoom (AdgGtkArea *area,
75 gboolean state);
76 gboolean adg_gtk_area_has_autozoom (AdgGtkArea *area);
77 void adg_gtk_area_reset (AdgGtkArea *area);
78 void adg_gtk_area_canvas_changed (AdgGtkArea *area,
79 AdgCanvas *old_canvas);
80 void adg_gtk_area_set_render_map (AdgGtkArea *area,
81 const cairo_matrix_t *map);
82 void adg_gtk_area_transform_render_map
83 (AdgGtkArea *area,
84 const cairo_matrix_t *transformation,
85 AdgTransformMode mode);
86 const cairo_matrix_t*
87 adg_gtk_area_get_render_map (AdgGtkArea *area);
88 void adg_gtk_area_extents_changed (AdgGtkArea *area,
89 const CpmlExtents
90 *old_extents);
92 G_END_DECLS
95 #endif /* __ADG_GTK_AREA_H__ */