Brought back visual indication of delete dragging.
[ardour.git] / gtk2_ardour / imageframe_time_axis.cc
index 17bdf5ecabc0a73fa47a413db873836cf39abbe1..018fae68959e169c849bd65171cd050d64cfaa09 100644 (file)
@@ -15,7 +15,6 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id$
 */
 
 #include <string>
@@ -23,6 +22,8 @@
 
 #include <pbd/error.h>
 
+#include <gtkmm/menu.h>
+
 #include <gtkmm2ext/utils.h>
 #include <gtkmm2ext/gtk_ui.h>
 
 
 #include "i18n.h"
 
-using namespace ARDOUR ;
-using namespace sigc ;
-using namespace Gtk ;
+using namespace ARDOUR;
+using namespace PBD;
+using namespace sigc;
+using namespace Gtk;
 
 /**
  * Constructs a new ImageFrameTimeAxis.
@@ -56,21 +58,18 @@ using namespace Gtk ;
  * @param sess the current session
  * @param canvas the parent canvas item
  */
-ImageFrameTimeAxis::ImageFrameTimeAxis(std::string track_id, PublicEditor& ed, ARDOUR::Session& sess, Canvas& canvas)
+ImageFrameTimeAxis::ImageFrameTimeAxis(const string & track_id, PublicEditor& ed, ARDOUR::Session& sess, ArdourCanvas::Canvas& canvas)
        : AxisView(sess),
          VisualTimeAxis(track_id, ed, sess, canvas)
 {
        _color = unique_random_color() ;
        
-       //GTK2FIX -- how to get the group? is the canvas display really a group?
-       //selection_group = gnome_canvas_item_new (GNOME_CANVAS_GROUP(canvas_display), gnome_canvas_group_get_type (), NULL) ;
-       selection_group = new Gnome::Canvas::Group (GNOME_CANVAS_GROUP(canvas_display));
+       selection_group = new ArdourCanvas::Group (*canvas_display);
        selection_group->hide();
 
        // intialize our data items
        _marked_for_display = true;
        y_position = -1 ;
-       name_prompter = 0 ;
 
        /* create our new image frame view */
        view = new ImageFrameTimeAxisView(*this) ;
@@ -114,23 +113,9 @@ ImageFrameTimeAxis::~ImageFrameTimeAxis ()
                image_action_menu = 0 ;
        }
        
-       for(list<SelectionRect*>::iterator i = free_selection_rects.begin(); i != free_selection_rects.end(); ++i)
-       {
-               gtk_object_destroy (GTK_OBJECT((*i)->rect));
-               gtk_object_destroy (GTK_OBJECT((*i)->start_trim));
-               gtk_object_destroy (GTK_OBJECT((*i)->end_trim));
-       }
-
-       for(list<SelectionRect*>::iterator i = used_selection_rects.begin(); i != used_selection_rects.end(); ++i)
-       {
-               gtk_object_destroy (GTK_OBJECT((*i)->rect));
-               gtk_object_destroy (GTK_OBJECT((*i)->start_trim));
-               gtk_object_destroy (GTK_OBJECT((*i)->end_trim));
-       }
-       
        if (selection_group)
        {
-               gtk_object_destroy (GTK_OBJECT (selection_group));
+               delete selection_group;
                selection_group = 0 ;
        }
        
@@ -245,6 +230,7 @@ void
 ImageFrameTimeAxis::build_display_menu()
 {
        using namespace Menu_Helpers;
+       using Gtk::Menu;
 
        /* get the size menu ready */
 
@@ -279,6 +265,7 @@ void
 ImageFrameTimeAxis::create_imageframe_menu()
 {
        using namespace Menu_Helpers;
+       using Gtk::Menu;
 
        imageframe_menu = manage(new Menu) ;
        imageframe_menu->set_name ("ArdourContextMenu");
@@ -361,7 +348,7 @@ ImageFrameTimeAxis::add_marker_time_axis(MarkerTimeAxis* marker_track, void* src
  * @return the named markerTimeAxis, or 0 if the named MarkerTimeAxis is not associated with this ImageFrameTimeAxis
  */
 MarkerTimeAxis*
-ImageFrameTimeAxis::get_named_marker_time_axis(std::string track_id)
+ImageFrameTimeAxis::get_named_marker_time_axis(const string & track_id)
 {
        MarkerTimeAxis* mta =  0 ;
        
@@ -384,7 +371,7 @@ ImageFrameTimeAxis::get_named_marker_time_axis(std::string track_id)
  * @return the removed MarkerTimeAxis
  */
 MarkerTimeAxis*
-ImageFrameTimeAxis::remove_named_marker_time_axis(std::string track_id, void* src)
+ImageFrameTimeAxis::remove_named_marker_time_axis(const string & track_id, void* src)
 {
        MarkerTimeAxis* mta = 0 ;