diff options
author | Guilherme Iscaro <iscaro@profusion.mobi> | 2016-09-20 12:10:08 -0300 |
---|---|---|
committer | Bruno Dilly <bdilly@profusion.mobi> | 2016-09-26 22:06:59 -0300 |
commit | 72c80ca947bbadd8747fe85c5911ad0bfe28f03e (patch) | |
tree | d67ca600e31a96f309ea0c7f88f12af216a862c5 | |
parent | 8acb509fbacbc99e190b0dc74719c2860989ce74 (diff) | |
download | efl-72c80ca947bbadd8747fe85c5911ad0bfe28f03e.tar.gz |
Evas_Device: Add a new event for added and removed devices.
This commits adds two event types for EFL_CANVAS. Every time
a device is added or removed the matching event will be emitted.
-rw-r--r-- | src/lib/efl/interfaces/efl_canvas.eo | 2 | ||||
-rw-r--r-- | src/lib/evas/canvas/evas_device.c | 4 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/lib/efl/interfaces/efl_canvas.eo b/src/lib/efl/interfaces/efl_canvas.eo index 7df573f71e..e0eba6a2c0 100644 --- a/src/lib/efl/interfaces/efl_canvas.eo +++ b/src/lib/efl/interfaces/efl_canvas.eo @@ -155,5 +155,7 @@ interface Efl.Canvas () render,pre; render,post; device,changed: Efl.Input.Device; + device,added: Efl.Input.Device; + device,removed: Efl.Input.Device; } } diff --git a/src/lib/evas/canvas/evas_device.c b/src/lib/evas/canvas/evas_device.c index 7fc8272340..598cee1cec 100644 --- a/src/lib/evas/canvas/evas_device.c +++ b/src/lib/evas/canvas/evas_device.c @@ -31,6 +31,8 @@ _del_cb(void *data, const Efl_Event *ev) // can not be done in std destructor e->devices = eina_list_remove(e->devices, ev->object); + efl_event_callback_call(e->evas, EFL_CANVAS_EVENT_DEVICE_REMOVED, + ev->object); } EAPI Evas_Device * @@ -68,6 +70,8 @@ evas_device_full_add(Evas *eo_e, const char *name, const char *desc, e->devices = eina_list_append(e->devices, dev); efl_event_callback_add(dev, EFL_EVENT_DEL, _del_cb, e); + efl_event_callback_call(eo_e, EFL_CANVAS_EVENT_DEVICE_ADDED, dev); + // Keeping this event to do not break things... evas_event_callback_call(eo_e, EVAS_CALLBACK_DEVICE_CHANGED, dev); return dev; |