eis: expose eis_region_contains

Same as the libei function, there's a use-case for this especially when
dealing with receiver contexts. libei filters those but we can't rely on
that in the server so using this is a workaround.
This commit is contained in:
Peter Hutterer 2023-06-06 09:58:16 +10:00
parent fc79982682
commit b5f0899352
3 changed files with 9 additions and 4 deletions

View file

@ -132,7 +132,7 @@ eis_region_add(struct eis_region *region)
eis_device_unref(region->device);
}
bool
_public_ bool
eis_region_contains(struct eis_region *r, double x, double y)
{
return (x >= r->x && x < r->x + r->width &&

View file

@ -39,6 +39,3 @@ struct eis_region {
uint32_t width, height;
double physical_scale;
};
bool
eis_region_contains(struct eis_region *r, double x, double y);

View file

@ -1007,6 +1007,14 @@ eis_region_get_height(struct eis_region *region);
double
eis_region_get_physical_scale(struct eis_region *region);
/**
* @ingroup libeis-region
*
* @see ei_region_contains
*/
bool
eis_region_contains(struct eis_region *region, double x, double y);
/**
* @ingroup libeis-device
*