]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlMinipage.C
14f1741b685c74c828e6868e5ee3686580b608f2
[lyx.git] / src / frontends / controllers / ControlMinipage.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 Juergen 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 "ControlMinipage.h"
21 #include "Dialogs.h"
22 #include "LyXView.h"
23 #include "buffer.h"
24
25 using SigC::slot;
26
27 ControlMinipage::ControlMinipage(LyXView & lv, Dialogs & d)
28         : ControlInset<InsetMinipage, MinipageParams>(lv, d)
29 {
30         d_.showMinipage.connect(slot(this, &ControlMinipage::showInset));
31         d_.updateMinipage.connect(slot(this, &ControlMinipage::showInset));
32 }
33
34
35 void ControlMinipage::applyParamsToInset()
36 {
37         inset()->width(params().width);
38         inset()->widthp(params().widthp);
39         inset()->pos(params().pos);
40 }
41
42
43 void ControlMinipage::applyParamsNoInset()
44 {
45 }
46
47
48 MinipageParams const ControlMinipage::getParams(InsetMinipage const & inset)
49 {
50         return MinipageParams(inset);
51 }
52
53
54 MinipageParams::MinipageParams()
55         : widthp(0), pos(InsetMinipage::top)
56 {}
57
58 MinipageParams::MinipageParams(InsetMinipage const & inset)
59         : width(inset.width()), widthp(inset.widthp()), pos(inset.pos())
60 {}
61
62 bool MinipageParams::operator==(MinipageParams const & o) const
63 {
64         return (width == o.width && widthp == o.widthp && pos == o.pos);
65 }
66
67 bool MinipageParams::operator!=(MinipageParams const & o) const
68 {
69         return !(*this == o);
70 }