2 * \file GraphicsParams.C
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Angus Leeming
8 * Full author contact details are available in file CREDITS
15 #include "GraphicsParams.h"
17 #include "lyxlength.h"
24 : display(ColorDisplay),
30 bool operator==(Params const & a, Params const & b)
32 return (a.filename == b.filename &&
33 a.display == b.display &&
40 bool operator!=(Params const & a, Params const & b)
46 BoundingBox::BoundingBox()
47 : xl(0), yb(0), xr(0), yt(0)
51 BoundingBox::BoundingBox(string const & bb)
52 : xl(0), yb(0), xr(0), yt(0)
57 std::istringstream is(bb.c_str());
59 is >> a >> b >> c >> d;
61 // inBP returns the length in Postscript points.
62 // Note further that there are 72 Postscript pixels per inch.
63 unsigned int const xl_tmp = abs(LyXLength(a).inBP());
64 unsigned int const yb_tmp = abs(LyXLength(b).inBP());
65 unsigned int const xr_tmp = abs(LyXLength(c).inBP());
66 unsigned int const yt_tmp = abs(LyXLength(d).inBP());
68 if (xr_tmp <= xl_tmp || yt_tmp <= yb_tmp)
78 bool BoundingBox::empty() const
80 return (!xl && !yb && !xr && !yt);
84 bool operator==(BoundingBox const & a, BoundingBox const & b)
86 return (a.xl == b.xl &&
93 bool operator!=(BoundingBox const & a, BoundingBox const & b)