Example #1
0
gboolean area_is_under_mouse(void *obj, int x, int y)
{
	Area *a = obj;
	if (!a->on_screen || a->width == 0 || a->height == 0)
		return FALSE;

	if (a->_is_under_mouse)
		return a->_is_under_mouse(a, x, y);

	return x >= a->posx && x <= (a->posx + a->width) && y >= a->posy && y <= (a->posy + a->height);
}
Example #2
0
gboolean full_width_area_is_under_mouse(void *obj, int x, int y)
{
	Area *a = obj;
	if (!a->on_screen)
		return FALSE;

	if (a->_is_under_mouse && a->_is_under_mouse != full_width_area_is_under_mouse)
		return a->_is_under_mouse(a, x, y);

	if (panel_horizontal)
		return (x >= a->posx) && (x <= a->posx + a->width);
	else
		return (y >= a->posy) && (y <= a->posy + a->height);
}