]> git.lyx.org Git - lyx.git/blob - src/graphics/GraphicsParams.h
redraw fix 1.
[lyx.git] / src / graphics / GraphicsParams.h
1 // -*- C++ -*-
2 /**
3  *  \file GraphicsParams.h
4  *  Copyright 2002 the LyX Team
5  *  Read the file COPYING
6  *
7  *  \author Angus Leeming <a.leeming@ic.ac.uk>
8  *
9  *  Used internally by the GraphicsCache.
10  */
11
12 #ifndef GRAPHICSPARAMS_H
13 #define GRAPHICSPARAMS_H
14
15 #ifdef __GNUG__
16 #pragma interface
17 #endif
18
19 #include "GraphicsTypes.h"
20 #include "LString.h"
21
22
23 namespace grfx {
24
25 /** Parse a string of the form "200pt 500pt 300mm 5in" into a
26  *  usable bounding box.
27  */
28 struct BoundingBox {
29         ///
30         BoundingBox();
31         ///
32         BoundingBox(string const &);
33
34         /// 0 0 0 0 is empty!
35         bool empty() const;
36
37         int xl;
38         int yb;
39         int xr;
40         int yt;
41 };
42
43 bool operator==(BoundingBox const &, BoundingBox const &);
44 bool operator!=(BoundingBox const &, BoundingBox const &);
45
46 struct Params
47 {
48         Params();
49
50         DisplayType display;
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         unsigned int width;
65         unsigned int height;
66         unsigned int scale;
67
68         /// Rotation angle.
69         int angle;
70 };
71
72 bool operator==(Params const &, Params const &);
73 bool operator!=(Params const &, Params const &);
74
75 } // namespace grfx
76
77 #endif // GRAPHICSPARAMS_H