2 * \file InsetMathSize.cpp
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS.
13 #include "InsetMathSize.h"
16 #include "MathParser.h"
17 #include "MathStream.h"
19 #include "support/convert.h"
26 InsetMathSize::InsetMathSize(Buffer
* buf
, latexkeys
const * l
)
27 : InsetMathNest(buf
, 1), key_(l
), style_(Styles(convert
<int>(l
->extra
)))
31 Inset
* InsetMathSize::clone() const
33 return new InsetMathSize(*this);
37 void InsetMathSize::metrics(MetricsInfo
& mi
, Dimension
& dim
) const
39 StyleChanger
dummy(mi
.base
, style_
);
40 cell(0).metrics(mi
, dim
);
45 void InsetMathSize::draw(PainterInfo
& pi
, int x
, int y
) const
47 StyleChanger
dummy(pi
.base
, style_
);
48 cell(0).draw(pi
, x
+ 1, y
);
49 drawMarkers(pi
, x
, y
);
53 void InsetMathSize::write(WriteStream
& os
) const
55 MathEnsurer
ensurer(os
);
56 os
<< "{\\" << key_
->name
<< ' ' << cell(0) << '}';
60 void InsetMathSize::normalize(NormalStream
& os
) const
62 os
<< '[' << key_
->name
<< ' ' << cell(0) << ']';
66 void InsetMathSize::infoize(odocstream
& os
) const
68 os
<< "Size: " << key_
->name
;