]> git.lyx.org Git - lyx.git/blob - src/mathed/math_boldsymbolinset.C
macro rework
[lyx.git] / src / mathed / math_boldsymbolinset.C
1 /**
2  * \file math_boldsymbolinset.C
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 "math_boldsymbolinset.h"
14 #include "math_mathmlstream.h"
15 #include "math_data.h"
16 #include "LaTeXFeatures.h"
17 #include "support/std_ostream.h"
18
19 using std::auto_ptr;
20
21
22 MathBoldsymbolInset::MathBoldsymbolInset()
23         : MathNestInset(1)
24 {}
25
26
27 auto_ptr<InsetBase> MathBoldsymbolInset::clone() const
28 {
29         return auto_ptr<InsetBase>(new MathBoldsymbolInset(*this));
30 }
31
32
33 void MathBoldsymbolInset::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         dim_ = dim;
40 }
41
42
43 void MathBoldsymbolInset::draw(PainterInfo & pi, int x, int y) const
44 {
45         //FontSetChanger dummy(pi.base, "mathbf");
46         cell(0).draw(pi, x + 1, y);
47         cell(0).draw(pi, x + 2, y);
48         drawMarkers(pi, x, y);
49 }
50
51
52 void MathBoldsymbolInset::metricsT(TextMetricsInfo const & mi, Dimension & /*dim*/) const
53 {
54         cell(0).metricsT(mi, dim_);
55 }
56
57
58 void MathBoldsymbolInset::drawT(TextPainter & pain, int x, int y) const
59 {
60         cell(0).drawT(pain, x, y);
61 }
62
63
64 void MathBoldsymbolInset::validate(LaTeXFeatures & features) const
65 {
66         MathNestInset::validate(features);
67         features.require("amssymb");
68 }
69
70
71 void MathBoldsymbolInset::write(WriteStream & os) const
72 {
73         os << "\\boldsymbol{" << cell(0) << "}";
74 }
75
76
77 void MathBoldsymbolInset::infoize(std::ostream & os) const
78 {
79         os << "Boldsymbol ";
80 }