2 * \file InsetMathXYMatrix.cpp
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS.
13 #include "InsetMathXYMatrix.h"
14 #include "MathStream.h"
16 #include "LaTeXFeatures.h"
17 #include "support/std_ostream.h"
23 InsetMathXYMatrix::InsetMathXYMatrix(LyXLength const & s, char c)
24 : InsetMathGrid(1, 1), spacing_(s), spacing_code_(c)
28 std::auto_ptr<InsetBase> InsetMathXYMatrix::doClone() const
30 return std::auto_ptr<InsetBase>(new InsetMathXYMatrix(*this));
34 int InsetMathXYMatrix::colsep() const
40 int InsetMathXYMatrix::rowsep() const
46 bool InsetMathXYMatrix::metrics(MetricsInfo & mi, Dimension & dim) const
48 if (mi.base.style == LM_ST_DISPLAY)
49 mi.base.style = LM_ST_TEXT;
50 InsetMathGrid::metrics(mi, dim);
58 void InsetMathXYMatrix::write(WriteStream & os) const
61 switch (spacing_code_) {
68 os << '@' << spacing_code_ << '='
69 << from_ascii(spacing_.asLatexString());
72 if (!spacing_.empty())
73 os << "@=" << from_ascii(spacing_.asLatexString());
76 InsetMathGrid::write(os);
81 void InsetMathXYMatrix::infoize(odocstream & os) const
84 switch (spacing_code_) {
91 os << spacing_code_ << ' '
92 << from_ascii(spacing_.asLatexString()) << ' ';
95 if (!spacing_.empty())
96 os << from_ascii(spacing_.asLatexString()) << ' ';
98 InsetMathGrid::infoize(os);
102 void InsetMathXYMatrix::normalize(NormalStream & os) const
105 InsetMathGrid::normalize(os);
110 void InsetMathXYMatrix::maple(MapleStream & os) const
113 InsetMathGrid::maple(os);
118 void InsetMathXYMatrix::validate(LaTeXFeatures & features) const
120 features.require("xy");
121 InsetMathGrid::validate(features);