From 9dc107692e4ab43025c62b2d33e21549ab114399 Mon Sep 17 00:00:00 2001 From: Lukasz Stanislawski Date: Thu, 23 Nov 2017 16:09:30 +0530 Subject: [PATCH] elm: [Flipselector]fix accessible at point functionality. Additionaly compilation warning ware removed. @tizen_feature orignal patch: 6217239e45ea094b9639037f35ddef6e4e821d7f Change-Id: I3bc9360393100f6d57051aa50cab58d1a7043840 --- src/lib/elementary/elm_flipselector.c | 35 ++++++++++++++++++++++++++++++++-- src/lib/elementary/elm_flipselector.eo | 3 +++ 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/src/lib/elementary/elm_flipselector.c b/src/lib/elementary/elm_flipselector.c index d26e3c4..32d8ed4 100644 --- a/src/lib/elementary/elm_flipselector.c +++ b/src/lib/elementary/elm_flipselector.c @@ -4,6 +4,7 @@ #define EFL_ACCESS_PROTECTED #define EFL_ACCESS_WIDGET_ACTION_PROTECTED +#define EFL_ACCESS_COMPONENT_PROTECTED #define ELM_WIDGET_ITEM_PROTECTED #include @@ -678,20 +679,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; } // @@ -943,6 +946,34 @@ _elm_flipselector_efl_access_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, return &atspi_actions[0]; } +//TIZEN_ONLY(20150716) : fix accessible_at_point getter +EOLIAN static Eo * +_elm_flipselector_efl_access_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; +} +// + /* Standard widget overrides */ ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(elm_flipselector, Elm_Flipselector_Data) diff --git a/src/lib/elementary/elm_flipselector.eo b/src/lib/elementary/elm_flipselector.eo index 4ba48de..e1ddf5b 100644 --- a/src/lib/elementary/elm_flipselector.eo +++ b/src/lib/elementary/elm_flipselector.eo @@ -167,6 +167,9 @@ class Elm.Flipselector (Efl.Ui.Layout, Efl.Ui.Range, Efl.Ui.Range.range_step { get; set; } Efl.Ui.Range.range_value { get; set; } Efl.Access.Widget.Action.elm_actions { get; } + //TIZEN_ONLY(20150716) : fix accessible_at_point getter + Efl.Access.Component.accessible_at_point_get; + // } events { underflowed; [[Called when flipselector is underflowed]] -- 2.7.4