]> git.lyx.org Git - lyx.git/blob - src/box.h
Add a Buffer::fully_loaded member function, returning true only when
[lyx.git] / src / box.h
1 // -*- C++ -*-
2 /**
3  * \file box.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author John Levon
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef BOX_H
13 #define BOX_H
14
15 #include <iosfwd>
16
17 /**
18  * A simple class representing rectangular regions.
19  * It is expected that the box be constructed in
20  * normalised form, that is to say : x1,y1 is top-left,
21  * x2,y2 is bottom-right.
22  *
23  * Negative values are allowed.
24  */
25 struct Box {
26         int x1;
27         int x2;
28         int y1;
29         int y2;
30
31         /// Zero-initialise the member variables.
32         Box();
33         /// Initialise the member variables.
34         Box(int x1_, int x2_, int y1_, int y2_);
35
36         /**
37          * Returns true if the given co-ordinates are within
38          * the box. Check is exclusive (point on a border
39          * returns false).
40          */
41         bool contains(int x, int y);
42 };
43
44
45 std::ostream & operator<<(std::ostream &, Box const &);
46
47 #endif // BOX_H