Oops. Fix XML stuff in GUI as well.
[ardour.git] / gtk2_ardour / canvas-flag.h
1 #ifndef CANVASFLAG_H_
2 #define CANVASFLAG_H_
3
4 #include <libgnomecanvasmm/group.h>
5 #include <libgnomecanvasmm/widget.h>
6
7 #include <ardour/midi_model.h>
8
9 #include "simplerect.h"
10 #include "simpleline.h"
11 #include "interactive-item.h"
12
13 class MidiRegionView;
14
15 namespace Gnome {
16 namespace Canvas {
17
18 class CanvasFlag : public Group, public InteractiveItem
19 {
20 public:
21         CanvasFlag(
22                 MidiRegionView&                       region,
23                 Group&                                parent,
24                 double                                height,
25                 guint                                 outline_color_rgba = 0xc0c0c0ff,
26                 guint                                 fill_color_rgba = 0x07070707,
27                 double                                x = 0.0,
28                 double                                y = 0.0
29         )       : Group(parent, x, y)
30         , _text(0)
31         , _height(height)
32         , _outline_color_rgba(outline_color_rgba)
33         , _fill_color_rgba(fill_color_rgba)
34         , _region(region)
35         , _line(0)
36         , _rect(0)
37         {}
38                         
39         virtual ~CanvasFlag();
40         
41         virtual bool on_event(GdkEvent* ev);
42
43         void set_text(string& a_text);
44
45 protected:
46         InteractiveText*                  _text;
47         double                            _height;
48         guint                             _outline_color_rgba;
49         guint                             _fill_color_rgba;
50         MidiRegionView&                   _region;
51         
52 private:
53         void delete_allocated_objects();
54         
55         SimpleLine*                       _line;
56         InteractiveRect*                  _rect;
57 };
58
59
60 } // namespace Canvas
61 } // namespace Gnome
62
63 #endif /*CANVASFLAG_H_*/