]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_binaryopinset.C
architectural changes to tex2lyx
[lyx.git] / src / mathed / math_binaryopinset.C
index 5106d17052505ea1d795cbbdd74927b141914284..71ff00f4afb4ad9122827caf50b5cc9e99937584 100644 (file)
@@ -1,21 +1,23 @@
-#ifdef __GNUG__
-#pragma implementation
-#endif
+#include <config.h>
+
 
 #include "math_binaryopinset.h"
-#include "Painter.h"
+#include "PainterInfo.h"
 #include "support/LOstream.h"
 #include "math_support.h"
 #include "math_mathmlstream.h"
 
 
+using std::max;
+
+
 MathBinaryOpInset::MathBinaryOpInset(char op)
        : MathNestInset(2), op_(op)
 {}
 
 
-MathInset * MathBinaryOpInset::clone() const
-{   
+InsetBase * MathBinaryOpInset::clone() const
+{
        return new MathBinaryOpInset(*this);
 }
 
@@ -26,22 +28,26 @@ int MathBinaryOpInset::opwidth() const
 }
 
 
-void MathBinaryOpInset::metrics(MathMetricsInfo const & mi) const
+#warning Andre, have a look here. (Lgb)
+#if 0
+// That this is not declared in class MathBinaryOpInset makes
+// Doxygen give warnings. (Lgb)
+void MathBinaryOpInset::metrics(MetricsInfo & mi, Dimension & dim) const
 {
        mi_ = mi;
-       xcell(0).metrics(mi);
-       xcell(1).metrics(mi);
-       width_   = xcell(0).width() + xcell(1).width() + opwidth();
-       ascent_  = std::max(xcell(0).ascent(),  xcell(1).ascent());
-       descent_ = std::max(xcell(0).descent(), xcell(1).descent());
+       cell(0).metrics(mi);
+       cell(1).metrics(mi);
+       width_   = cell(0).width() + cell(1).width() + opwidth();
+       ascent_  = max(cell(0).ascent(),  cell(1).ascent());
+       descent_ = max(cell(0).descent(), cell(1).descent());
 }
+#endif
 
-
-void MathBinaryOpInset::draw(Painter & pain, int x, int y) const
-{ 
-       xcell(0).draw(pain, x, y); 
-       drawChar(pain, LM_TC_CONST, mi_, x + xcell(0).width() , y, op_);
-       xcell(1).draw(pain, x + width() - xcell(1).width(), y); 
+void MathBinaryOpInset::draw(PainterInfo & pain, int x, int y) const
+{
+       cell(0).draw(pain, x, y);
+       drawChar(pain, LM_TC_CONST, mi_, x + cell(0).width() , y, op_);
+       cell(1).draw(pain, x + width() - cell(1).width(), y);
 }