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),
30 keepLyXAspectRatio(false),
35 bool operator==(Params const & a, Params const & b)
37 return (a.filename == b.filename &&
38 a.display == b.display &&
41 a.height == b.height &&
43 a.keepLyXAspectRatio == b.keepLyXAspectRatio &&
48 bool operator!=(Params const & a, Params const & b)
54 BoundingBox::BoundingBox()
55 : xl(0), yb(0), xr(0), yt(0)
59 BoundingBox::BoundingBox(string const & bb)
60 : xl(0), yb(0), xr(0), yt(0)
65 std::istringstream is(bb.c_str());
67 is >> a >> b >> c >> d;
69 // inBP returns the length in Postscript points.
70 // Note further that there are 72 Postscript pixels per inch.
71 int const xl_tmp = abs(LyXLength(a).inBP());
72 int const yb_tmp = abs(LyXLength(b).inBP());
73 int const xr_tmp = abs(LyXLength(c).inBP());
74 int const yt_tmp = abs(LyXLength(d).inBP());
76 if (xr_tmp <= xl_tmp || yt_tmp <= yb_tmp)
86 bool BoundingBox::empty() const
88 return (!xl && !yb && !xr && !yt);
92 bool operator==(BoundingBox const & a, BoundingBox const & b)
94 return (a.xl == b.xl &&
101 bool operator!=(BoundingBox const & a, BoundingBox const & b)