[e-mod-tizen-screen-reader] Propogate multi device mouse down and up for two finger... 07/214707/2
authorPrasoon Singh <prasoon.16@samsung.com>
Mon, 1 Jul 2019 14:37:40 +0000 (20:07 +0530)
committerPrasoon Singh <prasoon.16@samsung.com>
Wed, 25 Sep 2019 11:13:22 +0000 (16:43 +0530)
Change-Id: I5469a27ec8b11499226cd06f0f63040b06ea9e35
Signed-off-by: Prasoon Singh <prasoon.16@samsung.com>
src/e_screen_reader_gestures.c

index 46e76c9..b773c55 100644 (file)
@@ -87,7 +87,7 @@ struct _Cover
    struct {
         int n_taps;
         Eina_Bool double_tap;
-        Ecore_Event_Mouse_Button *ev_down;
+        Ecore_Event_Mouse_Button *ev_down, *ev_multi_down;
         Eina_Bool drag_start;
         int drag_x_delta;
         int drag_y_delta;
@@ -993,6 +993,11 @@ _hover_event_emit(Cover *cov, gesture_state_e state)
         cov->tap_n_hold_gesture_data.ev_down->multi.radius += MAGIC_NUMBER;
         cov->tap_n_hold_gesture_data.drag_start = EINA_TRUE;
         ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, cov->tap_n_hold_gesture_data.ev_down, NULL, NULL);
+        if (cov->tap_gesture_data.tap_type == TWO_FINGERS_GESTURE)
+          {
+             cov->tap_n_hold_gesture_data.ev_multi_down->multi.radius += MAGIC_NUMBER;
+             ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, cov->tap_n_hold_gesture_data.ev_multi_down, NULL, NULL);
+          }
      }
 
    cov->tap_n_hold_gesture_data.double_tap = EINA_FALSE;
@@ -1299,6 +1304,12 @@ _tap_gestures_mouse_down(Ecore_Event_Mouse_Button *ev, Cover *cov)
                cov->tap_gesture_data.y_org[1] = ev->root.y;
                if (cov->tap_gesture_data.tap_type < TWO_FINGERS_GESTURE)
                   cov->tap_gesture_data.tap_type = TWO_FINGERS_GESTURE;
+               if (!(cov->tap_n_hold_gesture_data.ev_multi_down = malloc(sizeof(Ecore_Event_Mouse_Button))))
+                 {
+                    DEBUG("NOT ENOUGH MEMORY");
+                    return ;
+                 }
+               memcpy (cov->tap_n_hold_gesture_data.ev_multi_down, ev, sizeof(Ecore_Event_Mouse_Button));
             }
          else if (cov->tap_gesture_data.finger[2] == -1 ||
                   cov->tap_gesture_data.finger[2] == ev->multi.device)
@@ -1484,7 +1495,7 @@ _mouse_button_up(int type, Ecore_Event_Mouse_Button *event)
      }
    if (cover->tap_n_hold_gesture_data.drag_start)
      {
-        Ecore_Event_Mouse_Button *ev_up;
+        Ecore_Event_Mouse_Button *ev_up, *ev_multi_up;
         if (!(ev_up = malloc(sizeof(Ecore_Event_Mouse_Button))))
           {
              DEBUG("NOT ENOUGH MEMORY");
@@ -1497,6 +1508,18 @@ _mouse_button_up(int type, Ecore_Event_Mouse_Button *event)
           ecore_timer_del(cover->up_timer);
         cover->up_timer = ecore_timer_add(0, _on_up_timeout, ev_up);
 
+        if (cover->tap_gesture_data.tap_type == TWO_FINGERS_GESTURE)
+          {
+             if (!(ev_multi_up = malloc(sizeof(Ecore_Event_Mouse_Button))))
+               {
+                  DEBUG("NOT ENOUGH MEMORY");
+                  return EINA_FALSE;
+               }
+             memcpy(ev_multi_up, ev, sizeof(Ecore_Event_Mouse_Button));
+             ev_multi_up->multi.radius += MAGIC_NUMBER;
+             ev_multi_up->multi.device = 1;
+             ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_UP, ev_multi_up, NULL, NULL);
+          }
         cover->tap_n_hold_gesture_data.drag_start = EINA_FALSE;
         highlighted_object_x = -1;
         highlighted_object_y = -1;