2002-02-27 09:59:52 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
2003-08-23 00:17:00 +00:00
|
|
|
* \file GraphicsParams.h
|
2002-09-05 15:14:23 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
2002-02-27 09:59:52 +00:00
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
* \author Angus Leeming
|
2002-09-05 11:31:30 +00:00
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
* Full author contact details are available in file CREDITS.
|
2002-02-27 09:59:52 +00:00
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
* Used internally by the lyx::graphics::Image.
|
2002-02-27 09:59:52 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef GRAPHICSPARAMS_H
|
|
|
|
#define GRAPHICSPARAMS_H
|
|
|
|
|
2002-06-26 14:15:08 +00:00
|
|
|
#include "GraphicsTypes.h"
|
2003-10-06 15:43:21 +00:00
|
|
|
|
|
|
|
#include <string>
|
2003-09-29 21:42:13 +00:00
|
|
|
#include <iosfwd>
|
2002-02-27 09:59:52 +00:00
|
|
|
|
|
|
|
|
2003-07-04 08:23:23 +00:00
|
|
|
namespace lyx {
|
|
|
|
namespace graphics {
|
2002-02-27 09:59:52 +00:00
|
|
|
|
|
|
|
/** Parse a string of the form "200pt 500pt 300mm 5in" into a
|
|
|
|
* usable bounding box.
|
|
|
|
*/
|
2005-01-19 15:03:31 +00:00
|
|
|
class BoundingBox {
|
|
|
|
public:
|
2002-02-27 09:59:52 +00:00
|
|
|
///
|
|
|
|
BoundingBox();
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
BoundingBox(std::string const &);
|
2002-02-27 09:59:52 +00:00
|
|
|
|
|
|
|
/// 0 0 0 0 is empty!
|
|
|
|
bool empty() const;
|
2002-02-28 11:50:42 +00:00
|
|
|
|
2002-08-24 22:02:30 +00:00
|
|
|
unsigned int xl;
|
|
|
|
unsigned int yb;
|
|
|
|
unsigned int xr;
|
|
|
|
unsigned int yt;
|
2002-02-27 09:59:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
bool operator==(BoundingBox const &, BoundingBox const &);
|
|
|
|
bool operator!=(BoundingBox const &, BoundingBox const &);
|
|
|
|
|
2003-09-29 21:42:13 +00:00
|
|
|
std::ostream & operator<<(std::ostream &, BoundingBox const &);
|
|
|
|
|
|
|
|
|
2005-01-19 15:03:31 +00:00
|
|
|
class Params
|
2002-02-27 09:59:52 +00:00
|
|
|
{
|
2005-01-19 15:03:31 +00:00
|
|
|
public:
|
2002-06-28 11:22:56 +00:00
|
|
|
Params();
|
2002-02-27 09:59:52 +00:00
|
|
|
|
|
|
|
DisplayType display;
|
2002-08-24 22:02:30 +00:00
|
|
|
unsigned int scale;
|
2002-02-27 09:59:52 +00:00
|
|
|
|
|
|
|
/// The image filename.
|
2003-10-06 15:43:21 +00:00
|
|
|
std::string filename;
|
2002-02-27 09:59:52 +00:00
|
|
|
|
2002-04-08 16:51:46 +00:00
|
|
|
/** Note that the BoundingBox is always relative to the BoundingBox
|
|
|
|
* as stored in the EPS file.
|
|
|
|
* Ie, bb.xl and bb.yb == 0 if that corner is not moved.
|
|
|
|
*/
|
2002-02-27 09:59:52 +00:00
|
|
|
BoundingBox bb;
|
|
|
|
|
|
|
|
/** The size of the view inside lyx in pixels or the scaling of the
|
|
|
|
* image.
|
|
|
|
*/
|
|
|
|
/// Rotation angle.
|
2002-08-24 22:02:30 +00:00
|
|
|
float angle;
|
2002-02-27 09:59:52 +00:00
|
|
|
};
|
|
|
|
|
2002-06-28 11:22:56 +00:00
|
|
|
bool operator==(Params const &, Params const &);
|
|
|
|
bool operator!=(Params const &, Params const &);
|
2002-02-27 09:59:52 +00:00
|
|
|
|
2003-07-04 08:23:23 +00:00
|
|
|
} // namespace graphics
|
|
|
|
} // namespace lyx
|
2002-02-27 09:59:52 +00:00
|
|
|
|
|
|
|
#endif // GRAPHICSPARAMS_H
|