fix cppcheck issues (remove unused functions) 58/106158/6
authorRadoslaw Cybulski <r.cybulski@partner.samsung.com>
Tue, 20 Dec 2016 13:15:12 +0000 (14:15 +0100)
committerLukasz Oleksak <l.oleksak@samsung.com>
Fri, 3 Mar 2017 07:53:20 +0000 (23:53 -0800)
Change-Id: Ief4a03885f5d084b855512c528d6ab0a6bf0ea92

14 files changed:
include/screen_reader_gestures.h
src/app_tracker.c
src/elm_access_adapter.c
src/flat_navi.c
src/keyboard_tracker.c
src/navigator.c
src/screen_reader_gestures.c
src/screen_reader_haptic.c
src/screen_reader_spi.c
src/screen_reader_switch.c
src/screen_reader_tts.c
src/screen_reader_utils.c
src/screen_reader_vconf.c
src/window_tracker.c

index 6057d3bbe5bd32fc362610ef542bcd11144cd522..57bf6d2d094e28756d9588766959c71fbabf61f9 100644 (file)
@@ -83,11 +83,6 @@ Eina_Bool screen_reader_gesture_wl_grab_touch_devices(Ecore_Wl_Window win);
 
 typedef void (*GestureCB)(void *data, const Eldbus_Message *msg);
 
-/**
- * @brief Registers callback on gestures
- */
-void screen_reader_gestures_tracker_register(GestureCB cb, void *data, Screen_Reader_Gestures_Data *gestures_ctx);
-
 /**
  * @brief Start event emission
  */
index 5072ef246480e32e848812981804ba0cda407557..a619046946339c1346537e7026b3fb506a764bd5 100644 (file)
@@ -875,11 +875,3 @@ void app_tracker_new_obj_highlighted_callback_register(AppTrackerEventCB cb, App
 
        app_tracker_ctx->_new_obj_highlighted_callback = cb;
 }
-
-void app_tracker_new_obj_highlighted_callback_unregister(AppTrackerEventCB cb, App_Tracker_Data *ctx)
-{
-       if (ctx == NULL)
-               return;
-
-       ctx->_new_obj_highlighted_callback = NULL;
-}
index 233e51afbc76ae817e8a4fd0105e5f48dea20ade..609dcd0e66b251e64164f723d707c66a1f227eb8 100644 (file)
@@ -62,15 +62,5 @@ void elm_access_adaptor_emit_activate(Ecore_X_Window win, int x, int y)
 void elm_access_adaptor_emit_read(Ecore_X_Window win, int x, int y)
 {
        _send_ecore_x_client_msg(win, x, y, EINA_FALSE);
-}
-#else
-void elm_access_adaptor_emit_activate(Ecore_Wl_Window *win, int x, int y)
-{
-
-}
-
-void elm_access_adaptor_emit_read(Ecore_Wl_Window *win, int x, int y)
-{
-
 }
 #endif
\ No newline at end of file
index 4844052cfed8192c21ccf59360f866e6991f0975..7271f67f10e37c2b992f426697f54bc0070ba895 100644 (file)
@@ -398,25 +398,6 @@ Eina_Bool flat_navi_context_current_at_x_y_set(Flat_Navi_Context *ctx, gint x_co
 }
 #endif
 
-AtspiAccessible *_get_child(AtspiAccessible *obj, int i)
-{
-       DEBUG("START:%d", i);
-       if (i < 0) {
-               DEBUG("END");
-               return NULL;
-       }
-       if (!obj) {
-               DEBUG("END");
-               return NULL;
-       }
-       int cc = atspi_accessible_get_child_count(obj, NULL);
-       if (cc == 0 || i >= cc) {
-               DEBUG("END");
-               return NULL;
-       }
-       return atspi_accessible_get_child_at_index(obj, i, NULL);
-}
-
 static Eina_Bool _has_next_sibling(AtspiAccessible *obj, int next_sibling_idx_modifier)
 {
        Eina_Bool ret = EINA_FALSE;
@@ -612,33 +593,6 @@ AtspiAccessible *_prev(Flat_Navi_Context * ctx, Screen_Reader_Vconf_Data_t *vcon
        return ret;
 }
 
-int flat_navi_context_current_children_count_visible_get(Flat_Navi_Context *ctx)
-{
-       if (!ctx)
-               return -1;
-       int count = 0;
-       /*
-          AtspiAccessible *obj = NULL;
-          AtspiStateSet *ss = NULL;
-
-          Eina_List *l, *l2, *line;
-          AtspiAccessible *current = flat_navi_context_current_get(ctx);
-          AtspiAccessible *parent = atspi_accessible_get_parent (current, NULL);
-
-          EINA_LIST_FOREACH(ctx->lines, l, line)
-          {
-          EINA_LIST_FOREACH(line, l2, obj)
-          {
-          ss = atspi_accessible_get_state_set(obj);
-          if (atspi_state_set_contains(ss, ATSPI_STATE_SHOWING) && parent == atspi_accessible_get_parent(obj, NULL))
-          count++;
-          g_object_unref(ss);
-          }
-          }
-        */
-       return count;
-}
-
 Flat_Navi_Context *flat_navi_context_create()
 {
        DEBUG("START");
@@ -680,14 +634,6 @@ AtspiAccessible *flat_navi_context_root_get(Flat_Navi_Context *ctx)
        return ctx->root;
 }
 
-const AtspiAccessible *flat_navi_context_first_get(Flat_Navi_Context *ctx)
-{
-       if (!ctx)
-               return NULL;
-
-       return _first(ctx);
-}
-
 const AtspiAccessible *flat_navi_context_last_get(Flat_Navi_Context *ctx)
 {
        if (!ctx)
index 4bd76c34dc67761902390db47adb544785253a6b..25b23bc4c5bb9412fb5a39a992bbb5b5c9ad9495 100644 (file)
@@ -341,21 +341,6 @@ void keyboard_geometry_set(Keyboard_Tracker_Data *ktd, int x, int y, int width,
        ktd->keyboardH = height;
 }
 
-Eina_Bool keyboard_geometry_get(const Keyboard_Tracker_Data *ktd, int *x, int *y, int *width, int *height)
-{
-       if (!ktd || !x || !y || !width || !height) {
-               ERROR("invalid parameter set {%p, %p, %p, %p, %p}", ktd, x, y, width, height);
-               return EINA_FALSE;
-       }
-
-       *x = ktd->keyboardX;
-       *y = ktd->keyboardY;
-       *width = ktd->keyboardW;
-       *height = ktd->keyboardH;
-
-       return EINA_TRUE;
-}
-
 Eina_Bool keyboard_event_status(Service_Data *sd, const int x, const int y)
 {
 #ifndef SCREEN_READER_TV
index 7daeb31d291a9d9b7d130323ab5405be845862b4..0fe7b9d555f9f7704388ab64fed189f1ea73512e 100644 (file)
@@ -621,7 +621,7 @@ static char *generate_description_from_relation_object(AtspiAccessible *obj)
                g_free(desc);
        }
        else if (desc) {
-               if (desc[0] != '\0') {
+               if (desc[0] != 0) {
                        char *ret = NULL;
                        if (asprintf(&ret, "%s, %s", desc, trait) < 0)
                                ERROR("asprintf failed.");
@@ -929,37 +929,6 @@ static void _current_highlight_object_set(Navigator_Data *nd, Screen_Reader_Vcon
        DEBUG("END");
 }
 
-void test_debug(AtspiAccessible *current_widget)
-{
-       GError *err = NULL;
-       AtspiAccessible *parent = atspi_accessible_get_parent(current_widget, &err);
-       GERROR_CHECK(err)
-       if (parent) {
-               int count_child = atspi_accessible_get_child_count(parent, &err);
-               GERROR_CHECK(err);
-               DEBUG("Total childs in parent: %d\n", count_child);
-
-               int jdx;
-               for (jdx = 0; jdx < count_child; jdx++) {
-                       AtspiAccessible *child_iter = atspi_accessible_get_child_at_index(parent, jdx, &err);
-                       GERROR_CHECK(err);
-
-                       gchar *role = NULL;
-                       if (current_widget == child_iter) {
-                               role = atspi_accessible_get_role_name(parent, &err);
-                               DEBUG("Childen found in parent: %s at index: %d\n", role, jdx);
-                       }
-                       else {
-                               role = atspi_accessible_get_role_name(parent, &err);
-                               DEBUG("Childen not found in parent: %s at index: %d\n", role, jdx);
-                       }
-                       g_free(role);
-                       GERROR_CHECK(err);
-               }
-               g_object_unref(parent);
-       }
-}
-
 static void _focus_widget(Navigator_Data *nd, Screen_Reader_Vconf_Data_t *vconf_data, Haptic_Data *haptic_data, Screen_Reader_Tts_Data_t *tts_data, Flat_Navi_Context *context, Gesture_Info *info)
 {
        DEBUG("START");
@@ -2007,34 +1976,6 @@ static Eina_Bool _is_index_item(Flat_Navi_Context *context)
        return EINA_FALSE;
 }
 
-void start_scroll(int x, int y, Screen_Reader_Gestures_Data *gestures_ctx)             //TODO: pass screen_reader_gestures context
-{
-#ifdef X11_ENABLED
-       Ecore_X_Window wins[1] = { win };
-       Ecore_X_Window under = ecore_x_window_at_xy_with_skip_get(x, y, wins, sizeof(wins) / sizeof(wins[0]));
-       _get_root_coords(under, &rx, &ry);
-       ecore_x_mouse_in_send(under, x - rx, y - ry);
-       ecore_x_window_focus(under);
-       ecore_x_mouse_down_send(under, x - rx, y - ry, 1);
-       scrolled_win = under;
-#endif
-}
-
-void continue_scroll(int x, int y, Screen_Reader_Gestures_Data *gestures_ctx)
-{
-#ifdef X11_ENABLED
-       ecore_x_mouse_move_send(scrolled_win, x - rx, y - ry);
-#endif
-}
-
-void end_scroll(int x, int y, Screen_Reader_Gestures_Data *gestures_ctx)
-{
-#ifdef X11_ENABLED
-       ecore_x_mouse_up_send(scrolled_win, x - rx, y - ry, 1);
-       ecore_x_mouse_out_send(scrolled_win, x - rx, y - ry);
-#endif
-}
-
 static void _move_slider(Navigator_Data *nd, Screen_Reader_Vconf_Data_t *vconf_data, Flat_Navi_Context *context, Gesture_Info *gi)
 {
        DEBUG("ONE FINGER DOUBLE TAP AND HOLD");
index fc1e0e4722c34bb46e2a34de4d80af0cda52191d..64114f48e41d2294a54119102de91edae0950e91 100644 (file)
@@ -204,490 +204,6 @@ static void _event_emit(Gesture g, int x, int y, int x_e, int y_e, int state, in
        free(gestures_ctx);
 }
 
-static void _flick_gesture_mouse_down(Ecore_Event_Mouse_Button *ev, Screen_Reader_Gestures_Data *gestures_ctx)
-{
-       if (gestures_ctx == NULL)
-               ERROR("NULL context parameter");
-
-       if (gestures_ctx->cov->flick_gesture.state == GESTURE_NOT_STARTED) {
-               gestures_ctx->cov->flick_gesture.state = GESTURE_ONGOING;
-               gestures_ctx->cov->flick_gesture.finger[0] = ev->multi.device;
-               gestures_ctx->cov->flick_gesture.x_org[0] = ev->root.x;
-               gestures_ctx->cov->flick_gesture.y_org[0] = ev->root.y;
-               gestures_ctx->cov->flick_gesture.timestamp[0] = ev->timestamp;
-               gestures_ctx->cov->flick_gesture.flick_to_scroll = EINA_FALSE;
-               gestures_ctx->cov->flick_gesture.n_fingers = 1;
-               gestures_ctx->cov->flick_gesture.n_fingers_left = 1;
-               gestures_ctx->cov->flick_gesture.dir = FLICK_DIRECTION_UNDEFINED;
-               gestures_ctx->cov->flick_gesture.finger_out[0] = EINA_FALSE;
-               gestures_ctx->cov->flick_gesture.return_flick[0] = EINA_FALSE;
-       } else if (gestures_ctx->cov->flick_gesture.state == GESTURE_ONGOING) {
-               // abort gesture if too many fingers touched screen
-               if ((gestures_ctx->cov->n_taps > 3) || (gestures_ctx->cov->flick_gesture.n_fingers > 2)) {
-                       gestures_ctx->cov->flick_gesture.state = GESTURE_ABORTED;
-                       return;
-               }
-
-               gestures_ctx->cov->flick_gesture.x_org[gestures_ctx->cov->flick_gesture.n_fingers] = ev->root.x;
-               gestures_ctx->cov->flick_gesture.y_org[gestures_ctx->cov->flick_gesture.n_fingers] = ev->root.y;
-               gestures_ctx->cov->flick_gesture.timestamp[gestures_ctx->cov->flick_gesture.n_fingers] = ev->timestamp;
-               gestures_ctx->cov->flick_gesture.finger[gestures_ctx->cov->flick_gesture.n_fingers] = ev->multi.device;
-               gestures_ctx->cov->flick_gesture.n_fingers++;
-               gestures_ctx->cov->flick_gesture.n_fingers_left++;
-               if (gestures_ctx->cov->flick_gesture.n_fingers < 3) {   /* n_fingers == 3 makes out of bounds write */
-                       gestures_ctx->cov->flick_gesture.finger_out[gestures_ctx->cov->flick_gesture.n_fingers] = EINA_FALSE;
-                       gestures_ctx->cov->flick_gesture.return_flick[gestures_ctx->cov->flick_gesture.n_fingers] = EINA_FALSE;
-               }
-       }
-}
-
-static Eina_Bool _flick_gesture_time_check(unsigned int event_time, unsigned int gesture_time)
-{
-       DEBUG("Flick time: %d", event_time - gesture_time);
-       if ((event_time - gesture_time) < _e_mod_config->one_finger_flick_max_time * 2) //Double time because of the possible of return flick
-               return EINA_TRUE;
-       else
-               return EINA_FALSE;
-}
-
-static Eina_Bool _flick_gesture_length_check(int x, int y, int x_org, int y_org)
-{
-       int dx = x - x_org;
-       int dy = y - y_org;
-
-       if ((dx * dx + dy * dy) > (_e_mod_config->one_finger_flick_min_length * _e_mod_config->one_finger_flick_min_length))
-               return EINA_TRUE;
-       else
-               return EINA_FALSE;
-}
-
-static flick_direction_e _flick_gesture_direction_get(int x, int y, int x_org, int y_org, Screen_Reader_Gestures_Data *gestures_ctx)
-{
-       if (gestures_ctx == NULL) {
-               ERROR("NULL context parameter");
-               return;
-       }
-
-       int dx = x - x_org;
-       int dy = y - y_org;
-       int tmp;
-
-       switch (gestures_ctx->win_angle) {
-       case 90:
-               tmp = dx;
-               dx = -dy;
-               dy = tmp;
-               break;
-       case 270:
-               tmp = dx;
-               dx = dy;
-               dy = -tmp;
-               break;
-       }
-
-       if ((dy < 0) && (abs(dx) < -dy))
-               return FLICK_DIRECTION_UP;
-       if ((dy > 0) && (abs(dx) < dy))
-               return FLICK_DIRECTION_DOWN;
-       if ((dx > 0) && (dx > abs(dy)))
-               return FLICK_DIRECTION_RIGHT;
-       if ((dx < 0) && (-dx > abs(dy)))
-               return FLICK_DIRECTION_LEFT;
-
-       return FLICK_DIRECTION_UNDEFINED;
-}
-
-static void _flick_event_emit(Screen_Reader_Gestures_Data *gestures_ctx)
-{
-       if (gestures_ctx == NULL)
-               ERROR("NULL context parameter");
-
-       int ax, ay, axe, aye, i, type = -1;
-       ax = ay = axe = aye = 0;
-
-       for (i = 0; i < gestures_ctx->cov->flick_gesture.n_fingers; i++) {
-               ax += gestures_ctx->cov->flick_gesture.x_org[i];
-               ay += gestures_ctx->cov->flick_gesture.y_org[i];
-               axe += gestures_ctx->cov->flick_gesture.x_end[i];
-               aye += gestures_ctx->cov->flick_gesture.y_end[i];
-       }
-
-       ax /= gestures_ctx->cov->flick_gesture.n_fingers;
-       ay /= gestures_ctx->cov->flick_gesture.n_fingers;
-       axe /= gestures_ctx->cov->flick_gesture.n_fingers;
-       aye /= gestures_ctx->cov->flick_gesture.n_fingers;
-
-       if (gestures_ctx->cov->flick_gesture.dir == FLICK_DIRECTION_LEFT) {
-               if (gestures_ctx->cov->flick_gesture.n_fingers == 1)
-                       type = ONE_FINGER_FLICK_LEFT;
-               if (gestures_ctx->cov->flick_gesture.n_fingers == 2)
-                       type = TWO_FINGERS_FLICK_LEFT;
-               if (gestures_ctx->cov->flick_gesture.n_fingers == 3)
-                       type = THREE_FINGERS_FLICK_LEFT;
-       } else if (gestures_ctx->cov->flick_gesture.dir == FLICK_DIRECTION_RIGHT) {
-               if (gestures_ctx->cov->flick_gesture.n_fingers == 1)
-                       type = ONE_FINGER_FLICK_RIGHT;
-               if (gestures_ctx->cov->flick_gesture.n_fingers == 2)
-                       type = TWO_FINGERS_FLICK_RIGHT;
-               if (gestures_ctx->cov->flick_gesture.n_fingers == 3)
-                       type = THREE_FINGERS_FLICK_RIGHT;
-       } else if (gestures_ctx->cov->flick_gesture.dir == FLICK_DIRECTION_UP) {
-               if (gestures_ctx->cov->flick_gesture.n_fingers == 1)
-                       type = ONE_FINGER_FLICK_UP;
-               if (gestures_ctx->cov->flick_gesture.n_fingers == 2)
-                       type = TWO_FINGERS_FLICK_UP;
-               if (gestures_ctx->cov->flick_gesture.n_fingers == 3)
-                       type = THREE_FINGERS_FLICK_UP;
-       } else if (gestures_ctx->cov->flick_gesture.dir == FLICK_DIRECTION_DOWN) {
-               if (gestures_ctx->cov->flick_gesture.n_fingers == 1)
-                       type = ONE_FINGER_FLICK_DOWN;
-               if (gestures_ctx->cov->flick_gesture.n_fingers == 2)
-                       type = TWO_FINGERS_FLICK_DOWN;
-               if (gestures_ctx->cov->flick_gesture.n_fingers == 3)
-                       type = THREE_FINGERS_FLICK_DOWN;
-       } else if (gestures_ctx->cov->flick_gesture.dir == FLICK_DIRECTION_DOWN_RETURN) {
-               if (gestures_ctx->cov->flick_gesture.n_fingers == 1)
-                       type = ONE_FINGER_FLICK_DOWN_RETURN;
-               if (gestures_ctx->cov->flick_gesture.n_fingers == 2)
-                       type = TWO_FINGERS_FLICK_DOWN_RETURN;
-               if (gestures_ctx->cov->flick_gesture.n_fingers == 3)
-                       type = THREE_FINGERS_FLICK_DOWN_RETURN;
-       } else if (gestures_ctx->cov->flick_gesture.dir == FLICK_DIRECTION_UP_RETURN) {
-               if (gestures_ctx->cov->flick_gesture.n_fingers == 1)
-                       type = ONE_FINGER_FLICK_UP_RETURN;
-               if (gestures_ctx->cov->flick_gesture.n_fingers == 2)
-                       type = TWO_FINGERS_FLICK_UP_RETURN;
-               if (gestures_ctx->cov->flick_gesture.n_fingers == 3)
-                       type = THREE_FINGERS_FLICK_UP_RETURN;
-       } else if (gestures_ctx->cov->flick_gesture.dir == FLICK_DIRECTION_LEFT_RETURN) {
-               if (gestures_ctx->cov->flick_gesture.n_fingers == 1)
-                       type = ONE_FINGER_FLICK_LEFT_RETURN;
-               if (gestures_ctx->cov->flick_gesture.n_fingers == 2)
-                       type = TWO_FINGERS_FLICK_LEFT_RETURN;
-               if (gestures_ctx->cov->flick_gesture.n_fingers == 3)
-                       type = THREE_FINGERS_FLICK_LEFT_RETURN;
-       } else if (gestures_ctx->cov->flick_gesture.dir == FLICK_DIRECTION_RIGHT_RETURN) {
-               if (gestures_ctx->cov->flick_gesture.n_fingers == 1)
-                       type = ONE_FINGER_FLICK_RIGHT_RETURN;
-               if (gestures_ctx->cov->flick_gesture.n_fingers == 2)
-                       type = TWO_FINGERS_FLICK_RIGHT_RETURN;
-               if (gestures_ctx->cov->flick_gesture.n_fingers == 3)
-                       type = THREE_FINGERS_FLICK_RIGHT_RETURN;
-       }
-       DEBUG("FLICK GESTURE: N: %d F: %d", gestures_ctx->cov->flick_gesture.n_fingers, gestures_ctx->cov->flick_gesture.dir);
-       _event_emit(type, ax, ay, axe, aye, 2, gestures_ctx->cov->event_time);
-}
-
-static void _flick_gesture_mouse_up(Ecore_Event_Mouse_Button *ev, Screen_Reader_Gestures_Data *gestures_ctx)
-{
-       if (gestures_ctx == NULL)
-               ERROR("NULL context parameter");
-
-       if (gestures_ctx->cov->flick_gesture.state == GESTURE_ONGOING) {
-               int i;
-               // check if fingers match
-               for (i = 0; i < gestures_ctx->cov->flick_gesture.n_fingers; i++) {
-                       if (gestures_ctx->cov->flick_gesture.finger[i] == ev->multi.device)
-                               break;
-               }
-               if (i == gestures_ctx->cov->flick_gesture.n_fingers) {
-                       DEBUG("Finger id not recognized. Gesture aborted.");
-                       gestures_ctx->cov->flick_gesture.state = GESTURE_ABORTED;
-                       goto end;
-               }
-               if (gestures_ctx->cov->flick_gesture.flick_to_scroll)
-               {
-                       if (ev->multi.device == 1) {
-                               //if it is second finger then update x and y,
-                               //We use last x and y coordinates in end_scroll.
-                               //So if the first finger is up before
-                               //the second one we will use latest x and y of second finger
-                               //because second was the finger that scroll follows.
-                               //Else we can encounter that delta between last continue_scroll
-                               //coordinates and end_scroll coordinates will be high.
-                               gestures_ctx->cov->flick_gesture.flick_to_scroll_last_x = ev->x;
-                               gestures_ctx->cov->flick_gesture.flick_to_scroll_last_y = ev->y;
-                       }
-
-                       DEBUG("Flick gesture was interpreted as scroll so we aborting it.");
-                       gestures_ctx->cov->flick_gesture.state = GESTURE_ABORTED;
-                       goto end;
-               }
-               // check if flick for given finger is valid
-               if (!_flick_gesture_time_check(ev->timestamp, gestures_ctx->cov->flick_gesture.timestamp[i])) {
-                       DEBUG("finger flick gesture timeout expired. Gesture aborted.");
-                       gestures_ctx->cov->flick_gesture.state = GESTURE_ABORTED;
-                       goto end;
-               }
-               // check minimal flick length
-               if (!_flick_gesture_length_check(ev->root.x, ev->root.y, gestures_ctx->cov->flick_gesture.x_org[i], gestures_ctx->cov->flick_gesture.y_org[i])) {
-                       if (!gestures_ctx->cov->flick_gesture.finger_out[i]) {
-                               DEBUG("Minimal gesture length not reached and no return flick. Gesture aborted.");
-                               gestures_ctx->cov->flick_gesture.state = GESTURE_ABORTED;
-                               goto end;
-                       }
-                       gestures_ctx->cov->flick_gesture.return_flick[i] = EINA_TRUE;
-               }
-
-               flick_direction_e s = gestures_ctx->cov->flick_gesture.return_flick[i] ? gestures_ctx->cov->flick_gesture.dir : _flick_gesture_direction_get(ev->root.x, ev->root.y,
-                                                                                                                                                            gestures_ctx->cov->flick_gesture.x_org[i],
-                                                                                                                                                            gestures_ctx->cov->flick_gesture.y_org[i],
-                                                                                                                                                            gestures_ctx);
-
-               gestures_ctx->cov->flick_gesture.n_fingers_left--;
-
-               if ((gestures_ctx->cov->flick_gesture.dir == FLICK_DIRECTION_UNDEFINED || gestures_ctx->cov->flick_gesture.dir > FLICK_DIRECTION_RIGHT)
-                   && gestures_ctx->cov->flick_gesture.return_flick[i] == EINA_FALSE) {
-                       DEBUG("Flick gesture");
-                       gestures_ctx->cov->flick_gesture.dir = s;
-               }
-               // gesture is valid only if all flicks are in same direction
-               if (gestures_ctx->cov->flick_gesture.dir != s) {
-                       DEBUG("Flick in different direction. Gesture aborted.");
-                       gestures_ctx->cov->flick_gesture.state = GESTURE_ABORTED;
-                       goto end;
-               }
-
-               gestures_ctx->cov->flick_gesture.x_end[i] = ev->root.x;
-               gestures_ctx->cov->flick_gesture.y_end[i] = ev->root.y;
-
-               if (!gestures_ctx->cov->flick_gesture.n_fingers_left) {
-                       _flick_event_emit(gestures_ctx);
-                       gestures_ctx->cov->flick_gesture.state = GESTURE_NOT_STARTED;
-               }
-       }
-
-end:
-       // if no finger is touching a screen, gesture will be reseted.
-       if (gestures_ctx->cov->flick_gesture.state == GESTURE_ABORTED) {
-               if (gestures_ctx->cov->flick_gesture.flick_to_scroll) {
-                       end_scroll(gestures_ctx->cov->flick_gesture.flick_to_scroll_last_x, gestures_ctx->cov->flick_gesture.flick_to_scroll_last_y);
-                       gestures_ctx->cov->flick_gesture.flick_to_scroll = EINA_FALSE;
-               }
-               if (gestures_ctx->cov->n_taps == 0)
-                       gestures_ctx->cov->flick_gesture.state = GESTURE_NOT_STARTED;
-       }
-}
-
-static Eina_Bool _flick_to_scroll_gesture_conditions_met(Ecore_Event_Mouse_Move * ev, int gesture_timestamp, int dx, int dy)
-{
-       if (ev->timestamp - gesture_timestamp > _e_mod_config->two_finger_flick_to_scroll_timeout)
-               if (abs(dx) > _e_mod_config->two_finger_flick_to_scroll_min_length || abs(dy) > _e_mod_config->two_finger_flick_to_scroll_min_length)
-                       return EINA_TRUE;
-
-       return EINA_FALSE;
-}
-
-static void _flick_gesture_mouse_move(Ecore_Event_Mouse_Move * ev, Screen_Reader_Gestures_Data *gestures_ctx)
-{
-       if (gestures_ctx == NULL) {
-               ERROR("NULL context parameter");
-               return;
-       }
-
-       if (gestures_ctx->cov->flick_gesture.state == GESTURE_ONGOING) {
-               int i;
-               for (i = 0; i < gestures_ctx->cov->flick_gesture.n_fingers; ++i) {
-                       if (gestures_ctx->cov->flick_gesture.finger[i] == ev->multi.device)
-                               break;
-               }
-               if (i == gestures_ctx->cov->flick_gesture.n_fingers) {
-                       if (gestures_ctx->cov->flick_gesture.n_fingers >= 3)    //that is because of the EFL bug. Mouse move event before mouse down(!)
-                       {
-                               ERROR("Finger id not recognized. Gesture aborted.");
-                               gestures_ctx->cov->flick_gesture.state = GESTURE_ABORTED;
-                               return;
-                       }
-               }
-
-               int dx = ev->root.x - gestures_ctx->cov->flick_gesture.x_org[i];
-               int dy = ev->root.y - gestures_ctx->cov->flick_gesture.y_org[i];
-               int tmp;
-
-               switch (gestures_ctx->win_angle) {
-               case 90:
-                       tmp = dx;
-                       dx = -dy;
-                       dy = tmp;
-                       break;
-               case 270:
-                       tmp = dx;
-                       dx = dy;
-                       dy = -tmp;
-                       break;
-               }
-               if (i == 1) {
-                       if (gestures_ctx->cov->flick_gesture.flick_to_scroll || _flick_to_scroll_gesture_conditions_met(ev, gestures_ctx->cov->flick_gesture.timestamp[i], dx, dy)) {
-                               if (!gestures_ctx->cov->flick_gesture.flick_to_scroll) {
-                                       start_scroll(ev->x, ev->y, gestures_ctx);
-                                       gestures_ctx->cov->flick_gesture.flick_to_scroll = EINA_TRUE;
-                               } else {
-                                       continue_scroll(ev->x, ev->y);
-                               }
-                               gestures_ctx->cov->flick_gesture.flick_to_scroll_last_x = ev->x;
-                               gestures_ctx->cov->flick_gesture.flick_to_scroll_last_y = ev->y;
-                               return;
-                       }
-               }
-
-               if (!gestures_ctx->cov->flick_gesture.finger_out[i]) {
-                       if (abs(dx) > _e_mod_config->one_finger_flick_min_length) {
-                               gestures_ctx->cov->flick_gesture.finger_out[i] = EINA_TRUE;
-                               if (dx > 0) {
-                                       if (gestures_ctx->cov->flick_gesture.dir == FLICK_DIRECTION_UNDEFINED || gestures_ctx->cov->flick_gesture.dir == FLICK_DIRECTION_RIGHT_RETURN) {
-                                               gestures_ctx->cov->flick_gesture.dir = FLICK_DIRECTION_RIGHT_RETURN;
-                                       } else {
-                                               ERROR("Invalid direction, abort");
-                                               gestures_ctx->cov->flick_gesture.state = GESTURE_ABORTED;
-                                       }
-                               } else {
-                                       if (gestures_ctx->cov->flick_gesture.dir == FLICK_DIRECTION_UNDEFINED || gestures_ctx->cov->flick_gesture.dir == FLICK_DIRECTION_LEFT_RETURN) {
-                                               gestures_ctx->cov->flick_gesture.dir = FLICK_DIRECTION_LEFT_RETURN;
-                                       } else {
-                                               ERROR("Invalid direction, abort");
-                                               gestures_ctx->cov->flick_gesture.state = GESTURE_ABORTED;
-                                       }
-                               }
-                               return;
-                       }
-
-                       else if (abs(dy) > _e_mod_config->one_finger_flick_min_length) {
-                               gestures_ctx->cov->flick_gesture.finger_out[i] = EINA_TRUE;
-                               if (dy > 0) {
-                                       if (gestures_ctx->cov->flick_gesture.dir == FLICK_DIRECTION_UNDEFINED || gestures_ctx->cov->flick_gesture.dir == FLICK_DIRECTION_DOWN_RETURN) {
-                                               gestures_ctx->cov->flick_gesture.dir = FLICK_DIRECTION_DOWN_RETURN;
-                                       } else {
-                                               ERROR("Invalid direction, abort");
-                                               gestures_ctx->cov->flick_gesture.state = GESTURE_ABORTED;
-                                       }
-                               } else {
-                                       if (gestures_ctx->cov->flick_gesture.dir == FLICK_DIRECTION_UNDEFINED || gestures_ctx->cov->flick_gesture.dir == FLICK_DIRECTION_UP_RETURN) {
-                                               gestures_ctx->cov->flick_gesture.dir = FLICK_DIRECTION_UP_RETURN;
-                                       } else {
-                                               ERROR("Invalid direction, abort");
-                                               gestures_ctx->cov->flick_gesture.state = GESTURE_ABORTED;
-                                       }
-                               }
-                               return;
-                       }
-               }
-       }
-       return;
-}
-
-static Eina_Bool _on_hover_timeout(void *data)
-{
-       Screen_Reader_Gestures_Data *gestures_ctx = (Screen_Reader_Gestures_Data *) data;
-       if(gestures_ctx == NULL) {
-               ERROR("NULL context parameter");
-               return;
-       }
-
-       DEBUG("Hover timer expierd");
-
-       gestures_ctx->cov->hover_gesture.longpressed = EINA_TRUE;
-       gestures_ctx->cov->hover_gesture.timer = NULL;
-
-       if (gestures_ctx->cov->hover_gesture.last_emission_time == -1) {
-               _hover_event_emit(gestures_ctx, 0);
-               gestures_ctx->cov->hover_gesture.last_emission_time = gestures_ctx->cov->event_time;
-       }
-       return EINA_FALSE;
-}
-
-static void _hover_gesture_timer_reset(Screen_Reader_Gestures_Data *gestures_ctx, double time)
-{
-       if (gestures_ctx == NULL) {
-               ERROR("NULL context parameter");
-               return;
-       }
-
-       DEBUG("Hover timer reset");
-       gestures_ctx->cov->hover_gesture.longpressed = EINA_FALSE;
-       if (gestures_ctx->cov->hover_gesture.timer) {
-               ecore_timer_reset(gestures_ctx->cov->hover_gesture.timer);
-               return;
-       }
-       gestures_ctx->cov->hover_gesture.timer = ecore_timer_add(time, _on_hover_timeout, gestures_ctx);
-}
-
-static void _hover_gesture_mouse_down(Ecore_Event_Mouse_Button * ev, Screen_Reader_Gestures_Data *gestures_ctx)
-{
-       if (gestures_ctx == NULL) {
-               ERROR("NULL context parameter");
-               return;
-       }
-
-       if (gestures_ctx->cov->hover_gesture.state == GESTURE_NOT_STARTED && gestures_ctx->cov->n_taps == 1) {
-               gestures_ctx->cov->hover_gesture.state = GESTURE_ONGOING;
-               gestures_ctx->cov->hover_gesture.timestamp = ev->timestamp;
-               gestures_ctx->cov->hover_gesture.last_emission_time = -1;
-               gestures_ctx->cov->hover_gesture.x[0] = ev->root.x;
-               gestures_ctx->cov->hover_gesture.y[0] = ev->root.y;
-               gestures_ctx->cov->hover_gesture.finger[0] = ev->multi.device;
-               gestures_ctx->cov->hover_gesture.n_fingers = 1;
-               _hover_gesture_timer_reset(gestures_ctx, _e_mod_config->one_finger_hover_longpress_timeout);
-       }
-       if (gestures_ctx->cov->hover_gesture.state == GESTURE_ONGOING && gestures_ctx->cov->n_taps == 2) {
-               if (gestures_ctx->cov->hover_gesture.longpressed) {
-                       _hover_event_emit(gestures_ctx, 2);
-                       goto abort;
-               }
-               gestures_ctx->cov->hover_gesture.timestamp = -1;
-               gestures_ctx->cov->hover_gesture.last_emission_time = -1;
-               gestures_ctx->cov->hover_gesture.x[1] = ev->root.x;
-               gestures_ctx->cov->hover_gesture.y[1] = ev->root.y;
-               gestures_ctx->cov->hover_gesture.finger[1] = ev->multi.device;
-               gestures_ctx->cov->hover_gesture.n_fingers = 2;
-               _hover_gesture_timer_reset(gestures_ctx, _e_mod_config->one_finger_hover_longpress_timeout);
-       }
-       // abort gesture if more then 2 fingers touched screen
-       if ((gestures_ctx->cov->hover_gesture.state == GESTURE_ONGOING) && gestures_ctx->cov->n_taps > 2) {
-               DEBUG("More then 2 finged. Abort hover gesture");
-               _hover_event_emit(gestures_ctx, 2);
-               goto abort;
-       }
-       return;
-
-abort:
-       gestures_ctx->cov->hover_gesture.state = GESTURE_ABORTED;
-       if (gestures_ctx->cov->hover_gesture.timer)
-               ecore_timer_del(gestures_ctx->cov->hover_gesture.timer);
-       gestures_ctx->cov->hover_gesture.timer = NULL;
-}
-
-static void _hover_gesture_mouse_up(Ecore_Event_Mouse_Button * ev, Screen_Reader_Gestures_Data *gestures_ctx)
-{
-       if (gestures_ctx == NULL) {
-               ERROR("NULL context parameter");
-               return;
-       }
-
-       if (gestures_ctx->cov->hover_gesture.state == GESTURE_ONGOING) {
-               int i;
-               for (i = 0; i < gestures_ctx->cov->hover_gesture.n_fingers; i++) {
-                       if (gestures_ctx->cov->hover_gesture.finger[i] == ev->multi.device)
-                               break;
-               }
-               if (i == gestures_ctx->cov->hover_gesture.n_fingers) {
-                       DEBUG("Invalid finger id: %d", ev->multi.device);
-                       return;
-               }
-               else {
-                       gestures_ctx->cov->hover_gesture.state = GESTURE_ABORTED;
-                       if (gestures_ctx->cov->hover_gesture.timer)
-                               ecore_timer_del(gestures_ctx->cov->hover_gesture.timer);
-                       gestures_ctx->cov->hover_gesture.timer = NULL;
-                       // aditionally emit event to complete sequence
-                       if (gestures_ctx->cov->hover_gesture.longpressed)
-                               _hover_event_emit(gestures_ctx, 2);
-               }
-       }
-       // reset gesture only if user released all his fingers
-       if (gestures_ctx->cov->n_taps == 0)
-               gestures_ctx->cov->hover_gesture.state = GESTURE_NOT_STARTED;
-}
-
 #ifdef X11_ENABLED
 static void _get_root_coords(Ecore_X_Window win, int *x, int *y)
 {
@@ -726,51 +242,9 @@ Ecore_X_Window top_window_get(int x, int y, Screen_Reader_Gestures_Data *gesture
        }
        return 0;
 }
-#else
-Ecore_Wl_Window *top_window_get(int x, int y)
-{
-       return 0;
-}
 #endif
 
 
-void start_scroll(int x, int y, Screen_Reader_Gestures_Data *gestures_ctx)
-{
-       if( gestures_ctx == NULL)
-               ERROR("NULL context parameter");
-
-#ifdef X11_ENABLED
-       Ecore_X_Window wins[1] = { gestures_ctx->win };
-       Ecore_X_Window under = ecore_x_window_at_xy_with_skip_get(x, y, wins, sizeof(wins) / sizeof(wins[0]));
-       _get_root_coords(under, gestures_ctx.rx, gestures_ctx.ry);
-       ecore_x_mouse_in_send(under, x - gestures_ctx->rx, y - gestures_ctx->ry);
-       ecore_x_window_focus(under);
-       ecore_x_mouse_down_send(under, x - gestures_ctx->rx, y - gestures_ctx->ry, 1);
-       gestures_ctx->scrolled_win = under;
-#endif
-}
-
-void continue_scroll(int x, int y, Screen_Reader_Gestures_Data *gestures_ctx)
-{
-       if( gestures_ctx == NULL)
-               ERROR("NULL context parameter");
-
-#ifdef X11_ENABLED
-       ecore_x_mouse_move_send(gestures_ctx->scrolled_win, x - gestures_ctx->rx, y - gestures_ctx->ry);
-#endif
-}
-
-void end_scroll(int x, int y, Screen_Reader_Gestures_Data *gestures_ctx)
-{
-       if( gestures_ctx == NULL)
-               ERROR("NULL context parameter");
-
-#ifdef X11_ENABLED
-       ecore_x_mouse_up_send(gestures_ctx->scrolled_win, x - gestures_ctx->rx, y - gestures_ctx->ry, 1);
-       ecore_x_mouse_out_send(gestures_ctx->scrolled_win, x - gestures_ctx->rx, y - gestures_ctx->ry);
-#endif
-}
-
 static unsigned int _win_angle_get(void)
 {
        int angle = 0;
@@ -795,56 +269,6 @@ static unsigned int _win_angle_get(void)
        return angle;
 }
 
-static void _hover_event_emit(Screen_Reader_Gestures_Data *gestures_ctx, int state)
-{
-       if( gestures_ctx == NULL)
-               ERROR("NULL context parameter");
-
-       int ax = 0, ay = 0, j;
-
-       for (j = 0; j < gestures_ctx->cov->hover_gesture.n_fingers; j++) {
-               ax += gestures_ctx->cov->hover_gesture.x[j];
-               ay += gestures_ctx->cov->hover_gesture.y[j];
-       }
-
-       ax /= gestures_ctx->cov->hover_gesture.n_fingers;
-       ay /= gestures_ctx->cov->hover_gesture.n_fingers;
-
-       switch (gestures_ctx->cov->hover_gesture.n_fingers) {
-       case 1:
-               INFO("ONE FINGER HOVER");
-               _event_emit(ONE_FINGER_HOVER, ax, ay, ax, ay, state, gestures_ctx->cov->event_time);
-               break;
-       default:
-               break;
-       }
-}
-
-static void _hover_gesture_mouse_move(Ecore_Event_Mouse_Move * ev, Screen_Reader_Gestures_Data *gestures_ctx)
-{
-       if( gestures_ctx == NULL)
-               ERROR("NULL context parameter");
-
-       if (gestures_ctx->cov->hover_gesture.state == GESTURE_ONGOING) {
-               // check fingers
-               int i;
-               if (!gestures_ctx->cov->hover_gesture.longpressed)
-                       return;
-
-               for (i = 0; i < gestures_ctx->cov->hover_gesture.n_fingers; i++) {
-                       if (gestures_ctx->cov->hover_gesture.finger[i] == ev->multi.device)
-                               break;
-               }
-               if (i == gestures_ctx->cov->hover_gesture.n_fingers) {
-                       DEBUG("Invalid finger id: %d", ev->multi.device);
-                       return;
-               }
-               gestures_ctx->cov->hover_gesture.x[i] = ev->root.x;
-               gestures_ctx->cov->hover_gesture.y[i] = ev->root.y;
-               _hover_event_emit(gestures_ctx, 1);
-       }
-}
-
 static void _tap_event_emit(Screen_Reader_Gestures_Data *gestures_ctx, int state)
 {
        if( gestures_ctx == NULL)
@@ -1023,189 +447,6 @@ static void _tap_gestures_mouse_down(Ecore_Event_Mouse_Button * ev, Screen_Reade
        }
 }
 
-static void _tap_gestures_mouse_up(Ecore_Event_Mouse_Button * ev, Screen_Reader_Gestures_Data *gestures_ctx)
-{
-       if (gestures_ctx == NULL)
-               ERROR("NULL context parameter");
-
-       if (gestures_ctx->cov->tap_gesture_data.timer) {
-               gestures_ctx->cov->tap_gesture_data.pressed = EINA_FALSE;
-
-               if (ev->multi.device == gestures_ctx->cov->tap_gesture_data.finger[0]) {
-                       DEBUG("First finger up");
-
-                       int dx = ev->root.x - gestures_ctx->cov->tap_gesture_data.x_org[0];
-                       int dy = ev->root.y - gestures_ctx->cov->tap_gesture_data.y_org[0];
-
-                       if ((dx * dx + dy * dy) < _e_mod_config->one_finger_tap_radius * _e_mod_config->one_finger_tap_radius) {
-                               if (gestures_ctx->cov->n_taps == 0) {
-                                       gestures_ctx->cov->tap_gesture_data.n_taps++;
-                               }
-                       } else {
-                               ERROR("Abort gesture");
-                               gestures_ctx->cov->tap_gesture_data.started = EINA_FALSE;
-                       }
-               } else if (ev->multi.device == gestures_ctx->cov->tap_gesture_data.finger[1]) {
-                       DEBUG("Second finger up");
-
-                       int dx = ev->root.x - gestures_ctx->cov->tap_gesture_data.x_org[1];
-                       int dy = ev->root.y - gestures_ctx->cov->tap_gesture_data.y_org[1];
-
-                       if ((dx * dx + dy * dy) < _e_mod_config->one_finger_tap_radius * _e_mod_config->one_finger_tap_radius) {
-                               if (gestures_ctx->cov->n_taps == 0) {
-                                       gestures_ctx->cov->tap_gesture_data.n_taps++;
-                               }
-                       } else {
-                               ERROR("Abort gesture");
-                               gestures_ctx->cov->tap_gesture_data.started = EINA_FALSE;
-                       }
-               } else if (ev->multi.device == gestures_ctx->cov->tap_gesture_data.finger[2]) {
-                       DEBUG("Third finger up");
-
-                       int dx = ev->root.x - gestures_ctx->cov->tap_gesture_data.x_org[2];
-                       int dy = ev->root.y - gestures_ctx->cov->tap_gesture_data.y_org[2];
-
-                       if ((dx * dx + dy * dy) < _e_mod_config->one_finger_tap_radius * _e_mod_config->one_finger_tap_radius) {
-                               if (gestures_ctx->cov->n_taps == 0) {
-                                       gestures_ctx->cov->tap_gesture_data.n_taps++;
-                               }
-                       } else {
-                               ERROR("Abort gesture");
-                               gestures_ctx->cov->tap_gesture_data.started = EINA_FALSE;
-                       }
-               } else {
-                       ERROR("Unknown finger up, abort gesture");
-                       gestures_ctx->cov->tap_gesture_data.started = EINA_FALSE;
-               }
-       }
-}
-
-static void _tap_gestures_move(Ecore_Event_Mouse_Move * ev, Screen_Reader_Gestures_Data *gestures_ctx)
-{
-       if (gestures_ctx == NULL)
-               ERROR("NULL context parameter");
-
-       int i;
-       for (i = 0; i < sizeof(gestures_ctx->cov->tap_gesture_data.finger) / sizeof(gestures_ctx->cov->tap_gesture_data.finger[0]); i++) {
-               if (ev->multi.device == gestures_ctx->cov->tap_gesture_data.finger[i]) {
-                       int dx = ev->root.x - gestures_ctx->cov->tap_gesture_data.x_org[i];
-                       int dy = ev->root.y - gestures_ctx->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) {
-                               DEBUG("abort tap gesutre");
-                               gestures_ctx->cov->tap_gesture_data.started = EINA_FALSE;
-                               ecore_timer_del(gestures_ctx->cov->tap_gesture_data.timer);
-                               gestures_ctx->cov->tap_gesture_data.timer = NULL;
-                               gestures_ctx->cov->tap_gesture_data.tap_type = ONE_FINGER_GESTURE;
-                               gestures_ctx->cov->tap_gesture_data.finger[0] = -1;
-                               gestures_ctx->cov->tap_gesture_data.finger[1] = -1;
-                               gestures_ctx->cov->tap_gesture_data.finger[2] = -1;
-                       }
-                       break;
-               }
-       }
-}
-
-static Eina_Bool _cb_mouse_down(void *data, int type EINA_UNUSED, void *event)
-{
-       Ecore_Event_Mouse_Button *ev = event;
-       Screen_Reader_Gestures_Data *gestures_ctx = (Screen_Reader_Gestures_Data *)data;
-       if(gestures_ctx == NULL) {
-               ERROR("NULL context parameter");
-               return;
-       }
-
-       gestures_ctx->cov->n_taps++;
-       gestures_ctx->cov->event_time = ev->timestamp;
-
-       DEBUG("mouse down: multi.device: %d, taps: %d", ev->multi.device, gestures_ctx->cov->n_taps);
-
-       win_angle = _win_angle_get();
-
-       _flick_gesture_mouse_down(ev, gestures_ctx);
-       _hover_gesture_mouse_down(ev, gestures_ctx);
-       _tap_gestures_mouse_down(ev, gestures_ctx);
-
-       free(gestures_ctx);
-       return ECORE_CALLBACK_PASS_ON;
-}
-
-static Eina_Bool _cb_mouse_up(void *data, int type EINA_UNUSED, void *event)
-{
-       Ecore_Event_Mouse_Button *ev = event;
-       Screen_Reader_Gestures_Data *gestures_ctx = (Screen_Reader_Gestures_Data *)data;
-       if(gestures_ctx == NULL) {
-               ERROR("NULL context parameter");
-               return;
-       }
-
-       gestures_ctx->cov->n_taps--;
-       gestures_ctx->cov->event_time = ev->timestamp;
-
-       DEBUG("mouse up, multi.device: %d, taps: %d", ev->multi.device, gestures_ctx->cov->n_taps);
-
-       _flick_gesture_mouse_up(ev, gestures_ctx);
-       _hover_gesture_mouse_up(ev, gestures_ctx);
-       _tap_gestures_mouse_up(ev, gestures_ctx);
-
-       return ECORE_CALLBACK_PASS_ON;
-}
-
-static Eina_Bool _cb_mouse_move(void *data, int type EINA_UNUSED, void *event)
-{
-       Ecore_Event_Mouse_Move *ev = event;
-       Screen_Reader_Gestures_Data *gestures_ctx = (Screen_Reader_Gestures_Data *)data;
-       if(gestures_ctx == NULL) {
-               ERROR("NULL context parameter");
-               return;
-       }
-
-       gestures_ctx->cov->event_time = ev->timestamp;
-
-       _flick_gesture_mouse_move(ev, gestures_ctx);
-       _hover_gesture_mouse_move(ev, gestures_ctx);
-       _tap_gestures_move(ev, gestures_ctx);
-
-       return ECORE_CALLBACK_PASS_ON;
-}
-
-static Eina_Bool _gesture_input_win_create(Screen_Reader_Gestures_Data *gestures_ctx)
-{
-       int w, h;
-
-       if (gestures_ctx == NULL) {
-               ERROR("NULL context parameter");
-               return;
-       }
-
-       if (!gestures_ctx->win) {
-#ifdef X11_ENABLED
-               Ecore_Window root = ecore_x_window_root_first_get();
-               if (!root)
-                       return EINA_FALSE;
-               ecore_x_window_geometry_get(root, NULL, NULL, &w, &h);
-               gestures_ctx->win = ecore_x_window_input_new(root, 0, 0, w, h);
-#else
-               ecore_wl_screen_size_get(&w, &h);
-               gestures_ctx->win = ecore_wl_window_new(NULL, 0, 0, w, h, ECORE_WL_WINDOW_BUFFER_TYPE_EGL_WINDOW);
-#endif
-       }
-       if (!gestures_ctx->win)
-               return EINA_FALSE;
-
-#ifdef X11_ENABLED
-       ecore_x_input_multi_select(gestures_ctx->win);
-       ecore_x_window_show(gestures_ctx->win);
-       ecore_x_window_raise(gestures_ctx->win);
-#else
-       ecore_wl_window_show(gestures_ctx->win);
-       ecore_wl_window_raise(gestures_ctx->win);
-#endif
-       // restet gestures
-       memset(gestures_ctx->cov, 0x0, sizeof(gestures_ctx->cov));
-
-       return EINA_TRUE;
-}
 #ifdef X11_ENABLED
 static Eina_Bool _win_property_changed(void *data, int type, void *event)
 {
@@ -1225,108 +466,3 @@ static Eina_Bool _win_property_changed(void *data, int type, void *event)
        return EINA_TRUE;
 }
 #endif
-
-static Eina_Bool _gestures_input_window_init(Screen_Reader_Gestures_Data *gestures_ctx)
-{
-       if(gestures_ctx == NULL) {
-               ERROR("NULL context parameter");
-               return EINA_FALSE;
-       }
-
-#ifdef X11_ENABLED
-       Ecore_Window root = ecore_x_window_root_first_get();
-       if (!root) {
-               ERROR("No root window found. Is Window manager running?");
-               return EINA_FALSE;
-       }
-       ecore_x_event_mask_set(root, ECORE_X_EVENT_MASK_WINDOW_PROPERTY);
-       gestures_ctx->property_changed_hld = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_PROPERTY, _win_property_changed, NULL);
-#endif
-       return _gesture_input_win_create(gestures_ctx);
-}
-
-static void _gestures_input_widnow_shutdown(Screen_Reader_Gestures_Data *gestures_ctx)
-{
-       if(gestures_ctx == NULL) {
-               ERROR("NULL context parameter");
-               return;
-       }
-
-       ecore_event_handler_del(gestures_ctx->property_changed_hld);
-       if (gestures_ctx->win)
-#ifdef X11_ENABLED
-               ecore_x_window_free(gestures_ctx->win);
-#else
-               ecore_wl_window_free(gestures_ctx->win);
-#endif
-       gestures_ctx->win = 0;
-}
-
-Screen_Reader_Gestures_Data *screen_reader_gestures_init(void)
-{
-       Screen_Reader_Gestures_Data *gestures_ctx = calloc(1, sizeof(Screen_Reader_Gestures_Data));
-       if (gestures_ctx == NULL) {
-               ERROR("NULL context parameter");
-               free(gestures_ctx);
-               return NULL;
-       }
-
-       ecore_init();
-#ifdef X11_ENABLED
-       ecore_x_init(NULL);
-#else
-       ecore_wl_init(NULL);
-#endif
-
-       if (!_gestures_input_window_init(gestures_ctx)) {
-               free(gestures_ctx);
-               return NULL;
-       }
-
-       _e_mod_config = calloc(sizeof(Gestures_Config), 1);
-       _e_mod_config->one_finger_flick_min_length = 100;
-       _e_mod_config->one_finger_flick_max_time = 400;
-       _e_mod_config->two_finger_flick_to_scroll_timeout = 100;
-       _e_mod_config->two_finger_flick_to_scroll_min_length = 50;
-       _e_mod_config->one_finger_hover_longpress_timeout = 0.81;
-       _e_mod_config->one_finger_tap_timeout = 0.4;
-       _e_mod_config->one_finger_tap_radius = 100;
-
-       gestures_ctx->handlers = eina_list_append(NULL, ecore_event_handler_add(ECORE_EVENT_MOUSE_MOVE, _cb_mouse_move, gestures_ctx));
-       gestures_ctx->handlers = eina_list_append(gestures_ctx->handlers, ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_UP, _cb_mouse_up, gestures_ctx));
-       gestures_ctx->handlers = eina_list_append(gestures_ctx->handlers, ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, _cb_mouse_down, gestures_ctx));
-
-       return gestures_ctx;
-}
-
-void screen_reader_gestures_shutdown(Screen_Reader_Gestures_Data *gestures_ctx)
-{
-       if(gestures_ctx == NULL) {
-               ERROR("NULL context parameter");
-               free(gestures_ctx);
-               return;
-       }
-
-       Ecore_Event_Handler *hdlr;
-       EINA_LIST_FREE(gestures_ctx->handlers, hdlr) {
-               ecore_event_handler_del(hdlr);
-       }
-       _gestures_input_widnow_shutdown(gestures_ctx);
-#ifdef X11_ENABLED
-       ecore_x_shutdown();
-#else
-       ecore_wl_shutdown();
-#endif
-       ecore_shutdown();
-       free(_e_mod_config);
-       free(gestures_ctx);
-}
-
-void screen_reader_gestures_tracker_register(GestureCB cb, void *data, Screen_Reader_Gestures_Data *gestures_ctx)
-{
-       if(gestures_ctx == NULL)
-               ERROR("NULL context parameter");
-
-       gestures_ctx->_global_cb = cb;
-       gestures_ctx->_global_data = data;
-}
index 5880d769255b5b0d7488f3a268240e97f1fc722e..95f40826fa738546b89efeb2578af374777e0677 100644 (file)
@@ -108,25 +108,3 @@ void haptic_vibrate_start(int duration, int feedback, Haptic_Data *haptic_data)
                ERROR("Cannot start vibration");
        }
 }
-
-/**
- * @brief Stop vibrations
- *
- */
-void haptic_vibrate_stop(Haptic_Data *haptic_data)
-{
-       if (haptic_data == NULL) {
-               ERROR("NULL context parameter");
-               return;
-       }
-
-       if (!haptic_data->handle) {
-               ERROR("Haptic handle lost");
-               return;
-       }
-       if (!device_haptic_stop(haptic_data->handle, &haptic_data->effect_handle)) {
-               ERROR("Vibrations stopped!");
-       } else {
-               DEBUG(RED "Cannot stop vibration" RESET);
-       }
-}
index 9aa7619a92b33ce7c127277920156b6064e530d1..9dc0b68573ba8d19dfd8c99edaf12bea62751a73 100644 (file)
@@ -35,26 +35,6 @@ struct Screen_Reader_Spi_Data_s {
        int last_caret_position;
 };
 
-/**
- * @brief Debug function. Print current toolkit version/event
- * type/event source/event detail1/event detail2
- *
- * @param AtspiEvent instance
- *
- */
-static void display_info(const AtspiEvent *event)
-{
-       AtspiAccessible *source = event->source;
-       gchar *name = atspi_accessible_get_name(source, NULL);
-       gchar *role = atspi_accessible_get_localized_role_name(source, NULL);
-       gchar *toolkit = atspi_accessible_get_toolkit_name(source, NULL);
-
-       DEBUG("--------------------------------------------------------");
-       DEBUG("Toolkit: %s; Event_type: %s; (%d, %d)", toolkit, event->type, event->detail1, event->detail2);
-       DEBUG("Name: %s; Role: %s", name, role);
-       DEBUG("--------------------------------------------------------");
-}
-
 bool allow_recursive_name(AtspiAccessible *obj)
 {
        AtspiRole r = atspi_accessible_get_role(obj, NULL);
@@ -109,341 +89,3 @@ char *generate_description_for_subtree(AtspiAccessible *obj)
        return strdup(ret);
 }
 
-static char *spi_on_state_changed_get_text(AtspiEvent *event, Screen_Reader_Spi_Data_t *spi_data)
-{
-       char *name;
-       char *names = NULL;
-       char *description;
-       char *role_name;
-       char *other;
-       char ret[256] = "\0";
-
-       if (!spi_data)
-       {
-               ERROR("Invalid parameter");
-               return NULL;
-       }
-
-       spi_data->currently_focused = event->source;
-
-       description = atspi_accessible_get_description(spi_data->currently_focused, NULL);
-       name = atspi_accessible_get_name(spi_data->currently_focused, NULL);
-       role_name = atspi_accessible_get_localized_role_name(spi_data->currently_focused, NULL);
-       other = generate_description_for_subtree(spi_data->currently_focused);
-
-       DEBUG("->->->->->-> WIDGET GAINED HIGHLIGHT: %s <-<-<-<-<-<-<-", name);
-       DEBUG("->->->->->-> FROM SUBTREE HAS NAME:  %s <-<-<-<-<-<-<-", other);
-
-       if (name && strncmp(name, "\0", 1))
-               names = strdup(name);
-       else if (other && strncmp(other, "\0", 1))
-               names = strdup(other);
-
-       if (names) {
-               strncat(ret, names, sizeof(ret) - strlen(ret) - 1);
-               strncat(ret, ", ", sizeof(ret) - strlen(ret) - 1);
-       }
-
-       if (role_name)
-               strncat(ret, role_name, sizeof(ret) - strlen(ret) - 1);
-
-       if (description) {
-               if (strncmp(description, "\0", 1))
-                       strncat(ret, ", ", sizeof(ret) - strlen(ret) - 1);
-               strncat(ret, description, sizeof(ret) - strlen(ret) - 1);
-       }
-
-       free(name);
-       free(names);
-       free(description);
-       free(role_name);
-       free(other);
-
-       return strdup(ret);
-}
-
-static char *spi_on_caret_move_get_text(AtspiEvent *event, void *user_data)
-{
-       if (!user_data) {
-               ERROR("Invalid parameter");
-               return NULL;
-       }
-
-       Screen_Reader_Spi_Data_t *spi_data = (Screen_Reader_Spi_Data_t *)user_data;
-       spi_data->currently_focused = event->source;
-       if (spi_data->last_caret_position == event->detail1) // ignore fake moves, selection moves etc.
-               return NULL;
-
-       spi_data->last_caret_position = event->detail1;
-
-       if (spi_data->ignore_next_caret_move) {
-               spi_data->ignore_next_caret_move = EINA_FALSE;
-               return NULL;
-       }
-
-       AtspiText *text_interface = atspi_accessible_get_text_iface(spi_data->currently_focused);
-       char *return_text = NULL;
-       if (text_interface) {
-               DEBUG("->->->->->-> WIDGET CARET MOVED: %s <-<-<-<-<-<-<-", atspi_accessible_get_name(spi_data->currently_focused, NULL));
-
-               int char_count = (int)atspi_text_get_character_count(text_interface, NULL);
-               int caret_pos = atspi_text_get_caret_offset(text_interface, NULL);
-               gchar *text = atspi_text_get_text(text_interface, caret_pos, caret_pos + 1, NULL);
-               char *added_text = NULL;
-
-               if (!caret_pos) {
-                       DEBUG("MIN POSITION REACHED");
-                       added_text = _("IDS_REACHED_MIN_POS");
-               }
-               else if (char_count == caret_pos) {
-                       DEBUG("MAX POSITION REACHED");
-                       added_text = _("IDS_REACHED_MAX_POS");
-               }
-
-               if (added_text)
-                       asprintf(&return_text, "%s %s", text, added_text);
-               else
-                       asprintf(&return_text, "%s", text);
-               g_free(text);
-               g_object_unref(text_interface);
-       }
-
-       return return_text;
-}
-
-static int spi_get_text_interface_text_length(AtspiEvent *event, Screen_Reader_Spi_Data_t *spi_data)
-{
-       AtspiText *text_interface;
-
-       spi_data->currently_focused = event->source;
-       text_interface = atspi_accessible_get_text_iface(spi_data->currently_focused);
-
-       if (text_interface) {
-               return (int)atspi_text_get_character_count(text_interface, NULL);
-       }
-
-       return -1;
-}
-
-static char *spi_on_value_changed_get_text(AtspiEvent *event, Screen_Reader_Spi_Data_t *spi_data)
-{
-       char *text_to_read = NULL;
-
-       spi_data->currently_focused = event->source;
-
-       AtspiValue *value_interface = atspi_accessible_get_value_iface(spi_data->currently_focused);
-
-       if (value_interface) {
-               DEBUG("->->->->->-> WIDGET VALUE CHANGED: %s <-<-<-<-<-<-<-", atspi_accessible_get_name(spi_data->currently_focused, NULL));
-
-               double current_temp_value = (double)atspi_value_get_current_value(value_interface, NULL);
-
-               if (abs(current_temp_value - atspi_value_get_maximum_value(value_interface, NULL)) < EPS) {
-                       DEBUG("MAX VALUE REACHED");
-
-                       if (asprintf(&text_to_read, "%.2f %s", current_temp_value, _("IDS_REACHED_MAX_VAL")) < 0) {
-                               ERROR(MEMORY_ERROR);
-                               return NULL;
-                       }
-               } else if (abs(current_temp_value - atspi_value_get_minimum_value(value_interface, NULL)) < EPS) {
-                       DEBUG("MIN VALUE REACHED");
-                       if (asprintf(&text_to_read, "%.2f %s", current_temp_value, _("IDS_REACHED_MIN_VAL")) < 0) {
-                               ERROR(MEMORY_ERROR);
-                               return NULL;
-                       }
-               } else {
-                       if (asprintf(&text_to_read, "%.2f", current_temp_value) < 0) {
-                               ERROR(MEMORY_ERROR);
-                               return NULL;
-                       }
-               }
-       }
-
-       return text_to_read;
-}
-
-static char *spi_on_text_delete(AtspiEvent *event, Screen_Reader_Spi_Data_t *spi_data)
-{
-       char ret[TTS_MAX_TEXT_SIZE] = "\0";
-
-       if (event->detail2 == 1) {
-               strncpy(ret, g_value_get_string(&event->any_data), sizeof(ret) - 1);
-               strncat(ret, _("IDS_REMOVED"), sizeof(ret) - strlen(ret) - 1);
-       } else {
-               strncpy(ret, _("IDS_TEXT_REMOVED"), sizeof(ret) - 1);
-       }
-
-       if (event->detail1 != spi_data->last_caret_position) {
-               if (event->detail1 == 0) {
-                       strncat(ret, _("IDS_REACHED_MIN_POS"), sizeof(ret) - strlen(ret) - 1);
-               }
-               spi_data->ignore_next_caret_move = EINA_TRUE;
-       } else if (event->detail1 == spi_get_text_interface_text_length(event, spi_data)) {
-               strncat(ret, _("IDS_REACHED_MAX_POS"), sizeof(ret) - strlen(ret) - 1);
-       }
-
-       return strdup(ret);
-}
-
-char *spi_event_get_text_to_read(AtspiEvent *event, Service_Data *sd)
-{
-       DEBUG("START");
-
-       if (!sd) {
-               ERROR("Invalid parameter");
-               return NULL;
-       }
-
-       Screen_Reader_Spi_Data_t *spi_data = sd->spi_data;
-
-       if (!spi_data) {
-               ERROR("Invalid parameter");
-               return NULL;
-       }
-
-       char *text_to_read = NULL;
-
-       char *tracking_signal_name = get_tracking_signal_name(sd->vconf_data);
-       if (!tracking_signal_name) {
-               ERROR("Invalid tracking signal name");
-               return NULL;
-       }
-
-       DEBUG("TRACK SIGNAL:%s", tracking_signal_name);
-       DEBUG("WENT EVENT:%s", event->type);
-
-       if (!strcmp(event->type, tracking_signal_name) && event->detail1 == 1) {
-               text_to_read = spi_on_state_changed_get_text(event, spi_data);
-
-       } else if (!strcmp(event->type, CARET_MOVED_SIG)) {
-               text_to_read = spi_on_caret_move_get_text(event, spi_data);
-
-       } else if (!strcmp(event->type, TEXT_INSERT_SIG)) {
-               spi_data->ignore_next_caret_move = EINA_TRUE;
-               if (event->detail2 == 1) {
-                       text_to_read = strdup(g_value_get_string(&event->any_data));
-               } else {
-                       text_to_read = strdup(_("IDS_TEXT_INSERTED"));
-               }
-
-       } else if (!strcmp(event->type, TEXT_DELETE_SIG)) {
-               text_to_read = spi_on_text_delete(event, spi_data);
-
-       } else if (!strcmp(event->type, VALUE_CHANGED_SIG)) {
-               text_to_read = spi_on_value_changed_get_text(event, spi_data);
-
-       } else if (!strcmp(event->type, STATE_FOCUSED_SIG)) {
-               spi_data->ignore_next_caret_move = EINA_TRUE;
-               spi_data->last_caret_position = -1;
-
-       } else {
-               ERROR("Unknown event type");
-               return NULL;
-       }
-
-       return text_to_read;
-}
-
-void spi_event_listener_cb(AtspiEvent *event, void *user_data)
-{
-       DEBUG("START");
-       display_info(event);
-
-       if (!user_data) {
-               ERROR("Invalid parameter");
-               return;
-       }
-
-       Service_Data *service_data = (Service_Data *)user_data;
-       if (!service_data) {
-               ERROR("NULL context parameter");
-               return;
-       }
-
-       Screen_Reader_Tts_Data_t *tts_data = service_data->tts_data;
-       if (!tts_data) {
-               ERROR("NULL context");
-               return;
-       }
-       char *text_to_read = spi_event_get_text_to_read(event, service_data);
-
-       if (!text_to_read) {
-               DEBUG("No text to read");
-               return;
-       }
-       DEBUG("SPEAK: %s", text_to_read);
-       tts_speak_customized(text_to_read, EINA_TRUE, EINA_TRUE, event->source, tts_data);
-
-       free(text_to_read);
-       DEBUG("END");
-}
-
-/**
-  * @brief Register new listener and log error if any
-**/
-static void spi_listener_register(AtspiEventListener *spi_listener, const char *signal_name)
-{
-       GError *error = NULL;
-
-       if (atspi_event_listener_register(spi_listener, signal_name, &error) == false) {
-               ERROR("FAILED TO REGISTER spi %s listener. Error: %s", signal_name, error ? error->message : "no error message");
-               if (error)
-                       g_clear_error(&error);
-       } else {
-               DEBUG("spi %s listener REGISTERED", signal_name);
-       }
-}
-
-/**
-  * @brief Initializer for screen-reader atspi listeners
-  *
-  * @param user_data screen-reader internal data
-  *
-**/
-Screen_Reader_Spi_Data_t *spi_init(Service_Data *service_data)
-{
-       DEBUG("--------------------- SPI_init START ---------------------");
-
-       if (!service_data) {
-               ERROR("Invalid parameter");
-               return NULL;
-       }
-
-       char *tracking_signal_name = get_tracking_signal_name(service_data->vconf_data);
-
-       Screen_Reader_Spi_Data_t *spi_data = malloc(sizeof(Screen_Reader_Spi_Data_t));
-       spi_data->ignore_next_caret_move = EINA_FALSE;
-       spi_data->last_caret_position = -1;
-
-       DEBUG(">>> Creating listeners <<<");
-
-       spi_data->spi_listener = atspi_event_listener_new(spi_event_listener_cb, service_data, NULL);
-       if (spi_data->spi_listener == NULL) {
-               DEBUG("FAILED TO CREATE spi state changed listener");
-       }
-       // ---------------------------------------------------------------------------------------------------
-
-       DEBUG("TRACKING SIGNAL:%s", tracking_signal_name);
-
-       spi_listener_register(spi_data->spi_listener, CARET_MOVED_SIG);
-       spi_listener_register(spi_data->spi_listener, VALUE_CHANGED_SIG);
-       spi_listener_register(spi_data->spi_listener, STATE_FOCUSED_SIG);
-       spi_listener_register(spi_data->spi_listener, TEXT_INSERT_SIG);
-       spi_listener_register(spi_data->spi_listener, TEXT_DELETE_SIG);
-
-       DEBUG("---------------------- SPI_init END ----------------------\n\n");
-
-       return spi_data;
-}
-
-void spi_shutdown(Screen_Reader_Spi_Data_t *spi_data)
-{
-       DEBUG("[START]");
-       //TODO unregister atspi listeners
-       if (!spi_data) {
-               ERROR("NULL context parameter");
-               return;
-       }
-       free(spi_data);
-       DEBUG("[END]");
-}
index 502624c1ab1a3dbb040d60e5c74d79ef29cdf968..fd8f8cbdccf78ce589372e76e51cb12282b7383d 100644 (file)
@@ -5,69 +5,6 @@
 #define E_A11Y_SERVICE_NAVI_IFC_NAME "org.tizen.GestureNavigation"
 #define E_A11Y_SERVICE_NAVI_OBJ_PATH "/org/tizen/GestureNavigation"
 
-Eina_Bool screen_reader_switch_enabled_get(Eina_Bool * value)
-{
-       Eldbus_Connection *conn;
-       Eldbus_Object *dobj;
-       Eldbus_Proxy *proxy;
-       Eldbus_Message *req, *reply;
-       const char *errname = NULL, *errmsg = NULL;
-       Eina_Bool ret = EINA_FALSE;
-       Eldbus_Message_Iter *iter;
-
-       eldbus_init();
-
-       if (!(conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SESSION))) {
-               ERROR("Connection to session bus failed");
-               return EINA_FALSE;
-       }
-       if (!(dobj = eldbus_object_get(conn, "org.a11y.Bus", "/org/a11y/bus"))) {
-               ERROR("Failed to create eldbus object for /org/a11y/bus");
-               goto fail_obj;
-       }
-       if (!(proxy = eldbus_proxy_get(dobj, "org.freedesktop.DBus.Properties"))) {
-               ERROR("Failed to create proxy object for 'org.freedesktop.DBus.Properties'");
-               goto fail_proxy;
-       }
-       if (!(req = eldbus_proxy_method_call_new(proxy, "Get"))) {
-               ERROR("Failed to create method call on org.freedesktop.DBus.Properties.Get");
-               goto fail_proxy;
-       }
-       eldbus_message_ref(req);
-
-       if (!eldbus_message_arguments_append(req, "ss", "org.a11y.Status", "ScreenReaderEnabled")) {
-               ERROR("Failed to append message args");
-               goto fail_msg;
-       }
-
-       reply = eldbus_proxy_send_and_block(proxy, req, 100);
-       if (!reply || eldbus_message_error_get(reply, &errname, &errmsg)) {
-               ERROR("Unable to call method org.freedesktop.DBus.Properties.Get: %s %s", errname, errmsg);
-               goto fail_msg;
-       }
-
-       if (!eldbus_message_arguments_get(reply, "v", &iter)) {
-               ERROR("Invalid answer signature");
-               goto fail_msg;
-       } else {
-               if (!eldbus_message_iter_arguments_get(iter, "b", value)) {
-                       ERROR("Invalid variant signature");
-               } else
-                       ret = EINA_TRUE;
-       }
-
- fail_msg:
-       eldbus_message_unref(req);
- fail_proxy:
-       eldbus_object_unref(dobj);
- fail_obj:
-       eldbus_connection_unref(conn);
-
-       eldbus_shutdown();
-
-       return ret;
-}
-
 Eina_Bool screen_reader_switch_enabled_set(Eina_Bool value)
 {
        Eldbus_Connection *conn;
index 7e2c4d951d390b00f02580ab202a7328903b4e06..b5953b3b52bfa91cc3fb45f9ae59de5433a79d93 100644 (file)
@@ -20,6 +20,7 @@
 #include <atspi/atspi.h>
 #include "screen_reader_tts.h"
 #include "screen_reader_vconf.h"
+#include "screen_reader_utils.h"
 #include "dbus_direct_reading_adapter.h"
 #include "logger.h"
 
index c7112edb9b52734e8c65a83da4e6b9756a15ad74..370d8220ef1bd549d2cc1566b9d7e88eaf0d8c4f 100644 (file)
@@ -274,6 +274,14 @@ bool widget_has_state(AtspiAccessible *obj, AtspiStateType type)
        return ret;
 }
 
+#define GERROR_CHECK(error)\
+if (error)\
+       {\
+       ERROR("Error_log:%s",error->message);\
+       g_error_free(error);\
+       error = NULL;\
+       }
+
 Eina_Bool widget_do_action(AtspiAccessible *obj, char *expected_action)
 {
        if (!obj) {
index ec2c6218ea4654d0f5796a6a9f4d43d36ef0bd5d..6b6254160e91341aaaf9e0055e7315f789e21c7b 100644 (file)
@@ -440,11 +440,3 @@ bool get_sound_feedback(Screen_Reader_Vconf_Data_t *vconf_data)
 
        return vconf_data->sound_feedback;
 }
-
-char *get_tracking_signal_name(Screen_Reader_Vconf_Data_t *vconf_data)
-{
-       if (!vconf_data)
-               return NULL;
-
-       return vconf_data->tracking_signal_name;
-}
index e7b86aa80d909ad3e2cb15a1efc18cd314ca7fff..a554bf6c7481d90e5aba2d836f73bddc067c33ee 100644 (file)
@@ -78,75 +78,6 @@ static void _on_atspi_window_cb(const AtspiEvent *event)
        g_free(name);
 }
 
-static AtspiAccessible *_get_active_win(Window_Tracker_Data *wtd)
-{
-       DEBUG("START");
-       int i, j, desktop_children_count, app_children_count;
-
-       if (wtd == NULL) {
-               ERROR("WINDOW TRACKER DATA NOT FOUND");
-               return NULL;
-       }
-
-       wtd->last_active_win = NULL;
-       AtspiAccessible *desktop = atspi_get_desktop(0);
-       if (desktop == NULL) {
-               ERROR("DESKTOP NOT FOUND");
-               return NULL;
-       }
-
-       unsigned int active_window_pid = 0;
-#ifdef X11_ENABLED
-       Ecore_X_Window focus_window = ecore_x_window_focus_get();
-
-       if (focus_window) {
-               //invoking atspi_accessible_get_child_count for non active apps results in very long screen-reader startup
-               //not active apps have low priority and dbus calls take a lot of time (a few hundred ms per call)
-               //Hence we first try to determine accessible window using pid of currently focused window
-               if (!ecore_x_window_prop_card32_get(focus_window, ECORE_X_ATOM_NET_WM_PID, &active_window_pid, 1))
-                       active_window_pid = 0;
-               if (active_window_pid)
-                       DEBUG("First we will try filter apps by PID: %i", active_window_pid);
-       }
-#endif
-       desktop_children_count = atspi_accessible_get_child_count(desktop, NULL);
-       DEBUG("Desktop children count = %d", desktop_children_count);
-       for (i = 0; i < desktop_children_count; i++) {
-               AtspiAccessible *app = atspi_accessible_get_child_at_index(desktop, i, NULL);
-               if (!app) continue;
-               if (active_window_pid == 0 || active_window_pid == atspi_accessible_get_process_id(app, NULL))
-                       app_children_count = atspi_accessible_get_child_count(app, NULL);
-               else
-                       app_children_count = 0;
-               for (j = 0; j < app_children_count; j++) {
-                       AtspiAccessible *win = atspi_accessible_get_child_at_index(app, j, NULL);
-                       AtspiStateSet *states = atspi_accessible_get_state_set(win);
-                       AtspiRole role = atspi_accessible_get_role(win, NULL);
-                       if ((atspi_state_set_contains(states, ATSPI_STATE_ACTIVE)) && (role == ATSPI_ROLE_WINDOW))
-                               wtd->last_active_win = win;
-
-                       g_object_unref(states);
-                       g_object_unref(win);
-
-                       if (wtd->last_active_win)
-                               break;
-               }
-               g_object_unref(app);
-               if (active_window_pid > 0 && (i == desktop_children_count - 1)) {
-                       // we are in last iteration and we should fall back to normal iteration over child windows
-                       // without filtering by focus windows PID
-                       i = -1;
-                       active_window_pid = 0;
-               }
-               if (wtd->last_active_win)
-                       break;
-       }
-       g_object_unref(desktop);
-       DEBUG("END last_active_win: %p", wtd->last_active_win);
-       wtd->top_win = wtd->last_active_win;
-       return wtd->last_active_win;
-}
-
 Window_Tracker_Data *window_tracker_init(void)
 {
        DEBUG("START");
@@ -207,21 +138,6 @@ void window_tracker_register(Window_Tracker_Data *wtd, Window_Tracker_Cb cb, voi
        wtd->user_data = data;
 }
 
-void window_tracker_active_window_request(Window_Tracker_Data *wtd)
-{
-       DEBUG("START");
-
-       if (wtd == NULL) {
-               ERROR("NULL context");
-               return;
-       }
-
-       Window_Tracker_Cb user_cb = wtd->user_cb;
-       _get_active_win(wtd);
-       if (user_cb)
-               user_cb(wtd->user_data, wtd->last_active_win);
-}
-
 AtspiAccessible *window_tracker_top_win_get(Window_Tracker_Data *wtd)
 {
        if (wtd == NULL)