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