Merge branch '4479_console_players'
[midnight-commander.git] / lib / widget / rect.h
blobca85968b3fb14756462c6dcdf976d52898477eb3
2 /** \file rect.h
3 * \brief Header: rectangular class
4 */
6 #ifndef MC__WIDGET_RECT_H
7 #define MC__WIDGET_RECT_H
9 /*** typedefs (not structures) and defined constants *********************************************/
11 #define RECT(x) ((WRect *)(x))
12 #define CONST_RECT(x) ((const WRect *)(x))
14 /*** enums ***************************************************************************************/
16 /*** structures declarations (and typedefs of structures) ****************************************/
18 struct WRect;
19 typedef struct WRect WRect;
21 struct WRect
23 int y;
24 int x;
25 int lines;
26 int cols;
29 /*** global variables defined in .c file *********************************************************/
31 /*** declarations of public functions ************************************************************/
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);
43 /*** inline functions ****************************************************************************/
45 #endif /* MC__WIDGET_RECT_H */