elput: Add API function to set max allowed pointer position

This patch adds an API function that can be used to restrict mouse
movement from going outside a screen

@feature

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
This commit is contained in:
Chris Michael 2016-05-10 15:12:53 -04:00
parent 3954aa5518
commit fa5abb2967
2 changed files with 29 additions and 0 deletions

View File

@ -297,6 +297,18 @@ EAPI void elput_input_pointer_xy_set(Elput_Manager *manager, const char *seat, i
*/
EAPI const Eina_List *elput_input_devices_get(Elput_Seat *seat);
/**
* Set the maximum position of any existing mouse pointers
*
* @param manager
* @param maxw
* @param maxh
*
* @ingroup Elput_Input_Group
* @since 1.18
*/
EAPI void elput_input_pointer_max_set(Elput_Manager *manager, int maxw, int maxh);
/**
* @defgroup Elput_Device_Group
*

View File

@ -338,3 +338,20 @@ elput_input_devices_get(Elput_Seat *seat)
EINA_SAFETY_ON_NULL_RETURN_VAL(seat, NULL);
return seat->devices;
}
EAPI void
elput_input_pointer_max_set(Elput_Manager *manager, int maxw, int maxh)
{
Eina_List *l;
Elput_Seat *eseat;
EINA_SAFETY_ON_NULL_RETURN(manager);
EINA_LIST_FOREACH(manager->input.seats, l, eseat)
{
if (!eseat->ptr) continue;
eseat->ptr->maxw = maxw;
eseat->ptr->maxh = maxh;
}
}