first compilable version of tabbable design.
[ardour.git] / gtk2_ardour / ardour_ui_dependents.cc
index 821382717fea91570302bb6fe6c4d68a79887c20..031ebd58a88e0592fe2fb81cbf17dcef4d65e974 100644 (file)
 
 #include "ardour/session.h"
 
+#include "actions.h"
 #include "ardour_ui.h"
 #include "public_editor.h"
+#include "meterbridge.h"
 #include "mixer_ui.h"
 #include "keyboard.h"
 #include "splash.h"
@@ -50,14 +52,6 @@ namespace ARDOUR {
 
 using namespace ARDOUR;
 
-void
-ARDOUR_UI::shutdown ()
-{
-       if (ui_config->dirty()) {
-               ui_config->save_state();
-       }
-}
-
 void
 ARDOUR_UI::we_have_dependents ()
 {
@@ -67,6 +61,14 @@ ARDOUR_UI::we_have_dependents ()
        editor->setup_tooltips ();
        editor->UpdateAllTransportClocks.connect (sigc::mem_fun (*this, &ARDOUR_UI::update_transport_clocks));
 
+       editor->add_to_notebook (_tabs, _("Editor"), 1);
+       mixer->add_to_notebook (_tabs, _("Mixer"), 1);
+       
+       /* all actions are defined */
+
+       ActionManager::enable_accelerators ();
+       ActionManager::load_menus (ARDOUR_COMMAND_LINE::menus_file);
+
        editor->track_mixer_selection ();
        mixer->track_editor_selection ();
 }
@@ -74,6 +76,7 @@ ARDOUR_UI::we_have_dependents ()
 void
 ARDOUR_UI::connect_dependents_to_session (ARDOUR::Session *s)
 {
+       DisplaySuspender ds;
        BootMessage (_("Setup Editor"));
        editor->set_session (s);
        BootMessage (_("Setup Mixer"));
@@ -101,3 +104,42 @@ ARDOUR_UI::exit_on_main_window_close (GdkEventAny * /*ev*/)
 #endif
 }
 
+GtkNotebook*
+ARDOUR_UI::tab_window_root_drop (GtkNotebook* src,
+                                GtkWidget* w,
+                                gint x,
+                                gint y,
+                                gpointer)
+{
+       using namespace std;
+       Gtk::Notebook* nb = 0;
+       Gtk::Window* win = 0;
+       
+       if (w == GTK_WIDGET(mixer->contents().gobj())) {
+               /* Mixer */
+
+               cerr << "Call use own window, mixer\n";
+               
+               nb = mixer->tab_root_drop ();
+               win = mixer->own_window ();
+
+       } else if (w == GTK_WIDGET(editor->contents().gobj())) {
+
+               /* Editor */
+
+               cerr << "Call use own window, editor\n";
+               
+               nb = editor->tab_root_drop ();
+               win = editor->own_window ();
+
+       }
+
+       if (nb) {
+               win->move (x, y);
+               win->show_all ();
+               win->present ();
+               return nb->gobj();
+       }
+       
+       return 0; /* what was that? */
+}