]> git.lyx.org Git - lyx.git/blob - src/Box.cpp
rename MathArray into MathData
[lyx.git] / src / Box.cpp
1 /**
2  * \file Box.cpp
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author John Levon
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 // Code moved out of line and out of Box.h by Angus (7 Jan 2002)
12
13 #include <config.h>
14
15 #include "Box.h"
16
17 #include "support/std_ostream.h"
18
19
20 namespace lyx {
21
22 using std::ostream;
23
24
25 Box::Box()
26         : x1(0), x2(0), y1(0), y2(0)
27 {}
28
29
30 Box::Box(int x1_, int x2_, int y1_, int y2_)
31         : x1(x1_), x2(x2_), y1(y1_), y2(y2_)
32 {}
33
34
35 bool Box::contains(int x, int y)
36 {
37         return (x1 < x && x2 > x && y1 < y && y2 > y);
38 }
39
40
41 ostream & operator<<(ostream & os, Box const & b)
42 {
43         return os << "x1,y1: " << b.x1 << ',' << b.y1
44                  << " x2,y2: " << b.x2 << ',' << b.y2
45                  << std::endl;
46 }
47
48
49 } // namespace lyx