add EPA stuff from 2.X
[ardour.git] / libs / gnomecanvas / libgnomecanvas / gnome-canvas-widget.h
1 /*
2  * Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation
3  * All rights reserved.
4  *
5  * This file is part of the Gnome Library.
6  *
7  * The Gnome Library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Library General Public License as
9  * published by the Free Software Foundation; either version 2 of the
10  * License, or (at your option) any later version.
11  *
12  * The Gnome Library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Library General Public License for more details.
16  *
17  * You should have received a copy of the GNU Library General Public
18  * License along with the Gnome Library; see the file COPYING.LIB.  If not,
19  * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20  * Boston, MA 02111-1307, USA.
21  */
22 /*
23   @NOTATION@
24  */
25 /* Widget item type for GnomeCanvas widget
26  *
27  * GnomeCanvas is basically a port of the Tk toolkit's most excellent canvas widget.  Tk is
28  * copyrighted by the Regents of the University of California, Sun Microsystems, and other parties.
29  *
30  *
31  * Author: Federico Mena <federico@nuclecu.unam.mx>
32  */
33
34 #ifndef GNOME_CANVAS_WIDGET_H
35 #define GNOME_CANVAS_WIDGET_H
36
37
38 #include <libgnomecanvas/gnome-canvas.h>
39
40
41 G_BEGIN_DECLS
42
43
44 /* Widget item for canvas.  The widget is positioned with respect to an anchor point.
45  * The following object arguments are available:
46  *
47  * name                 type                    read/write      description
48  * ------------------------------------------------------------------------------------------
49  * widget               GtkWidget*              RW              Pointer to the widget
50  * x                    double                  RW              X coordinate of anchor point
51  * y                    double                  RW              Y coordinate of anchor point
52  * width                double                  RW              Width of widget (see below)
53  * height               double                  RW              Height of widget (see below)
54  * anchor               GtkAnchorType           RW              Anchor side for widget
55  * size_pixels          boolean                 RW              Specifies whether the widget size
56  *                                                              is specified in pixels or canvas units.
57  *                                                              If it is in pixels, then the widget will not
58  *                                                              be scaled when the canvas zoom factor changes.
59  *                                                              Otherwise, it will be scaled.
60  */
61
62
63 #define GNOME_TYPE_CANVAS_WIDGET            (gnome_canvas_widget_get_type ())
64 #define GNOME_CANVAS_WIDGET(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_TYPE_CANVAS_WIDGET, GnomeCanvasWidget))
65 #define GNOME_CANVAS_WIDGET_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_TYPE_CANVAS_WIDGET, GnomeCanvasWidgetClass))
66 #define GNOME_IS_CANVAS_WIDGET(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_TYPE_CANVAS_WIDGET))
67 #define GNOME_IS_CANVAS_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_TYPE_CANVAS_WIDGET))
68 #define GNOME_CANVAS_WIDGET_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_TYPE_CANVAS_WIDGET, GnomeCanvasWidgetClass))
69
70
71 typedef struct _GnomeCanvasWidget GnomeCanvasWidget;
72 typedef struct _GnomeCanvasWidgetClass GnomeCanvasWidgetClass;
73
74 struct _GnomeCanvasWidget {
75         GnomeCanvasItem item;
76
77         GtkWidget *widget;              /* The child widget */
78
79         double x, y;                    /* Position at anchor */
80         double width, height;           /* Dimensions of widget */
81         GtkAnchorType anchor;           /* Anchor side for widget */
82
83         int cx, cy;                     /* Top-left canvas coordinates for widget */
84         int cwidth, cheight;            /* Size of widget in pixels */
85
86         guint destroy_id;               /* Signal connection id for destruction of child widget */
87
88         guint size_pixels : 1;          /* Is size specified in (unchanging) pixels or units (get scaled)? */
89         guint in_destroy : 1;           /* Is child widget being destroyed? */
90 };
91
92 struct _GnomeCanvasWidgetClass {
93         GnomeCanvasItemClass parent_class;
94 };
95
96
97 /* Standard Gtk function */
98 GType gnome_canvas_widget_get_type (void) G_GNUC_CONST;
99
100
101 G_END_DECLS
102
103 #endif