]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_braceinset.C
small up/down tweaking
[lyx.git] / src / mathed / math_braceinset.C
index 6680d7fd221c16ad0cfc3ddd06153869cc5c1cd9..ba204213128768aa6b8c886beee56b1bc7918489 100644 (file)
@@ -8,7 +8,7 @@
 #include "math_parser.h"
 #include "math_support.h"
 #include "math_mathmlstream.h"
-
+#include "support/LOstream.h"
 
 using std::max;
 
@@ -18,29 +18,38 @@ MathBraceInset::MathBraceInset()
 {}
 
 
+MathBraceInset::MathBraceInset(MathArray const & ar)
+       : MathNestInset(1)
+{
+       cell(0) = ar;
+}
+
+
 MathInset * MathBraceInset::clone() const
-{   
+{
        return new MathBraceInset(*this);
 }
 
 
-void MathBraceInset::metrics(MathMetricsInfo const & mi) const
+void MathBraceInset::metrics(MathMetricsInfo & mi) const
 {
-       xcell(0).metrics(mi);
-       int a, d;
-       whichFont(font_, LM_TC_TEX, mi);
-       mathed_char_dim(font_, '{', a, d, wid_);
-       ascent_  = max(xcell(0).ascent(), a);
-       descent_ = max(xcell(0).descent(), a);
-       width_   = xcell(0).width() + 2 * wid_;
+       cell(0).metrics(mi);
+       Dimension t;
+       mathed_char_dim(mi.base.font, '{', t);
+       wid_ = t.w;
+       dim_.a = max(cell(0).ascent(), t.a);
+       dim_.d = max(cell(0).descent(), t.a);
+       dim_.w = cell(0).width() + 2 * wid_;
 }
 
 
-void MathBraceInset::draw(Painter & pain, int x, int y) const
-{ 
-       drawChar(pain, font_, x, y, '{');
-       xcell(0).draw(pain, x + wid_, y);
-       drawChar(pain, font_, x + width_ - wid_, y, '}');
+void MathBraceInset::draw(MathPainterInfo & pi, int x, int y) const
+{
+       LyXFont font = pi.base.font;
+       font.setColor(LColor::latex);
+       drawChar(pi, font, x, y, '{');
+       cell(0).draw(pi, x + wid_, y);
+       drawChar(pi, font, x + width() - wid_, y, '}');
 }
 
 
@@ -56,3 +65,31 @@ void MathBraceInset::normalize(NormalStream & os) const
 }
 
 
+void MathBraceInset::maplize(MapleStream & os) const
+{
+       os << cell(0);
+}
+
+
+void MathBraceInset::octavize(OctaveStream & os) const
+{
+       os << cell(0);
+}
+
+
+void MathBraceInset::mathmlize(MathMLStream & os) const
+{
+       os << MTag("mrow") << cell(0) << ETag("mrow");
+}
+
+
+void MathBraceInset::mathematicize(MathematicaStream & os) const
+{
+       os << cell(0);
+}
+
+
+void MathBraceInset::infoize(std::ostream & os) const
+{
+       os << "Nested Block: ";
+}