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.
17 /// Simple wrapper around three ints
21 Dimension() : wid(0), asc(0), des(0) {}
23 Dimension(int w
, int a
, int d
) : wid(w
), asc(a
), des(d
) {}
25 Dimension
& operator=(Dimension
const & dim
) {
32 void operator+=(Dimension
const & dim
);
34 void clear() { wid
= asc
= des
= 0; }
36 int height() const { return asc
+ des
; }
38 int ascent() const { return asc
; }
40 int descent() const { return des
; }
42 int width() const { return wid
; }
44 /// add space for a frame
45 //void addFrame(int frame) const;
46 /// add space for bottom part of a frame
47 //void addFrameBottom(int frame) const;
50 /// these are intentionally public as things like
54 /// are used all over the place and "hiding" those behind
56 /// dim.ascent(dim.ascent() + 20);
58 /// makes the code neither faster nor clearer
68 bool operator==(Dimension
const & a
, Dimension
const & b
)
70 return a
.wid
== b
.wid
&& a
.asc
== b
.asc
&& a
.des
== b
.des
;
75 bool operator!=(Dimension
const & a
, Dimension
const & b
)
77 return a
.wid
!= b
.wid
|| a
.asc
!= b
.asc
|| a
.des
!= b
.des
;