- int const b = y - ascent_ - 2;
- xcell(0).draw(pain, x + w + 2, y);
- mathed_draw_deco(pain, x + 1, b, w, height() + 4, left_);
- mathed_draw_deco(pain, x + width() - w - 1, b, w, height() + 4, right_);
+ int const b = y - ascent();
+ cell(0).draw(pi, x + w + 4, y);
+ mathed_draw_deco(pi, x + 4, b, w, height(), left_);
+ mathed_draw_deco(pi, x + width() - w - 4, b, w, height(), right_);
+}
+
+
+bool MathDelimInset::isParanthesis() const
+{
+ return left_ == "(" && right_ == ")";
+}
+
+
+bool MathDelimInset::isBrackets() const
+{
+ return left_ == "[" && right_ == "]";
+}
+
+
+bool MathDelimInset::isAbs() const
+{
+ return left_ == "|" && right_ == "|";
+}
+
+
+void MathDelimInset::maple(MapleStream & os) const
+{
+ if (isAbs()) {
+ if (cell(0).size() == 1 && cell(0).front()->asMatrixInset())
+ os << "linalg[det](" << cell(0) << ')';
+ else
+ os << "abs(" << cell(0) << ')';
+ }
+ else
+ os << left_ << cell(0) << right_;
+}
+
+void MathDelimInset::maxima(MaximaStream & os) const
+{
+ if (isAbs()) {
+ if (cell(0).size() == 1 && cell(0).front()->asMatrixInset())
+ os << "determinant(" << cell(0) << ')';
+ else
+ os << "abs(" << cell(0) << ')';
+ }
+ else
+ os << left_ << cell(0) << right_;
+}
+
+
+void MathDelimInset::mathematica(MathematicaStream & os) const
+{
+ if (isAbs()) {
+ if (cell(0).size() == 1 && cell(0).front()->asMatrixInset())
+ os << "Det" << cell(0) << ']';
+ else
+ os << "Abs[" << cell(0) << ']';
+ }
+ else
+ os << left_ << cell(0) << right_;
+}
+
+
+void MathDelimInset::mathmlize(MathMLStream & os) const
+{
+ os << "<fenced open=\"" << left_ << "\" close=\""
+ << right_ << "\">" << cell(0) << "</fenced>";
+}
+
+
+void MathDelimInset::octave(OctaveStream & os) const
+{
+ if (isAbs())
+ os << "det(" << cell(0) << ')';
+ else
+ os << left_ << cell(0) << right_;