diff --git a/libs/pbd/glib_event_source.cc b/libs/pbd/glib_event_source.cc new file mode 100644 index 0000000000..59ae3d7c86 --- /dev/null +++ b/libs/pbd/glib_event_source.cc @@ -0,0 +1,19 @@ +#include "pbd/glib_event_source.h" + +bool +GlibEventLoopSource::prepare (int& timeout) +{ + return false; +} + +bool +GlibEventLoopSource::check () +{ + return false; +} + +bool +GlibEventLoopSource::dispatch (sigc::slot_base*) +{ + return false; +} diff --git a/libs/pbd/pbd/glib_event_source.h b/libs/pbd/pbd/glib_event_source.h new file mode 100644 index 0000000000..65752fbd53 --- /dev/null +++ b/libs/pbd/pbd/glib_event_source.h @@ -0,0 +1,33 @@ +#ifndef __libpbd_glib_event_source_h__ +#define __libpbd_glib_event_source_h__ + +#include + +#include + +class GlibEventLoopSource : public Glib::Source +{ + public: + GlibEventLoopSource () {}; + + bool prepare (int& timeout); + bool check(); + bool dispatch (sigc::slot_base*); +}; + + +class GlibEventLoopCallback : public GlibEventLoopSource +{ + public: + GlibEventLoopCallback (boost::function callback) : _callback (callback) {} + + bool check() { + _callback(); + return false; + } + + private: + boost::function _callback; +}; + +#endif /* __libpbd_glib_event_source_h__ */ diff --git a/libs/pbd/wscript b/libs/pbd/wscript index 77b41d6d10..d0393b6275 100644 --- a/libs/pbd/wscript +++ b/libs/pbd/wscript @@ -51,6 +51,7 @@ libpbd_sources = [ 'file_archive.cc', 'file_utils.cc', 'fpu.cc', + 'glib_event_source.cc', 'id.cc', 'locale_guard.cc', 'localtime_r.cc',