Large nasty commit in the form of a 5000 line patch chock-full of completely
[ardour.git] / gtk2_ardour / automation_line.cc
index da208489f479650117a085b19c25bd0cccd0ee1c..b87a71ca875aa1699dc861659856f08371a4ec0b 100644 (file)
@@ -48,6 +48,7 @@
 using namespace std;
 using namespace sigc;
 using namespace ARDOUR;
+using namespace PBD;
 using namespace Editing;
 using namespace Gnome; // for Canvas
 
@@ -105,7 +106,7 @@ ControlPoint::ControlPoint (const ControlPoint& other, bool dummy_arg_to_force_s
 
 ControlPoint::~ControlPoint ()
 {
-       gtk_object_destroy (GTK_OBJECT(item));
+       delete item;
 }
 
 bool
@@ -129,7 +130,7 @@ ControlPoint::show()
 void
 ControlPoint::set_visible (bool yn)
 {
-       item->set_property ("draw", (gboolean) yn);
+       item->property_draw() = (gboolean) yn;
 }
 
 void
@@ -145,10 +146,10 @@ ControlPoint::show_color (bool entered, bool hide_too)
 {
        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);
                        }
@@ -156,10 +157,10 @@ ControlPoint::show_color (bool entered, bool hide_too)
 
        } 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);
                        }
@@ -174,9 +175,9 @@ ControlPoint::set_size (double sz)
 
 #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
 
@@ -205,10 +206,10 @@ ControlPoint::move_to (double x, double y, ShapeType shape)
                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;
@@ -217,7 +218,7 @@ ControlPoint::move_to (double x, double y, ShapeType shape)
 
 /*****/
 
-AutomationLine::AutomationLine (string name, TimeAxisView& tv, Gnome::Canvas::Group& parent, AutomationList& al)
+AutomationLine::AutomationLine (const string & name, TimeAxisView& tv, ArdourCanvas::Group& parent, AutomationList& al)
        : trackview (tv),
          _name (name),
          alist (al),
@@ -231,12 +232,13 @@ AutomationLine::AutomationLine (string name, TimeAxisView& tv, Gnome::Canvas::Gr
        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);
+       group = new ArdourCanvas::Group (parent);
+       group->property_x() = 0.0;
+       group->property_y() = 0.0;
 
-       line = new Gnome::Canvas::Line (*group);
-       line->set_property ("width_pixels", (guint)1);
+       line = new ArdourCanvas::Line (*group);
+       line->property_width_pixels() = (guint)1;
+       line->set_data ("line", this);
 
        line->signal_event().connect (mem_fun (*this, &AutomationLine::event_handler));
 
@@ -246,8 +248,7 @@ AutomationLine::AutomationLine (string name, TimeAxisView& tv, Gnome::Canvas::Gr
 AutomationLine::~AutomationLine ()
 {
        vector_delete (&control_points);
-
-       gtk_object_destroy (GTK_OBJECT(group));
+       delete group;
 }
 
 bool
@@ -319,7 +320,7 @@ 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