From: Shinwoo Kim Date: Fri, 31 Mar 2017 10:20:25 +0000 (+0900) Subject: Support selection mode X-Git-Tag: accepted/tizen/unified/20170711.181140^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c0b4246a61921d0bce20fc729a0d9764cca72811;p=platform%2Fcore%2Fuifw%2Fe-mod-tizen-screen-reader.git Support selection mode Double tap & hold with two fingers to enter the Selection mode. If the text input filed is changed to selection mode, then we do not use two fingers to scroll. The two fingers gesture is used as below: - 2 fingers flick down: select all - 2 fingers flick up: copy - 2 fingers flick left: cut - 2 fingers flick right: paste Change-Id: Iede0729340f352249e1f489005b66f2bc4247b37 Needs: https://review.tizen.org/gerrit/#/c/122452/ --- diff --git a/src/e_mod_main.c b/src/e_mod_main.c index 78f6f2b..133fb2d 100644 --- a/src/e_mod_main.c +++ b/src/e_mod_main.c @@ -19,6 +19,7 @@ Eldbus_Service_Interface *iface = NULL; Eina_Bool is_slider; Eina_Bool is_screen_reader_support; int highlighted_object_x, highlighted_object_y; +Eina_Bool is_selection_mode; EAPI E_Module_Api e_modapi = { @@ -31,6 +32,7 @@ static Eldbus_Message *_sc_enable(const Eldbus_Service_Interface *iface, const E static Eldbus_Message *_is_slider(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg); static Eldbus_Message *_highlighted_object_info(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg); static Eldbus_Message *_is_screen_reader_support(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg); +static Eldbus_Message *_is_selection_mode(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg); static const Eldbus_Method methods[] = { { "ScreenReaderEnabled", ELDBUS_ARGS({"b", "bool"}), ELDBUS_ARGS({"b", "bool"}), @@ -45,6 +47,9 @@ static const Eldbus_Method methods[] = { { "IsScreenReaderSupport", ELDBUS_ARGS({"b", "bool"}), NULL, _is_screen_reader_support }, + { "IsSelectionMode", ELDBUS_ARGS({"b", "bool"}), NULL, + _is_selection_mode + }, { } }; @@ -299,6 +304,15 @@ _highlighted_object_info(const Eldbus_Service_Interface *iface, const Eldbus_Mes return NULL; } +static Eldbus_Message * +_is_selection_mode(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg) +{ + if (!eldbus_message_arguments_get(msg, "b", &is_selection_mode)) + ERROR("eldbus_message_arguments_get() error\n"); + + return NULL; +} + static int _fetch_a11y_bus_address(void) { diff --git a/src/e_screen_reader_gestures.c b/src/e_screen_reader_gestures.c index 99a0d79..8925ce2 100644 --- a/src/e_screen_reader_gestures.c +++ b/src/e_screen_reader_gestures.c @@ -505,7 +505,6 @@ _flick_gesture_mouse_up(Ecore_Event_Mouse_Button *ev, Cover *cov) cov->flick_gesture.x_end[i] = ev->root.x; cov->flick_gesture.y_end[i] = ev->root.y; - if (!cov->flick_gesture.n_fingers_left) { _flick_event_emit(cov); @@ -620,7 +619,9 @@ _flick_gesture_mouse_move(Ecore_Event_Mouse_Move *ev, Cover *cov) break; } if (i == 1 && cov->n_taps == 2) { - if ((cov->flick_gesture.flick_to_scroll || _flick_to_scroll_gesture_conditions_met(ev, cov->flick_gesture.timestamp[i], dx, dy)) && scrolling) { + if (!is_selection_mode && scrolling && + (cov->flick_gesture.flick_to_scroll || + _flick_to_scroll_gesture_conditions_met(ev, cov->flick_gesture.timestamp[i], dx, dy))) { if (!cov->flick_gesture.flick_to_scroll) { start_scroll(cov); cov->flick_gesture.flick_to_scroll = EINA_TRUE; @@ -804,7 +805,7 @@ _hover_gesture_mouse_down(Ecore_Event_Mouse_Button *ev, Cover *cov) } /* start_scroll is necessary for mouse down event */ - if (!cov->flick_gesture.flick_to_scroll) { + if (!is_selection_mode && !cov->flick_gesture.flick_to_scroll) { start_scroll(cov); cov->flick_gesture.flick_to_scroll = EINA_TRUE; } @@ -1292,7 +1293,7 @@ _tap_gestures_move(Ecore_Event_Mouse_Move *ev, Cover *cov) int dy = ev->root.y - cov->tap_gesture_data.y_org[i]; if ((dx * dx + dy * dy) > _e_mod_config->one_finger_tap_radius * _e_mod_config->one_finger_tap_radius) { - ERROR("Abort gesture"); + ERROR("Abort tap gesture"); if (cov->n_taps == 2) scrolling = EINA_TRUE; cov->tap_gesture_data.started = EINA_FALSE; ecore_timer_del(cov->tap_gesture_data.timer); @@ -1313,7 +1314,9 @@ _mouse_move(int type, Ecore_Event_Mouse_Move *event) Ecore_Event_Mouse_Move *ev = event; /* flick_to_scroll: 2 fingers touch and move drag_start: 1 finger tap and hold move */ - if (ev->multi.radius >= MAGIC_NUMBER || cover->flick_gesture.flick_to_scroll || cover->tap_n_hold_gesture_data.drag_start) + if (ev->multi.radius >= MAGIC_NUMBER || + cover->tap_n_hold_gesture_data.drag_start || + (cover->flick_gesture.flick_to_scroll && !is_selection_mode)) { if (ev->multi.radius >= MAGIC_NUMBER) ev->multi.radius -= MAGIC_NUMBER; if (cover->flick_gesture.flick_to_scroll) _hover_gesture_mouse_move(ev, cover); diff --git a/src/e_screen_reader_private.h b/src/e_screen_reader_private.h index 21f0647..15c2ee7 100644 --- a/src/e_screen_reader_private.h +++ b/src/e_screen_reader_private.h @@ -69,6 +69,7 @@ typedef struct { extern Eina_Bool is_slider; extern Eina_Bool is_screen_reader_support; extern int highlighted_object_x, highlighted_object_y; +extern Eina_Bool is_selection_mode; int _e_mod_log_init(void); void _e_mod_log_shutdown(void);