]> git.lyx.org Git - lyx.git/blob - src/graphics/GraphicsParams.h
Purely mechanical: move fragile into LatexRunParams.
[lyx.git] / src / graphics / GraphicsParams.h
1 // -*- C++ -*-
2 /**
3  *  \file GraphicsParams.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  *  \author Angus Leeming
8  *
9  * Full author contact details are available in file CREDITS
10  *
11  *  Used internally by the grfx::Image.
12  */
13
14 #ifndef GRAPHICSPARAMS_H
15 #define GRAPHICSPARAMS_H
16
17 #include "GraphicsTypes.h"
18 #include "LString.h"
19
20
21 namespace grfx {
22
23 /** Parse a string of the form "200pt 500pt 300mm 5in" into a
24  *  usable bounding box.
25  */
26 struct BoundingBox {
27         ///
28         BoundingBox();
29         ///
30         BoundingBox(string const &);
31
32         /// 0 0 0 0 is empty!
33         bool empty() const;
34
35         unsigned int xl;
36         unsigned int yb;
37         unsigned int xr;
38         unsigned int yt;
39 };
40
41 bool operator==(BoundingBox const &, BoundingBox const &);
42 bool operator!=(BoundingBox const &, BoundingBox const &);
43
44 struct Params
45 {
46         Params();
47
48         DisplayType display;
49         unsigned int scale;
50
51         /// The image filename.
52         string filename;
53
54         /** Note that the BoundingBox is always relative to the BoundingBox
55          *  as stored in the EPS file.
56          *  Ie, bb.xl and bb.yb == 0 if that corner is not moved.
57          */
58         BoundingBox bb;
59
60         /** The size of the view inside lyx in pixels or the scaling of the
61          *  image.
62          */
63         /// Rotation angle.
64         float angle;
65 };
66
67 bool operator==(Params const &, Params const &);
68 bool operator!=(Params const &, Params const &);
69
70 } // namespace grfx
71
72 #endif // GRAPHICSPARAMS_H