12 is_in_box(struct box
*box
, int x
, int y
)
14 return (x
>= box
->x
&& y
>= box
->y
15 && x
< box
->x
+ box
->width
16 && y
< box
->y
+ box
->height
);
20 row_is_in_box(struct box
*box
, int y
)
22 return (y
>= box
->y
&& y
< box
->y
+ box
->height
);
26 col_is_in_box(struct box
*box
, int x
)
28 return (x
>= box
->x
&& x
< box
->x
+ box
->width
);
31 /* Mainly intended for use with double-width characters. */
33 colspan_is_in_box(struct box
*box
, int x
, int span
)
35 return (x
>= box
->x
&& x
+ span
<= box
->x
+ box
->width
);
40 set_box(struct box
*box
, int x
, int y
, int width
, int height
)
49 copy_box(struct box
*dst
, struct box
*src
)
51 copy_struct(dst
, src
);
54 #define dbg_show_box(box) DBG("x=%i y=%i width=%i height=%i", (box)->x, (box)->y, (box)->width, (box)->height)
55 #define dbg_show_xy(x_, y_) DBG("x=%i y=%i", x_, y_)