2002-02-27 09:59:52 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
|
|
|
* \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
|
|
|
*
|
2002-12-01 22:59:25 +00:00
|
|
|
* \author Angus Leeming
|
2002-09-05 11:31:30 +00:00
|
|
|
*
|
2002-09-05 14:10:50 +00:00
|
|
|
* Full author contact details are available in file CREDITS
|
2002-02-27 09:59:52 +00:00
|
|
|
*
|
2003-07-21 21:30:57 +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"
|
2002-02-27 09:59:52 +00:00
|
|
|
#include "LString.h"
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
*/
|
|
|
|
struct BoundingBox {
|
|
|
|
///
|
|
|
|
BoundingBox();
|
|
|
|
///
|
|
|
|
BoundingBox(string const &);
|
|
|
|
|
|
|
|
/// 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 &);
|
|
|
|
|
2002-06-28 11:22:56 +00:00
|
|
|
struct Params
|
2002-02-27 09:59:52 +00:00
|
|
|
{
|
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.
|
|
|
|
string filename;
|
|
|
|
|
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
|