]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathBoldSymbol.cpp
27ee877c28ad0b8afbde8ce89163927247541f8d
[lyx.git] / src / mathed / InsetMathBoldSymbol.cpp
1 /**
2  * \file InsetMathBoldSymbol.cpp
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author André Pönitz
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13 #include "InsetMathBoldSymbol.h"
14 #include "MathStream.h"
15 #include "MathData.h"
16 #include "LaTeXFeatures.h"
17 #include "support/std_ostream.h"
18
19
20 namespace lyx {
21
22 InsetMathBoldSymbol::InsetMathBoldSymbol()
23         : InsetMathNest(1)
24 {}
25
26
27 Inset * InsetMathBoldSymbol::clone() const
28 {
29         return new InsetMathBoldSymbol(*this);
30 }
31
32
33 void InsetMathBoldSymbol::metrics(MetricsInfo & mi, Dimension & dim) const
34 {
35         //FontSetChanger dummy(mi.base, "mathbf");
36         cell(0).metrics(mi, dim);
37         metricsMarkers(dim);
38         ++dim.wid;  // for 'double stroke'
39         // Cache the inset dimension. 
40         setDimCache(mi, dim);
41 }
42
43
44 void InsetMathBoldSymbol::draw(PainterInfo & pi, int x, int y) const
45 {
46         //FontSetChanger dummy(pi.base, "mathbf");
47         cell(0).draw(pi, x + 1, y);
48         cell(0).draw(pi, x + 2, y);
49         drawMarkers(pi, x, y);
50 }
51
52
53 void InsetMathBoldSymbol::metricsT(TextMetricsInfo const & mi, Dimension & /*dim*/) const
54 {
55         // FIXME: BROKEN!
56         Dimension dim;
57         cell(0).metricsT(mi, dim);
58 }
59
60
61 void InsetMathBoldSymbol::drawT(TextPainter & pain, int x, int y) const
62 {
63         cell(0).drawT(pain, x, y);
64 }
65
66
67 void InsetMathBoldSymbol::validate(LaTeXFeatures & features) const
68 {
69         InsetMathNest::validate(features);
70         features.require("amssymb");
71 }
72
73
74 void InsetMathBoldSymbol::write(WriteStream & os) const
75 {
76         os << "\\boldsymbol{" << cell(0) << "}";
77 }
78
79
80 void InsetMathBoldSymbol::infoize(odocstream & os) const
81 {
82         os << "Boldsymbol ";
83 }
84
85
86 } // namespace lyx