From 38d41b4a2b6236b657fc4d30c88e58718f1f1ee4 Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Mon, 16 Oct 2017 17:19:42 +0200 Subject: [PATCH] efl_ui_focus_composition: support beeing a pure logical composition --- src/lib/elementary/efl_ui_focus_composition.c | 17 ++++++++++++++++- src/lib/elementary/efl_ui_focus_composition.eo | 6 ++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/lib/elementary/efl_ui_focus_composition.c b/src/lib/elementary/efl_ui_focus_composition.c index 427db3d..fe6af14 100644 --- a/src/lib/elementary/efl_ui_focus_composition.c +++ b/src/lib/elementary/efl_ui_focus_composition.c @@ -16,6 +16,7 @@ typedef struct { Eina_List *adapters; Efl_Ui_Focus_Manager *registered, *custom_manager; Eina_Bool dirty; + Eina_Bool logical; } Efl_Ui_Focus_Composition_Data; static void @@ -49,7 +50,10 @@ _state_apply(Eo *obj, Efl_Ui_Focus_Composition_Data *pd) EINA_LIST_FOREACH(pd->register_target, n, o) { - efl_ui_focus_manager_calc_register(manager, o, obj, NULL); + if (!pd->logical) + efl_ui_focus_manager_calc_register(manager, o, obj, NULL); + else + efl_ui_focus_manager_calc_register_logical(manager, o, obj, NULL); pd->registered_targets = eina_list_append(pd->registered_targets, o); } @@ -180,6 +184,17 @@ _efl_ui_focus_composition_custom_manager_get(Eo *obj EINA_UNUSED, Efl_Ui_Focus_C return pd->custom_manager; } +EOLIAN static void +_efl_ui_focus_composition_logical_mode_set(Eo *obj EINA_UNUSED, Efl_Ui_Focus_Composition_Data *pd, Eina_Bool logical_mode) +{ + pd->logical = logical_mode; +} + +EOLIAN static Eina_Bool +_efl_ui_focus_composition_logical_mode_get(Eo *obj EINA_UNUSED, Efl_Ui_Focus_Composition_Data *pd) +{ + return pd->logical; +} #include "efl_ui_focus_composition.eo.c" diff --git a/src/lib/elementary/efl_ui_focus_composition.eo b/src/lib/elementary/efl_ui_focus_composition.eo index b03d0e7..ef72475 100644 --- a/src/lib/elementary/efl_ui_focus_composition.eo +++ b/src/lib/elementary/efl_ui_focus_composition.eo @@ -39,6 +39,12 @@ mixin Efl.Ui.Focus.Composition (Efl.Interface, Elm.Widget ) { custom_manager : Efl.Ui.Focus.Manager; } } + @property logical_mode @protected { + [[Set to true if all children should be registered as logicals]] + values { + logical_mode : bool; [[$true or $false]] + } + } } implements { Elm.Widget.focus_state_apply; -- 2.7.4