jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=21bc2f89f5e932405a63a65f332a0f6d9319c0c3

commit 21bc2f89f5e932405a63a65f332a0f6d9319c0c3
Author: Jean-Philippe Andre <[email protected]>
Date:   Wed May 11 13:55:54 2016 +0900

    ecore_input: Pass all events through direct cb first
    
    Since the direct input event callback returns true if the
    event has been processed, we can easily support legacy and
    progressively implement full support for eo input events.
---
 src/lib/ecore_evas/ecore_evas.c             |  20 ++--
 src/lib/ecore_input_evas/ecore_input_evas.c | 165 ++++++++++++++++++----------
 2 files changed, 120 insertions(+), 65 deletions(-)

diff --git a/src/lib/ecore_evas/ecore_evas.c b/src/lib/ecore_evas/ecore_evas.c
index dc7d1d4..4b11bfd 100644
--- a/src/lib/ecore_evas/ecore_evas.c
+++ b/src/lib/ecore_evas/ecore_evas.c
@@ -4289,61 +4289,61 @@ ecore_evas_psl1ght_new(const char* name, int w, int h)
  */
 
 static Eina_Bool
-_direct_key_down_cb(Ecore_Evas *ee EINA_UNUSED, const Ecore_Event_Key *ev 
EINA_UNUSED)
+_direct_key_down_cb(Ecore_Evas *ee EINA_UNUSED, const Ecore_Event_Key *info 
EINA_UNUSED)
 {
    return EINA_FALSE;
 }
 
 static Eina_Bool
-_direct_key_up_cb(Ecore_Evas *ee EINA_UNUSED, const Ecore_Event_Key *ev 
EINA_UNUSED)
+_direct_key_up_cb(Ecore_Evas *ee EINA_UNUSED, const Ecore_Event_Key *info 
EINA_UNUSED)
 {
    return EINA_FALSE;
 }
 
 static Eina_Bool
-_direct_mouse_down_cb(Ecore_Evas *ee EINA_UNUSED, const 
Ecore_Event_Mouse_Button *ev EINA_UNUSED)
+_direct_mouse_down_cb(Ecore_Evas *ee EINA_UNUSED, const 
Ecore_Event_Mouse_Button *info EINA_UNUSED)
 {
    return EINA_FALSE;
 }
 
 static Eina_Bool
-_direct_mouse_up_cb(Ecore_Evas *ee EINA_UNUSED, const Ecore_Event_Mouse_Button 
*ev EINA_UNUSED)
+_direct_mouse_up_cb(Ecore_Evas *ee EINA_UNUSED, const Ecore_Event_Mouse_Button 
*info EINA_UNUSED)
 {
    return EINA_FALSE;
 }
 
 static Eina_Bool
-_direct_mouse_cancel_cb(Ecore_Evas *ee EINA_UNUSED, const 
Ecore_Event_Mouse_Button *ev EINA_UNUSED)
+_direct_mouse_cancel_cb(Ecore_Evas *ee EINA_UNUSED, const 
Ecore_Event_Mouse_Button *info EINA_UNUSED)
 {
    return EINA_FALSE;
 }
 
 static Eina_Bool
-_direct_mouse_move_cb(Ecore_Evas *ee EINA_UNUSED, const Ecore_Event_Mouse_Move 
*ev EINA_UNUSED)
+_direct_mouse_move_cb(Ecore_Evas *ee EINA_UNUSED, const Ecore_Event_Mouse_Move 
*info EINA_UNUSED)
 {
    return EINA_FALSE;
 }
 
 static Eina_Bool
-_direct_mouse_wheel_cb(Ecore_Evas *ee EINA_UNUSED, const 
Ecore_Event_Mouse_Wheel *ev EINA_UNUSED)
+_direct_mouse_wheel_cb(Ecore_Evas *ee EINA_UNUSED, const 
Ecore_Event_Mouse_Wheel *info EINA_UNUSED)
 {
    return EINA_FALSE;
 }
 
 static Eina_Bool
-_direct_mouse_in_cb(Ecore_Evas *ee EINA_UNUSED, const Ecore_Event_Mouse_IO *ev 
EINA_UNUSED)
+_direct_mouse_in_cb(Ecore_Evas *ee EINA_UNUSED, const Ecore_Event_Mouse_IO 
*info EINA_UNUSED)
 {
    return EINA_FALSE;
 }
 
 static Eina_Bool
-_direct_mouse_out_cb(Ecore_Evas *ee EINA_UNUSED, const Ecore_Event_Mouse_IO 
*ev EINA_UNUSED)
+_direct_mouse_out_cb(Ecore_Evas *ee EINA_UNUSED, const Ecore_Event_Mouse_IO 
*info EINA_UNUSED)
 {
    return EINA_FALSE;
 }
 
 static Eina_Bool
-_direct_axis_update_cb(Ecore_Evas *ee EINA_UNUSED, const 
Ecore_Event_Axis_Update *ev EINA_UNUSED)
+_direct_axis_update_cb(Ecore_Evas *ee EINA_UNUSED, const 
Ecore_Event_Axis_Update *info EINA_UNUSED)
 {
    return EINA_FALSE;
 }
diff --git a/src/lib/ecore_input_evas/ecore_input_evas.c 
b/src/lib/ecore_input_evas/ecore_input_evas.c
index daed66a..df7a851 100644
--- a/src/lib/ecore_input_evas/ecore_input_evas.c
+++ b/src/lib/ecore_input_evas/ecore_input_evas.c
@@ -412,23 +412,36 @@ _ecore_event_evas_key(Ecore_Event_Key *e, 
Ecore_Event_Press press)
    if (!lookup) return ECORE_CALLBACK_PASS_ON;
    ecore_event_evas_modifier_lock_update(lookup->evas, e->modifiers);
    if (press == ECORE_DOWN)
-     evas_event_feed_key_down_with_keycode(lookup->evas,
-                                           e->keyname,
-                                           e->key,
-                                           e->string,
-                                           e->compose,
-                                           e->timestamp,
-                                           e->data,
-                                           e->keycode);
+     {
+        if (!lookup->direct ||
+            !lookup->direct(lookup->window, ECORE_EVENT_KEY_DOWN, e))
+          {
+             evas_event_feed_key_down_with_keycode(lookup->evas,
+                                                   e->keyname,
+                                                   e->key,
+                                                   e->string,
+                                                   e->compose,
+                                                   e->timestamp,
+                                                   e->data,
+                                                   e->keycode);
+          }
+     }
    else
-     evas_event_feed_key_up_with_keycode(lookup->evas,
-                                         e->keyname,
-                                         e->key,
-                                         e->string,
-                                         e->compose,
-                                         e->timestamp,
-                                         e->data,
-                                         e->keycode);
+     {
+        if (!lookup->direct ||
+            !lookup->direct(lookup->window, ECORE_EVENT_KEY_DOWN, e))
+          {
+             evas_event_feed_key_up_with_keycode(lookup->evas,
+                                                 e->keyname,
+                                                 e->key,
+                                                 e->string,
+                                                 e->compose,
+                                                 e->timestamp,
+                                                 e->data,
+                                                 e->keycode);
+          }
+     }
+
    return ECORE_CALLBACK_PASS_ON;
 }
 
@@ -443,7 +456,11 @@ 
_ecore_event_evas_mouse_button_cancel(Ecore_Event_Mouse_Button *e)
    if (!lookup) return ECORE_CALLBACK_PASS_ON;
 
    INF("ButtonEvent cancel, device(%d), button(%d)", e->multi.device, 
e->buttons);
-   evas_event_feed_mouse_cancel(lookup->evas, e->timestamp, NULL);
+   if (!lookup->direct ||
+       !lookup->direct(lookup->window, ECORE_EVENT_MOUSE_BUTTON_CANCEL, e))
+     {
+        evas_event_feed_mouse_cancel(lookup->evas, e->timestamp, NULL);
+     }
 
    //the number of last event is small, simple check is ok.
    EINA_LIST_FOREACH(_last_events, l, eel)
@@ -507,47 +524,67 @@ _ecore_event_evas_mouse_button(Ecore_Event_Mouse_Button 
*e, Ecore_Event_Press pr
      {
         ecore_event_evas_modifier_lock_update(lookup->evas, e->modifiers);
         if (press == ECORE_DOWN)
-          evas_event_feed_mouse_down(lookup->evas, e->buttons, flags,
-                                     e->timestamp, NULL);
+          {
+             if (!lookup->direct ||
+                 !lookup->direct(lookup->window, 
ECORE_EVENT_MOUSE_BUTTON_DOWN, e))
+               {
+                  evas_event_feed_mouse_down(lookup->evas, e->buttons, flags,
+                                             e->timestamp, NULL);
+               }
+          }
         else
-          evas_event_feed_mouse_up(lookup->evas, e->buttons, flags,
-                                   e->timestamp, NULL);
+          {
+             if (!lookup->direct ||
+                 !lookup->direct(lookup->window, ECORE_EVENT_MOUSE_BUTTON_UP, 
e))
+               {
+                  evas_event_feed_mouse_up(lookup->evas, e->buttons, flags,
+                                           e->timestamp, NULL);
+               }
+          }
      }
    else
      {
         if (press == ECORE_DOWN)
           {
-             if (lookup->down_multi)
-                lookup->down_multi(lookup->window, e->multi.device,
-                                   e->x, e->y, e->multi.radius,
-                                   e->multi.radius_x, e->multi.radius_y,
-                                   e->multi.pressure, e->multi.angle,
-                                   e->multi.x, e->multi.y, flags,
-                                   e->timestamp);
-             else
-               evas_event_input_multi_down(lookup->evas, e->multi.device,
-                                           e->x, e->y, e->multi.radius,
-                                           e->multi.radius_x, 
e->multi.radius_y,
-                                           e->multi.pressure, e->multi.angle,
-                                           e->multi.x, e->multi.y, flags,
-                                           e->timestamp, NULL);
+             if (!lookup->direct ||
+                 !lookup->direct(lookup->window, 
ECORE_EVENT_MOUSE_BUTTON_DOWN, e))
+               {
+                  if (lookup->down_multi)
+                    lookup->down_multi(lookup->window, e->multi.device,
+                                       e->x, e->y, e->multi.radius,
+                                       e->multi.radius_x, e->multi.radius_y,
+                                       e->multi.pressure, e->multi.angle,
+                                       e->multi.x, e->multi.y, flags,
+                                       e->timestamp);
+                  else
+                     evas_event_input_multi_down(lookup->evas, e->multi.device,
+                                                 e->x, e->y, e->multi.radius,
+                                                 e->multi.radius_x, 
e->multi.radius_y,
+                                                 e->multi.pressure, 
e->multi.angle,
+                                                 e->multi.x, e->multi.y, flags,
+                                                 e->timestamp, NULL);
+               }
           }
         else
           {
-             if (lookup->up_multi)
-                lookup->up_multi(lookup->window, e->multi.device,
-                                 e->x, e->y, e->multi.radius,
-                                 e->multi.radius_x, e->multi.radius_y,
-                                 e->multi.pressure, e->multi.angle,
-                                 e->multi.x, e->multi.y, flags,
-                                 e->timestamp);
-             else
-               evas_event_input_multi_up(lookup->evas, e->multi.device,
-                                         e->x, e->y, e->multi.radius,
-                                         e->multi.radius_x, e->multi.radius_y,
-                                         e->multi.pressure, e->multi.angle,
-                                         e->multi.x, e->multi.y, flags,
-                                         e->timestamp, NULL);
+             if (!lookup->direct ||
+                 !lookup->direct(lookup->window, ECORE_EVENT_MOUSE_BUTTON_UP, 
e))
+               {
+                  if (lookup->up_multi)
+                    lookup->up_multi(lookup->window, e->multi.device,
+                                     e->x, e->y, e->multi.radius,
+                                     e->multi.radius_x, e->multi.radius_y,
+                                     e->multi.pressure, e->multi.angle,
+                                     e->multi.x, e->multi.y, flags,
+                                     e->timestamp);
+                  else
+                     evas_event_input_multi_up(lookup->evas, e->multi.device,
+                                               e->x, e->y, e->multi.radius,
+                                               e->multi.radius_x, 
e->multi.radius_y,
+                                               e->multi.pressure, 
e->multi.angle,
+                                               e->multi.x, e->multi.y, flags,
+                                               e->timestamp, NULL);
+               }
           }
      }
    return ECORE_CALLBACK_PASS_ON;
@@ -622,10 +659,18 @@ _ecore_event_evas_mouse_io(Ecore_Event_Mouse_IO *e, 
Ecore_Event_IO io)
    switch (io)
      {
       case ECORE_IN:
-         evas_event_feed_mouse_in(lookup->evas, e->timestamp, NULL);
+        if (!lookup->direct ||
+            !lookup->direct(lookup->window, ECORE_EVENT_MOUSE_IN, e))
+          {
+             evas_event_feed_mouse_in(lookup->evas, e->timestamp, NULL);
+          }
          break;
       case ECORE_OUT:
-         evas_event_feed_mouse_out(lookup->evas, e->timestamp, NULL);
+        if (!lookup->direct ||
+            !lookup->direct(lookup->window, ECORE_EVENT_MOUSE_OUT, e))
+          {
+             evas_event_feed_mouse_out(lookup->evas, e->timestamp, NULL);
+          }
          break;
       default:
          break;
@@ -657,7 +702,12 @@ ecore_event_evas_mouse_wheel(void *data EINA_UNUSED, int 
type EINA_UNUSED, void
    lookup = _ecore_event_window_match(e->event_window);
    if (!lookup) return ECORE_CALLBACK_PASS_ON;
    ecore_event_evas_modifier_lock_update(lookup->evas, e->modifiers);
-   evas_event_feed_mouse_wheel(lookup->evas, e->direction, e->z, e->timestamp, 
NULL);
+   if (!lookup->direct ||
+       !lookup->direct(lookup->window, ECORE_EVENT_MOUSE_WHEEL, e))
+     {
+        evas_event_feed_mouse_wheel(lookup->evas, e->direction, e->z, 
e->timestamp, NULL);
+     }
+
    return ECORE_CALLBACK_PASS_ON;
 }
 
@@ -682,9 +732,14 @@ ecore_event_evas_axis_update(void *data EINA_UNUSED, int 
type EINA_UNUSED, void
    e = event;
    lookup = _ecore_event_window_match(e->event_window);
    if (!lookup) return ECORE_CALLBACK_PASS_ON;
-   evas_event_feed_axis_update(lookup->evas, e->timestamp, e->device,
-                               e->toolid, e->naxis,
-                               (Evas_Axis *)e->axis, NULL);
+   if (!lookup->direct ||
+       !lookup->direct(lookup->window, ECORE_EVENT_AXIS_UPDATE, e))
+     {
+        evas_event_feed_axis_update(lookup->evas, e->timestamp, e->device,
+                                    e->toolid, e->naxis,
+                                    (Evas_Axis *)e->axis, NULL);
+     }
+
    return ECORE_CALLBACK_PASS_ON;
 }
 

-- 


Reply via email to