X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fgtkmm2ext%2Fgtk_ui.cc;h=c3e94c922eee2c3b5899afabc5b9eaac6d96ce8e;hb=cf52d6e4b40111eb04b244ec054055a4ec15dbe0;hp=df7ec96324c7c71dc37d010efd1eb32d1d1ed265;hpb=6b3a8915f3c50f7220121fcb9202ec20144389c4;p=ardour.git diff --git a/libs/gtkmm2ext/gtk_ui.cc b/libs/gtkmm2ext/gtk_ui.cc index df7ec96324..c3e94c922e 100644 --- a/libs/gtkmm2ext/gtk_ui.cc +++ b/libs/gtkmm2ext/gtk_ui.cc @@ -35,6 +35,7 @@ #include "pbd/replace_all.h" #include "gtkmm2ext/application.h" +#include "gtkmm2ext/bindings.h" #include "gtkmm2ext/gtk_ui.h" #include "gtkmm2ext/textviewer.h" #include "gtkmm2ext/popup.h" @@ -45,7 +46,7 @@ #include "gtkmm2ext/actions.h" #include "gtkmm2ext/gui_thread.h" -#include "i18n.h" +#include "pbd/i18n.h" using namespace Gtkmm2ext; using namespace Gtk; @@ -53,7 +54,8 @@ using namespace Glib; using namespace PBD; using std::map; -UI *UI::theGtkUI = 0; +UI* UI::theGtkUI = 0; +float UI::ui_scale = 1.0; BaseUI::RequestType Gtkmm2ext::NullMessage = BaseUI::new_request_type(); BaseUI::RequestType Gtkmm2ext::ErrorMessage = BaseUI::new_request_type(); @@ -67,14 +69,16 @@ BaseUI::RequestType Gtkmm2ext::AddTimeout = BaseUI::new_request_type(); template class AbstractUI; -UI::UI (string namestr, int *argc, char ***argv) - : AbstractUI (namestr) +UI::UI (string application_name, string thread_name, int *argc, char ***argv) + : AbstractUI (thread_name) , _receiver (*this) + , global_bindings (0) , errors (0) - { theMain = new Main (argc, argv); + pthread_set_name ("gui"); + _active = false; if (!theGtkUI) { @@ -89,13 +93,17 @@ UI::UI (string namestr, int *argc, char ***argv) */ run_loop_thread = Threads::Thread::self(); - + /* store "this" as the UI-for-thread of this thread, same argument as for previous line. */ set_event_loop_for_thread (this); + /* we will be receiving requests */ + + EventLoop::register_request_buffer_factory ("gui", request_buffer_factory); + /* attach our request source to the default main context */ attach_request_source (); @@ -105,7 +113,7 @@ UI::UI (string namestr, int *argc, char ***argv) errors->text().set_name ("ErrorText"); errors->signal_unmap().connect (sigc::bind (sigc::ptr_fun (&ActionManager::uncheck_toggleaction), X_("/Editor/toggle-log-window"))); - Glib::set_application_name(namestr); + Glib::set_application_name (application_name); WindowTitle title(Glib::get_application_name()); title += _("Log"); @@ -140,9 +148,9 @@ UI::load_rcfile (string path, bool themechange) /* Yes, pointers to Glib::RefPtr. If these are not kept around, * a segfault somewhere deep in the wonderfully robust glib will result. * This does not occur if wiget.get_style is used instead of rc.get_style below, - * except that doesn't actually work... + * except that doesn't actually work... */ - + static Glib::RefPtr