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