]> git.lyx.org Git - lyx.git/blob - src/insets/inset.C
more IU
[lyx.git] / src / insets / inset.C
1 /**
2  * \file inset.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Alejandro Aguilar Sierra
7  * \author Jürgen Vigna
8  * \author Lars Gullik Bjønnes
9  * \author Matthias Ettrich
10  *
11  * Full author contact details are available in file CREDITS.
12  */
13
14 #include <config.h>
15
16 #include "inset.h"
17 #include "updatableinset.h"
18
19 #include "BufferView.h"
20 #include "debug.h"
21 #include "gettext.h"
22 #include "lyxtext.h"
23 #include "LColor.h"
24
25
26 using std::string;
27
28
29 InsetOld::InsetOld()
30         : InsetBase(),
31           xo_(0), yo_(0), scx(0), owner_(0),
32           //background_color_(LColor::inherit)
33           background_color_(LColor::background)
34 {}
35
36
37 InsetOld::InsetOld(InsetOld const & in)
38         : InsetBase(),
39           xo_(0), yo_(0), scx(0), owner_(0), name_(in.name_),
40           background_color_(in.background_color_)
41 {}
42
43
44 void InsetOld::setBackgroundColor(LColor_color color)
45 {
46         background_color_ = color;
47 }
48
49
50 LColor_color InsetOld::backgroundColor() const
51 {
52         return LColor::color(background_color_);
53 }
54
55
56 bool InsetOld::forceDefaultParagraphs(InsetBase const * inset) const
57 {
58         if (owner())
59                 return owner()->forceDefaultParagraphs(inset);
60         return false;
61 }
62
63
64 int InsetOld::ascent() const
65 {
66         return dim_.asc;
67 }
68
69
70 int InsetOld::descent() const
71 {
72         return dim_.des;
73 }
74
75
76 int InsetOld::width() const
77 {
78         return dim_.wid;
79 }
80
81
82 int InsetOld::scroll(bool recursive) const
83 {
84         if (!recursive || !owner_)
85                 return scx;
86         return 0;
87 }