jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=e2eebc12213774a179316d60a9b0bdc8ce30c917
commit e2eebc12213774a179316d60a9b0bdc8ce30c917 Author: Jean-Philippe Andre <jp.an...@samsung.com> Date: Thu Jun 16 17:19:23 2016 +0900 Evas: Rename object focus to key_focus The evas focus concept is valid and applies only to the keyboard inputs. --- src/examples/evas/evas-object-manipulation-eo.c | 2 +- src/lib/evas/canvas/evas_focus.c | 6 +-- src/lib/evas/canvas/evas_object.eo | 49 +++++++------------------ src/lib/evas/canvas/evas_object_main.c | 2 +- src/tests/emotion/emotion_test_main-eo.c | 2 +- 5 files changed, 20 insertions(+), 41 deletions(-) diff --git a/src/examples/evas/evas-object-manipulation-eo.c b/src/examples/evas/evas-object-manipulation-eo.c index be50221..1dd25cc 100644 --- a/src/examples/evas/evas-object-manipulation-eo.c +++ b/src/examples/evas/evas-object-manipulation-eo.c @@ -185,7 +185,7 @@ main(void) efl_gfx_size_set(d.bg, WIDTH, HEIGHT); /* covers full canvas */ efl_gfx_visible_set(d.bg, EINA_TRUE); - evas_obj_focus_set(d.bg, EINA_TRUE); + evas_object_focus_set(d.bg, EINA_TRUE); evas_object_event_callback_add( d.bg, EVAS_CALLBACK_KEY_DOWN, _on_keydown, NULL); diff --git a/src/lib/evas/canvas/evas_focus.c b/src/lib/evas/canvas/evas_focus.c index f9344e1..939a6d2 100644 --- a/src/lib/evas/canvas/evas_focus.c +++ b/src/lib/evas/canvas/evas_focus.c @@ -8,7 +8,7 @@ /* public calls */ EOLIAN void -_evas_object_focus_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Eina_Bool focus) +_evas_object_key_focus_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Eina_Bool focus) { int event_id = 0; @@ -24,7 +24,7 @@ _evas_object_focus_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Eina_Bool fo if (focus) { if (obj->layer->evas->focused) - evas_obj_focus_set(obj->layer->evas->focused, 0); + evas_object_focus_set(obj->layer->evas->focused, 0); if (obj->layer->evas->focused) goto end; obj->focused = 1; @@ -47,7 +47,7 @@ _evas_object_focus_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Eina_Bool fo } EOLIAN Eina_Bool -_evas_object_focus_get(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj) +_evas_object_key_focus_get(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj) { return obj->focused; } diff --git a/src/lib/evas/canvas/evas_object.eo b/src/lib/evas/canvas/evas_object.eo index bce44da..fd2c180 100644 --- a/src/lib/evas/canvas/evas_object.eo +++ b/src/lib/evas/canvas/evas_object.eo @@ -296,42 +296,21 @@ abstract Evas.Object (Eo.Base, Evas.Common_Interface, Efl.Gfx, Efl.Gfx.Stack, default size.]] } } - @property focus { + @property key_focus { + [[Indicates that this object is the keyboard event receiver on + its canvas. + + Changing focus only affects where (key) input events go. + There can be only one object focused at any time. If $focus + is $true, $obj will be set as the currently focused object + and it will receive all keyboard events that are not + exclusive key grabs on other objects. + ]] set { - [[Sets or unsets a given object as the currently focused one on - its canvas. - - Changing focus only affects where (key) input events go. - There can be only one object focused at any time. If $focus - is $true, $obj will be set as the currently focused object - and it will receive all keyboard events that are not - exclusive key grabs on other objects. - - See also @.key_grab, @.key_ungrab. - ]] - /* FIXME-doc - Example: - @dontinclude evas-events.c - @skip evas_object_focus_set - @until evas_object_focus_set - - See the full example @ref Example_Evas_Events "here". - */ + legacy: evas_object_focus_set; } get { - [[Retrieve whether an object has the focus. - - If the passed object is the currently focused one, $true is - returned. $false is returned, otherwise. - ]] - /* FIXME-doc - Example: - @dontinclude evas-events.c - @skip And again - @until something is bad - - See the full example @ref Example_Evas_Events "here". - */ + legacy: evas_object_focus_get; } values { focus: bool; [[$true when set as focused or $false otherwise.]] @@ -628,7 +607,7 @@ abstract Evas.Object (Eo.Base, Evas.Common_Interface, Efl.Gfx, Efl.Gfx.Stack, Warning: Providing impossible modifier sets creates undefined behavior. - See also @.key_ungrab, @.focus.get, @.focus.set, + See also @.key_ungrab, @.key_focus.get, @.key_focus.set, \@ref evas_focus_get, \@ref evas_key_modifier_add. ]] /* FIXME-doc @@ -678,7 +657,7 @@ abstract Evas.Object (Eo.Base, Evas.Common_Interface, Efl.Gfx, Efl.Gfx.Stack, Removes a key grab on $obj if $keyname, $modifiers, and $not_modifiers match. - See also @.key_grab, @.focus.get, @.focus.set, + See also @.key_grab, @.key_focus.get, @.key_focus.set, \@ref evas_focus_get. ]] /* FIXME-doc diff --git a/src/lib/evas/canvas/evas_object_main.c b/src/lib/evas/canvas/evas_object_main.c index 8058398..fa24674 100644 --- a/src/lib/evas/canvas/evas_object_main.c +++ b/src/lib/evas/canvas/evas_object_main.c @@ -1788,7 +1788,7 @@ _evas_object_eo_base_dbg_info_get(Eo *eo_obj, Evas_Object_Protected_Data *obj EI efl_gfx_size_hint_align_get(eo_obj, &dblx, &dbly); efl_gfx_size_hint_weight_get(eo_obj, &dblw, &dblh); efl_gfx_color_get(eo_obj, &r, &g, &b, &a); - focus = evas_obj_focus_get(eo_obj); + focus = evas_object_focus_get(eo_obj); m = evas_obj_pointer_mode_get(eo_obj); pass_event = evas_obj_pass_events_get(eo_obj); repeat_event = evas_obj_repeat_events_get(eo_obj); diff --git a/src/tests/emotion/emotion_test_main-eo.c b/src/tests/emotion/emotion_test_main-eo.c index c5adbe1..48b0535 100644 --- a/src/tests/emotion/emotion_test_main-eo.c +++ b/src/tests/emotion/emotion_test_main-eo.c @@ -117,7 +117,7 @@ bg_setup(void) efl_gfx_size_set(o_bg, startw, starth); efl_gfx_stack_layer_set(o_bg, -999); efl_gfx_visible_set(o_bg, EINA_TRUE); - evas_obj_focus_set(o_bg, EINA_TRUE); + evas_object_focus_set(o_bg, EINA_TRUE); eo_event_callback_add(o_bg, EFL_EVENT_KEY_DOWN, bg_key_down, NULL); } --