]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlMinipage.C
Collapse all those LFUN_XYZ_APPLY to a single LFUN_INSET_APPLY.
[lyx.git] / src / frontends / controllers / ControlMinipage.C
1 /**
2  * \file ControlMinipage.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Jürgen Vigna
7  * \author Angus Leeming
8  *
9  * Full author contact details are available in file CREDITS
10  */
11
12 #include <config.h>
13
14
15 #include "ControlMinipage.h"
16 #include "BufferView.h"
17
18
19 ControlMinipage::ControlMinipage(LyXView & lv, Dialogs & d)
20         : ControlInset<InsetMinipage, MinipageParams>(lv, d)
21 {}
22
23
24 void ControlMinipage::applyParamsToInset()
25 {
26         inset()->pageWidth(params().pageWidth);
27         inset()->pos(params().pos);
28
29         bufferview()->updateInset(inset(), true);
30 }
31
32
33 void ControlMinipage::applyParamsNoInset()
34 {
35 }
36
37
38 MinipageParams const ControlMinipage::getParams(InsetMinipage const & inset)
39 {
40         return MinipageParams(inset);
41 }
42
43
44 MinipageParams::MinipageParams()
45         : pos(InsetMinipage::top)
46 {}
47
48
49 MinipageParams::MinipageParams(InsetMinipage const & inset)
50         : pageWidth(inset.pageWidth()), pos(inset.pos())
51 {}
52
53
54 bool operator==(MinipageParams const & p1, MinipageParams const & p2)
55 {
56         return (p1.pageWidth == p2.pageWidth && p1.pos == p2.pos);
57 }
58
59
60 bool operator!=(MinipageParams const & p1, MinipageParams const & p2)
61 {
62         return !(p1 == p2);
63 }