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 dummy = mi.base.changeArray();
53 InsetMathGrid::metrics(mi, dim);
57 void InsetMathXYMatrix::draw(PainterInfo & pi, int x, int y) const
59 setPosCache(pi, x, y);
60 Changer dummy = pi.base.changeArray();
61 InsetMathGrid::draw(pi, x, y);
65 void InsetMathXYMatrix::write(WriteStream & os) const
67 MathEnsurer ensurer(os);
69 bool open = os.startOuterRow();
72 switch (spacing_code_) {
79 switch (spacing_code_) {
86 os << '@' << spacing_code_ << '='
87 << from_ascii(spacing_.asLatexString());
90 if (!spacing_.empty())
91 os << "@=" << from_ascii(spacing_.asLatexString());
95 InsetMathGrid::write(os);
103 void InsetMathXYMatrix::infoize(odocstream & os) const
106 if (equal_spacing_) {
107 switch (spacing_code_) {
111 os << '!' << spacing_code_ << ' ';
114 switch (spacing_code_) {
121 os << spacing_code_ << ' '
122 << from_ascii(spacing_.asLatexString()) << ' ';
125 if (!spacing_.empty())
126 os << from_ascii(spacing_.asLatexString()) << ' ';
129 InsetMathGrid::infoize(os);
133 void InsetMathXYMatrix::normalize(NormalStream & os) const
136 InsetMathGrid::normalize(os);
141 void InsetMathXYMatrix::maple(MapleStream & os) const
144 InsetMathGrid::maple(os);
149 void InsetMathXYMatrix::validate(LaTeXFeatures & features) const
151 features.require("xy");
152 InsetMathGrid::validate(features);
156 void InsetMathXYMatrix::mathmlize(MathStream &) const
158 throw MathExportException();
162 void InsetMathXYMatrix::htmlize(HtmlStream &) const
164 throw MathExportException();