Create and make default the new rc file ardour2_ui.rc, with new font definitions
[ardour.git] / gtk2_ardour / editor_markers.cc
index 54612000d1585b249fcd81d91bde9e98ada9fbe5..47982ff72897963d4cd0b01928ade70dd3fa3392 100644 (file)
     $Id$
 */
 
-#include <sigc++/rettype.h>
+#include <sigc++/retype.h>
 #include <cstdlib>
 #include <cmath>
 
-#include <gtk-canvas.h>
-#include <gtkmmext/gtk_ui.h>
+#include <libgnomecanvas/libgnomecanvas.h>
+#include <gtkmm2ext/gtk_ui.h>
 
 #include <ardour/location.h>
 
 #include "editor.h"
 #include "marker.h"
 #include "selection.h"
+#include "simplerect.h"
 #include "editing.h"
 #include "gui_thread.h"
+#include "simplerect.h"
 
 #include "i18n.h"
 
 using namespace std;
-using namespace SigC;
+using namespace sigc;
 using namespace ARDOUR;
 using namespace Gtk;
 
@@ -69,31 +71,30 @@ Editor::add_new_location (Location *location)
        }
 
        if (location->is_mark()) {
-               lam->start = new Marker (*this, GTK_CANVAS_GROUP(marker_group), color, 
-                                        location->name(), Marker::Mark, PublicEditor::canvas_marker_event, location->start());
+               lam->start = new Marker (*this, *marker_group, color, location->name(), Marker::Mark, location->start());
                lam->end   = 0;
 
        } else if (location->is_auto_loop()) {
                // transport marker
-               lam->start = new Marker (*this, GTK_CANVAS_GROUP(transport_marker_group), color, 
-                                        location->name(), Marker::LoopStart, PublicEditor::canvas_marker_event, location->start());
-               lam->end   = new Marker (*this, GTK_CANVAS_GROUP(transport_marker_group), color, 
-                                        location->name(), Marker::LoopEnd, PublicEditor::canvas_marker_event, location->end());
+               lam->start = new Marker (*this, *transport_marker_group, color, 
+                                        location->name(), Marker::LoopStart, location->start());
+               lam->end   = new Marker (*this, *transport_marker_group, color, 
+                                        location->name(), Marker::LoopEnd, location->end());
                
        } else if (location->is_auto_punch()) {
                // transport marker
-               lam->start = new Marker (*this, GTK_CANVAS_GROUP(transport_marker_group), color, 
-                                        location->name(), Marker::PunchIn, PublicEditor::canvas_marker_event, location->start());
-               lam->end   = new Marker (*this, GTK_CANVAS_GROUP(transport_marker_group), color, 
-                                        location->name(), Marker::PunchOut, PublicEditor::canvas_marker_event, location->end());
+               lam->start = new Marker (*this, *transport_marker_group, color, 
+                                        location->name(), Marker::PunchIn, location->start());
+               lam->end   = new Marker (*this, *transport_marker_group, color, 
+                                        location->name(), Marker::PunchOut, location->end());
                
        } else {
 
                // range marker
-               lam->start = new Marker (*this, GTK_CANVAS_GROUP(range_marker_group), color, 
-                                        location->name(), Marker::Start, PublicEditor::canvas_marker_event, location->start());
-               lam->end   = new Marker (*this, GTK_CANVAS_GROUP(range_marker_group), color, 
-                                        location->name(), Marker::End, PublicEditor::canvas_marker_event, location->end());
+               lam->start = new Marker (*this, *range_marker_group, color, 
+                                        location->name(), Marker::Start, location->start());
+               lam->end   = new Marker (*this, *range_marker_group, color, 
+                                        location->name(), Marker::End, location->end());
        }
 
        if (location->is_hidden ()) {
@@ -102,11 +103,11 @@ Editor::add_new_location (Location *location)
                lam->show ();
        }
 
-       location->start_changed.connect (slot (*this, &Editor::location_changed));
-       location->end_changed.connect (slot (*this, &Editor::location_changed));
-       location->changed.connect (slot (*this, &Editor::location_changed));
-       location->name_changed.connect (slot (*this, &Editor::location_changed));
-       location->FlagsChanged.connect (slot (*this, &Editor::location_flags_changed));
+       location->start_changed.connect (mem_fun(*this, &Editor::location_changed));
+       location->end_changed.connect (mem_fun(*this, &Editor::location_changed));
+       location->changed.connect (mem_fun(*this, &Editor::location_changed));
+       location->name_changed.connect (mem_fun(*this, &Editor::location_changed));
+       location->FlagsChanged.connect (mem_fun(*this, &Editor::location_flags_changed));
 
        pair<Location*,LocationMarkers*> newpair;
 
@@ -119,7 +120,7 @@ Editor::add_new_location (Location *location)
 void
 Editor::location_changed (Location *location)
 {
-       ENSURE_GUI_THREAD (bind (slot (*this, &Editor::location_changed), location));
+       ENSURE_GUI_THREAD (bind (mem_fun(*this, &Editor::location_changed), location));
 
        LocationMarkers *lam = find_location_markers (location);
 
@@ -141,7 +142,7 @@ Editor::location_changed (Location *location)
 void
 Editor::location_flags_changed (Location *location, void *src)
 {
-       ENSURE_GUI_THREAD(bind (slot (*this, &Editor::location_flags_changed), location, src));
+       ENSURE_GUI_THREAD(bind (mem_fun(*this, &Editor::location_flags_changed), location, src));
        
        LocationMarkers *lam = find_location_markers (location);
        
@@ -226,7 +227,7 @@ Editor::refresh_location_display_internal (Locations::LocationList& locations)
 void
 Editor::refresh_location_display ()
 {
-       ENSURE_GUI_THREAD(slot (*this, &Editor::refresh_location_display));
+       ENSURE_GUI_THREAD(mem_fun(*this, &Editor::refresh_location_display));
        
        if (session) {
                session->locations()->apply (*this, &Editor::refresh_location_display_internal);
@@ -236,7 +237,7 @@ Editor::refresh_location_display ()
 void
 Editor::refresh_location_display_s (Change ignored)
 {
-       ENSURE_GUI_THREAD(bind (slot (*this, &Editor::refresh_location_display_s), ignored));
+       ENSURE_GUI_THREAD(bind (mem_fun(*this, &Editor::refresh_location_display_s), ignored));
 
        if (session) {
                session->locations()->apply (*this, &Editor::refresh_location_display_internal);
@@ -293,12 +294,12 @@ Editor::mouse_add_new_marker (jack_nframes_t where)
 }
 
 void
-Editor::remove_marker (GtkCanvasItem* item, GdkEvent* event)
+Editor::remove_marker (ArdourCanvas::Item& item, GdkEvent* event)
 {
        Marker* marker;
        bool is_start;
 
-       if ((marker = static_cast<Marker *> (gtk_object_get_data (GTK_OBJECT(item), "marker"))) == 0) {
+       if ((marker = static_cast<Marker*> (item.get_data ("marker"))) == 0) {
                fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
                /*NOTREACHED*/
        }
@@ -315,7 +316,7 @@ Editor::remove_marker (GtkCanvasItem* item, GdkEvent* event)
                        loc->set_hidden (true, this);
                }
                else {
-                       Gtk::Main::idle.connect (bind (slot (*this, &Editor::really_remove_marker), loc));
+                       Glib::signal_idle().connect (bind (mem_fun(*this, &Editor::really_remove_marker), loc));
                }
        }
 }
@@ -334,7 +335,7 @@ Editor::really_remove_marker (Location* loc)
 void
 Editor::location_gone (Location *location)
 {
-       ENSURE_GUI_THREAD(bind (slot (*this, &Editor::location_gone), location));
+       ENSURE_GUI_THREAD(bind (mem_fun(*this, &Editor::location_gone), location));
        
        LocationMarkerMap::iterator i;
 
@@ -356,7 +357,7 @@ Editor::location_gone (Location *location)
 }
 
 void
-Editor::tm_marker_context_menu (GdkEventButton* ev, GtkCanvasItem* item)
+Editor::tm_marker_context_menu (GdkEventButton* ev, ArdourCanvas::Item* item)
 {
        if (tm_marker_menu == 0) {
                build_tm_marker_menu ();
@@ -369,10 +370,10 @@ Editor::tm_marker_context_menu (GdkEventButton* ev, GtkCanvasItem* item)
 
 
 void
-Editor::marker_context_menu (GdkEventButton* ev, GtkCanvasItem* item)
+Editor::marker_context_menu (GdkEventButton* ev, ArdourCanvas::Item* item)
 {
        Marker * marker;
-       if ((marker = reinterpret_cast<Marker *> (gtk_object_get_data (GTK_OBJECT(item), "marker"))) == 0) {
+       if ((marker = reinterpret_cast<Marker *> (item->get_data("marker"))) == 0) {
                fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
                /*NOTREACHED*/
        }
@@ -391,10 +392,10 @@ Editor::marker_context_menu (GdkEventButton* ev, GtkCanvasItem* item)
                        build_marker_menu ();
                }
 
-               Menu_Helpers::MenuList & children = marker_menu->items();
-               // XXX: should really find this some other way
+               // GTK2FIX use action group sensitivity
+#ifdef GTK2FIX
                if (children.size() >= 3) {
-                       MenuItem * loopitem = children[2];
+                       MenuItem * loopitem = &children[2];
                        if (loopitem) {
                                if (loc->is_mark()) {
                                        loopitem->set_sensitive(false);
@@ -404,7 +405,7 @@ Editor::marker_context_menu (GdkEventButton* ev, GtkCanvasItem* item)
                                }
                        }
                }
-               
+#endif         
                marker_menu_item = item;
                marker_menu->popup (1, ev->time);
        }
@@ -412,7 +413,7 @@ Editor::marker_context_menu (GdkEventButton* ev, GtkCanvasItem* item)
 
 
 void
-Editor::new_transport_marker_context_menu (GdkEventButton* ev, GtkCanvasItem* item)
+Editor::new_transport_marker_context_menu (GdkEventButton* ev, ArdourCanvas::Item* item)
 {
        if (new_transport_marker_menu == 0) {
                build_new_transport_marker_menu ();
@@ -423,7 +424,7 @@ Editor::new_transport_marker_context_menu (GdkEventButton* ev, GtkCanvasItem* it
 }
 
 void
-Editor::transport_marker_context_menu (GdkEventButton* ev, GtkCanvasItem* item)
+Editor::transport_marker_context_menu (GdkEventButton* ev, ArdourCanvas::Item* item)
 {
        if (transport_marker_menu == 0) {
                build_transport_marker_menu ();
@@ -441,17 +442,17 @@ Editor::build_marker_menu ()
        MenuList& items = marker_menu->items();
        marker_menu->set_name ("ArdourContextMenu");
 
-       items.push_back (MenuElem (_("Locate to"), slot (*this, &Editor::marker_menu_set_playhead)));
-       items.push_back (MenuElem (_("Play from"), slot (*this, &Editor::marker_menu_play_from)));
-       items.push_back (MenuElem (_("Loop range"), slot (*this, &Editor::marker_menu_loop_range)));
-       items.push_back (MenuElem (_("Set from playhead"), slot (*this, &Editor::marker_menu_set_from_playhead)));
-       items.push_back (MenuElem (_("Set from range"), slot (*this, &Editor::marker_menu_set_from_selection)));
+       items.push_back (MenuElem (_("Locate to"), mem_fun(*this, &Editor::marker_menu_set_playhead)));
+       items.push_back (MenuElem (_("Play from"), mem_fun(*this, &Editor::marker_menu_play_from)));
+       items.push_back (MenuElem (_("Loop range"), mem_fun(*this, &Editor::marker_menu_loop_range)));
+       items.push_back (MenuElem (_("Set from playhead"), mem_fun(*this, &Editor::marker_menu_set_from_playhead)));
+       items.push_back (MenuElem (_("Set from range"), mem_fun(*this, &Editor::marker_menu_set_from_selection)));
 
        items.push_back (SeparatorElem());
 
-       items.push_back (MenuElem (_("Rename"), slot (*this, &Editor::marker_menu_rename)));
-       items.push_back (MenuElem (_("Hide"), slot (*this, &Editor::marker_menu_hide)));
-       items.push_back (MenuElem (_("Remove"), slot (*this, &Editor::marker_menu_remove)));
+       items.push_back (MenuElem (_("Rename"), mem_fun(*this, &Editor::marker_menu_rename)));
+       items.push_back (MenuElem (_("Hide"), mem_fun(*this, &Editor::marker_menu_hide)));
+       items.push_back (MenuElem (_("Remove"), mem_fun(*this, &Editor::marker_menu_remove)));
 }
 
 void
@@ -463,8 +464,8 @@ Editor::build_tm_marker_menu ()
        MenuList& items = tm_marker_menu->items();
        tm_marker_menu->set_name ("ArdourContextMenu");
 
-       items.push_back (MenuElem (_("Edit"), slot (*this, &Editor::marker_menu_edit)));
-       items.push_back (MenuElem (_("Remove"), slot (*this, &Editor::marker_menu_remove)));
+       items.push_back (MenuElem (_("Edit"), mem_fun(*this, &Editor::marker_menu_edit)));
+       items.push_back (MenuElem (_("Remove"), mem_fun(*this, &Editor::marker_menu_remove)));
 }
 
 void
@@ -476,10 +477,10 @@ Editor::build_new_transport_marker_menu ()
        MenuList& items = new_transport_marker_menu->items();
        new_transport_marker_menu->set_name ("ArdourContextMenu");
 
-       items.push_back (MenuElem (_("Set Loop Range"), slot (*this, &Editor::new_transport_marker_menu_set_loop)));
-       items.push_back (MenuElem (_("Set Punch Range"), slot (*this, &Editor::new_transport_marker_menu_set_punch)));
+       items.push_back (MenuElem (_("Set Loop Range"), mem_fun(*this, &Editor::new_transport_marker_menu_set_loop)));
+       items.push_back (MenuElem (_("Set Punch Range"), mem_fun(*this, &Editor::new_transport_marker_menu_set_punch)));
 
-       new_transport_marker_menu->unmap_event.connect ( slot (*this, &Editor::new_transport_marker_menu_popdown)); 
+       new_transport_marker_menu->signal_unmap_event().connect ( mem_fun(*this, &Editor::new_transport_marker_menu_popdown)); 
 }
 
 void
@@ -491,12 +492,12 @@ Editor::build_transport_marker_menu ()
        MenuList& items = transport_marker_menu->items();
        transport_marker_menu->set_name ("ArdourContextMenu");
 
-       items.push_back (MenuElem (_("Locate to"), slot (*this, &Editor::marker_menu_set_playhead)));
-       items.push_back (MenuElem (_("Play from"), slot (*this, &Editor::marker_menu_play_from)));
-       items.push_back (MenuElem (_("Set from playhead"), slot (*this, &Editor::marker_menu_set_from_playhead)));
-       items.push_back (MenuElem (_("Set from range"), slot (*this, &Editor::marker_menu_set_from_selection)));
+       items.push_back (MenuElem (_("Locate to"), mem_fun(*this, &Editor::marker_menu_set_playhead)));
+       items.push_back (MenuElem (_("Play from"), mem_fun(*this, &Editor::marker_menu_play_from)));
+       items.push_back (MenuElem (_("Set from playhead"), mem_fun(*this, &Editor::marker_menu_set_from_playhead)));
+       items.push_back (MenuElem (_("Set from range"), mem_fun(*this, &Editor::marker_menu_set_from_selection)));
        items.push_back (SeparatorElem());
-       items.push_back (MenuElem (_("Hide"), slot (*this, &Editor::marker_menu_hide)));
+       items.push_back (MenuElem (_("Hide"), mem_fun(*this, &Editor::marker_menu_hide)));
 }
 
 void
@@ -504,7 +505,7 @@ Editor::marker_menu_hide ()
 {
        Marker* marker;
 
-       if ((marker = reinterpret_cast<Marker *> (gtk_object_get_data (GTK_OBJECT(marker_menu_item), "marker"))) == 0) {
+       if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
                fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
                /*NOTREACHED*/
        }
@@ -522,7 +523,7 @@ Editor::marker_menu_play_from ()
 {
        Marker* marker;
 
-       if ((marker = reinterpret_cast<Marker *> (gtk_object_get_data (GTK_OBJECT(marker_menu_item), "marker"))) == 0) {
+       if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
                fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
                /*NOTREACHED*/
        }
@@ -552,7 +553,7 @@ Editor::marker_menu_set_playhead ()
 {
        Marker* marker;
 
-       if ((marker = reinterpret_cast<Marker *> (gtk_object_get_data (GTK_OBJECT(marker_menu_item), "marker"))) == 0) {
+       if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
                fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
                /*NOTREACHED*/
        }
@@ -580,7 +581,7 @@ Editor::marker_menu_set_from_playhead ()
 {
        Marker* marker;
 
-       if ((marker = reinterpret_cast<Marker *> (gtk_object_get_data (GTK_OBJECT(marker_menu_item), "marker"))) == 0) {
+       if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
                fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
                /*NOTREACHED*/
        }
@@ -608,7 +609,7 @@ Editor::marker_menu_set_from_selection ()
 {
        Marker* marker;
 
-       if ((marker = reinterpret_cast<Marker *> (gtk_object_get_data (GTK_OBJECT(marker_menu_item), "marker"))) == 0) {
+       if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
                fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
                /*NOTREACHED*/
        }
@@ -646,7 +647,7 @@ Editor::marker_menu_loop_range ()
 {
        Marker* marker;
 
-       if ((marker = reinterpret_cast<Marker *> (gtk_object_get_data (GTK_OBJECT(marker_menu_item), "marker"))) == 0) {
+       if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
                fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
                /*NOTREACHED*/
        }
@@ -673,7 +674,7 @@ Editor::marker_menu_edit ()
        TempoMarker* tm;
        Marker* marker;
 
-       if ((marker = reinterpret_cast<Marker *> (gtk_object_get_data (GTK_OBJECT(marker_menu_item), "marker"))) == 0) {
+       if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
                fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
                /*NOTREACHED*/
        }
@@ -696,7 +697,7 @@ Editor::marker_menu_remove ()
        TempoMarker* tm;
        Marker* marker;
 
-       if ((marker = reinterpret_cast<Marker *> (gtk_object_get_data (GTK_OBJECT(marker_menu_item), "marker"))) == 0) {
+       if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
                fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
                /*NOTREACHED*/
        }
@@ -706,7 +707,7 @@ Editor::marker_menu_remove ()
        } else if ((tm = dynamic_cast<TempoMarker*> (marker)) != 0) {
                remove_tempo_marker (marker_menu_item);
        } else {
-               remove_marker (marker_menu_item, (GdkEvent*) 0);
+               remove_marker (*marker_menu_item, (GdkEvent*) 0);
        }
 }
 
@@ -715,7 +716,7 @@ Editor::marker_menu_rename ()
 {
        Marker* marker;
 
-       if ((marker = reinterpret_cast<Marker *> (gtk_object_get_data (GTK_OBJECT(marker_menu_item), "marker"))) == 0) {
+       if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
                fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
                /*NOTREACHED*/
        }
@@ -739,8 +740,8 @@ Editor::marker_menu_rename ()
        }
 
        dialog.set_name ("MarkRenameWindow");
-       dialog.set_usize (300, -1);
-       dialog.set_position (GTK_WIN_POS_MOUSE);
+       dialog.set_size_request (300, -1);
+       dialog.set_position (Gtk::WIN_POS_MOUSE);
        dialog.set_modal (true);
 
        dialog.get_vbox()->set_border_width (10);
@@ -753,10 +754,10 @@ Editor::marker_menu_rename ()
        ok_button.set_name ("EditorGTKButton");
        cancel_button.set_name ("EditorGTKButton");
 
-       entry.activate.connect (bind (slot (*this, &Editor::finish_sub_event_loop), 1));
-       cancel_button.clicked.connect (bind (slot (*this, &Editor::finish_sub_event_loop), -1));
-       ok_button.clicked.connect (bind (slot (*this, &Editor::finish_sub_event_loop), 1));
-       dialog.delete_event.connect (bind (slot (*this, &Editor::finish_sub_event_loop_on_delete), -1));
+       entry.signal_activate().connect (bind (mem_fun(*this, &Editor::finish_sub_event_loop), 1));
+       cancel_button.signal_clicked().connect (bind (mem_fun(*this, &Editor::finish_sub_event_loop), -1));
+       ok_button.signal_clicked().connect (bind (mem_fun(*this, &Editor::finish_sub_event_loop), 1));
+       dialog.signal_delete_event().connect (bind (mem_fun(*this, &Editor::finish_sub_event_loop_on_delete), -1));
 
        dialog.show_all ();
        entry.grab_focus ();
@@ -778,8 +779,8 @@ gint
 Editor::new_transport_marker_menu_popdown (GdkEventAny *ev)
 {
        // hide rects
-       gtk_canvas_item_hide (transport_bar_drag_rect);
-       gtk_canvas_item_hide (range_marker_drag_rect);
+       transport_bar_drag_rect->hide();
+       range_marker_drag_rect->hide();
 
        return FALSE;
 }
@@ -801,8 +802,8 @@ Editor::new_transport_marker_menu_set_loop ()
                session->add_redo_no_execute (session->locations()->get_memento());
        }
        else {
-               session->add_undo (rettype<void>(bind (slot (*tll, &Location::set), tll->start(), tll->end())));
-               session->add_redo (rettype<void>(bind (slot (*tll, &Location::set), temp_location->start(), temp_location->end())));
+               session->add_undo (retype_return<void>(bind (mem_fun (*tll, &Location::set), tll->start(), tll->end())));
+               session->add_redo (retype_return<void>(bind (mem_fun (*tll, &Location::set), temp_location->start(), temp_location->end())));
                tll->set_hidden (false, this);
                tll->set (temp_location->start(), temp_location->end());
        }
@@ -826,8 +827,8 @@ Editor::new_transport_marker_menu_set_punch ()
                session->set_auto_punch_location (tpl);
                session->add_redo_no_execute (session->locations()->get_memento());
        } else {
-               session->add_undo (rettype<void>(bind (slot (*tpl, &Location::set), tpl->start(), tpl->end())));
-               session->add_redo (rettype<void>(bind (slot (*tpl, &Location::set), temp_location->start(), temp_location->end())));
+               session->add_undo (retype_return<void>(bind (mem_fun (*tpl, &Location::set), tpl->start(), tpl->end())));
+               session->add_redo (retype_return<void>(bind (mem_fun (*tpl, &Location::set), temp_location->start(), temp_location->end())));
                tpl->set_hidden(false, this);
                tpl->set(temp_location->start(), temp_location->end());
        }
@@ -849,14 +850,15 @@ Editor::update_loop_range_view (bool visibility)
                double x1 = frame_to_pixel (tll->start());
                double x2 = frame_to_pixel (tll->end());
                
-               gtk_canvas_item_set (transport_loop_range_rect, "x1", x1, "x2", x2, NULL);
+               transport_loop_range_rect->property_x1() = x1;
+               transport_loop_range_rect->property_x2() = x2;
                
                if (visibility) {
-                       gtk_canvas_item_show (transport_loop_range_rect);
+                       transport_loop_range_rect->show();
                }
        }
        else if (visibility) {
-               gtk_canvas_item_hide (transport_loop_range_rect);
+               transport_loop_range_rect->hide();
        }
 }
 
@@ -874,38 +876,39 @@ Editor::update_punch_range_view (bool visibility)
                double x1 = frame_to_pixel (tpl->start());
                double x2 = frame_to_pixel (tpl->end());
                
-               gtk_canvas_item_set (transport_punch_range_rect, "x1", x1, "x2", x2, NULL);
+               transport_punch_range_rect->property_x1() = x1;
+               transport_punch_range_rect->property_x2() = x2;
                
                if (visibility) {
-                       gtk_canvas_item_show (transport_punch_range_rect);
+                       transport_punch_range_rect->show();
                }
        }
        else if (visibility) {
-               gtk_canvas_item_hide (transport_punch_range_rect);
+               transport_punch_range_rect->hide();
        }
 
 //     if (session->get_punch_in()) {
 //             double x = frame_to_pixel (transport_punch_location->start());
-//             gtk_canvas_item_set (transport_punchin_line, "x1", x, "x2", x, NULL);
+//             gnome_canvas_item_set (transport_punchin_line, "x1", x, "x2", x, NULL);
                
 //             if (visibility) {
-//                     gtk_canvas_item_show (transport_punchin_line);
+//                     gnome_canvas_item_show (transport_punchin_line);
 //             }
 //     }
 //     else if (visibility) {
-//             gtk_canvas_item_hide (transport_punchin_line);
+//             gnome_canvas_item_hide (transport_punchin_line);
 //     }
        
 //     if (session->get_punch_out()) {
 //             double x = frame_to_pixel (transport_punch_location->end());
                
-//             gtk_canvas_item_set (transport_punchout_line, "x1", x, "x2", x, NULL);
+//             gnome_canvas_item_set (transport_punchout_line, "x1", x, "x2", x, NULL);
                
 //             if (visibility) {
-//                     gtk_canvas_item_show (transport_punchout_line);
+//                     gnome_canvas_item_show (transport_punchout_line);
 //             }
 //     }
 //     else if (visibility) {
-//             gtk_canvas_item_hide (transport_punchout_line);
+//             gnome_canvas_item_hide (transport_punchout_line);
 //     }
 }