2002-08-15 17:48:53 +00:00
|
|
|
/**
|
2001-04-26 18:58:49 +00:00
|
|
|
* \file Dialogs.C
|
2002-08-15 17:48:53 +00:00
|
|
|
* Copyright 1995-2002 The LyX Team.
|
|
|
|
* See the file COPYING.
|
|
|
|
* \author Angus Leeming <leeming@lyx.org>
|
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:
|
|
|
|
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:
|
|
|
|
Signal & thesignal() const
|
|
|
|
{
|
|
|
|
if (!signal_.get())
|
|
|
|
signal_.reset(new Signal);
|
|
|
|
return *signal_;
|
|
|
|
}
|
2002-06-18 15:44:30 +00:00
|
|
|
|
2002-08-15 17:48:53 +00:00
|
|
|
mutable boost::scoped_ptr<Signal> signal_;
|
|
|
|
};
|
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-08-15 17:48:53 +00:00
|
|
|
static BugfixSignal<boost::signal0<void> > thesignal;
|
|
|
|
return thesignal();
|
2002-06-18 15:44:30 +00:00
|
|
|
}
|