bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=0eefeca64bd7cede4c9db7a0ba5cf95db79123bc

commit 0eefeca64bd7cede4c9db7a0ba5cf95db79123bc
Author: Marcel Hollerbach <[email protected]>
Date:   Fri Nov 4 17:42:26 2016 +0100

    efl_ui_focus_manager: add new api to receive child configuration
---
 src/lib/elementary/efl_ui_focus_manager.c  | 41 ++++++++++++++++++++++++++++++
 src/lib/elementary/efl_ui_focus_manager.eo | 19 ++++++++++++++
 2 files changed, 60 insertions(+)

diff --git a/src/lib/elementary/efl_ui_focus_manager.c 
b/src/lib/elementary/efl_ui_focus_manager.c
index 6a4f090..737a7b5 100644
--- a/src/lib/elementary/efl_ui_focus_manager.c
+++ b/src/lib/elementary/efl_ui_focus_manager.c
@@ -1048,4 +1048,45 @@ _efl_ui_focus_manager_efl_object_finalize(Eo *obj, 
Efl_Ui_Focus_Manager_Data *pd
    return result;
 }
 
+static Eina_List*
+_convert(Eina_List *node_list)
+{
+   Eina_List *n, *par = NULL;
+   Node *node;
+
+   EINA_LIST_FOREACH(node_list, n, node)
+     par = eina_list_append(par, node->focusable);
+
+   return par;
+}
+
+EOLIAN static Efl_Ui_Focus_Relations*
+_efl_ui_focus_manager_fetch(Eo *obj, Efl_Ui_Focus_Manager_Data *pd, 
Efl_Ui_Focus_Object *child)
+{
+   Efl_Ui_Focus_Relations *res;
+   Node *n;
+
+   n = node_get(pd, child);
+
+   if (!n) return NULL;
+
+   res = calloc(1, sizeof(Efl_Ui_Focus_Relations));
+
+   dirty_flush(obj, pd);
+
+#define DIR_CLONE(dir) _convert(G(n).directions[dir].partners);
+
+   res->right = DIR_CLONE(EFL_UI_FOCUS_DIRECTION_RIGHT);
+   res->left = DIR_CLONE(EFL_UI_FOCUS_DIRECTION_LEFT);
+   res->top = DIR_CLONE(EFL_UI_FOCUS_DIRECTION_UP);
+   res->down = DIR_CLONE(EFL_UI_FOCUS_DIRECTION_DOWN);
+   res->next = _next(n)->focusable;
+   res->prev = _prev(n)->focusable;
+
+#undef DIR_CLONE
+
+   return res;
+}
+
+
 #include "efl_ui_focus_manager.eo.c"
\ No newline at end of file
diff --git a/src/lib/elementary/efl_ui_focus_manager.eo 
b/src/lib/elementary/efl_ui_focus_manager.eo
index f61b37e..7db508d 100644
--- a/src/lib/elementary/efl_ui_focus_manager.eo
+++ b/src/lib/elementary/efl_ui_focus_manager.eo
@@ -9,6 +9,14 @@ enum Efl.Ui.Focus.Direction {
     last = 6
 }
 
+struct Efl.Ui.Focus.Relations{
+    right : list<Efl.Ui.Focus.Object>;
+    left : list<Efl.Ui.Focus.Object>;
+    top : list<Efl.Ui.Focus.Object>;
+    down : list<Efl.Ui.Focus.Object>;
+    next : Efl.Ui.Focus.Object;
+    prev : Efl.Ui.Focus.Object;
+}
 
 class Efl.Ui.Focus.Manager (Efl.Object) {
     [[Calculates the directions of Efl.Ui.Focus.Direction
@@ -120,6 +128,17 @@ class Efl.Ui.Focus.Manager (Efl.Object) {
                 root : Efl.Ui.Focus.Object @nonull; [[Will be registered into 
this manager object]]
             }
         }
+        fetch {
+            [[This will fetch the data from a registered node
+
+              Be aware this function will trigger all dirty nodes to be 
computed
+            ]]
+            params {
+                child : Efl.Ui.Focus.Object;
+            }
+
+            return : own(ptr(Efl.Ui.Focus.Relations));
+        }
     }
     implements {
         Efl.Object.constructor;

-- 


Reply via email to