X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fgtkmm2ext%2Fgtk_ui.cc;h=33841cd0beb6821c61a5927c2a848437e1eeb2f7;hb=944c32346b3c6bb87fccb22f159bdd9297bae50d;hp=dcce6b6c2854d611514242dac4aa89a6e5cabe2c;hpb=94827dd755d5d3e93ceb99788ca5f6e0054f85ef;p=ardour.git diff --git a/libs/gtkmm2ext/gtk_ui.cc b/libs/gtkmm2ext/gtk_ui.cc index dcce6b6c28..33841cd0be 100644 --- a/libs/gtkmm2ext/gtk_ui.cc +++ b/libs/gtkmm2ext/gtk_ui.cc @@ -27,19 +27,23 @@ #include #include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include + +#include "pbd/error.h" +#include "pbd/touchable.h" +#include "pbd/failed_constructor.h" +#include "pbd/pthread_utils.h" +#include "pbd/replace_all.h" + +#include "gtkmm2ext/application.h" +#include "gtkmm2ext/gtk_ui.h" +#include "gtkmm2ext/textviewer.h" +#include "gtkmm2ext/popup.h" +#include "gtkmm2ext/utils.h" +#include "gtkmm2ext/window_title.h" +#include "gtkmm2ext/actions.h" +#include "gtkmm2ext/activatable.h" +#include "gtkmm2ext/actions.h" +#include "gtkmm2ext/gui_thread.h" #include "i18n.h" @@ -63,11 +67,10 @@ BaseUI::RequestType Gtkmm2ext::AddTimeout = BaseUI::new_request_type(); UI::UI (string namestr, int *argc, char ***argv) : AbstractUI (namestr) + , _receiver (*this) + { theMain = new Main (argc, argv); -#ifndef GTK_NEW_TOOLTIP_API - tips = new Tooltips; -#endif _active = false; @@ -82,7 +85,7 @@ UI::UI (string namestr, int *argc, char ***argv) which is assumed to have called this. */ - run_loop_thread = Thread::self(); + run_loop_thread = Threads::Thread::self(); /* store "this" as the UI-for-thread of this thread, same argument as for previous line. @@ -92,7 +95,7 @@ UI::UI (string namestr, int *argc, char ***argv) /* attach our request source to the default main context */ - request_channel.ios()->attach (MainContext::get_default()); + attach_request_source (); errors = new TextViewer (800,600); errors->text().set_editable (false); @@ -106,7 +109,7 @@ UI::UI (string namestr, int *argc, char ***argv) errors->set_title (title.get_string()); errors->dismiss_button().set_name ("ErrorLogCloseButton"); - errors->signal_delete_event().connect (bind (sigc::ptr_fun (just_hide_it), (Window *) errors)); + errors->signal_delete_event().connect (sigc::bind (sigc::ptr_fun (just_hide_it), (Window *) errors)); errors->set_type_hint (Gdk::WINDOW_TYPE_HINT_UTILITY); //load_rcfile (rcfile); @@ -118,13 +121,13 @@ UI::UI (string namestr, int *argc, char ***argv) UI::~UI () { + _receiver.hangup (); } - bool UI::caller_is_ui_thread () { - return Thread::self() == run_loop_thread; + return Threads::Thread::self() == run_loop_thread; } int @@ -135,7 +138,7 @@ UI::load_rcfile (string path, bool themechange) * This does not occur if wiget.get_style is used instead of rc.get_style below, * except that doesn't actually work... */ - + static Glib::RefPtr