2 * \file GraphicsParams.cpp
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"
26 : display(ColorDisplay),
33 bool operator==(Params const & a, Params const & b)
35 return (a.filename == b.filename &&
36 a.display == b.display &&
44 bool operator!=(Params const & a, Params const & b)
50 ostream & operator<<(ostream & os, BoundingBox const & bb)
52 os << bb.xl << ' ' << bb.yb << ' ' << bb.xr << ' ' << bb.yt;
57 BoundingBox::BoundingBox()
58 : xl(0), yb(0), xr(0), yt(0)
62 BoundingBox::BoundingBox(string const & bb)
63 : xl(0), yb(0), xr(0), yt(0)
68 istringstream is(bb.c_str());
70 is >> a >> b >> c >> d;
72 // inBP returns the length in Postscript points.
73 // Note further that there are 72 Postscript pixels per inch.
74 unsigned int const xl_tmp = abs(Length(a).inBP());
75 unsigned int const yb_tmp = abs(Length(b).inBP());
76 unsigned int const xr_tmp = abs(Length(c).inBP());
77 unsigned int const yt_tmp = abs(Length(d).inBP());
79 if (xr_tmp <= xl_tmp || yt_tmp <= yb_tmp)
89 bool BoundingBox::empty() const
91 return (!xl && !yb && !xr && !yt);
95 bool operator==(BoundingBox const & a, BoundingBox const & b)
97 return (a.xl == b.xl &&
104 bool operator!=(BoundingBox const & a, BoundingBox const & b)
109 } // namespace graphics