mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-15 19:16:40 +01:00
libpbd/guis: move __invalidator() into PBD::EventLoop
we allow use of/dependency on sigc::trackable there, so this is both legal but also sensible. Leave the macro definition of invalidator(x) in gtkmm2ext/gui_thread.h because it doesn't hurt and makes some sense for it to be there. No reason for a source module that needs invalidator(x) to load EventLoop decl.
This commit is contained in:
parent
f5f48b421e
commit
d5ad9ff033
4 changed files with 23 additions and 20 deletions
|
|
@ -456,23 +456,6 @@ UI::idle_add (int (*func)(void *), void *arg)
|
|||
|
||||
/* END abstract_ui interfaces */
|
||||
|
||||
/** Create a PBD::EventLoop::InvalidationRecord and attach a callback
|
||||
* to a given sigc::trackable so that PBD::EventLoop::invalidate_request
|
||||
* is called when that trackable is destroyed.
|
||||
*/
|
||||
PBD::EventLoop::InvalidationRecord*
|
||||
__invalidator (sigc::trackable& trackable, const char* file, int line)
|
||||
{
|
||||
PBD::EventLoop::InvalidationRecord* ir = new PBD::EventLoop::InvalidationRecord;
|
||||
|
||||
ir->file = file;
|
||||
ir->line = line;
|
||||
|
||||
trackable.add_destroy_notify_callback (ir, PBD::EventLoop::invalidate_request);
|
||||
|
||||
return ir;
|
||||
}
|
||||
|
||||
void
|
||||
UI::do_request (UIRequest* req)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@ namespace sigc {
|
|||
#define gui_context() Gtkmm2ext::UI::instance() /* a UICallback-derived object that specifies the event loop for GUI signal handling */
|
||||
#define ui_bind(f, ...) boost::protect (boost::bind (f, __VA_ARGS__))
|
||||
|
||||
LIBGTKMM2EXT_API extern PBD::EventLoop::InvalidationRecord* __invalidator (sigc::trackable& trackable, const char*, int);
|
||||
#define invalidator(x) __invalidator ((x), __FILE__, __LINE__)
|
||||
#define invalidator(x) PBD::EventLoop::__invalidator ((x), __FILE__, __LINE__)
|
||||
|
||||
#endif /* __ardour_gtk_gui_thread_h__ */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue