summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukasz Stanislawski <l.stanislaws@samsung.com>2015-05-12 15:23:21 +0200
committerLukasz Stanislawski <l.stanislaws@samsung.com>2015-05-12 15:24:16 +0200
commitadf9c5cb9292746549d15daf3fe568a4990c0906 (patch)
tree1a73ac9c7174bc295b1a7bc8c778a787e195ca3a
parent2fb2e28c1adcb1a9552a02731474e77cb541fcdf (diff)
atspi: fix accessible_at_point method to match specification.
-rw-r--r--src/lib/elm_interface_atspi_component.c37
-rw-r--r--src/lib/elm_interface_atspi_component.eo2
2 files changed, 18 insertions, 21 deletions
diff --git a/src/lib/elm_interface_atspi_component.c b/src/lib/elm_interface_atspi_component.c
index 6218df4a2..5d3eb728a 100644
--- a/src/lib/elm_interface_atspi_component.c
+++ b/src/lib/elm_interface_atspi_component.c
@@ -3,6 +3,7 @@
3#endif 3#endif
4 4
5#define ELM_INTERFACE_ATSPI_COMPONENT_PROTECTED 5#define ELM_INTERFACE_ATSPI_COMPONENT_PROTECTED
6#define ELM_INTERFACE_ATSPI_ACCESSIBLE_PROTECTED
6 7
7#include <Elementary.h> 8#include <Elementary.h>
8 9
@@ -65,33 +66,29 @@ _elm_interface_atspi_component_alpha_get(Eo *obj, void *_pd EINA_UNUSED)
65 return (double)alpha / 255.0; 66 return (double)alpha / 255.0;
66} 67}
67 68
68EOLIAN static Evas_Object * 69EOLIAN static Eo *
69_elm_interface_atspi_component_accessible_at_point_get(Eo *obj, void *_pd EINA_UNUSED, Eina_Bool screen_coords, int x, int y) 70_elm_interface_atspi_component_accessible_at_point_get(Eo *obj, void *_pd EINA_UNUSED, Eina_Bool screen_coords, int x, int y)
70{ 71{
71 Evas_Object *evobj; 72 Eina_List *l, *children;
72 int ee_x, ee_y; 73 Eo *ret = NULL, *child;
73 Eina_List *l, *objs;
74 Evas_Object *ret = NULL;
75 74
76 if (screen_coords) 75 eo_do(obj, children = elm_interface_atspi_accessible_children_get());
77 { 76
78 Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj)); 77 EINA_LIST_FOREACH(children, l, child)
79 if (!ee) return NULL;
80 ecore_evas_geometry_get(ee, &ee_x, &ee_y, NULL, NULL);
81 x -= ee_x;
82 y -= ee_y;
83 }
84 objs = evas_objects_at_xy_get(evas_object_evas_get(obj), x, y, EINA_TRUE, EINA_TRUE);
85 EINA_LIST_FOREACH(objs, l, evobj)
86 { 78 {
87 // return first only, test if there is atspi interface for eo 79 Eina_Bool contains;
88 if (eo_isa(evobj, ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN)) 80 if (eo_isa(child, ELM_INTERFACE_ATSPI_COMPONENT_MIXIN))
89 { 81 {
90 ret = evobj; 82 eo_do(child, contains = elm_interface_atspi_component_contains(screen_coords, x, y));
91 break; 83 if (contains)
84 {
85 ret = child;
86 break;
87 }
92 } 88 }
93 } 89 }
94 eina_list_free(objs); 90
91 eina_list_free(children);
95 return ret; 92 return ret;
96} 93}
97 94
diff --git a/src/lib/elm_interface_atspi_component.eo b/src/lib/elm_interface_atspi_component.eo
index 42f950956..708110c91 100644
--- a/src/lib/elm_interface_atspi_component.eo
+++ b/src/lib/elm_interface_atspi_component.eo
@@ -106,7 +106,7 @@ mixin Elm_Interface_Atspi_Component ()
106 @in int x; 106 @in int x;
107 @in int y; 107 @in int y;
108 } 108 }
109 return: Evas_Object *; 109 return: Eo*;
110 } 110 }
111 } 111 }
112} 112}