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