]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/xarray.h
use stream-like syntax for LaTeX output
[lyx.git] / src / mathed / xarray.h
index 6e96aa9c9fb2768bf597d854aee3cef12d9dafd4..b09d6af34492814f1bf94041000d35f6c246187c 100644 (file)
@@ -5,6 +5,7 @@
 
 #include <iosfwd>
 #include "array.h"
+#include "math_defs.h"
 
 #ifdef __GNUG__
 #pragma interface
@@ -15,23 +16,26 @@ class Painter;
 class MathXArray
 {
 public:
+       ///
+       typedef MathArray::size_type       size_type;
+       ///
+       typedef MathArray::const_iterator  const_iterator;
+
        ///
        MathXArray();
        ///
-       void metrics(MathStyles st);
+       void metrics(MathMetricsInfo const & st) const;
        ///
-       void draw(Painter & pain, int x, int y);
+       void draw(Painter & pain, int x, int y) const;
 
        ///
        int xo() const { return xo_; }
        ///
        int yo() const { return yo_; }
        ///
-       int pos2x(int pos) const;
+       int pos2x(size_type pos) const;
        ///
-       int x2pos(int pos) const;
-       ///
-       int width(int pos) const;
+       size_type x2pos(int pos) const;
 
        ///
        int ascent() const { return ascent_; }
@@ -43,22 +47,27 @@ public:
        int width() const { return width_; }
        ///
        MathStyles style() const { return style_; }
-       
 
+       ///
+       const_iterator begin() const { return data_.begin(); }
+       ///
+       const_iterator end() const { return data_.end(); }
+       
+public:
        ///
        MathArray data_;
        ///
-       int width_;
+       mutable int width_;
        ///
-       int ascent_;
+       mutable int ascent_;
        ///
-       int descent_;
+       mutable int descent_;
        ///
-       int xo_;
+       mutable int xo_;
        ///
-       int yo_;
+       mutable int yo_;
        ///
-       MathStyles style_;
+       mutable MathStyles style_;
 };
 
 std::ostream & operator<<(std::ostream & os, MathXArray const & ar);