]> git.lyx.org Git - lyx.git/blob - src/graphics/GraphicsParams.h
Properly resolve more warnings about comparison between signed and
[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  *  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 #include "lyxlength.h"
24
25 class InsetGraphicsParams;
26
27 namespace grfx {
28
29 /** Parse a string of the form "200pt 500pt 300mm 5in" into a
30  *  usable bounding box.
31  */
32 struct BoundingBox {
33         ///
34         BoundingBox();
35         ///
36         BoundingBox(string const &);
37
38         /// 0 0 0 0 is empty!
39         bool empty() const;
40         ///
41         int xl;
42         int yb;
43         int xr;
44         int yt;
45 };
46
47 ///
48 bool operator==(BoundingBox const &, BoundingBox const &);
49 ///
50 bool operator!=(BoundingBox const &, BoundingBox const &);
51
52 struct GParams 
53 {
54         /// 
55         GParams(InsetGraphicsParams const &);
56
57         /// How is the image to be displayed on the LyX screen?
58         enum DisplayType {
59                 ///
60                 COLOR,
61                 ///
62                 GRAYSCALE,
63                 ///
64                 MONOCHROME,
65                 /// We aren't going to display it at all!
66                 NONE
67         };
68
69         ///
70         DisplayType display;
71
72         /// The image filename.
73         string filename;
74
75         ///
76         BoundingBox bb;
77
78         /** The size of the view inside lyx in pixels or the scaling of the
79          *  image.
80          */
81         unsigned int width;
82         ///
83         unsigned int height;
84         /// 
85         unsigned int scale;
86
87         /// Rotation angle.
88         int angle;
89 };
90
91 ///
92 bool operator==(GParams const &, GParams const &);
93 ///
94 bool operator!=(GParams const &, GParams const &);
95
96 } // namespace grfx
97
98 #endif // GRAPHICSPARAMS_H