2 * \file math_biginset.C
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 "math_biginset.h"
14 #include "math_support.h"
15 #include "math_parser.h"
16 #include "math_mathmlstream.h"
17 #include "math_streamstr.h"
22 MathBigInset::MathBigInset(string const & name, string const & delim)
23 : name_(name), delim_(delim)
27 auto_ptr<InsetBase> MathBigInset::clone() const
29 return auto_ptr<InsetBase>(new MathBigInset(*this));
33 MathBigInset::size_type MathBigInset::size() const
35 return name_.size() - 4;
39 double MathBigInset::increase() const
50 void MathBigInset::metrics(MetricsInfo & mi, Dimension & dim) const
52 double const h = mathed_char_ascent(mi.base.font, 'I');
53 double const f = increase();
55 dim_.asc = int(h + f * h);
56 dim_.des = int(f * h);
61 void MathBigInset::draw(PainterInfo & pi, int x, int y) const
63 mathed_draw_deco(pi, x + 1, y - dim_.ascent(), 4, dim_.height(), delim_);
67 void MathBigInset::write(WriteStream & os) const
69 os << '\\' << name_ << ' ' << delim_;
73 void MathBigInset::normalize(NormalStream & os) const
75 os << '[' << name_ << ' ' << delim_ << ']';