2003-09-12 10:14:31 +00:00
|
|
|
|
/**
|
2007-04-25 03:01:35 +00:00
|
|
|
|
* \file InsetMathBoldSymbol.cpp
|
2003-09-12 10:14:31 +00:00
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
|
*
|
|
|
|
|
* \author Andr<EFBFBD> P<EFBFBD>nitz
|
|
|
|
|
*
|
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
2006-09-17 09:14:18 +00:00
|
|
|
|
#include "InsetMathBoldSymbol.h"
|
2006-10-22 10:15:23 +00:00
|
|
|
|
#include "MathStream.h"
|
2007-04-26 16:05:57 +00:00
|
|
|
|
#include "MathData.h"
|
2003-09-12 10:14:31 +00:00
|
|
|
|
#include "LaTeXFeatures.h"
|
|
|
|
|
#include "support/std_ostream.h"
|
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
|
|
2006-09-16 18:11:38 +00:00
|
|
|
|
InsetMathBoldSymbol::InsetMathBoldSymbol()
|
|
|
|
|
: InsetMathNest(1)
|
2003-09-12 10:14:31 +00:00
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
|
2007-08-30 18:03:17 +00:00
|
|
|
|
Inset * InsetMathBoldSymbol::clone() const
|
2003-09-12 10:14:31 +00:00
|
|
|
|
{
|
2007-08-30 18:03:17 +00:00
|
|
|
|
return new InsetMathBoldSymbol(*this);
|
2003-09-12 10:14:31 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-09-21 20:39:47 +00:00
|
|
|
|
void InsetMathBoldSymbol::metrics(MetricsInfo & mi, Dimension & dim) const
|
2003-09-12 10:14:31 +00:00
|
|
|
|
{
|
|
|
|
|
//FontSetChanger dummy(mi.base, "mathbf");
|
|
|
|
|
cell(0).metrics(mi, dim);
|
2004-01-30 11:41:12 +00:00
|
|
|
|
metricsMarkers(dim);
|
2003-09-12 10:14:31 +00:00
|
|
|
|
++dim.wid; // for 'double stroke'
|
2007-09-23 22:39:49 +00:00
|
|
|
|
// Cache the inset dimension.
|
|
|
|
|
setDimCache(mi, dim);
|
2003-09-12 10:14:31 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2006-09-16 18:11:38 +00:00
|
|
|
|
void InsetMathBoldSymbol::draw(PainterInfo & pi, int x, int y) const
|
2003-09-12 10:14:31 +00:00
|
|
|
|
{
|
|
|
|
|
//FontSetChanger dummy(pi.base, "mathbf");
|
|
|
|
|
cell(0).draw(pi, x + 1, y);
|
|
|
|
|
cell(0).draw(pi, x + 2, y);
|
|
|
|
|
drawMarkers(pi, x, y);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2006-09-16 18:11:38 +00:00
|
|
|
|
void InsetMathBoldSymbol::metricsT(TextMetricsInfo const & mi, Dimension & /*dim*/) const
|
2003-09-12 10:14:31 +00:00
|
|
|
|
{
|
2007-09-23 22:39:49 +00:00
|
|
|
|
// FIXME: BROKEN!
|
|
|
|
|
Dimension dim;
|
|
|
|
|
cell(0).metricsT(mi, dim);
|
2003-09-12 10:14:31 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2006-09-16 18:11:38 +00:00
|
|
|
|
void InsetMathBoldSymbol::drawT(TextPainter & pain, int x, int y) const
|
2003-09-12 10:14:31 +00:00
|
|
|
|
{
|
|
|
|
|
cell(0).drawT(pain, x, y);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2006-09-16 18:11:38 +00:00
|
|
|
|
void InsetMathBoldSymbol::validate(LaTeXFeatures & features) const
|
2003-09-12 10:14:31 +00:00
|
|
|
|
{
|
2006-09-16 18:11:38 +00:00
|
|
|
|
InsetMathNest::validate(features);
|
2003-09-12 10:14:31 +00:00
|
|
|
|
features.require("amssymb");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2006-09-16 18:11:38 +00:00
|
|
|
|
void InsetMathBoldSymbol::write(WriteStream & os) const
|
2003-09-12 10:14:31 +00:00
|
|
|
|
{
|
|
|
|
|
os << "\\boldsymbol{" << cell(0) << "}";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2006-10-22 10:15:23 +00:00
|
|
|
|
void InsetMathBoldSymbol::infoize(odocstream & os) const
|
2003-09-12 10:14:31 +00:00
|
|
|
|
{
|
|
|
|
|
os << "Boldsymbol ";
|
|
|
|
|
}
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace lyx
|