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
14 #pragma implementation
19 #include "GraphicsParams.h"
21 #include "lyxlength.h"
28 : display(ColorDisplay),
34 bool operator==(Params const & a, Params const & b)
36 return (a.filename == b.filename &&
37 a.display == b.display &&
44 bool operator!=(Params const & a, Params const & b)
50 BoundingBox::BoundingBox()
51 : xl(0), yb(0), xr(0), yt(0)
55 BoundingBox::BoundingBox(string const & bb)
56 : xl(0), yb(0), xr(0), yt(0)
61 std::istringstream is(bb.c_str());
63 is >> a >> b >> c >> d;
65 // inBP returns the length in Postscript points.
66 // Note further that there are 72 Postscript pixels per inch.
67 unsigned int const xl_tmp = abs(LyXLength(a).inBP());
68 unsigned int const yb_tmp = abs(LyXLength(b).inBP());
69 unsigned int const xr_tmp = abs(LyXLength(c).inBP());
70 unsigned int const yt_tmp = abs(LyXLength(d).inBP());
72 if (xr_tmp <= xl_tmp || yt_tmp <= yb_tmp)
82 bool BoundingBox::empty() const
84 return (!xl && !yb && !xr && !yt);
88 bool operator==(BoundingBox const & a, BoundingBox const & b)
90 return (a.xl == b.xl &&
97 bool operator!=(BoundingBox const & a, BoundingBox const & b)