[access] initial draft of 1 finger tap then touch & hold, move
authorShinwoo Kim <cinoo.kim@samsung.com>
Wed, 17 Apr 2013 04:41:28 +0000 (13:41 +0900)
committerSungho Kwak <sungho1.kwak@samsung.com>
Mon, 29 Apr 2013 11:29:57 +0000 (20:29 +0900)
src/lib/elm_access.c

index 7e032d4..34cb8b7 100644 (file)
@@ -466,9 +466,13 @@ void
 _elm_access_highlight_object_scroll(Evas_Object *obj, int type, int x, int y)
 {
    Evas *evas;
-   Evas_Object *ho;
+   Evas_Object *ho, *win;
    Evas_Coord_Rectangle ho_area;
 
+#ifdef HAVE_ELEMENTARY_X
+   Ecore_X_Window xwin = 0;
+#endif
+
    if (!obj) return;
 
    evas = evas_object_evas_get(obj);
@@ -524,6 +528,60 @@ _elm_access_highlight_object_scroll(Evas_Object *obj, int type, int x, int y)
         s_iface->repeat_events_set(s_parent, EINA_TRUE);
         break;
 
+      case 3:
+        ho = _access_highlight_object_get(obj);
+        if (!ho)
+          {
+             s_parent = NULL;
+             return;
+          }
+        else
+          {
+             s_parent = ho;
+             evas_object_geometry_get
+               (ho, &ho_area.x, &ho_area.y, &ho_area.w, &ho_area.h);
+
+             offset.x = x - (ho_area.x + (ho_area.w / 2));
+             offset.y = y - (ho_area.y + (ho_area.h / 2));
+          }
+
+#ifdef HAVE_ELEMENTARY_X
+        win = elm_widget_top_get(ho);
+        xwin = elm_win_xwindow_get(win);
+        if (!xwin) return;
+
+        x = x - offset.x;
+        y = y - offset.y;
+        ecore_x_mouse_in_send(xwin, x, y);
+        ecore_x_mouse_move_send(xwin, x, y);
+        ecore_x_mouse_down_send(xwin, x, y, 1);
+#endif
+        break;
+
+      case 4:
+        if (!s_parent) return;
+
+#ifdef HAVE_ELEMENTARY_X
+        win = elm_widget_top_get(s_parent);
+        xwin = elm_win_xwindow_get(win);
+        if (!xwin) return;
+
+        ecore_x_mouse_move_send(xwin, x - offset.x, y - offset.y);
+#endif
+        break;
+
+      case 5:
+        if (!s_parent) return;
+
+#ifdef HAVE_ELEMENTARY_X
+        win = elm_widget_top_get(s_parent);
+        xwin = elm_win_xwindow_get(win);
+        if (!xwin) return;
+
+        ecore_x_mouse_up_send(xwin, x - offset.x, y - offset.y, 1);
+#endif
+        break;
+
       default:
         break;
      }
@@ -876,7 +934,7 @@ _elm_access_object_hilight(Evas_Object *obj)
    evas_object_resize(o, w, h);
 
    /* use callback, should an access object do below every time when
-       * a window gets a client message ECORE_X_ATOM_E_ILLMUE_ACTION_READ? */
+    * a window gets a client message ECORE_X_ATOM_E_ILLMUE_ACTION_READ? */
    a = calloc(1, sizeof(Elm_Access_Action_Info));
    a->action_by = action_by;
    if (!_access_action_callback_call(obj, ELM_ACCESS_ACTION_HIGHLIGHT, a))