]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathBoldSymbol.cpp
6ef4de7099b862cbbf17b2fe0d4e6573278bc8ce
[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
15 #include "MathStream.h"
16 #include "MathData.h"
17 #include "LaTeXFeatures.h"
18
19 #include <ostream>
20
21
22 namespace lyx {
23
24 InsetMathBoldSymbol::InsetMathBoldSymbol()
25         : InsetMathNest(1)
26 {}
27
28
29 Inset * InsetMathBoldSymbol::clone() const
30 {
31         return new InsetMathBoldSymbol(*this);
32 }
33
34
35 void InsetMathBoldSymbol::metrics(MetricsInfo & mi, Dimension & dim) const
36 {
37         //FontSetChanger dummy(mi.base, "mathbf");
38         cell(0).metrics(mi, dim);
39         metricsMarkers(dim);
40         ++dim.wid;  // for 'double stroke'
41         // Cache the inset dimension. 
42         setDimCache(mi, dim);
43 }
44
45
46 void InsetMathBoldSymbol::draw(PainterInfo & pi, int x, int y) const
47 {
48         //FontSetChanger dummy(pi.base, "mathbf");
49         cell(0).draw(pi, x + 1, y);
50         cell(0).draw(pi, x + 2, y);
51         drawMarkers(pi, x, y);
52 }
53
54
55 void InsetMathBoldSymbol::metricsT(TextMetricsInfo const & mi, Dimension & /*dim*/) const
56 {
57         // FIXME: BROKEN!
58         Dimension dim;
59         cell(0).metricsT(mi, dim);
60 }
61
62
63 void InsetMathBoldSymbol::drawT(TextPainter & pain, int x, int y) const
64 {
65         cell(0).drawT(pain, x, y);
66 }
67
68
69 void InsetMathBoldSymbol::validate(LaTeXFeatures & features) const
70 {
71         InsetMathNest::validate(features);
72         features.require("amssymb");
73 }
74
75
76 void InsetMathBoldSymbol::write(WriteStream & os) const
77 {
78         os << "\\boldsymbol{" << cell(0) << "}";
79 }
80
81
82 void InsetMathBoldSymbol::infoize(odocstream & os) const
83 {
84         os << "Boldsymbol ";
85 }
86
87
88 } // namespace lyx