/* attach our request source to the default main context */
- request_channel.ios()->attach (MainContext::get_default());
+ attach_request_source (MainContext::get_default());
errors = new TextViewer (800,600);
errors->text().set_editable (false);
BaseUI::RequestType BaseUI::Quit = BaseUI::new_request_type();
BaseUI::BaseUI (const string& str)
- : request_channel (true)
- , run_loop_thread (0)
+ : run_loop_thread (0)
, _name (str)
+ , request_channel (true)
{
base_ui_instance = this;
return true;
}
-
+
+void
+BaseUI::signal_new_request ()
+{
+ request_channel.wakeup ();
+}
+
+void
+BaseUI::attach_request_source (Glib::RefPtr<Glib::MainContext> context)
+{
+ request_channel.ios()->attach (context);
+}
at the per-thread and generic request lists.
*/
- request_channel.wakeup ();
+ signal_new_request ();
}
}
void quit ();
protected:
- CrossThreadChannel request_channel;
bool _ok;
Glib::RefPtr<Glib::MainLoop> _main_loop;
*/
bool request_handler (Glib::IOCondition);
+ void signal_new_request ();
+ void attach_request_source (Glib::RefPtr<Glib::MainContext> context);
+
/** Derived UI objects must implement this method,
* which will be called whenever there are requests
* to be dealt with.
private:
std::string _name;
BaseUI* base_ui_instance;
+
+ CrossThreadChannel request_channel;
static uint64_t rt_bit;