2005-09-25 18:42:24 +00:00
|
|
|
#ifndef __ardour_gtk_gui_thread_h__
|
|
|
|
|
#define __ardour_gtk_gui_thread_h__
|
|
|
|
|
|
2006-01-12 00:56:57 +00:00
|
|
|
#include <gtkmm2ext/gtk_ui.h>
|
2006-11-16 03:18:30 +00:00
|
|
|
#include <pbd/crossthread.h>
|
2006-01-12 00:56:57 +00:00
|
|
|
|
2005-09-25 18:42:24 +00:00
|
|
|
#define ENSURE_GUI_THREAD(slot) \
|
2006-04-24 22:45:19 +00:00
|
|
|
if (!Gtkmm2ext::UI::instance()->caller_is_ui_thread()) {\
|
2005-09-25 20:33:00 +00:00
|
|
|
Gtkmm2ext::UI::instance()->call_slot ((slot));\
|
2005-09-25 18:42:24 +00:00
|
|
|
return;\
|
|
|
|
|
}
|
|
|
|
|
|
2006-11-16 03:18:30 +00:00
|
|
|
#define GTK_SAFE(theSlot) crossthread_safe (Gtkmm2ext::UI::instance()->thread_id(),\
|
|
|
|
|
*Gtkmm2ext::UI::instance(), \
|
|
|
|
|
(theSlot))
|
|
|
|
|
|
2005-09-25 18:42:24 +00:00
|
|
|
#endif /* __ardour_gtk_gui_thread_h__ */
|