]> git.lyx.org Git - lyx.git/blob - src/frontends/Dialogs.C
Really dull and boring header shit
[lyx.git] / src / frontends / Dialogs.C
1 /**
2  * \file Dialogs.C
3  * See the file COPYING.
4  * \author Angus Leeming 
5  *
6  * Full author contact details are available in file CREDITS
7  *
8  * Common to all frontends' Dialogs
9  */
10
11 #include <config.h>
12
13 #ifdef __GNUG__
14 #pragma implementation
15 #endif
16
17 #include "Dialogs.h"
18
19 // Note that static boost signals break some compilers, so this wrapper
20 // initialises the signal dynamically when it is first invoked.
21 template<typename Signal>
22 class BugfixSignal {
23 public:
24         Signal & operator()() { return thesignal(); }
25         Signal const & operator()() const { return thesignal(); }
26
27 private:
28         Signal & thesignal() const
29         {
30                 if (!signal_.get())
31                         signal_.reset(new Signal);
32                 return *signal_;
33         }
34
35         mutable boost::scoped_ptr<Signal> signal_;
36 };
37
38
39 boost::signal0<void> & Dialogs::redrawGUI()
40 {
41         static BugfixSignal<boost::signal0<void> > thesignal;
42         return thesignal();
43 }