4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
9 * Full author contact details are available in file CREDITS.
20 /// Simple wrapper around three ints
24 Dimension() : wid(0), asc(0), des(0) {}
26 Dimension(int w, int a, int d) : wid(w), asc(a), des(d) {}
28 Dimension & operator=(Dimension const & dim) {
35 void operator+=(Dimension const & dim);
37 void clear() { wid = asc = des = 0; }
38 /// set to empty box suitble for given font
39 void clear(LyXFont const & font);
41 int height() const { return asc + des; }
43 int ascent() const { return asc; }
45 int descent() const { return des; }
47 int width() const { return wid; }
49 /// add space for a frame
50 //void addFrame(int frame) const;
51 /// add space for bottom part of a frame
52 //void addFrameBottom(int frame) const;
55 /// these are intentionally public as things like
59 /// are used all over the place and "hiding" those behind
61 /// dim.ascent(dim.ascent() + 20);
63 /// makes the code neither faster nor clearer
73 bool operator==(Dimension const & a, Dimension const & b)
75 return a.wid == b.wid && a.asc == b.asc && a.des == b.des ;
80 bool operator!=(Dimension const & a, Dimension const & b)
82 return a.wid != b.wid || a.asc != b.asc || a.des != b.des ;