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.
13 #include "GraphicsParams.h"
15 #include "lyxlength.h"
17 #include "support/std_sstream.h"
26 : display(ColorDisplay),
32 bool operator==(Params const & a, Params const & b)
34 return (a.filename == b.filename &&
35 a.display == b.display &&
42 bool operator!=(Params const & a, Params const & b)
48 BoundingBox::BoundingBox()
49 : xl(0), yb(0), xr(0), yt(0)
53 BoundingBox::BoundingBox(string const & bb)
54 : xl(0), yb(0), xr(0), yt(0)
59 std::istringstream is(bb.c_str());
61 is >> a >> b >> c >> d;
63 // inBP returns the length in Postscript points.
64 // Note further that there are 72 Postscript pixels per inch.
65 unsigned int const xl_tmp = abs(LyXLength(a).inBP());
66 unsigned int const yb_tmp = abs(LyXLength(b).inBP());
67 unsigned int const xr_tmp = abs(LyXLength(c).inBP());
68 unsigned int const yt_tmp = abs(LyXLength(d).inBP());
70 if (xr_tmp <= xl_tmp || yt_tmp <= yb_tmp)
80 bool BoundingBox::empty() const
82 return (!xl && !yb && !xr && !yt);
86 bool operator==(BoundingBox const & a, BoundingBox const & b)
88 return (a.xl == b.xl &&
95 bool operator!=(BoundingBox const & a, BoundingBox const & b)
100 } // namespace graphics