+ Glib::RefPtr<Glib::MainLoop> _main_loop;
+ Glib::RefPtr<Glib::MainContext> m_context;
+ Glib::Threads::Thread* run_loop_thread;
+ Glib::Threads::Mutex _run_lock;
+ Glib::Threads::Cond _running;
+
+ /* this signals _running from within the event loop,
+ from an idle callback
+ */
+
+ bool signal_running ();
+
+ /** Derived UI objects can implement thread_init()
+ * which will be called by the event loop thread
+ * immediately before it enters the event loop.
+ */
+
+ virtual void thread_init () {};
+
+#ifdef PLATFORM_WINDOWS
+ static gboolean _request_handler (gpointer);
+ bool request_handler ();
+#else
+ /** Called when there input ready on the request_channel
+ */
+ bool request_handler (Glib::IOCondition);
+#endif
+
+ void signal_new_request ();
+ void attach_request_source ();
+
+ /** Derived UI objects must implement this method,
+ * which will be called whenever there are requests
+ * to be dealt with.
+ */
+ virtual void handle_ui_requests () = 0;
+