2002-08-15 17:48:53 +00:00
|
|
|
/**
|
2002-09-26 08:57:43 +00:00
|
|
|
* \file frontends/Dialogs.C
|
2002-09-05 15:14:23 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
2002-12-01 22:59:25 +00:00
|
|
|
* \author Angus Leeming
|
2002-09-05 14:10:50 +00:00
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS
|
2001-04-26 18:58:49 +00:00
|
|
|
*
|
2002-08-15 17:48:53 +00:00
|
|
|
* Common to all frontends' Dialogs
|
2001-04-26 18:58:49 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma implementation
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "Dialogs.h"
|
2002-06-18 15:44:30 +00:00
|
|
|
|
2002-08-15 17:48:53 +00:00
|
|
|
// Note that static boost signals break some compilers, so this wrapper
|
|
|
|
// initialises the signal dynamically when it is first invoked.
|
|
|
|
template<typename Signal>
|
|
|
|
class BugfixSignal {
|
|
|
|
public:
|
2002-12-01 22:59:25 +00:00
|
|
|
Signal & operator()() { return thesignal(); }
|
|
|
|
Signal const & operator()() const { return thesignal(); }
|
2002-06-18 15:44:30 +00:00
|
|
|
|
2002-08-15 17:48:53 +00:00
|
|
|
private:
|
2002-12-01 22:59:25 +00:00
|
|
|
Signal & thesignal() const
|
|
|
|
{
|
|
|
|
if (!signal_.get())
|
|
|
|
signal_.reset(new Signal);
|
|
|
|
return *signal_;
|
|
|
|
}
|
|
|
|
|
|
|
|
mutable boost::scoped_ptr<Signal> signal_;
|
2002-08-15 17:48:53 +00:00
|
|
|
};
|
2002-06-18 15:44:30 +00:00
|
|
|
|
|
|
|
|
2002-08-15 17:48:53 +00:00
|
|
|
boost::signal0<void> & Dialogs::redrawGUI()
|
2002-06-18 15:44:30 +00:00
|
|
|
{
|
2002-12-01 22:59:25 +00:00
|
|
|
static BugfixSignal<boost::signal0<void> > thesignal;
|
|
|
|
return thesignal();
|
2002-06-18 15:44:30 +00:00
|
|
|
}
|