a4031453b579554d0111316a39ea4e3e9eec62de
[ardour.git] / gtk2_ardour / canvas-simplerect.h
1 /* libgnomecanvas/gnome-canvas-simplerect.h: GnomeCanvas item for simple rects
2  *
3  * Copyright (C) 2001 Paul Davis <pbd@op.net>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public
16  * License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18  * Boston, MA 02111-1307, USA.
19  *
20  */
21
22 #ifndef __GNOME_CANVAS_SIMPLERECT_H__
23 #define __GNOME_CANVAS_SIMPLERECT_H__
24
25 #include <stdint.h>
26
27 #include <libgnomecanvas/libgnomecanvas.h>
28
29 G_BEGIN_DECLS
30
31 /* Wave viewer item for canvas.
32  */
33
34 #define GNOME_CANVAS_TYPE_CANVAS_SIMPLERECT            (gnome_canvas_simplerect_get_type ())
35 #define GNOME_CANVAS_SIMPLERECT(obj)                   (GTK_CHECK_CAST ((obj), GNOME_CANVAS_TYPE_CANVAS_SIMPLERECT, GnomeCanvasSimpleRect))
36 #define GNOME_CANVAS_SIMPLERECT_CLASS(klass)           (GTK_CHECK_CLASS_CAST ((klass), GNOME_CANVAS_TYPE_CANVAS_SIMPLERECT, GnomeCanvasSimpleRectClass))
37 #define GNOME_CANVAS_IS_CANVAS_SIMPLERECT(obj)         (GTK_CHECK_TYPE ((obj), GNOME_CANVAS_TYPE_CANVAS_SIMPLERECT))
38 #define GNOME_CANVAS_IS_CANVAS_SIMPLERECT_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GNOME_CANVAS_TYPE_CANVAS_SIMPLERECT))
39
40 typedef struct _GnomeCanvasSimpleRect            GnomeCanvasSimpleRect;
41 typedef struct _GnomeCanvasSimpleRectClass       GnomeCanvasSimpleRectClass;
42
43 struct _GnomeCanvasSimpleRect
44 {
45     GnomeCanvasItem item;
46     double x1, y1, x2, y2;
47     gboolean     fill;
48     gboolean     draw;
49     gboolean     full_draw_on_update;
50     uint32_t fill_color;
51     uint32_t outline_color;
52     uint32_t outline_pixels;
53
54     /* cached values set during update/used during render */
55
56     unsigned char fill_r, fill_b, fill_g, fill_a;
57     unsigned char outline_r, outline_b, outline_g;
58     unsigned char outline_what;
59     guint32 bbox_ulx, bbox_uly;
60     guint32 bbox_lrx, bbox_lry;
61 };
62
63 struct _GnomeCanvasSimpleRectClass {
64         GnomeCanvasItemClass parent_class;
65 };
66
67 GtkType gnome_canvas_simplerect_get_type (void);
68
69 G_END_DECLS
70
71 #endif /* __GNOME_CANVAS_SIMPLERECT_H__ */