flipselector: fix accessible at point functionality. 46/71646/2
authorLukasz Stanislawski <l.stanislaws@samsung.com>
Tue, 8 Sep 2015 17:06:33 +0000 (19:06 +0200)
committerShinwoo Kim <cinoo.kim@samsung.com>
Thu, 26 May 2016 10:53:44 +0000 (03:53 -0700)
Additionaly compilation warning ware removed.

@tizen_feature

Change-Id: I4ebc6bd414073caaa02ea436a65f54d20c80eb33

src/lib/elm_flipselector.c
src/lib/elm_flipselector.eo

index a4693ed..4b632e2 100644 (file)
@@ -4,6 +4,7 @@
 
 #define ELM_INTERFACE_ATSPI_ACCESSIBLE_PROTECTED
 #define ELM_INTERFACE_ATSPI_WIDGET_ACTION_PROTECTED
+#define ELM_INTERFACE_ATSPI_COMPONENT_PROTECTED
 
 #define ELM_WIDGET_ITEM_PROTECTED
 #include <Elementary.h>
@@ -587,20 +588,22 @@ elm_flipselector_add(Evas_Object *parent)
 }
 
 //TIZEN ONLY(2015090): expose flipselector top/bottom buttons for accessibility tree
-static Eina_Bool _activate_top_cb (void *data, Evas_Object *obj, Elm_Access_Action_Info *action_info)
+static Eina_Bool _activate_top_cb (void *data, Evas_Object *obj EINA_UNUSED, Elm_Access_Action_Info *action_info EINA_UNUSED)
 {
    Elm_Flipselector_Data *sd = (Elm_Flipselector_Data*)data;
    _flipselector_walk(sd);
    _flip_up(sd);
    _flipselector_unwalk(sd);
+   return EINA_TRUE;
 }
 
-static Eina_Bool _activate_bottom_cb (void *data, Evas_Object *obj, Elm_Access_Action_Info *action_info)
+static Eina_Bool _activate_bottom_cb (void *data, Evas_Object *obj EINA_UNUSED, Elm_Access_Action_Info *action_info EINA_UNUSED)
 {
    Elm_Flipselector_Data *sd = (Elm_Flipselector_Data*)data;
    _flipselector_walk(sd);
    _flip_down(sd);
    _flipselector_unwalk(sd);
+   return EINA_TRUE;
 }
 //
 
@@ -865,5 +868,33 @@ _elm_flipselector_elm_interface_atspi_widget_action_elm_actions_get(Eo *obj EINA
    return &atspi_actions[0];
 }
 
+///TIZEN_ONLY(20150716) : fix accessible_at_point getter
+EOLIAN static Eo *
+_elm_flipselector_elm_interface_atspi_component_accessible_at_point_get(Eo *obj, Elm_Flipselector_Data *_pd EINA_UNUSED, Eina_Bool screen_coords, int x, int y)
+{
+   Evas_Coord wx, wy, ww, wh;
+   int ee_x, ee_y;
+
+   if (screen_coords)
+     {
+        Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj));
+        if (!ee) return NULL;
+        ecore_evas_geometry_get(ee, &ee_x, &ee_y, NULL, NULL);
+        x -= ee_x;
+        y -= ee_y;
+     }
+
+   evas_object_geometry_get(_pd->access_top_button, &wx, &wy, &ww, &wh);
+   if (!((x > wx + ww) || (y > wy + wh) || (x < wx - ww) || (y < wy - wh)))
+     return _pd->access_top_button;
+
+   evas_object_geometry_get(_pd->access_bottom_button, &wx, &wy, &ww, &wh);
+   if (!((x > wx + ww) || (y > wy + wh) || (x < wx - ww) || (y < wy - wh)))
+     return _pd->access_bottom_button;
+
+   return NULL;
+}
+///
+
 #include "elm_flipselector_item.eo.c"
 #include "elm_flipselector.eo.c"
index e855927..1ec54b2 100644 (file)
@@ -165,6 +165,9 @@ class Elm.Flipselector (Elm.Layout, Elm_Interface_Atspi_Widget_Action,
       Elm.Widget.event;
       Elm.Layout.sizing_eval;
       Elm_Interface_Atspi_Widget_Action.elm_actions.get;
+      ///TIZEN_ONLY(20150716) : fix accessible_at_point getter
+      Elm_Interface_Atspi_Component.accessible_at_point_get;
+      ///
    }
    events {
       underflowed;