From 54eabd94e29df256122a16c0f7bb5ac17db8ebe7 Mon Sep 17 00:00:00 2001 From: zmike Date: Wed, 7 May 2014 01:08:04 -0400 Subject: [PATCH] Revert "focus: Removed unused parameter from an internal focus function." This reverts commit 5832b692aa5f68a2924bd7886390d489eb13aefb. broke build --- legacy/elementary/src/lib/elm_gengrid.c | 19 +++++++++++++++---- legacy/elementary/src/lib/elm_genlist.c | 19 +++++++++++++++---- legacy/elementary/src/lib/elm_list.c | 19 +++++++++++++++---- legacy/elementary/src/lib/elm_toolbar.c | 25 +++++++++++++++++++------ legacy/elementary/src/lib/elm_widget.c | 5 ++++- legacy/elementary/src/lib/elm_widget.eo | 1 + legacy/elementary/src/lib/elm_widget.h | 2 +- legacy/elementary/src/lib/elm_win.c | 4 ++-- 8 files changed, 72 insertions(+), 22 deletions(-) diff --git a/legacy/elementary/src/lib/elm_gengrid.c b/legacy/elementary/src/lib/elm_gengrid.c index 38063bdfb5..ccf3366dcf 100644 --- a/legacy/elementary/src/lib/elm_gengrid.c +++ b/legacy/elementary/src/lib/elm_gengrid.c @@ -4276,16 +4276,27 @@ elm_gengrid_nth_item_get(const Evas_Object *obj, unsigned int nth) } EOLIAN static void -_elm_gengrid_elm_widget_focus_highlight_geometry_get(Eo *obj, Elm_Gengrid_Data *sd, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h) +_elm_gengrid_elm_widget_focus_highlight_geometry_get(Eo *obj, Elm_Gengrid_Data *sd, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h, Eina_Bool is_next) { Evas_Coord ox, oy, oh, ow, item_x = 0, item_y = 0, item_w = 0, item_h = 0; evas_object_geometry_get(obj, &ox, &oy, &ow, &oh); - if (sd->focused_item) + if (is_next) { - evas_object_geometry_get(VIEW(sd->focused_item), &item_x, &item_y, &item_w, &item_h); - elm_widget_focus_highlight_focus_part_geometry_get(VIEW(sd->focused_item), &item_x, &item_y, &item_w, &item_h); + if (sd->focused_item) + { + evas_object_geometry_get(VIEW(sd->focused_item), &item_x, &item_y, &item_w, &item_h); + elm_widget_focus_highlight_focus_part_geometry_get(VIEW(sd->focused_item), &item_x, &item_y, &item_w, &item_h); + } + } + else + { + if (sd->prev_focused_item) + { + evas_object_geometry_get(VIEW(sd->prev_focused_item), &item_x, &item_y, &item_w, &item_h); + elm_widget_focus_highlight_focus_part_geometry_get(VIEW(sd->prev_focused_item), &item_x, &item_y, &item_w, &item_h); + } } *x = item_x; diff --git a/legacy/elementary/src/lib/elm_genlist.c b/legacy/elementary/src/lib/elm_genlist.c index 6567448202..ce5b94c946 100644 --- a/legacy/elementary/src/lib/elm_genlist.c +++ b/legacy/elementary/src/lib/elm_genlist.c @@ -7418,16 +7418,27 @@ elm_genlist_nth_item_get(const Evas_Object *obj, unsigned int nth) } EOLIAN static void -_elm_genlist_elm_widget_focus_highlight_geometry_get(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h) +_elm_genlist_elm_widget_focus_highlight_geometry_get(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h, Eina_Bool is_next) { Evas_Coord ox, oy, oh, item_x = 0, item_y = 0, item_w = 0, item_h = 0; evas_object_geometry_get(obj, &ox, &oy, NULL, &oh); - if (sd->focused_item) + if (is_next) { - evas_object_geometry_get(VIEW(sd->focused_item), &item_x, &item_y, &item_w, &item_h); - elm_widget_focus_highlight_focus_part_geometry_get(VIEW(sd->focused_item), &item_x, &item_y, &item_w, &item_h); + if (sd->focused_item) + { + evas_object_geometry_get(VIEW(sd->focused_item), &item_x, &item_y, &item_w, &item_h); + elm_widget_focus_highlight_focus_part_geometry_get(VIEW(sd->focused_item), &item_x, &item_y, &item_w, &item_h); + } + } + else + { + if (sd->prev_focused_item) + { + evas_object_geometry_get(VIEW(sd->prev_focused_item), &item_x, &item_y, &item_w, &item_h); + elm_widget_focus_highlight_focus_part_geometry_get(VIEW(sd->prev_focused_item), &item_x, &item_y, &item_w, &item_h); + } } if (item_y < oy) diff --git a/legacy/elementary/src/lib/elm_list.c b/legacy/elementary/src/lib/elm_list.c index 0508978716..d4f1aa54c1 100644 --- a/legacy/elementary/src/lib/elm_list.c +++ b/legacy/elementary/src/lib/elm_list.c @@ -2877,12 +2877,23 @@ _elm_list_item_coordinates_adjust(Elm_List_Item *it, } EOLIAN static void -_elm_list_elm_widget_focus_highlight_geometry_get(Eo *obj EINA_UNUSED, Elm_List_Data *sd, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h) +_elm_list_elm_widget_focus_highlight_geometry_get(Eo *obj EINA_UNUSED, Elm_List_Data *sd, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h, Eina_Bool is_next) { - if (sd->focused_item) + if (is_next) { - _elm_list_item_coordinates_adjust((Elm_List_Item *)sd->focused_item, x, y, w, h); - elm_widget_focus_highlight_focus_part_geometry_get(VIEW(sd->focused_item), x, y, w, h); + if (sd->focused_item) + { + _elm_list_item_coordinates_adjust((Elm_List_Item *)sd->focused_item, x, y, w, h); + elm_widget_focus_highlight_focus_part_geometry_get(VIEW(sd->focused_item), x, y, w, h); + } + } + else + { + if (sd->prev_focused_item) + { + _elm_list_item_coordinates_adjust((Elm_List_Item *)sd->prev_focused_item, x, y, w, h); + elm_widget_focus_highlight_focus_part_geometry_get(VIEW(sd->prev_focused_item), x, y, w, h); + } } } diff --git a/legacy/elementary/src/lib/elm_toolbar.c b/legacy/elementary/src/lib/elm_toolbar.c index 0a62fe1f6b..347b4629b0 100644 --- a/legacy/elementary/src/lib/elm_toolbar.c +++ b/legacy/elementary/src/lib/elm_toolbar.c @@ -2937,14 +2937,27 @@ _elm_toolbar_coordinates_adjust(Elm_Toolbar_Item *it, } EOLIAN static void -_elm_toolbar_elm_widget_focus_highlight_geometry_get(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h) +_elm_toolbar_elm_widget_focus_highlight_geometry_get(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h, Eina_Bool is_next) { - if (sd->focused_item) + if (is_next) { - _elm_toolbar_coordinates_adjust - (sd->focused_item, x, y, w, h); - elm_widget_focus_highlight_focus_part_geometry_get - (VIEW(sd->focused_item), x, y, w, h); + if (sd->focused_item) + { + _elm_toolbar_coordinates_adjust + (sd->focused_item, x, y, w, h); + elm_widget_focus_highlight_focus_part_geometry_get + (VIEW(sd->focused_item), x, y, w, h); + } + } + else + { + if (sd->prev_focused_item) + { + _elm_toolbar_coordinates_adjust + (sd->prev_focused_item, x, y, w, h); + elm_widget_focus_highlight_focus_part_geometry_get + (VIEW(sd->prev_focused_item), x, y, w, h); + } } } diff --git a/legacy/elementary/src/lib/elm_widget.c b/legacy/elementary/src/lib/elm_widget.c index 25e6be290b..b5d53362e4 100644 --- a/legacy/elementary/src/lib/elm_widget.c +++ b/legacy/elementary/src/lib/elm_widget.c @@ -3762,8 +3762,11 @@ elm_widget_focus_highlight_focus_part_geometry_get(const Evas_Object *obj, } EOLIAN static void -_elm_widget_focus_highlight_geometry_get(Eo *obj, Elm_Widget_Smart_Data *sd, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h) +_elm_widget_focus_highlight_geometry_get(Eo *obj, Elm_Widget_Smart_Data *sd, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h, Eina_Bool is_next) { + (void)is_next; + + evas_object_geometry_get(obj, x, y, w, h); elm_widget_focus_highlight_focus_part_geometry_get(sd->resize_obj, x, y, w, h); } diff --git a/legacy/elementary/src/lib/elm_widget.eo b/legacy/elementary/src/lib/elm_widget.eo index 9efcf21513..8eb1d44e85 100644 --- a/legacy/elementary/src/lib/elm_widget.eo +++ b/legacy/elementary/src/lib/elm_widget.eo @@ -496,6 +496,7 @@ abstract Elm_Widget (Evas_Smart, Elm_Interface_Atspi_Widget) @in Evas_Coord *y; @in Evas_Coord *w; @in Evas_Coord *h; + @in Eina_Bool is_next; } } activate { diff --git a/legacy/elementary/src/lib/elm_widget.h b/legacy/elementary/src/lib/elm_widget.h index ab8657006e..043e45ec67 100644 --- a/legacy/elementary/src/lib/elm_widget.h +++ b/legacy/elementary/src/lib/elm_widget.h @@ -755,7 +755,7 @@ EAPI void elm_widget_orientation_set(Evas_Object *obj, int rotation) EAPI Elm_Object_Item *elm_widget_focused_item_get(const Evas_Object *obj); EAPI void elm_widget_orientation_mode_disabled_set(Evas_Object *obj, Eina_Bool disabled); EAPI Eina_Bool elm_widget_orientation_mode_disabled_get(const Evas_Object *obj); -EAPI void elm_widget_focus_highlight_geometry_get(const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h); +EAPI void elm_widget_focus_highlight_geometry_get(const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h, Eina_Bool is_next); EAPI Elm_Widget_Item *_elm_widget_item_new(Evas_Object *parent, size_t alloc_size); EAPI void _elm_widget_item_free(Elm_Widget_Item *item); EAPI Evas_Object *_elm_widget_item_widget_get(const Elm_Widget_Item *item); diff --git a/legacy/elementary/src/lib/elm_win.c b/legacy/elementary/src/lib/elm_win.c index aa80b2b93f..e34fecfdd8 100644 --- a/legacy/elementary/src/lib/elm_win.c +++ b/legacy/elementary/src/lib/elm_win.c @@ -762,7 +762,7 @@ _elm_win_focus_highlight_anim_setup(Elm_Win_Data *sd, Evas_Object *target = sd->focus_highlight.cur.target; evas_object_geometry_get(obj, &px, &py, &pw, &ph); - elm_widget_focus_highlight_geometry_get(target, &tx, &ty, &tw, &th); + elm_widget_focus_highlight_geometry_get(target, &tx, &ty, &tw, &th, EINA_TRUE); evas_object_move(obj, tx, ty); evas_object_resize(obj, tw, th); @@ -791,7 +791,7 @@ _elm_win_focus_highlight_simple_setup(Elm_Win_Data *sd, Evas_Object *clip, *target = sd->focus_highlight.cur.target; Evas_Coord x, y, w, h; - elm_widget_focus_highlight_geometry_get(target, &x, &y, &w, &h); + elm_widget_focus_highlight_geometry_get(target, &x, &y, &w, &h, EINA_TRUE); evas_object_move(obj, x, y); evas_object_resize(obj, w, h);