BOOL WINAPI PtInRegion( HRGN hrgn, INT x, INT y ) { MWRGNOBJ * obj; obj = (MWRGNOBJ *) GDI_GetObjPtr( hrgn, OBJ_REGION ); if(!obj) return FALSE; return GdPtInRegion(obj->rgn, x, y); }
/* * Find the window which is currently visible for the specified coordinates. * This just walks down the window tree looking for the deepest mapped * window which contains the specified point. If the coordinates are * off the screen, the root window is returned. */ GR_WINDOW * GsFindVisibleWindow(GR_COORD x, GR_COORD y) { GR_WINDOW *wp; /* current window */ GR_WINDOW *retwp; /* returned window */ wp = rootwp; retwp = wp; while (wp) { if (wp->realized && ((!wp->clipregion && (wp->x <= x) && (wp->y <= y) && (wp->x + wp->width > x) && (wp->y + wp->height > y)) || (wp->clipregion && GdPtInRegion(wp->clipregion, x - wp->x, y - wp->y)))) { retwp = wp; wp = wp->children; continue; } wp = wp->siblings; } return retwp; }