introduce efl_ui_focus_manager_window_root

Which is a interface that indicates that this is the root of all focus
managers.
This commit is contained in:
Marcel Hollerbach 2018-04-09 16:16:16 +02:00
parent 33921385f9
commit 84ad5d9fe3
6 changed files with 21 additions and 9 deletions

View File

@ -101,6 +101,7 @@ elm_public_eolian_files = \
lib/elementary/efl_selection.eo \
lib/elementary/efl_ui_dnd.eo \
lib/elementary/efl_ui_dnd_container.eo \
lib/elementary/efl_ui_focus_manager_window_root.eo \
$(NULL)
# More public files -- FIXME

View File

@ -155,6 +155,7 @@ typedef Eo Efl_Ui_Focus_Manager;
# include <efl_ui_focus_object.eo.h>
# include <efl_ui_focus_manager.eo.h>
# include <efl_ui_focus_manager_window_root.eo.h>
# include <efl_ui_focus_manager_calc.eo.h>
# include <efl_ui_focus_manager_sub.eo.h>
# include <efl_ui_focus_manager_root_focus.eo.h>

View File

@ -6,3 +6,4 @@
#include "elm_priv.h"
#include "efl_ui_focus_manager.eo.c"
#include "efl_ui_focus_manager_window_root.eo.c"

View File

@ -86,22 +86,24 @@ static void dirty_add(Eo *obj, Efl_Ui_Focus_Manager_Calc_Data *pd, Node *dirty);
static void
_manager_in_chain_set(Eo *obj, Efl_Ui_Focus_Manager_Calc_Data *pd)
{
Eo *manager;
Eo *manager, *root;
EINA_SAFETY_ON_NULL_RETURN(pd->root);
root = efl_ui_focus_manager_root_get(obj);
manager = efl_ui_focus_object_focus_manager_get(pd->root->focusable);
if (!efl_isa(pd->root->focusable, EFL_UI_WIN_CLASS))
EINA_SAFETY_ON_NULL_RETURN(efl_ui_focus_object_focus_manager_get(pd->root->focusable));
EINA_SAFETY_ON_NULL_RETURN(root);
if (!efl_isa(root, EFL_UI_FOCUS_MANAGER_WINDOW_ROOT_INTERFACE))
EINA_SAFETY_ON_NULL_RETURN(manager);
//so we dont run infinitly this does not fix it, but at least we only have a error
EINA_SAFETY_ON_TRUE_RETURN(efl_ui_focus_object_focus_manager_get(pd->root->focusable) == obj);
EINA_SAFETY_ON_TRUE_RETURN(manager == obj);
manager = efl_ui_focus_object_focus_manager_get(pd->root->focusable);
if (manager)
efl_ui_focus_manager_focus_set(manager, pd->root->focusable);
efl_ui_focus_manager_focus_set(manager, root);
else
DBG("No focus manager for focusable %s@%p",
efl_class_name_get(pd->root->focusable), pd->root->focusable);
efl_class_name_get(pd->root->focusable), root);
}
static Efl_Ui_Focus_Direction

View File

@ -0,0 +1,7 @@
interface Efl.Ui.Focus.Manager.Window_Root {
[[ A interface to indicate the end of a focus chain.
Focusmanagers are ensuring that if they give focus to something, that they are registered in the upper focus manager.
The most upper focus manager does not need to do that, and can implement this interface to indicate that.
]]
}

View File

@ -158,7 +158,7 @@ class Efl.Ui.Win (Efl.Ui.Widget, Efl.Canvas, Efl.Canvas.Pointer, Efl.Access.Wind
Efl.Access.Component, Efl.Access.Widget.Action,
Efl.Content, Efl.Input.State, Efl.Input.Interface, Efl.Screen,
Efl.Gfx.Size.Hint, Efl.Text, Efl.Config.Global, Efl.Part,
Efl.Ui.Focus.Manager )
Efl.Ui.Focus.Manager, Efl.Ui.Focus.Manager.Window_Root)
{
[[Efl UI window class]]
legacy_prefix: elm_win;