]> git.lyx.org Git - features.git/blob - src/graphics/GraphicsParams.h
move a comment and an #include
[features.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  *  Only a subset of InsetGraphicsParams is needed for display purposes.
11  *  The GraphicsParams c-tor also interrogates lyxrc to ascertain whether
12  *  to display or not.
13  */
14
15 #ifndef GRAPHICSPARAMS_H
16 #define GRAPHICSPARAMS_H
17
18 #ifdef __GNUG__
19 #pragma interface
20 #endif
21
22 #include "LString.h"
23
24
25 namespace grfx {
26
27 /** Parse a string of the form "200pt 500pt 300mm 5in" into a
28  *  usable bounding box.
29  */
30 struct BoundingBox {
31         ///
32         BoundingBox();
33         ///
34         BoundingBox(string const &);
35
36         /// 0 0 0 0 is empty!
37         bool empty() const;
38
39         int xl;
40         int yb;
41         int xr;
42         int yt;
43 };
44
45 bool operator==(BoundingBox const &, BoundingBox const &);
46 bool operator!=(BoundingBox const &, BoundingBox const &);
47
48 struct GParams
49 {
50         GParams();
51
52         /// How is the image to be displayed on the LyX screen?
53         enum DisplayType {
54                 COLOR,
55                 GRAYSCALE,
56                 MONOCHROME,
57                 /// We aren't going to display it at all!
58                 NONE
59         };
60
61         DisplayType display;
62
63         /// The image filename.
64         string filename;
65
66         /** Note that the BoundingBox is always relative to the BoundingBox
67          *  as stored in the EPS file.
68          *  Ie, bb.xl and bb.yb == 0 if that corner is not moved.
69          */
70         BoundingBox bb;
71
72         /** The size of the view inside lyx in pixels or the scaling of the
73          *  image.
74          */
75         unsigned int width;
76         unsigned int height;
77         unsigned int scale;
78
79         /// Rotation angle.
80         int angle;
81 };
82
83 bool operator==(GParams const &, GParams const &);
84 bool operator!=(GParams const &, GParams const &);
85
86 } // namespace grfx
87
88 #endif // GRAPHICSPARAMS_H