f15cb40548af9467240e59dd33b4127ecc69d96a
[ardour.git] / gtk2_ardour / canvas-simplerect.h
1 /* gtk-canvas-simplerect.h: GtkCanvas 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 __GTK_CANVAS_SIMPLERECT_H__
23 #define __GTK_CANVAS_SIMPLERECT_H__
24
25 #include <stdint.h>
26
27 #include <gtk-canvas/gtk-canvas-defs.h>
28 #include "gtk-canvas/gtk-canvas.h"
29
30 BEGIN_GTK_CANVAS_DECLS
31
32 /* Wave viewer item for canvas.
33  */
34
35 #define GTK_CANVAS_TYPE_CANVAS_SIMPLERECT            (gtk_canvas_simplerect_get_type ())
36 #define GTK_CANVAS_SIMPLERECT(obj)                   (GTK_CHECK_CAST ((obj), GTK_CANVAS_TYPE_CANVAS_SIMPLERECT, GtkCanvasSimpleRect))
37 #define GTK_CANVAS_SIMPLERECT_CLASS(klass)           (GTK_CHECK_CLASS_CAST ((klass), GTK_CANVAS_TYPE_CANVAS_SIMPLERECT, GtkCanvasSimpleRectClass))
38 #define GTK_CANVAS_IS_CANVAS_SIMPLERECT(obj)         (GTK_CHECK_TYPE ((obj), GTK_CANVAS_TYPE_CANVAS_SIMPLERECT))
39 #define GTK_CANVAS_IS_CANVAS_SIMPLERECT_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_CANVAS_TYPE_CANVAS_SIMPLERECT))
40
41 typedef struct _GtkCanvasSimpleRect            GtkCanvasSimpleRect;
42 typedef struct _GtkCanvasSimpleRectClass       GtkCanvasSimpleRectClass;
43
44 struct _GtkCanvasSimpleRect
45 {
46     GtkCanvasItem item;
47     double x1, y1, x2, y2;
48     gboolean     fill;
49     gboolean     draw;
50     gboolean     full_draw_on_update;
51     uint32_t fill_color;
52     uint32_t outline_color;
53     uint32_t outline_pixels;
54
55     /* cached values set during update/used during render */
56
57     unsigned char fill_r, fill_b, fill_g, fill_a;
58     unsigned char outline_r, outline_b, outline_g;
59     unsigned char outline_what;
60     guint32 bbox_ulx, bbox_uly;
61     guint32 bbox_lrx, bbox_lry;
62 };
63
64 struct _GtkCanvasSimpleRectClass {
65         GtkCanvasItemClass parent_class;
66 };
67
68 GtkType gtk_canvas_simplerect_get_type (void);
69
70 END_GTK_CANVAS_DECLS
71
72 #endif /* __GTK_CANVAS_SIMPLERECT_H__ */