]> git.lyx.org Git - lyx.git/blob - src/mathed/math_diminset.h
use a single function dimension() instead of three.
[lyx.git] / src / mathed / math_diminset.h
1 // -*- C++ -*-
2 #ifndef MATH_DIMINSET_H
3 #define MATH_DIMINSET_H
4
5 #include "math_inset.h"
6
7 /// things that need the dimension cache
8
9 class MathDimInset : public MathInset {
10 public:
11         /// not sure whether the initialization is really necessary
12         MathDimInset() : width_(0), ascent_(0), descent_(0) {}
13         /// read ascent value (should be inline according to gprof)
14         int ascent() const { return ascent_; }
15         /// read descent
16         int descent() const { return descent_; }
17         /// read width
18         int width() const { return width_; }
19         /// 
20         void dimensions(int & w, int & a, int & d) const;
21         ///
22         void metricsT(TextMetricsInfo const &) const;
23         ///
24         void drawT(TextPainter & pain, int x, int y) const;
25
26 protected:
27         ///
28         mutable int width_;
29         ///
30         mutable int ascent_;
31         ///
32         mutable int descent_;
33 };
34 #endif