]> git.lyx.org Git - lyx.git/blob - src/graphics/GraphicsParams.h
98fc614fdbb9c44357b8f45b31dd5762a3c3af59
[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 lyx::graphics::Image.
12  */
13
14 #ifndef GRAPHICSPARAMS_H
15 #define GRAPHICSPARAMS_H
16
17 #include "GraphicsTypes.h"
18 #include "LString.h"
19
20
21 namespace lyx {
22 namespace graphics {
23
24 /** Parse a string of the form "200pt 500pt 300mm 5in" into a
25  *  usable bounding box.
26  */
27 struct BoundingBox {
28         ///
29         BoundingBox();
30         ///
31         BoundingBox(string const &);
32
33         /// 0 0 0 0 is empty!
34         bool empty() const;
35
36         unsigned int xl;
37         unsigned int yb;
38         unsigned int xr;
39         unsigned int yt;
40 };
41
42 bool operator==(BoundingBox const &, BoundingBox const &);
43 bool operator!=(BoundingBox const &, BoundingBox const &);
44
45 struct Params
46 {
47         Params();
48
49         DisplayType display;
50         unsigned int scale;
51
52         /// The image filename.
53         string filename;
54
55         /** Note that the BoundingBox is always relative to the BoundingBox
56          *  as stored in the EPS file.
57          *  Ie, bb.xl and bb.yb == 0 if that corner is not moved.
58          */
59         BoundingBox bb;
60
61         /** The size of the view inside lyx in pixels or the scaling of the
62          *  image.
63          */
64         /// Rotation angle.
65         float angle;
66 };
67
68 bool operator==(Params const &, Params const &);
69 bool operator!=(Params const &, Params const &);
70
71 } // namespace graphics
72 } // namespace lyx
73
74 #endif // GRAPHICSPARAMS_H