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"
25 : display(ColorDisplay),
32 bool operator==(Params const & a, Params const & b)
34 return (a.filename == b.filename &&
35 a.display == b.display &&
43 bool operator!=(Params const & a, Params const & b)
49 ostream & operator<<(ostream & os, BoundingBox const & bb)
51 os << bb.xl << ' ' << bb.yb << ' ' << bb.xr << ' ' << bb.yt;
56 BoundingBox::BoundingBox()
57 : xl(0), yb(0), xr(0), yt(0)
61 BoundingBox::BoundingBox(string const & bb)
62 : xl(0), yb(0), xr(0), yt(0)
67 istringstream is(bb.c_str());
69 is >> a >> b >> c >> d;
71 // inBP returns the length in Postscript points.
72 // Note further that there are 72 Postscript pixels per inch.
73 unsigned int const xl_tmp = abs(Length(a).inBP());
74 unsigned int const yb_tmp = abs(Length(b).inBP());
75 unsigned int const xr_tmp = abs(Length(c).inBP());
76 unsigned int const yt_tmp = abs(Length(d).inBP());
78 if (xr_tmp <= xl_tmp || yt_tmp <= yb_tmp)
88 bool BoundingBox::empty() const
90 return (!xl && !yb && !xr && !yt);
94 bool operator==(BoundingBox const & a, BoundingBox const & b)
96 return (a.xl == b.xl &&
103 bool operator!=(BoundingBox const & a, BoundingBox const & b)
108 } // namespace graphics