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