2001-12-05 08:04:20 +00:00
|
|
|
#include <config.h>
|
|
|
|
|
2001-02-28 11:56:36 +00:00
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma implementation
|
|
|
|
#endif
|
|
|
|
|
2001-02-13 13:28:32 +00:00
|
|
|
#include "math_dotsinset.h"
|
2001-11-08 12:06:56 +00:00
|
|
|
#include "math_mathmlstream.h"
|
2001-12-05 08:04:20 +00:00
|
|
|
#include "math_streamstr.h"
|
2001-11-08 12:15:12 +00:00
|
|
|
#include "math_support.h"
|
2002-07-17 10:25:33 +00:00
|
|
|
#include "math_parser.h"
|
2001-02-13 13:28:32 +00:00
|
|
|
|
|
|
|
|
2002-07-17 10:25:33 +00:00
|
|
|
MathDotsInset::MathDotsInset(latexkeys const * key)
|
|
|
|
: key_(key)
|
2001-06-25 00:06:33 +00:00
|
|
|
{}
|
2001-02-13 13:28:32 +00:00
|
|
|
|
|
|
|
|
2001-06-28 10:25:20 +00:00
|
|
|
MathInset * MathDotsInset::clone() const
|
2001-02-13 13:28:32 +00:00
|
|
|
{
|
2001-06-25 00:06:33 +00:00
|
|
|
return new MathDotsInset(*this);
|
2002-03-21 17:42:56 +00:00
|
|
|
}
|
2001-02-13 13:28:32 +00:00
|
|
|
|
|
|
|
|
2002-05-30 07:09:54 +00:00
|
|
|
void MathDotsInset::metrics(MathMetricsInfo & mi) const
|
2002-03-19 16:55:58 +00:00
|
|
|
{
|
2002-07-11 11:27:24 +00:00
|
|
|
mathed_char_dim(mi.base.font, 'M', dim_);
|
2002-07-17 10:25:33 +00:00
|
|
|
if (key_->name == "ldots" || key_->name == "dotsm")
|
2002-05-29 15:58:26 +00:00
|
|
|
dh_ = 0;
|
2002-07-17 10:25:33 +00:00
|
|
|
else if (key_->name == "cdots" || key_->name == "dotsb"
|
|
|
|
|| key_->name == "dotsm" || key_->name == "dotsi")
|
2002-07-11 11:27:24 +00:00
|
|
|
dh_ = ascent() / 2;
|
2002-07-17 10:25:33 +00:00
|
|
|
else if (key_->name == "dotsc")
|
2002-07-11 11:27:24 +00:00
|
|
|
dh_ = ascent() / 4;
|
2002-11-25 10:15:13 +00:00
|
|
|
else if (key_->name == "vdots") {
|
|
|
|
dim_.w = (dim_.w / 2) + 1;
|
|
|
|
dh_ = ascent();
|
|
|
|
}
|
2002-07-17 10:25:33 +00:00
|
|
|
else if (key_->name == "ddots")
|
2002-07-11 11:27:24 +00:00
|
|
|
dh_ = ascent();
|
2002-03-21 17:42:56 +00:00
|
|
|
}
|
2002-03-19 16:55:58 +00:00
|
|
|
|
|
|
|
|
2002-05-30 07:09:54 +00:00
|
|
|
void MathDotsInset::draw(MathPainterInfo & pain, int x, int y) const
|
2001-02-13 13:28:32 +00:00
|
|
|
{
|
2002-07-17 10:25:33 +00:00
|
|
|
mathed_draw_deco(pain, x + 2, y - dh_, width() - 2, ascent(), key_->name);
|
|
|
|
if (key_->name == "vdots" || key_->name == "ddots")
|
2001-04-25 15:43:57 +00:00
|
|
|
++x;
|
2002-07-17 10:25:33 +00:00
|
|
|
if (key_->name != "vdots")
|
2001-04-25 15:43:57 +00:00
|
|
|
--y;
|
2002-07-17 10:25:33 +00:00
|
|
|
mathed_draw_deco(pain, x + 2, y - dh_, width() - 2, ascent(), key_->name);
|
2001-02-13 13:28:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-08-05 07:09:11 +00:00
|
|
|
string MathDotsInset::name() const
|
2001-02-13 13:28:32 +00:00
|
|
|
{
|
2002-08-05 07:09:11 +00:00
|
|
|
return key_->name;
|
2001-04-25 15:43:57 +00:00
|
|
|
}
|