]> git.lyx.org Git - lyx.git/blob - src/insets/inset.C
changelogs
[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 #include "metricsinfo.h"
25 #include "coordcache.h"
26
27 using std::string;
28
29
30 InsetOld::InsetOld()
31         : scx(0),
32           //background_color_(LColor::inherit)
33           background_color_(LColor::background)
34 {}
35
36
37 InsetOld::InsetOld(InsetOld const & in)
38         : InsetBase(in), scx(0), name_(in.name_),
39           background_color_(in.background_color_)
40 {}
41
42
43 void InsetOld::setBackgroundColor(LColor_color color)
44 {
45         background_color_ = color;
46 }
47
48
49 LColor_color InsetOld::backgroundColor() const
50 {
51         return LColor::color(background_color_);
52 }
53
54
55 bool InsetOld::forceDefaultParagraphs(InsetBase const *) const
56 {
57         return false;
58 }
59
60
61 int InsetOld::ascent() const
62 {
63         return dim_.asc;
64 }
65
66
67 int InsetOld::descent() const
68 {
69         return dim_.des;
70 }
71
72
73 int InsetOld::width() const
74 {
75         return dim_.wid;
76 }
77
78
79 int InsetOld::scroll(bool) const
80 {
81         return scx;
82 }
83
84
85 void InsetOld::setPosCache(PainterInfo const &, int x, int y) const
86 {
87         //lyxerr << "InsetOld:: position cache to " << x << " " << y << std::endl;
88         theCoords.insets_.add(this, x, y);
89 }