]> git.lyx.org Git - lyx.git/blob - src/graphics/GraphicsParams.h
Switch from SigC signals to boost::signals
[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 "LString.h"
20
21
22 namespace grfx {
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         int xl;
37         int yb;
38         int xr;
39         int yt;
40 };
41
42 bool operator==(BoundingBox const &, BoundingBox const &);
43 bool operator!=(BoundingBox const &, BoundingBox const &);
44
45 struct GParams
46 {
47         GParams();
48
49         /// How is the image to be displayed on the LyX screen?
50         enum DisplayType {
51                 COLOR,
52                 GRAYSCALE,
53                 MONOCHROME,
54                 /// We aren't going to display it at all!
55                 NONE
56         };
57
58         DisplayType display;
59
60         /// The image filename.
61         string filename;
62
63         /** Note that the BoundingBox is always relative to the BoundingBox
64          *  as stored in the EPS file.
65          *  Ie, bb.xl and bb.yb == 0 if that corner is not moved.
66          */
67         BoundingBox bb;
68
69         /** The size of the view inside lyx in pixels or the scaling of the
70          *  image.
71          */
72         unsigned int width;
73         unsigned int height;
74         unsigned int scale;
75
76         /// Rotation angle.
77         int angle;
78 };
79
80 bool operator==(GParams const &, GParams const &);
81 bool operator!=(GParams const &, GParams const &);
82
83 } // namespace grfx
84
85 #endif // GRAPHICSPARAMS_H