start of new crossthread-safe design
[ardour.git] / gtk2_ardour / gui_thread.h
1 #ifndef __ardour_gtk_gui_thread_h__
2 #define __ardour_gtk_gui_thread_h__
3
4 #include <gtkmm2ext/gtk_ui.h>
5 #include <pbd/crossthread.h>
6
7 #define ENSURE_GUI_THREAD(slot) \
8      if (!Gtkmm2ext::UI::instance()->caller_is_ui_thread()) {\
9         Gtkmm2ext::UI::instance()->call_slot ((slot));\
10         return;\
11      }
12
13 #define GTK_SAFE(theSlot) crossthread_safe (Gtkmm2ext::UI::instance()->thread_id(),\
14                                             *Gtkmm2ext::UI::instance(), \
15                                             (theSlot))
16
17 #endif /* __ardour_gtk_gui_thread_h__ */