2 * \file GraphicsParams.C
3 * Read the file COPYING
5 * \author Angus Leeming
7 * Full author contact details available in file CREDITS
13 #pragma implementation
18 #include "GraphicsParams.h"
20 #include "lyxlength.h"
27 : display(ColorDisplay),
33 bool operator==(Params const & a, Params const & b)
35 return (a.filename == b.filename &&
36 a.display == b.display &&
43 bool operator!=(Params const & a, Params const & b)
49 BoundingBox::BoundingBox()
50 : xl(0), yb(0), xr(0), yt(0)
54 BoundingBox::BoundingBox(string const & bb)
55 : xl(0), yb(0), xr(0), yt(0)
60 std::istringstream is(bb.c_str());
62 is >> a >> b >> c >> d;
64 // inBP returns the length in Postscript points.
65 // Note further that there are 72 Postscript pixels per inch.
66 unsigned int const xl_tmp = abs(LyXLength(a).inBP());
67 unsigned int const yb_tmp = abs(LyXLength(b).inBP());
68 unsigned int const xr_tmp = abs(LyXLength(c).inBP());
69 unsigned int const yt_tmp = abs(LyXLength(d).inBP());
71 if (xr_tmp <= xl_tmp || yt_tmp <= yb_tmp)
81 bool BoundingBox::empty() const
83 return (!xl && !yb && !xr && !yt);
87 bool operator==(BoundingBox const & a, BoundingBox const & b)
89 return (a.xl == b.xl &&
96 bool operator!=(BoundingBox const & a, BoundingBox const & b)