using namespace Editing;
using namespace Gnome; // for Canvas
-ControlPoint::ControlPoint (AutomationLine& al, sigc::slot<bool,GdkEvent*,ControlPoint*> handler)
+ControlPoint::ControlPoint (AutomationLine& al)
: line (al)
{
model = al.the_list().end();
item->property_outline_color_rgba() = color_map[cControlPointOutline];
item->property_outline_pixels() = 1;
item->set_data ("control_point", this);
- item->signal_event().connect (bind (handler, this));
+ item->signal_event().connect (mem_fun (this, &ControlPoint::event_handler));
hide ();
set_visible (false);
ControlPoint::~ControlPoint ()
{
- gtk_object_destroy (GTK_OBJECT(item));
+ delete item;
+}
+
+bool
+ControlPoint::event_handler (GdkEvent* event)
+{
+ return PublicEditor::instance().canvas_control_point_event (event, item, this);
}
void
void
ControlPoint::set_visible (bool yn)
{
- item->set_property ("draw", (gboolean) yn);
+ item->property_draw() = (gboolean) yn;
}
void
{
if (entered) {
if (selected) {
- item->set_property ("outline_color_rgba", color_map[cEnteredControlPointSelected]);
+ item->property_outline_color_rgba() = color_map[cEnteredControlPointSelected];
set_visible(true);
} else {
- item->set_property ("outline_color_rgba", color_map[cEnteredControlPoint]);
+ item->property_outline_color_rgba() = color_map[cEnteredControlPoint];
if (hide_too) {
set_visible(false);
}
} else {
if (selected) {
- item->set_property ("outline_color_rgba", color_map[cControlPointSelected]);
+ item->property_outline_color_rgba() = color_map[cControlPointSelected];
set_visible(true);
} else {
- item->set_property ("outline_color_rgba", color_map[cControlPoint]);
+ item->property_outline_color_rgba() = color_map[cControlPoint];
if (hide_too) {
set_visible(false);
}
#if 0
if (_size > 6.0) {
- item->set_property ("fill", (gboolean) TRUE);
+ item->property_fill() = (gboolean) TRUE;
} else {
- item->set_property ("fill", (gboolean) FALSE);
+ item->property_fill() = (gboolean) FALSE;
}
#endif
break;
}
- item->set_property ("x1", x1);
- item->set_property ("x2", x2);
- item->set_property ("y1", y - half_size);
- item->set_property ("y2", y + half_size);
+ item->property_x1() = x1;
+ item->property_x2() = x2;
+ item->property_y1() = y - half_size;
+ item->property_y2() = y + half_size;
_x = x;
_y = y;
/*****/
-AutomationLine::AutomationLine (string name, TimeAxisView& tv, Gnome::Canvas::Group& parent, AutomationList& al,
- slot<bool,GdkEvent*,ControlPoint*> point_handler,
- slot<bool,GdkEvent*,AutomationLine*> line_handler)
-
+AutomationLine::AutomationLine (const string & name, TimeAxisView& tv, ArdourCanvas::Group& parent, AutomationList& al)
: trackview (tv),
_name (name),
alist (al),
_vc_uses_gain_mapping = false;
no_draw = false;
_visible = true;
- point_slot = point_handler;
terminal_points_can_slide = true;
_height = 0;
- group = new Gnome::Canvas::Group (parent);
- group->set_property ("x", 0.0);
- group->set_property ("y", 0.0);
-
- line = new Gnome::Canvas::Line (*group);
- line->set_property ("width_pixels", (guint)1);
+ group = new ArdourCanvas::Group (parent);
+ group->property_x() = 0.0;
+ group->property_y() = 0.0;
+ line = new ArdourCanvas::Line (*group);
+ line->property_width_pixels() = (guint)1;
line->set_data ("line", this);
- line->signal_event().connect (bind (line_handler, this));
+
+ line->signal_event().connect (mem_fun (*this, &AutomationLine::event_handler));
alist.StateChanged.connect (mem_fun(*this, &AutomationLine::list_changed));
}
AutomationLine::~AutomationLine ()
{
vector_delete (&control_points);
+ delete group;
+}
- gtk_object_destroy (GTK_OBJECT(group));
+bool
+AutomationLine::event_handler (GdkEvent* event)
+{
+ return PublicEditor::instance().canvas_line_event (event, line, this);
}
void
AutomationLine::set_line_color (uint32_t color)
{
_line_color = color;
- line->set_property ("fill_color_rgba", color);
+ line->property_fill_color_rgba() = color;
}
void
if (view_index >= control_points.size()) {
/* make sure we have enough control points */
- ControlPoint* ncp = new ControlPoint (*this, point_slot);
+ ControlPoint* ncp = new ControlPoint (*this);
if (_height > (guint32) TimeAxisView::Larger) {
ncp->set_size (8.0);