remove <gtkmm/gtkmm.h> from all files, plus a small fix related to map/realize handling
[ardour.git] / gtk2_ardour / ardour_dialog.cc
index a5604fbbdbd2593061fc377363d691bd7d4e20a3..22f3f260483089ac93c917f023a0fd752218e7bd 100644 (file)
 #include "ardour_ui.h"
 
 
-ArdourDialog::ArdourDialog (string name)
-       : Dialog (name), 
-         KeyboardTarget (*this, name)
+ArdourDialog::ArdourDialog (string title, bool modal)
+       : Dialog (title, modal)
 {
        session = 0;
-       kbd_input = false;
-       running = false;
-       _run_status = 0;
-       _within_hiding = false;
-       hide_on_stop = true;
 }
 
 ArdourDialog::~ArdourDialog ()
@@ -46,106 +40,24 @@ bool
 ArdourDialog::on_enter_notify_event (GdkEventCrossing *ev)
 {
        if (ev->detail != GDK_NOTIFY_INFERIOR) {
-               Keyboard::the_keyboard().set_current_dialog (this);
+               // GTK2FIX
+               //Keyboard::the_keyboard().set_current_dialog (this);
        }
-       return FALSE;
+       return false;
 }
 
 bool
 ArdourDialog::on_leave_notify_event (GdkEventCrossing *ev)
 {
        if (ev->detail != GDK_NOTIFY_INFERIOR) {
-               Keyboard::the_keyboard().set_current_dialog (0);
+               // GTK2FIX
+               //Keyboard::the_keyboard().set_current_dialog (0);
        }
-       return FALSE;
+       return false;
 }
 
 void
 ArdourDialog::on_unmap ()
 {
-       _within_hiding = true;
-       Hiding (); /* EMIT_SIGNAL */
-       _within_hiding = false;
        Dialog::on_unmap ();
 }
-
-void
-ArdourDialog::wm_close()
-{
-       stop (-1);
-       ARDOUR_UI::instance()->allow_focus(false);
-}
-
-void
-ArdourDialog::set_hide_on_stop (bool yn)
-{
-       hide_on_stop = yn;
-}
-
-void
-ArdourDialog::close ()
-{
-       hide_all ();
-
-       if (kbd_input) {
-               ARDOUR_UI::instance()->allow_focus (false);
-       }
-}
-
-void
-ArdourDialog::stop (int rr)
-{
-       if (hide_on_stop) {
-               Hiding (); /* EMIT_SIGNAL */
-               hide_all ();
-
-               if (kbd_input) {
-                       ARDOUR_UI::instance()->allow_focus (false);
-               }
-       }
-
-       if (running) {
-               if (rr == 0) {
-                       response (GTK_RESPONSE_ACCEPT);
-               } else {
-                       response (GTK_RESPONSE_CANCEL);
-               }
-               running = false;
-       }
-}
-
-void
-ArdourDialog::run ()
-{
-       show_all ();
-
-       if (kbd_input) {
-               ARDOUR_UI::instance()->allow_focus (true);
-       }
-
-       running = true;
-       switch (Dialog::run ()) {
-       case GTK_RESPONSE_ACCEPT:
-               _run_status = 0;
-               break;
-               
-       case GTK_RESPONSE_DELETE_EVENT:
-               _run_status = -1;
-               break;
-
-       default:
-               _run_status = -1;
-       }
-}
-
-void
-ArdourDialog::set_keyboard_input (bool yn)
-{
-       kbd_input = yn;
-}
-
-int
-ArdourDialog::run_status ()
-{
-       return _run_status;
-}