3 #include "math_biginset.h"
4 #include "math_support.h"
5 #include "math_parser.h"
6 #include "math_mathmlstream.h"
7 #include "math_streamstr.h"
12 MathBigInset::MathBigInset(string const & name, string const & delim)
13 : name_(name), delim_(delim)
17 auto_ptr<InsetBase> MathBigInset::clone() const
19 return auto_ptr<InsetBase>(new MathBigInset(*this));
23 MathBigInset::size_type MathBigInset::size() const
25 return name_.size() - 4;
29 double MathBigInset::increase() const
40 void MathBigInset::metrics(MetricsInfo & mi, Dimension & dim) const
42 double const h = mathed_char_ascent(mi.base.font, 'I');
43 double const f = increase();
45 dim_.asc = int(h + f * h);
46 dim_.des = int(f * h);
51 void MathBigInset::draw(PainterInfo & pi, int x, int y) const
53 mathed_draw_deco(pi, x + 1, y - dim_.ascent(), 4, dim_.height(), delim_);
57 void MathBigInset::write(WriteStream & os) const
59 os << '\\' << name_ << ' ' << delim_;
63 void MathBigInset::normalize(NormalStream & os) const
65 os << '[' << name_ << ' ' << delim_ << ']';