#include "regions.h" #include "points.h" #include "lists.h" #include int point_in_rect(point_t *pt, rect_t *r) { if (pt->x >= r->left && pt->y >= r->top && pt->x <= r->right && pt->y <= r->bottom) return 1; return 0; } int point_in_rgn(point_t *pt, region_t *rgn) { node_t *n; if ((n = rgn->rects.first) == NULL) return 0; do { if (point_in_rect(pt, &((rect_node_t *)n)->rect)) return 1; n = n->next; } while (n != rgn->rects.first); return 0; }