]> git.lyx.org Git - lyx.git/blob - src/frontends/CaretGeometry.h
Fix bug #12772
[lyx.git] / src / frontends / CaretGeometry.h
1 // -*- C++ -*-
2 /**
3  * \file CaretGeometry.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Jean-Marc Lasgouttes
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef CARETGEOMETRY_H
13 #define CARETGEOMETRY_H
14
15 #include "Dimension.h"
16
17 #include <list>
18 #include <vector>
19
20 namespace lyx {
21
22 namespace frontend {
23
24 /**
25  * CaretGeometry - Data for painting the caret
26  */
27 struct CaretGeometry {
28         ///
29         int height() const { return bottom - top; }
30         ///
31         int width() const { return right - left; }
32
33         // A polygon
34         typedef std::vector<Point> Shape;
35         // several polygons
36         typedef std::list<Shape> Shapes;
37         // data for pointer
38         Shapes shapes;
39         // left-most abcissa
40         int left = 0;
41         // right-most abcissa
42         int right = 0;
43         // top value
44         int top = 0;
45         // bottom value
46         int bottom = 0;
47 };
48
49 } // namespace frontend
50 } // namespace lyx
51
52 #endif // CARETGEOMETRY_H