2008-12-11 03:06:27 -05:00
|
|
|
#ifndef CANVASFLAG_H_
|
|
|
|
#define CANVASFLAG_H_
|
|
|
|
|
2009-02-16 00:54:12 -05:00
|
|
|
#include <string>
|
2008-12-11 03:06:27 -05:00
|
|
|
#include <libgnomecanvasmm/group.h>
|
|
|
|
#include <libgnomecanvasmm/widget.h>
|
|
|
|
|
2009-02-25 13:26:51 -05:00
|
|
|
#include "ardour/midi_model.h"
|
2008-12-11 03:06:27 -05:00
|
|
|
|
|
|
|
#include "simplerect.h"
|
|
|
|
#include "simpleline.h"
|
2008-12-23 20:24:49 -05:00
|
|
|
#include "interactive-item.h"
|
2008-12-11 03:06:27 -05:00
|
|
|
|
|
|
|
class MidiRegionView;
|
|
|
|
|
|
|
|
namespace Gnome {
|
|
|
|
namespace Canvas {
|
|
|
|
|
2008-12-23 20:24:49 -05:00
|
|
|
class CanvasFlag : public Group, public InteractiveItem
|
2008-12-11 03:06:27 -05:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
CanvasFlag(
|
2009-02-16 00:54:12 -05:00
|
|
|
MidiRegionView& region,
|
|
|
|
Group& parent,
|
|
|
|
double height,
|
|
|
|
guint outline_color_rgba = 0xc0c0c0ff,
|
|
|
|
guint fill_color_rgba = 0x07070707,
|
|
|
|
double x = 0.0,
|
|
|
|
double y = 0.0)
|
|
|
|
: Group(parent, x, y)
|
|
|
|
, _text(0)
|
|
|
|
, _height(height)
|
|
|
|
, _outline_color_rgba(outline_color_rgba)
|
|
|
|
, _fill_color_rgba(fill_color_rgba)
|
|
|
|
, _region(region)
|
|
|
|
, _line(0)
|
|
|
|
, _rect(0)
|
2008-12-11 03:06:27 -05:00
|
|
|
{}
|
2008-12-12 17:04:22 -05:00
|
|
|
|
2008-12-11 03:06:27 -05:00
|
|
|
virtual ~CanvasFlag();
|
|
|
|
|
2008-12-12 17:04:22 -05:00
|
|
|
virtual bool on_event(GdkEvent* ev);
|
|
|
|
|
2009-02-16 00:54:12 -05:00
|
|
|
void set_text(const std::string& a_text);
|
2008-12-11 03:06:27 -05:00
|
|
|
|
|
|
|
protected:
|
2009-02-16 00:54:12 -05:00
|
|
|
InteractiveText* _text;
|
|
|
|
double _height;
|
|
|
|
guint _outline_color_rgba;
|
|
|
|
guint _fill_color_rgba;
|
|
|
|
MidiRegionView& _region;
|
2008-12-11 03:06:27 -05:00
|
|
|
|
|
|
|
private:
|
2008-12-12 01:57:38 -05:00
|
|
|
void delete_allocated_objects();
|
|
|
|
|
2009-02-16 00:54:12 -05:00
|
|
|
SimpleLine* _line;
|
|
|
|
InteractiveRect* _rect;
|
2008-12-12 17:04:22 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-12-11 03:06:27 -05:00
|
|
|
} // namespace Canvas
|
|
|
|
} // namespace Gnome
|
|
|
|
|
|
|
|
#endif /*CANVASFLAG_H_*/
|