make all of dialog visible for add_route_dialog
[ardour.git] / gtk2_ardour / connection_editor.h
index a09a4560d1c4e7a803abdd23d3a2059b660b6d60..1d6dd7d7fc098629eb8a98ef91e4fd69e083a025 100644 (file)
@@ -28,13 +28,14 @@ using __gnu_cxx::slist;
 #include <slist.h>
 #endif
 
-#include <gtk--/box.h>
-#include <gtk--/window.h>
-#include <gtk--/scrolledwindow.h>
-#include <gtk--/button.h>
-#include <gtk--/frame.h>
-#include <gtk--/notebook.h>
-#include <gtk--/clist.h>
+#include <gtkmm/box.h>
+#include <gtkmm/window.h>
+#include <gtkmm/scrolledwindow.h>
+#include <gtkmm/button.h>
+#include <gtkmm/frame.h>
+#include <gtkmm/notebook.h>
+#include <gtkmm/treeview.h>
+#include <gtkmm/liststore.h>
 
 #include "ardour_dialog.h"
 
@@ -53,15 +54,30 @@ class ConnectionEditor : public ArdourDialog {
        void set_session (ARDOUR::Session *);
 
   protected:
-       gint map_event_impl (GdkEventAny *);
+       void on_map ();
 
   private:
        ARDOUR::Connection *current_connection;
        int                 selected_port;
        bool                push_at_front;
 
-       Gtk::CList input_connection_display;
-       Gtk::CList output_connection_display;
+
+       struct ConnectionDisplayModelColumns : public Gtk::TreeModel::ColumnRecord {
+           ConnectionDisplayModelColumns() { 
+                   add (name);
+                   add (connection);
+           }
+           Gtk::TreeModelColumn<Glib::ustring> name;
+           Gtk::TreeModelColumn<ARDOUR::Connection*> connection;
+       };
+
+       ConnectionDisplayModelColumns connection_columns;
+
+       Glib::RefPtr<Gtk::ListStore> input_connection_model;
+       Glib::RefPtr<Gtk::ListStore> output_connection_model;
+
+       Gtk::TreeView input_connection_display;
+       Gtk::TreeView output_connection_display;
        Gtk::ScrolledWindow input_scroller;
        Gtk::ScrolledWindow output_scroller;
 
@@ -128,18 +144,18 @@ class ConnectionEditor : public ArdourDialog {
        void cancel ();
        void accept ();
 
-       void port_selection_handler (gint row, gint col, GdkEvent *ev, Gtk::CList *);
+       void selection_changed (Gtk::TreeView* display);
 
        void add_port ();
        void remove_port (int which_port);
 
-       void port_column_click (gint col, Gtk::CList *clist);
-       gint port_button_event (GdkEventButton *, Gtk::CList *clist);
-       gint connection_click (GdkEventButton *ev, Gtk::CList *clist);
-       void connection_selected (gint, gint, GdkEvent *, bool);
+       void port_column_click (gint col, Gtk::TreeView* );
+       gint port_button_event (GdkEventButton *, Gtk::TreeView*);
+       gint connection_click (GdkEventButton *ev, Gtk::TreeView*);
+       void connection_selection_changed (Gtk::TreeView&, Glib::RefPtr<Gtk::ListStore>&);
 
-       SigC::Connection config_connection;
-       SigC::Connection connect_connection;
+       sigc::connection config_connection;
+       sigc::connection connect_connection;
        void configuration_changed (bool);
        void connections_changed (int, bool);
 };