]> git.lyx.org Git - lyx.git/blob - src/box.h
copy some code over to allow work to start on prefs
[lyx.git] / src / box.h
1 // -*- C++ -*-
2 /**
3  * \file box.h
4  * Copyright 2001 the LyX Team
5  * Read the file COPYING
6  *
7  * \author John Levon <moz@compsoc.man.ac.uk>
8  */
9
10 #ifndef BOX_H
11 #define BOX_H
12
13 #include <iosfwd>
14
15 /**
16  * A simple class representing rectangular regions.
17  * It is expected that the box be constructed in
18  * normalised form, that is to say : x1,y1 is top-left,
19  * x2,y2 is bottom-right.
20  *
21  * Negative values are allowed.
22  */
23 struct Box {
24         int x1;
25         int x2;
26         int y1;
27         int y2;
28
29         /// Initialise the member variables.
30         Box(int x1_, int x2_, int y1_, int y2_);
31
32         /**
33          * Returns true if the given co-ordinates are within
34          * the box. Check is exclusive (point on a border
35          * returns false).
36          */
37         bool contained(int x, int y);
38 };
39
40
41 std::ostream & operator<<(std::ostream &, Box const &);
42
43 #endif // BOX_H