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);
72 bool open = os.startOuterRow();
75 switch (spacing_code_) {
82 switch (spacing_code_) {
89 os << '@' << spacing_code_ << '='
90 << from_ascii(spacing_.asLatexString());
93 if (!spacing_.empty())
94 os << "@=" << from_ascii(spacing_.asLatexString());
98 InsetMathGrid::write(os);
106 void InsetMathXYMatrix::infoize(odocstream & os) const
109 if (equal_spacing_) {
110 switch (spacing_code_) {
114 os << '!' << spacing_code_ << ' ';
117 switch (spacing_code_) {
124 os << spacing_code_ << ' '
125 << from_ascii(spacing_.asLatexString()) << ' ';
128 if (!spacing_.empty())
129 os << from_ascii(spacing_.asLatexString()) << ' ';
132 InsetMathGrid::infoize(os);
136 void InsetMathXYMatrix::normalize(NormalStream & os) const
139 InsetMathGrid::normalize(os);
144 void InsetMathXYMatrix::maple(MapleStream & os) const
147 InsetMathGrid::maple(os);
152 void InsetMathXYMatrix::validate(LaTeXFeatures & features) const
154 features.require("xy");
155 InsetMathGrid::validate(features);
159 void InsetMathXYMatrix::mathmlize(MathMLStream &) const
161 throw MathExportException();
165 void InsetMathXYMatrix::htmlize(HtmlStream &) const
167 throw MathExportException();