]> git.lyx.org Git - lyx.git/blob - src/mathed/math_xdata.h
cosmetics: rename (x)array.[Ch] into math_(x)data.[Ch]
[lyx.git] / src / mathed / math_xdata.h
1 // -*- C++ -*-
2
3 #ifndef MATHEDXARRAY_H
4 #define MATHEDXARRAY_H
5
6 #include <iosfwd>
7
8 #include "math_data.h"
9 #include "math_metricsinfo.h"
10
11 #ifdef __GNUG__
12 #pragma interface
13 #endif
14
15 class Painter;
16
17 class MathXArray
18 {
19 public:
20         ///
21         typedef MathArray::size_type       size_type;
22         ///
23         typedef MathArray::const_iterator  const_iterator;
24
25         ///
26         MathXArray();
27         ///
28         void metrics(MathMetricsInfo const & st) const;
29         ///
30         void draw(Painter & pain, int x, int y) const;
31
32         ///
33         int xo() const { return xo_; }
34         ///
35         int yo() const { return yo_; }
36         ///
37         int pos2x(size_type pos) const;
38         ///
39         size_type x2pos(int pos) const;
40
41         ///
42         int ascent() const { return ascent_; }
43         ///
44         int descent() const { return descent_; }
45         ///
46         int height() const { return ascent_ + descent_; }
47         ///
48         int width() const { return width_; }
49
50         ///
51         const_iterator begin() const { return data_.begin(); }
52         ///
53         const_iterator end() const { return data_.end(); }
54         
55 public:
56         ///
57         MathArray data_;
58         ///
59         mutable int width_;
60         ///
61         mutable int ascent_;
62         ///
63         mutable int descent_;
64         ///
65         mutable int xo_;
66         ///
67         mutable int yo_;
68         ///
69         mutable MathMetricsInfo size_;
70 };
71
72 std::ostream & operator<<(std::ostream & os, MathXArray const & ar);
73
74 #endif