]> git.lyx.org Git - lyx.git/blob - src/graphics/GraphicsParams.h
partial framebox support
[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 <leeming@lyx.org>
8  *
9  *  Used internally by the grfx::Image.
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         unsigned int xl;
38         unsigned int yb;
39         unsigned int xr;
40         unsigned 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         unsigned int scale;
52
53         /// The image filename.
54         string filename;
55
56         /** Note that the BoundingBox is always relative to the BoundingBox
57          *  as stored in the EPS file.
58          *  Ie, bb.xl and bb.yb == 0 if that corner is not moved.
59          */
60         BoundingBox bb;
61
62         /** The size of the view inside lyx in pixels or the scaling of the
63          *  image.
64          */
65         /// Rotation angle.
66         float angle;
67 };
68
69 bool operator==(Params const &, Params const &);
70 bool operator!=(Params const &, Params const &);
71
72 } // namespace grfx
73
74 #endif // GRAPHICSPARAMS_H