1
2
3
4
5
6 #ifndef MC__WIDGET_RECT_H
7 #define MC__WIDGET_RECT_H
8
9
10
11 #define RECT(x) ((WRect *)(x))
12 #define CONST_RECT(x) ((const WRect *)(x))
13
14
15
16
17
18 struct WRect;
19 typedef struct WRect WRect;
20
21 struct WRect
22 {
23 int y;
24 int x;
25 int lines;
26 int cols;
27 };
28
29
30
31
32
33 WRect *rect_new (int y, int x, int lines, int cols);
34 void rect_init (WRect * r, int y, int x, int lines, int cols);
35 void rect_move (WRect * r, int dy, int dx);
36 void rect_resize (WRect * r, int dl, int dc);
37 void rect_grow (WRect * r, int dl, int dc);
38 void rect_intersect (WRect * r, const WRect * r1);
39 void rect_union (WRect * r, const WRect * r1);
40 gboolean rects_are_overlapped (const WRect * r1, const WRect * r2);
41 gboolean rects_are_equal (const WRect * r1, const WRect * r2);
42
43
44
45 #endif