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"
15 #include "MathStream.h"
17 #include "LaTeXFeatures.h"
18 #include "MetricsInfo.h"
25 InsetMathXYMatrix::InsetMathXYMatrix(Buffer * buf, Length const & s, char c,
26 bool e) : InsetMathGrid(buf, 1, 1), spacing_(s), spacing_code_(c),
32 Inset * InsetMathXYMatrix::clone() const
34 return new InsetMathXYMatrix(*this);
38 int InsetMathXYMatrix::colsep() const
44 int InsetMathXYMatrix::rowsep() const
50 void InsetMathXYMatrix::metrics(MetricsInfo & mi, Dimension & dim) const
52 Changer dummy2 = mi.base.changeEnsureMath();
53 Changer dummy = mi.base.changeArray();
54 InsetMathGrid::metrics(mi, dim);
58 void InsetMathXYMatrix::draw(PainterInfo & pi, int x, int y) const
60 Changer dummy2 = pi.base.changeEnsureMath();
61 Changer dummy = pi.base.changeArray();
62 InsetMathGrid::draw(pi, x, y);
66 void InsetMathXYMatrix::write(TeXMathStream & os) const
68 MathEnsurer ensurer(os);
70 bool open = os.startOuterRow();
73 switch (spacing_code_) {
80 switch (spacing_code_) {
87 os << '@' << spacing_code_ << '='
88 << from_ascii(spacing_.asLatexString());
91 if (!spacing_.empty())
92 os << "@=" << from_ascii(spacing_.asLatexString());
96 InsetMathGrid::write(os);
104 void InsetMathXYMatrix::infoize(odocstream & os) const
107 if (equal_spacing_) {
108 switch (spacing_code_) {
112 os << '!' << spacing_code_ << ' ';
115 switch (spacing_code_) {
122 os << spacing_code_ << ' '
123 << from_ascii(spacing_.asLatexString()) << ' ';
126 if (!spacing_.empty())
127 os << from_ascii(spacing_.asLatexString()) << ' ';
130 InsetMathGrid::infoize(os);
134 void InsetMathXYMatrix::normalize(NormalStream & os) const
137 InsetMathGrid::normalize(os);
142 void InsetMathXYMatrix::maple(MapleStream & os) const
145 InsetMathGrid::maple(os);
150 void InsetMathXYMatrix::validate(LaTeXFeatures & features) const
152 features.require("xy");
153 InsetMathGrid::validate(features);
157 void InsetMathXYMatrix::mathmlize(MathMLStream &) const
159 throw MathExportException();
163 void InsetMathXYMatrix::htmlize(HtmlStream &) const
165 throw MathExportException();