aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/evas/canvas/evas_device.c
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2017-05-18 11:36:55 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2017-05-19 13:17:31 -0400
commitd47197e65b59406e0f25c5a4db56e68da61bec30 (patch)
tree5bf3a646f14643aa49f69bad2d5f8fe4d5ec74e3 /src/lib/evas/canvas/evas_device.c
parentecore-wl2: block key->string translation when appropriate (diff)
downloadefl-d47197e65b59406e0f25c5a4db56e68da61bec30.tar.gz
evas: add evas_device_get_by_seat_id()
sometimes it may be more useful to find a device by its hw id @feature
Diffstat (limited to 'src/lib/evas/canvas/evas_device.c')
-rw-r--r--src/lib/evas/canvas/evas_device.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/lib/evas/canvas/evas_device.c b/src/lib/evas/canvas/evas_device.c
index 3d63a4c7c1..2e7763aa1c 100644
--- a/src/lib/evas/canvas/evas_device.c
+++ b/src/lib/evas/canvas/evas_device.c
@@ -122,6 +122,29 @@ evas_device_get(Evas *eo_e, const char *name)
}
EAPI Evas_Device *
+evas_device_get_by_seat_id(Evas *eo_e, unsigned int id)
+{
+ unsigned int seat_id;
+ Evas_Public_Data *e;
+ Evas_Device *dev;
+ Eina_List *l;
+
+ SAFETY_CHECK(eo_e, EVAS_CANVAS_CLASS, NULL);
+
+ e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
+
+ EINA_LIST_FOREACH(e->devices, l, dev)
+ {
+ seat_id = efl_input_device_seat_id_get(dev);
+
+ if (seat_id == id)
+ return dev;
+ }
+
+ return NULL;
+}
+
+EAPI Evas_Device *
evas_device_add(Evas *eo_e)
{
return evas_device_add_full(eo_e, NULL, NULL, NULL, NULL,