lyx_mirror/src/mathed/InsetMathDiagram.cpp
Pavel Sanda 65962da47b Add support for feyn package and Diagram inset.
Patch from Ronen Abravanel.
http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg161952.html

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35455 a592a061-630c-0410-9148-cb99ea01b6c8
2010-09-19 22:12:06 +00:00

96 lines
1.5 KiB
C++

/**
* \file InsetMathDiagram.cpp
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author André Pönitz
* \author Ronen Abravanel
*
* Full author contact details are available in file CREDITS.
*/
#include <config.h>
#include "InsetMathDiagram.h"
#include "LaTeXFeatures.h"
#include "MathStream.h"
#include <ostream>
namespace lyx {
InsetMathDiagram::InsetMathDiagram(Buffer * buf) : InsetMathGrid(buf, 1, 1)
{
}
Inset * InsetMathDiagram::clone() const
{
return new InsetMathDiagram(*this);
}
int InsetMathDiagram::colsep() const
{
return 10;
}
int InsetMathDiagram::rowsep() const
{
return 10;
}
void InsetMathDiagram::metrics(MetricsInfo & mi, Dimension & dim) const
{
if (mi.base.style == LM_ST_DISPLAY)
mi.base.style = LM_ST_TEXT;
InsetMathGrid::metrics(mi, dim);
}
void InsetMathDiagram::write(WriteStream & os) const
{
MathEnsurer ensurer(os);
os << "\\Diagram";
os << '{';
InsetMathGrid::write(os);
os << "}\n";
}
void InsetMathDiagram::infoize(odocstream & os) const
{
os << "Diagram ";
InsetMathGrid::infoize(os);
}
void InsetMathDiagram::normalize(NormalStream & os) const
{
os << "[Diagram ";
InsetMathGrid::normalize(os);
os << ']';
}
void InsetMathDiagram::maple(MapleStream & os) const
{
os << "Diagram(";
InsetMathGrid::maple(os);
os << ')';
}
void InsetMathDiagram::validate(LaTeXFeatures & features) const
{
features.require("feyn");
InsetMathGrid::validate(features);
}
} // namespace lyx