- 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_;
+ xcell(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::maplize(MapleStream & os) const
+{
+ if (isAbs()) {
+ bool mat =
+ cell(0).size() == 1 && cell(0).begin()->nucleus()
+ && cell(0).begin()->nucleus()->asMatrixInset();
+ if (mat)
+ os << "linalg[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::octavize(OctaveStream & os) const
+{
+ if (isAbs())
+ os << "det(" << cell(0) << ")";
+ else
+ os << left_ << cell(0) << right_;