-#include <config.h>
+/**
+ * \file math_biginset.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author André Pönitz
+ *
+ * Full author contact details are available in file CREDITS.
+ */
-#ifdef __GNUG__
-#pragma implementation
-#endif
+#include <config.h>
#include "math_biginset.h"
#include "math_support.h"
-#include "math_parser.h"
#include "math_mathmlstream.h"
#include "math_streamstr.h"
+using std::string;
+using std::auto_ptr;
+
+
MathBigInset::MathBigInset(string const & name, string const & delim)
: name_(name), delim_(delim)
{}
-MathInset * MathBigInset::clone() const
-{
- return new MathBigInset(*this);
+auto_ptr<InsetBase> MathBigInset::doClone() const
+{
+ return auto_ptr<InsetBase>(new MathBigInset(*this));
}
case 3: return 0.7;
default: return 0.0;
}
- return 0.0;
}
-void MathBigInset::metrics(MathMetricsInfo const & mi) const
+void MathBigInset::metrics(MetricsInfo & mi, Dimension & dim) const
{
- LyXFont font;
- whichFont(font, LM_TC_VAR, mi);
- double h = mathed_char_ascent(font, 'I');
- double f = increase();
- width_ = 6;
- ascent_ = int(h + f * h);
- descent_ = int(f * h);
+ double const h = mathed_char_ascent(mi.base.font, 'I');
+ double const f = increase();
+ dim_.wid = 6;
+ dim_.asc = int(h + f * h);
+ dim_.des = int(f * h);
+ dim = dim_;
}
-void MathBigInset::draw(Painter & pain, int x, int y) const
-{
- mathed_draw_deco(pain, x + 1, y - ascent_, 4, height(), delim_);
+void MathBigInset::draw(PainterInfo & pi, int x, int y) const
+{
+ mathed_draw_deco(pi, x + 1, y - dim_.ascent(), 4, dim_.height(), delim_);
}
void MathBigInset::normalize(NormalStream & os) const
{
- os << "[" << name_ << ' ' << delim_ << ']';
+ os << '[' << name_ << ' ' << delim_ << ']';
}