2 * \file GraphicsParams.C
3 * Copyright 2002 the LyX Team
4 * Read the file COPYING
6 * \author Angus Leeming <leeming@lyx.org>
12 #pragma implementation
17 #include "GraphicsParams.h"
19 #include "lyxlength.h"
26 : display(ColorDisplay),
34 bool operator==(Params const & a, Params const & b)
36 return (a.filename == b.filename &&
37 a.display == b.display &&
40 a.height == b.height &&
46 bool operator!=(Params const & a, Params const & b)
52 BoundingBox::BoundingBox()
53 : xl(0), yb(0), xr(0), yt(0)
57 BoundingBox::BoundingBox(string const & bb)
58 : xl(0), yb(0), xr(0), yt(0)
63 std::istringstream is(bb.c_str());
65 is >> a >> b >> c >> d;
67 // inBP returns the length in Postscript points.
68 // Note further that there are 72 Postscript pixels per inch.
69 int const xl_tmp = abs(LyXLength(a).inBP());
70 int const yb_tmp = abs(LyXLength(b).inBP());
71 int const xr_tmp = abs(LyXLength(c).inBP());
72 int const yt_tmp = abs(LyXLength(d).inBP());
74 if (xr_tmp <= xl_tmp || yt_tmp <= yb_tmp)
84 bool BoundingBox::empty() const
86 return (!xl && !yb && !xr && !yt);
90 bool operator==(BoundingBox const & a, BoundingBox const & b)
92 return (a.xl == b.xl &&
99 bool operator!=(BoundingBox const & a, BoundingBox const & b)