]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlERT.C
Add the missing template instatiations!
[lyx.git] / src / frontends / controllers / ControlERT.C
1 /* This file is part of
2  * ====================================================== 
3  *
4  *           LyX, The Document Processor
5  *
6  *           Copyright 2001 The LyX Team.
7  *
8  * ======================================================
9  *
10  * \author Jürgen Vigna, jug@sad.it
11  * \author Angus Leeming, a.leeming@ic.ac.uk
12  */
13
14 #include <config.h>
15
16 #ifdef __GNUG__
17 #pragma implementation
18 #endif
19
20 #include "ViewBase.h"
21 #include "ButtonControllerBase.h"
22 #include "ControlERT.h"
23 #include "ControlInset.tmpl"
24 #include "Dialogs.h"
25 #include "LyXView.h"
26 #include "buffer.h"
27 #include "BufferView.h"
28
29 using std::vector;
30 using SigC::slot;
31
32 // sorry this is just a temporary hack we should include vspace.h! (Jug)
33 extern const char * stringFromUnit(int);
34
35 ControlERT::ControlERT(LyXView & lv, Dialogs & d)
36         : ControlInset<InsetERT, ERTParams>(lv, d)
37 {
38         d_.showERT.connect(slot(this, &ControlERT::showInset));
39
40         // We could have an extra method updateInset that calls
41         // view().update() rather than view().show(), but I don't see why
42         // it is really needed.
43         d_.updateERT.connect(slot(this, &ControlERT::showInset));
44 }
45
46
47 void ControlERT::applyParamsToInset()
48 {
49         inset()->status(lv_.view(), params().status);
50 }
51
52
53 void ControlERT::applyParamsNoInset()
54 {
55 }
56
57
58 ERTParams const ControlERT::getParams(InsetERT const & inset)
59 {
60         return ERTParams(inset);
61 }
62
63
64 ERTParams::ERTParams()
65         : status(InsetERT::Collapsed)
66 {}
67
68 ERTParams::ERTParams(InsetERT const & inset)
69         : status(inset.status())
70 {}
71
72
73 bool operator==(ERTParams const & p1, ERTParams const & p2)
74 {
75         return (p1.status == p2.status);
76 }
77
78
79 bool operator!=(ERTParams const & p1, ERTParams const & p2)
80 {
81         return !(p1 == p2);
82 }