ardour
gtk_ui.cc
Go to the documentation of this file.
1 /*
2  Copyright (C) 1999-2005 Paul Barton-Davis
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program; if not, write to the Free Software
16  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 
18  $Id$
19 */
20 
21 #include <cmath>
22 #include <fcntl.h>
23 #include <signal.h>
24 #include <unistd.h>
25 #include <cerrno>
26 #include <climits>
27 #include <cctype>
28 
29 #include <gtkmm.h>
30 
31 #include "pbd/error.h"
32 #include "pbd/touchable.h"
33 #include "pbd/failed_constructor.h"
34 #include "pbd/pthread_utils.h"
35 #include "pbd/replace_all.h"
36 
37 #include "gtkmm2ext/application.h"
38 #include "gtkmm2ext/gtk_ui.h"
39 #include "gtkmm2ext/textviewer.h"
40 #include "gtkmm2ext/popup.h"
41 #include "gtkmm2ext/utils.h"
42 #include "gtkmm2ext/window_title.h"
43 #include "gtkmm2ext/actions.h"
44 #include "gtkmm2ext/activatable.h"
45 #include "gtkmm2ext/actions.h"
46 #include "gtkmm2ext/gui_thread.h"
47 
48 #include "i18n.h"
49 
50 using namespace Gtkmm2ext;
51 using namespace Gtk;
52 using namespace Glib;
53 using namespace PBD;
54 using std::map;
55 
56 UI *UI::theGtkUI = 0;
57 
65 
66 #include "pbd/abstract_ui.cc" /* instantiate the template */
67 
69 
70 UI::UI (string namestr, int *argc, char ***argv)
71  : AbstractUI<UIRequest> (namestr)
72  , _receiver (*this)
73  , errors (0)
74 
75 {
76  theMain = new Main (argc, argv);
77 
78  pthread_set_name ("gui");
79 
80  _active = false;
81 
82  if (!theGtkUI) {
83  theGtkUI = this;
84  } else {
85  fatal << "duplicate UI requested" << endmsg;
86  abort(); /* NOTREACHED */
87  }
88 
89  /* the GUI event loop runs in the main thread of the app,
90  which is assumed to have called this.
91  */
92 
93  run_loop_thread = Threads::Thread::self();
94 
95  /* store "this" as the UI-for-thread of this thread, same argument
96  as for previous line.
97  */
98 
100 
101  /* attach our request source to the default main context */
102 
104 
105  errors = new TextViewer (800,600);
106  errors->text().set_editable (false);
107  errors->text().set_name ("ErrorText");
108  errors->signal_unmap().connect (sigc::bind (sigc::ptr_fun (&ActionManager::uncheck_toggleaction), X_("<Actions>/Editor/toggle-log-window")));
109 
110  Glib::set_application_name(namestr);
111 
112  WindowTitle title(Glib::get_application_name());
113  title += _("Log");
114  errors->set_title (title.get_string());
115 
116  errors->dismiss_button().set_name ("ErrorLogCloseButton");
117  errors->signal_delete_event().connect (sigc::bind (sigc::ptr_fun (just_hide_it), (Window *) errors));
118  errors->set_type_hint (Gdk::WINDOW_TYPE_HINT_UTILITY);
119 
120  //load_rcfile (rcfile);
121 
122  /* instantiate the Application singleton */
123 
125 }
126 
128 {
129  _receiver.hangup ();
130  delete (errors);
131 }
132 
133 bool
135 {
136  return Threads::Thread::self() == run_loop_thread;
137 }
138 
139 int
140 UI::load_rcfile (string path, bool themechange)
141 {
142  /* Yes, pointers to Glib::RefPtr. If these are not kept around,
143  * a segfault somewhere deep in the wonderfully robust glib will result.
144  * This does not occur if wiget.get_style is used instead of rc.get_style below,
145  * except that doesn't actually work...
146  */
147 
148  static Glib::RefPtr<Style>* fatal_style = 0;
149  static Glib::RefPtr<Style>* error_style = 0;
150  static Glib::RefPtr<Style>* warning_style = 0;
151  static Glib::RefPtr<Style>* info_style = 0;
152 
153  if (path.length() == 0) {
154  return -1;
155  }
156 
157  if (!Glib::file_test (path, Glib::FILE_TEST_EXISTS|Glib::FILE_TEST_IS_REGULAR)) {
158  error << "UI: couldn't find rc file \""
159  << path
160  << '"'
161  << endmsg;
162  return -1;
163  }
164 
165  RC rc (path.c_str());
166  //this is buggy in gtkmm for some reason, so use C
167  //RC::reset_styles (Gtk::Settings::get_default());
168  gtk_rc_reset_styles (gtk_settings_get_default());
169 
170  theme_changed.emit();
171 
172  if (themechange) {
173  return 0; //Don't continue on every time there is a theme change
174  }
175 
176  /* have to pack widgets into a toplevel window so that styles will stick */
177 
178  Window temp_window (WINDOW_TOPLEVEL);
179  temp_window.ensure_style ();
180 
181  HBox box;
182  Label fatal_widget;
183  Label error_widget;
184  Label warning_widget;
185  Label info_widget;
186  RefPtr<Gtk::Style> style;
187  RefPtr<TextBuffer> buffer (errors->text().get_buffer());
188 
189  box.pack_start (fatal_widget);
190  box.pack_start (error_widget);
191  box.pack_start (warning_widget);
192  box.pack_start (info_widget);
193 
194  error_ptag = buffer->create_tag();
195  error_mtag = buffer->create_tag();
196  fatal_ptag = buffer->create_tag();
197  fatal_mtag = buffer->create_tag();
198  warning_ptag = buffer->create_tag();
199  warning_mtag = buffer->create_tag();
200  info_ptag = buffer->create_tag();
201  info_mtag = buffer->create_tag();
202 
203  fatal_widget.set_name ("FatalMessage");
204  delete fatal_style;
205 
206  /* This next line and the similar ones below are sketchily
207  * guessed to fix #2885. I think maybe that problems occur
208  * because with gtk_rc_get_style (to quote its docs) "no
209  * refcount is added to the returned style". So I've switched
210  * this to use Glib::wrap with take_copy == true, which requires
211  * all the nasty casts and calls to plain-old-C GTK.
212  *
213  * At worst I think this causes a memory leak; at least it appears
214  * to fix the bug.
215  *
216  * I could be wrong about any or all of the above.
217  */
218  fatal_style = new Glib::RefPtr<Style> (Glib::wrap (gtk_rc_get_style (reinterpret_cast<GtkWidget*> (fatal_widget.gobj())), true));
219 
220  fatal_ptag->property_font_desc().set_value((*fatal_style)->get_font());
221  fatal_ptag->property_foreground_gdk().set_value((*fatal_style)->get_fg(STATE_ACTIVE));
222  fatal_ptag->property_background_gdk().set_value((*fatal_style)->get_bg(STATE_ACTIVE));
223  fatal_mtag->property_font_desc().set_value((*fatal_style)->get_font());
224  fatal_mtag->property_foreground_gdk().set_value((*fatal_style)->get_fg(STATE_NORMAL));
225  fatal_mtag->property_background_gdk().set_value((*fatal_style)->get_bg(STATE_NORMAL));
226 
227  error_widget.set_name ("ErrorMessage");
228  delete error_style;
229  error_style = new Glib::RefPtr<Style> (Glib::wrap (gtk_rc_get_style (reinterpret_cast<GtkWidget*> (error_widget.gobj())), true));
230 
231  error_ptag->property_font_desc().set_value((*error_style)->get_font());
232  error_ptag->property_foreground_gdk().set_value((*error_style)->get_fg(STATE_ACTIVE));
233  error_ptag->property_background_gdk().set_value((*error_style)->get_bg(STATE_ACTIVE));
234  error_mtag->property_font_desc().set_value((*error_style)->get_font());
235  error_mtag->property_foreground_gdk().set_value((*error_style)->get_fg(STATE_NORMAL));
236  error_mtag->property_background_gdk().set_value((*error_style)->get_bg(STATE_NORMAL));
237 
238  warning_widget.set_name ("WarningMessage");
239  delete warning_style;
240  warning_style = new Glib::RefPtr<Style> (Glib::wrap (gtk_rc_get_style (reinterpret_cast<GtkWidget*> (warning_widget.gobj())), true));
241 
242  warning_ptag->property_font_desc().set_value((*warning_style)->get_font());
243  warning_ptag->property_foreground_gdk().set_value((*warning_style)->get_fg(STATE_ACTIVE));
244  warning_ptag->property_background_gdk().set_value((*warning_style)->get_bg(STATE_ACTIVE));
245  warning_mtag->property_font_desc().set_value((*warning_style)->get_font());
246  warning_mtag->property_foreground_gdk().set_value((*warning_style)->get_fg(STATE_NORMAL));
247  warning_mtag->property_background_gdk().set_value((*warning_style)->get_bg(STATE_NORMAL));
248 
249  info_widget.set_name ("InfoMessage");
250  delete info_style;
251  info_style = new Glib::RefPtr<Style> (Glib::wrap (gtk_rc_get_style (reinterpret_cast<GtkWidget*> (info_widget.gobj())), true));
252 
253  info_ptag->property_font_desc().set_value((*info_style)->get_font());
254  info_ptag->property_foreground_gdk().set_value((*info_style)->get_fg(STATE_ACTIVE));
255  info_ptag->property_background_gdk().set_value((*info_style)->get_bg(STATE_ACTIVE));
256  info_mtag->property_font_desc().set_value((*info_style)->get_font());
257  info_mtag->property_foreground_gdk().set_value((*info_style)->get_fg(STATE_NORMAL));
258  info_mtag->property_background_gdk().set_value((*info_style)->get_bg(STATE_NORMAL));
259 
260  return 0;
261 }
262 
263 void
264 UI::run (Receiver &old_receiver)
265 {
270 
271  /* stop the old receiver (text/console) once we hit the first idle */
272 
273  Glib::signal_idle().connect (bind_return (mem_fun (old_receiver, &Receiver::hangup), false));
274 
275  if (starting ()) {
276  return;
277  }
278 
279  _active = true;
280  theMain->run ();
281  _active = false;
282 
283  return;
284 }
285 
286 bool
288 {
289  return _active;
290 }
291 
292 void
294 {
295  UIRequest *req = get_request (Quit);
296 
297  if (req == 0) {
298  return;
299  }
300 
301  send_request (req);
302 }
303 
304 static bool idle_quit ()
305 {
306  Main::quit ();
307  return true;
308 }
309 
310 void
312 {
313  if (getenv ("ARDOUR_RUNNING_UNDER_VALGRIND")) {
314  Main::quit ();
315  } else {
316  Glib::signal_idle().connect (sigc::ptr_fun (idle_quit));
317  }
318 }
319 
320 void
322 {
324 
325  if (req == 0) {
326  return;
327  }
328 
329  req->display = display;
330 
331  send_request (req);
332 }
333 
334 void
335 UI::set_tip (Widget &w, const gchar *tip)
336 {
337  set_tip(&w, tip, "");
338 }
339 
340 void
341 UI::set_tip (Widget &w, const std::string& tip)
342 {
343  set_tip(&w, tip.c_str(), "");
344 }
345 
346 void
347 UI::set_tip (Widget *w, const gchar *tip, const gchar *hlp)
348 {
349  UIRequest *req = get_request (SetTip);
350 
351  std::string msg(tip);
352 
353  Glib::RefPtr<Gtk::Action> action = w->get_action();
354 
355  if (!action) {
356  Gtkmm2ext::Activatable* activatable;
357  if ((activatable = dynamic_cast<Gtkmm2ext::Activatable*>(w))) {
358  action = activatable->get_related_action();
359  }
360  }
361 
362  if (action) {
363  Gtk::AccelKey key;
364  ustring ap = action->get_accel_path();
365  if (!ap.empty()) {
366  string shortcut = ActionManager::get_key_representation (ap, key);
367  if (!shortcut.empty()) {
368  replace_all (shortcut, "<", "");
369  replace_all (shortcut, ">", "-");
370  msg.append(_("\n\nShortcut: ")).append (shortcut);
371  }
372  }
373  }
374 
375  if (req == 0) {
376  return;
377  }
378 
379 
380  req->widget = w;
381  req->msg = msg.c_str();
382  req->msg2 = hlp;
383 
384  send_request (req);
385 }
386 
387 void
388 UI::set_state (Widget *w, StateType state)
389 {
391 
392  if (req == 0) {
393  return;
394  }
395 
396  req->new_state = state;
397  req->widget = w;
398 
399  send_request (req);
400 }
401 
402 void
403 UI::idle_add (int (*func)(void *), void *arg)
404 {
405  UIRequest *req = get_request (AddIdle);
406 
407  if (req == 0) {
408  return;
409  }
410 
411  req->function = func;
412  req->arg = arg;
413 
414  send_request (req);
415 }
416 
417 /* END abstract_ui interfaces */
418 
424 __invalidator (sigc::trackable& trackable, const char* file, int line)
425 {
427 
428  ir->file = file;
429  ir->line = line;
430 
431  trackable.add_destroy_notify_callback (ir, PBD::EventLoop::invalidate_request);
432 
433  return ir;
434 }
435 
436 void
438 {
439  if (req->type == ErrorMessage) {
440 
441  process_error_message (req->chn, req->msg);
442  free (const_cast<char*>(req->msg)); /* it was strdup'ed */
443  req->msg = 0; /* don't free it again in the destructor */
444 
445  } else if (req->type == Quit) {
446 
447  do_quit ();
448 
449  } else if (req->type == CallSlot) {
450 #ifndef NDEBUG
451  if (getenv ("DEBUG_THREADED_SIGNALS")) {
452  cerr << "call slot for " << name() << endl;
453  }
454 #endif
455  req->the_slot ();
456 
457  } else if (req->type == TouchDisplay) {
458 
459  req->display->touch ();
460  if (req->display->delete_after_touch()) {
461  delete req->display;
462  }
463 
464  } else if (req->type == StateChange) {
465 
466  req->widget->set_state (req->new_state);
467 
468  } else if (req->type == SetTip) {
469 
470  gtk_widget_set_tooltip_markup (req->widget->gobj(), req->msg);
471 
472  } else {
473 
474  error << "GtkUI: unknown request type "
475  << (int) req->type
476  << endmsg;
477  }
478 }
479 
480 /*======================================================================
481  Error Display
482  ======================================================================*/
483 
484 void
485 UI::receive (Transmitter::Channel chn, const char *str)
486 {
487  if (caller_is_ui_thread()) {
488  process_error_message (chn, str);
489  } else {
491 
492  if (req == 0) {
493  return;
494  }
495 
496  req->chn = chn;
497  req->msg = strdup (str);
498 
499  send_request (req);
500  }
501 }
502 
503 #define OLD_STYLE_ERRORS 1
504 
505 void
507 {
508  RefPtr<Style> style;
509  RefPtr<TextBuffer::Tag> ptag;
510  RefPtr<TextBuffer::Tag> mtag;
511  const char *prefix;
512  size_t prefix_len;
513  bool fatal_received = false;
514 #ifndef OLD_STYLE_ERRORS
515  PopUp* popup = new PopUp (WIN_POS_CENTER, 0, true);
516 #endif
517 
518  switch (chn) {
519  case Transmitter::Fatal:
520  prefix = "[FATAL]: ";
521  ptag = fatal_ptag;
522  mtag = fatal_mtag;
523  prefix_len = 9;
524  fatal_received = true;
525  break;
526  case Transmitter::Error:
527 #if OLD_STYLE_ERRORS
528  prefix = "[ERROR]: ";
529  ptag = error_ptag;
530  mtag = error_mtag;
531  prefix_len = 9;
532 #else
533  popup->set_name ("ErrorMessage");
534  popup->set_text (str);
535  popup->touch ();
536  return;
537 #endif
538  break;
539  case Transmitter::Info:
540 #if OLD_STYLE_ERRORS
541  prefix = "[INFO]: ";
542  ptag = info_ptag;
543  mtag = info_mtag;
544  prefix_len = 8;
545 #else
546  popup->set_name ("InfoMessage");
547  popup->set_text (str);
548  popup->touch ();
549  return;
550 #endif
551 
552  break;
554 #if OLD_STYLE_ERRORS
555  prefix = "[WARNING]: ";
556  ptag = warning_ptag;
557  mtag = warning_mtag;
558  prefix_len = 11;
559 #else
560  popup->set_name ("WarningMessage");
561  popup->set_text (str);
562  popup->touch ();
563  return;
564 #endif
565  break;
566  default:
567  /* no choice but to use text/console output here */
568  cerr << "programmer error in UI::check_error_messages (channel = " << chn << ")\n";
569  ::exit (1);
570  }
571 
572  errors->text().get_buffer()->begin_user_action();
573 
574  if (fatal_received) {
575  handle_fatal (str);
576  } else {
577 
578  if (!ptag || !mtag) {
579  /* oops, message sent before we set up tags - don't crash */
580  cerr << prefix << str << endl;
581  } else {
582  display_message (prefix, prefix_len, ptag, mtag, str);
583  }
584  }
585 
586  errors->text().get_buffer()->end_user_action();
587 }
588 
589 void
591 {
592  Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("toggle-log-window"));
593  if (!act) {
594  return;
595  }
596 
597  Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
598  if (tact) {
599  tact->set_active ();
600  }
601 }
602 
603 void
605 {
606  Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("toggle-log-window"));
607  if (!act) {
608  return;
609  }
610 
611  Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
612 
613  if (tact->get_active()) {
614  errors->set_position (WIN_POS_MOUSE);
615  errors->show ();
616  } else {
617  errors->hide ();
618  }
619 }
620 
621 void
622 UI::display_message (const char *prefix, gint /*prefix_len*/, RefPtr<TextBuffer::Tag> ptag, RefPtr<TextBuffer::Tag> mtag, const char *msg)
623 {
624  RefPtr<TextBuffer> buffer (errors->text().get_buffer());
625 
626  buffer->insert_with_tag(buffer->end(), prefix, ptag);
627  buffer->insert_with_tag(buffer->end(), msg, mtag);
628  buffer->insert_with_tag(buffer->end(), "\n", mtag);
629 
631 }
632 
633 void
634 UI::handle_fatal (const char *message)
635 {
636  Dialog win;
637  Label label (message);
638  Button quit (_("Press To Exit"));
639  HBox hpacker;
640 
641  win.set_default_size (400, 100);
642 
643  WindowTitle title(Glib::get_application_name());
644  title += ": Fatal Error";
645  win.set_title (title.get_string());
646 
647  win.set_position (WIN_POS_MOUSE);
648  win.set_border_width (12);
649 
650  win.get_vbox()->pack_start (label, true, true);
651  hpacker.pack_start (quit, true, false);
652  win.get_vbox()->pack_start (hpacker, false, false);
653 
654  quit.signal_clicked().connect(mem_fun(*this,&UI::quit));
655 
656  win.show_all ();
657  win.set_modal (true);
658 
659  theMain->run ();
660 
661  _exit (1);
662 }
663 
664 void
665 UI::popup_error (const string& text)
666 {
667  if (!caller_is_ui_thread()) {
668  error << "non-UI threads can't use UI::popup_error"
669  << endmsg;
670  return;
671  }
672 
673  MessageDialog msg (text);
674  msg.set_title (string_compose (_("I'm sorry %1, I can't do that"), g_get_user_name()));
675  msg.set_wmclass (X_("error"), name());
676  msg.set_position (WIN_POS_MOUSE);
677  msg.run ();
678 }
679 
680 void
682 {
683  if (!caller_is_ui_thread()) {
684  error << "non-UI threads cannot call UI::flush_pending()"
685  << endmsg;
686  return;
687  }
688 
689  gtk_main_iteration();
690 
691  while (gtk_events_pending()) {
692  gtk_main_iteration();
693  }
694 }
695 
696 bool
697 UI::just_hide_it (GdkEventAny* /*ev*/, Window *win)
698 {
699  win->hide ();
700  return true;
701 }
702 
703 Gdk::Color
704 UI::get_color (const string& prompt, bool& picked, const Gdk::Color* initial)
705 {
706  Gdk::Color color;
707 
708  ColorSelectionDialog color_dialog (prompt);
709 
710  color_dialog.set_modal (true);
711  color_dialog.get_cancel_button()->signal_clicked().connect (bind (mem_fun (*this, &UI::color_selection_done), false));
712  color_dialog.get_ok_button()->signal_clicked().connect (bind (mem_fun (*this, &UI::color_selection_done), true));
713  color_dialog.signal_delete_event().connect (mem_fun (*this, &UI::color_selection_deleted));
714 
715  if (initial) {
716  color_dialog.get_colorsel()->set_current_color (*initial);
717  }
718 
719  color_dialog.show_all ();
720  color_picked = false;
721  picked = false;
722 
723  Main::run();
724 
725  color_dialog.hide_all ();
726 
727  if (color_picked) {
728  Gdk::Color f_rgba = color_dialog.get_colorsel()->get_current_color ();
729  color.set_red(f_rgba.get_red());
730  color.set_green(f_rgba.get_green());
731  color.set_blue(f_rgba.get_blue());
732 
733  picked = true;
734  }
735 
736  return color;
737 }
738 
739 void
741 {
742  color_picked = status;
743  Main::quit ();
744 }
745 
746 bool
747 UI::color_selection_deleted (GdkEventAny* /*ev*/)
748 {
749  Main::quit ();
750  return true;
751 }
TextViewer * errors
Definition: gtk_ui.h:184
void set_text(std::string)
Definition: popup.cc:121
void send_request(UIRequest *)
static RequestType new_request_type()
Definition: base_ui.cc:67
static RequestType CallSlot
Definition: base_ui.h:62
LIBPBD_API Transmitter fatal
bool running()
Definition: gtk_ui.cc:287
Glib::RefPtr< Gtk::Action > get_related_action()
Definition: activatable.h:43
std::string name() const
Definition: base_ui.h:57
virtual void display_message(const char *prefix, gint prefix_len, Glib::RefPtr< Gtk::TextBuffer::Tag > ptag, Glib::RefPtr< Gtk::TextBuffer::Tag > mtag, const char *msg)
Definition: gtk_ui.cc:622
PBD::EventLoop::InvalidationRecord * __invalidator(sigc::trackable &trackable, const char *file, int line)
Definition: gtk_ui.cc:424
int(* function)(void *)
Definition: gtk_ui.h:82
Glib::RefPtr< Gtk::TextBuffer::Tag > info_ptag
Definition: gtk_ui.h:189
UIRequest * get_request(RequestType)
Glib::RefPtr< Gtk::TextBuffer::Tag > warning_ptag
Definition: gtk_ui.h:191
static void set_event_loop_for_thread(EventLoop *ui)
Definition: event_loop.cc:36
void hangup()
Definition: receiver.cc:38
BaseUI::RequestType AddIdle
Definition: gtk_ui.cc:63
static Application * instance()
void touch_display(Touchable *)
Definition: gtk_ui.cc:321
Definition: ardour_ui.h:130
Gtk::StateType new_state
Definition: gtk_ui.h:81
Gtk::Button & dismiss_button()
Definition: textviewer.h:47
BaseUI::RequestType ErrorMessage
Definition: gtk_ui.cc:59
Glib::RefPtr< Gtk::TextBuffer::Tag > info_mtag
Definition: gtk_ui.h:190
LIBGTKMM2EXT_API Glib::RefPtr< Gtk::Action > get_action(const char *group, const char *name)
Definition: actions.cc:406
BaseUI::RequestType TouchDisplay
Definition: gtk_ui.cc:60
BaseUI::RequestType SetTip
Definition: gtk_ui.cc:62
bool color_selection_deleted(GdkEventAny *)
Definition: gtk_ui.cc:747
BaseUI::RequestType AddTimeout
Definition: gtk_ui.cc:64
LIBPBD_API Transmitter error
LIBPBD_API Transmitter warning
void touch()
Definition: popup.cc:94
const char * msg2
Definition: gtk_ui.h:86
virtual ~UI()
Definition: gtk_ui.cc:127
void process_error_message(Transmitter::Channel, const char *)
Definition: gtk_ui.cc:506
std::ostream & endmsg(std::ostream &ostr)
Definition: transmitter.h:71
BaseUI::RequestType StateChange
Definition: gtk_ui.cc:61
static UI * theGtkUI
Definition: gtk_ui.h:177
LIBPBD_API int replace_all(std::string &str, const std::string &target, const std::string &replacement)
Definition: strreplace.cc:24
static void * invalidate_request(void *data)
Definition: event_loop.cc:42
static bool just_hide_it(GdkEventAny *, Gtk::Window *)
Definition: gtk_ui.cc:697
bool _active
Definition: gtk_ui.h:179
Glib::RefPtr< Gtk::TextBuffer::Tag > fatal_mtag
Definition: gtk_ui.h:188
const std::string & get_string()
Definition: window_title.h:53
#define _(Text)
Definition: i18n.h:11
const char * msg
Definition: gtk_ui.h:80
bool caller_is_ui_thread()
Definition: gtk_ui.cc:134
#define X_(Text)
Definition: i18n.h:13
Transmitter::Channel chn
Definition: gtk_ui.h:84
void flush_pending()
Definition: gtk_ui.cc:681
static bool idle_quit()
Definition: gtk_ui.cc:304
Touchable * display
Definition: gtk_ui.h:79
int load_rcfile(std::string, bool themechange=false)
Definition: gtk_ui.cc:140
void run()
Definition: base_ui.cc:99
void idle_add(int(*func)(void *), void *arg)
Definition: gtk_ui.cc:403
sigc::signal< void > theme_changed
Definition: gtk_ui.h:166
Gdk::Color get_color(const std::string &prompt, bool &picked, const Gdk::Color *initial=0)
Definition: gtk_ui.cc:704
UI(std::string name, int *argc, char **argv[])
Definition: gtk_ui.cc:70
Gtk::Main * theMain
Definition: gtk_ui.h:180
LIBGTKMM2EXT_API void uncheck_toggleaction(std::string)
void toggle_errors()
Definition: gtk_ui.cc:604
virtual void handle_fatal(const char *)
Definition: gtk_ui.cc:634
void set_name(std::string)
Definition: popup.cc:127
void do_quit()
Definition: gtk_ui.cc:311
bool color_picked
Definition: gtk_ui.h:200
LIBPBD_API void pthread_set_name(const char *name)
LIBPBD_API Transmitter info
void color_selection_done(bool status)
Definition: gtk_ui.cc:740
void set_tip(Gtk::Widget &w, const gchar *tip)
Glib::RefPtr< Gtk::TextBuffer::Tag > fatal_ptag
Definition: gtk_ui.h:187
void set_state(Gtk::Widget *w, Gtk::StateType state)
Definition: gtk_ui.cc:388
Glib::RefPtr< Gtk::TextBuffer::Tag > error_ptag
Definition: gtk_ui.h:185
void do_request(UIRequest *)
Definition: gtk_ui.cc:437
Gtk::Widget * widget
Definition: gtk_ui.h:83
void show_errors()
Definition: gtk_ui.cc:590
void attach_request_source()
Definition: base_ui.cc:158
Gtk::TextView & text()
Definition: textviewer.h:46
Glib::RefPtr< Gtk::TextBuffer::Tag > error_mtag
Definition: gtk_ui.h:186
LIBGTKMM2EXT_API std::string get_key_representation(const std::string &accel_path, Gtk::AccelKey &key)
static RequestType Quit
Definition: base_ui.h:63
Definition: debug.h:30
void receive(Transmitter::Channel, const char *)
Definition: gtk_ui.cc:485
Glib::Threads::Thread * run_loop_thread
Definition: base_ui.h:79
bool delete_after_touch() const
Definition: touchable.h:31
void listen_to(Transmitter &)
Definition: receiver.cc:51
void quit()
Definition: gtk_ui.cc:293
BaseUI::RequestType NullMessage
Definition: gtk_ui.cc:58
Glib::RefPtr< Gtk::TextBuffer::Tag > warning_mtag
Definition: gtk_ui.h:192
virtual void touch()=0
std::string string_compose(const std::string &fmt, const T1 &o1)
Definition: compose.h:208
virtual int starting()=0
MyReceiver _receiver
Definition: gtk_ui.h:113
void popup_error(const std::string &text)
Definition: gtk_ui.cc:665
LIBARDOUR_API PBD::PropertyDescriptor< bool > color
Definition: route_group.cc:50