summaryrefslogtreecommitdiff
path: root/src/lib/elput
diff options
context:
space:
mode:
authorChris Michael <cpmichael@osg.samsung.com>2016-05-04 10:20:04 -0400
committerChris Michael <cpmichael@osg.samsung.com>2016-05-04 10:20:04 -0400
commit28f725a6875951c0500d22c5bca9a393d77507d7 (patch)
tree4a8f42a54f20d0d37a42e9b067455869ae788c39 /src/lib/elput
parent6a237f3cca3c62b1c05035e532a7abbc790b7cbb (diff)
elput: Add API function to get pointer position on a given seat
Small patch to add an API function that can be used to retrieve current pointer position on a given seat name. @feature Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
Diffstat (limited to 'src/lib/elput')
-rw-r--r--src/lib/elput/Elput.h13
-rw-r--r--src/lib/elput/elput_input.c25
2 files changed, 38 insertions, 0 deletions
diff --git a/src/lib/elput/Elput.h b/src/lib/elput/Elput.h
index d629dd4ca2..beee6775ed 100644
--- a/src/lib/elput/Elput.h
+++ b/src/lib/elput/Elput.h
@@ -227,6 +227,19 @@ EAPI Eina_Bool elput_input_init(Elput_Manager *manager, const char *seat);
227EAPI void elput_input_shutdown(Elput_Manager *manager); 227EAPI void elput_input_shutdown(Elput_Manager *manager);
228 228
229/** 229/**
230 * Get the pointer position on a given seat
231 *
232 * @param manager
233 * @param seat
234 * @param x
235 * @param y
236 *
237 * @ingroup Elput_Input_Group
238 * @since 1.18
239 */
240EAPI void elput_input_pointer_xy_get(Elput_Manager *manager, const char *seat, int *x, int *y);
241
242/**
230 * @defgroup Elput_Device_Group 243 * @defgroup Elput_Device_Group
231 * 244 *
232 * Functions that deal with input devices. 245 * Functions that deal with input devices.
diff --git a/src/lib/elput/elput_input.c b/src/lib/elput/elput_input.c
index 6c43f2f03d..c6d22cbf14 100644
--- a/src/lib/elput/elput_input.c
+++ b/src/lib/elput/elput_input.c
@@ -275,3 +275,28 @@ elput_input_shutdown(Elput_Manager *manager)
275 275
276 libinput_unref(manager->input.lib); 276 libinput_unref(manager->input.lib);
277} 277}
278
279EAPI void
280elput_input_pointer_xy_get(Elput_Manager *manager, const char *seat, int *x, int *y)
281{
282 Elput_Seat *eseat;
283 Eina_List *l;
284
285 if (x) *x = 0;
286 if (y) *y = 0;
287
288 EINA_SAFETY_ON_NULL_RETURN(manager);
289
290 /* if no seat name is passed in, just use default seat name */
291 if (!seat) seat = "seat0";
292
293 EINA_LIST_FOREACH(manager->input.seats, l, eseat)
294 {
295 if (!eseat->ptr) continue;
296 if ((eseat->name) && (strcmp(eseat->name, seat)))
297 continue;
298 if (x) *x = eseat->ptr->x;
299 if (y) *y = eseat->ptr->y;
300 break;
301 }
302}