Remove duplicate menubarstyle property.
[ardour.git] / gtk2_ardour / marker_time_axis.cc
index 44a169750d797d77ab5dbe2d8ebb00714ed9ac60..df041f8f765373e4af48f9057c486f160859a503 100644 (file)
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id$
 */
 
 #include <string>
 
 #include <pbd/error.h>
 
+#include <gtkmm/menu.h>
+
 #include <gtkmm2ext/utils.h>
 
 #include <ardour/session.h>
 #include "ardour_ui.h"
 #include "public_editor.h"
 #include "imageframe_time_axis.h"
-#include "canvas-simplerect.h"
 #include "selection.h"
 #include "imageframe_time_axis_view.h"
 #include "marker_time_axis_view.h"
 #include "imageframe_view.h"
 #include "marker_time_axis.h"
+#include "canvas_impl.h"
 
 #include "i18n.h"
 
 using namespace ARDOUR;
+using namespace PBD;
 using namespace sigc;
 using namespace Gtk;
 
@@ -55,7 +57,7 @@ using namespace Gtk;
  * @param name the name/id of this time axis
  * @param tav the associated track view that this MarkerTimeAxis is marking up
  */
-MarkerTimeAxis::MarkerTimeAxis (PublicEditor& ed, ARDOUR::Session& sess, Widget *canvas, std::string name, TimeAxisView* tav)
+MarkerTimeAxis::MarkerTimeAxis (PublicEditor& ed, ARDOUR::Session& sess, Canvas& canvas, const string & name, TimeAxisView* tav)
        : AxisView(sess),
          VisualTimeAxis(name, ed, sess, canvas)
 {
@@ -65,11 +67,10 @@ MarkerTimeAxis::MarkerTimeAxis (PublicEditor& ed, ARDOUR::Session& sess, Widget
        _color = unique_random_color() ;
        time_axis_name = name ;
 
-       selection_group = gtk_canvas_item_new (GTK_CANVAS_GROUP(canvas_display), gtk_canvas_group_get_type (), 0) ;
-       gtk_canvas_item_hide(selection_group) ;
+       selection_group = new Group (*canvas_display);
+       selection_group->hide();
 
        // intialize our data items
-       name_prompter = 0 ;
        marker_menu = 0 ;
 
        y_position = -1 ;
@@ -81,7 +82,7 @@ MarkerTimeAxis::MarkerTimeAxis (PublicEditor& ed, ARDOUR::Session& sess, Widget
        label_view() ;
                
        // set the initial height of this time axis
-       set_height(Small) ;
+       set_height(hSmall) ;
 }
 
 /**
@@ -90,32 +91,12 @@ MarkerTimeAxis::MarkerTimeAxis (PublicEditor& ed, ARDOUR::Session& sess, Widget
  */
 MarkerTimeAxis::~MarkerTimeAxis()
 {
-        GoingAway() ; /* EMIT_SIGNAL */
-
-       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)) ;
-               selection_group = 0 ;
-       }
+       GoingAway() ; /* EMIT_SIGNAL */
 
        // destroy the view helper
        // this handles removing and destroying individual marker items
-       if(view)
-       {
+
+       if(view) {
                delete view ;
                view = 0 ;
        }
@@ -125,13 +106,8 @@ MarkerTimeAxis::~MarkerTimeAxis()
 //---------------------------------------------------------------------------------------//
 // ui methods & data
        
-/**
- * Sets the height of this TrackView to one of the defined TrackHeights
- *
- * @param h the TrackHeight value to set
- */    
 void
-MarkerTimeAxis::set_height (TrackHeight h)
+MarkerTimeAxis::set_height (uint32_t h)
 {
        VisualTimeAxis::set_height(h) ;
        
@@ -240,6 +216,7 @@ void
 MarkerTimeAxis::build_marker_menu()
 {
        using namespace Menu_Helpers;
+       using Gtk::Menu;
 
        marker_menu = manage(new Menu) ;
        marker_menu->set_name ("ArdourContextMenu");
@@ -303,31 +280,3 @@ MarkerTimeAxis::get_marked_time_axis()
 
 
 
-/**
- * Handle the closing of the renaming dialog during the rename of this item
- */
-void
-MarkerTimeAxis::finish_route_rename()
-{
-       name_prompter->hide_all ();
-       ARDOUR_UI::instance()->allow_focus (false);
-
-       if (name_prompter->status == Gtkmm2ext::Prompter::cancelled) {
-               return;
-       }
-       
-       string result;
-       name_prompter->get_result(result);
-       time_axis_name = result ;
-       editor.route_name_changed(this) ;
-       label_view() ;
-       delete name_prompter ;
-       name_prompter = 0 ;
-}
-
-
-
-
-
-
-