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