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